1.0.11 • Published 3 years ago

node-red-contrib-redplc-automationhat v1.0.11

Weekly downloads
16
License
Apache-2.0
Repository
github
Last release
3 years ago

node-red-contrib-redplc-automationhat

Node-Red node for Pimoroni Automation HAT

Node Features

  • 3 x 5-24V Digital Inputs
  • 3 x Relays (24V @2A)
  • 3 x 24V Sinking Outputs
  • Brightness adjustable Leds for Inputs, Relays, Outputs and Indicators
  • 3 x Indicator Leds POWER, COMMS, WARN
  • 3 x 11bit Analog Input (0..25V) conversion time 1ms/channel
  • 1 x 11bit Analog Input (0..3.3V) conversion time 1ms
  • Output value in mV
  • Scaling with factor and offset

Automation HAT more Info

Install

For using with Ladder-Logic install redPlc nodes

For using with other nodes, install module nodes

Install with Node-Red Palette Manager or npm command:

cd ~/.node-red
npm install node-red-contrib-redplc-automationhat

Usage

Update is triggered by redPlc cpu node or module-update node This node reads/writes from/to Node-Red global variables This node works only on Raspberry Pi with Raspberry Pi OS Enable I2C with raspi-config

I/O Mapping

Digital Input (Variable I):

BitFunction
0Input 1
1Input 2
2Input 3

Digital Output (Variable Q):

BitFunction
0Relay 1
1Relay 2
2Relay 3
3Output 1
4Output 2
5Output 3
6LED WARN
7LED COMMS
8LED POWER

Analog Input (Variable IA):

InputArray-Index
ADC10
ADC21
ADC32
ADC43

Scaling with Factor and Offset:

Formula:

Factor = (OH - OL) / (IH - IL)
Offset = OL - (IL * Factor)

Output = Input * Factor + Offset

Where:

IL = Input Low (mV), IH = Input High (mV) 
OL = Output Low, OH = Output High

Example:

Input: 0mV .. 10000mV, IL = 0, IH = 10000 Output: -20°C .. 60°C, OL = -20, OH = 60 Factor = (60 - (-20)) / (10000 - 0) = 0.008 Offset = (-20) - (0 * 0.008) = -20

Input = 4000mV Output = 4000 * 0.008 + (-20) = 12°C

Donate

If you like my work please support it with donate:

Donate