2.0.0 • Published 10 months ago

@redplc/node-red-gpio v2.0.0

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
10 months ago

@redplc/node-red-gpio

platform platform platform

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

IndexFunct.PinPinFunct.Index
3V3125V
2GPIO02345V
3GPIO0356GND
4GPIO0478GPIO1414
GND910GPIO1515
17GPIO171112GPIO1818
27GPIO271314GND
22GPIO221516GPIO2323
3V31718GPIO2424
10GPIO101920GND
9GPIO092122GPIO2525
11GPIO112324GPIO088
GND2526GPIO077
2728
5GPIO052930GND
6GPIO063132GPIO1212
13GPIO133334GND
19GPIO193536GPIO1615
26GPIO263738GPIO2020
GND3940GPIO2121

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.