@redplc/node-red-gpio
v2.0.1
Published
Node-RED nodes for Raspberry Pi gpio using with redPlc nodes
Downloads
157
Maintainers
Readme
@redplc/node-red-gpio
Node-RED nodes for Raspberry Pi GPIO using with redPlc nodes.
Installation
Install with Node-Red Palette Manager or npm command:
cd ~/.node-red
npm install @redplc/node-red-gpio
Report any issues here with name @redplc/node-red-gpio.
Detail
- This node uses the gpio character devices interface (V2) from the Linux operating system
- The interface to hardware is implemented in C++ as add-on module
- This library works on Raspberry Pi with 32bit or 64bit OS
- Works on Raspberry Pi 3, 4, 5
- Not yet tested on the Raspberry Pi 2
Nodes
- gpio-in: Reads GPIO inputs and store in boolean array.
- gpio-out: Sets GPIO outputs from boolean array.
Usage
- Install redPlc nodes.
- Use redPlc s-inject node for trigger update.
- Connect to first output on s-inject node.
- Daisy chain nodes in series.
- For logical operations use redPlc nodes.
- Data is exchanged with global context variable arrays.
- Array index is equal gpio number for easy handling.
- Select different gpio pins for input and output.
- For open inputs select pull down/up resistors.
- Check with raspi-config for alternate functions on GPIO.
Array Index Mapping
|Index|Funct.|Pin|Pin|Funct.|Index| |:--|:---- |:-:|:-:|:-----|:--| ||3V3|1|2|5V|| |2|GPIO02|3|4|5V|| |3|GPIO03|5|6|GND|| |4|GPIO04|7|8|GPIO14|14| ||GND|9|10|GPIO15|15| |17|GPIO17|11|12|GPIO18|18| |27|GPIO27|13|14|GND|| |22|GPIO22|15|16|GPIO23|23| ||3V3|17|18|GPIO24|24| |10|GPIO10|19|20|GND|| |9|GPIO09|21|22|GPIO25|25| |11|GPIO11|23|24|GPIO08|8| ||GND|25|26|GPIO07|7| |||27|28||| |5|GPIO05|29|30|GND|| |6|GPIO06|31|32|GPIO12|12| |13|GPIO13|33|34|GND|| |19|GPIO19|35|36|GPIO16|15| |26|GPIO26|37|38|GPIO20|20| ||GND|39|40|GPIO21|21|
Example
The example shows the logic behind redPlc. Please install this and @redplc/node-red-redplc Node. Connect switches to GPIO21, GPIO20 and GPIO16 with common to ground. LEDs with series resistors can be connected to the outputs GPIO12, GPIO13, GPIO19 and GPIO26. Please note the maximum output current of the GPIO pins.