2.0.5 • Published 4 months ago

@redplc/node-red-rpi-mcp3424 v2.0.5

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

@redplc/node-red-rpi-mcp3424

platform platform platform

Node-RED node for mcp3424 18bit adc using with redPlc nodes

mcp3424 analog to digital converter

  • 12..18bit Conversion Resolution.
  • Four Analog Inputs.
  • Each input can be disabled.
  • Internal Voltage Reference.
  • Internal Oscillator.
  • Programmable Data Rate 3.75 SPS (18bits) to 240 SPS (12bits).
  • The PGA offers input ranges from ±256 mV to ±2048 V.
  • I2C Interface with Eight Pin-Selectable Addresses.
  • Works also for mcp3421..mcp3428

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 input number for easy handling.
  • This node works on Raspberry Pi with 32bit or 64bit OS.
  • Input voltage more than VCC can damage adc input.
  • The output value is mV or adc raw data.
  • Works also on Raspberry Pi 5
  • Enable I2C with raspi-config.
  • If other type then mcp3424 used, set correct parameter (see table below).
  • If you use i2c-0 port add dtparam=i2c_vc=on to /boot/config.txt, then Pin27=SDA, Pin28=SCK.
  • For other ports add this to /boot/config.txt.

Array Index

InputArray-Index
CH10
CH21
CH32
CH43

Address Pin Connection

I2C AddressADR0 PinADR1 Pin
68HOpenOpen
68HGNDGND
69HGNDOpen
6AHGNDVCC
6BHVCCGND
6CHVCCOpen
6DHVCCVCC
6EHOpenGND
6FHOpenVCC

Supported Devices

Type# ChannelMax. Resol.Address-Range
mcp3421118bit68H
mcp3422218bit68H
mcp3423218bit68H-6FH
mcp3424418bit68H-6FH
mcp3425116bit68H
mcp3426216bit68H
mcp3427216bit68H-6FH
mcp3428416bit68H-6FH

Example

This example reads temperature from sensor LM35 (DZ). The temperature sensor LM35 (DZ) outputs voltage 10.0 mV/°C. The sensor measures in the range of 2°..150°. Therefore the output is 20mV..1500mV. The module node mcp3424 is set for input CH1 and CH2 to Input-Range 2048mV. Other adc inputs are disabled. The redPlc calculate node divides adc value to 10. The redPlc export nodes reads the analog variables and sends to Dashboard gauge.