# MCP3424 with RedPLC

**URL:** <https://discourse.nodered.org/t/mcp3424-with-redplc/52623>\
**Category:** General\
**Created:** [23 October 2021 17:07 UTC](https://discourse.nodered.org/t/mcp3424-with-redplc/52623 "2021-10-23T17:07:39Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Crashy77](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@Crashy77](https://discourse.nodered.org/u/Crashy77)\
**Post date:** [23 October 2021 17:07 UTC](https://discourse.nodered.org/t/mcp3424-with-redplc/52623/1 "2021-10-23T17:07:39Z")

</div>

Hi.

I´m using 5 I²C modules for my Pi.  
Today I´ve tried to work with an analog input 18bit, but I don´t know how to configurate it.  
IA-address: 0  
Dev-Type: mcp3424  
Dev-Addr.: 68H  
Mode of all 4 channels is 18bit, range is not important for now.

I connect the module together with the in- and outputs to the CPU.  
But if I´m using the "rung start" and contacts like on the inputs, I´m getting always "true".

What I´m doing wrong ?

 ![PLC](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/8/b87cb482dccbf6920fe70be5d5d07d47540abd4f.jpeg)

With kind regards,  
Thorsten

---

<div class="post-metadata">

**Author:** ![iiLaw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iilaw/32/14782_2.png) [@iiLaw](https://discourse.nodered.org/u/iiLaw)\
**Post date:** [25 October 2021 15:10 UTC](https://discourse.nodered.org/t/mcp3424-with-redplc/52623/2 "2021-10-25T15:10:18Z")

</div>

Thorsten thin you only need one run output  
I would say RedPLC was very much work in prog and think the developer has dropped it.  
I think you need to consider a different approach as RedPLC is an attempt to do PLc scan like control on platform that isn't designed for that .

---

<div class="post-metadata">

**Author:** ![Crashy77](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@Crashy77](https://discourse.nodered.org/u/Crashy77)\
**Post date:** [25 October 2021 15:21 UTC](https://discourse.nodered.org/t/mcp3424-with-redplc/52623/3 "2021-10-25T15:21:22Z")

</div>

I´ve tried it with the i2c input, but no command was working, same on all inputs or outputs.  
That´s why I´m using redplc.

In another case I´m using a PCF8591 for analog signals and that´s working fine with i2c in- and output.

Maybe you´re having an idea how to use PCF8574 and MCP3424.

---

<div class="post-metadata">

**Author:** ![iiLaw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iilaw/32/14782_2.png) [@iiLaw](https://discourse.nodered.org/u/iiLaw)\
**Post date:** [25 October 2021 15:50 UTC](https://discourse.nodered.org/t/mcp3424-with-redplc/52623/4 "2021-10-25T15:50:05Z")

</div>

Sorry I can't help I've only played with I2C years ago.  
A quick search of forum shows

> [@Help for node-red-contrib-redplc-rpi-mcp342x](https://discourse.nodered.org/t/help-for-node-red-contrib-redplc-rpi-mcp342x/52185):
>
> Hello everyone, i am trying to use this node as indicated but i cannot get it to work specifically MCP3424 (4ch). The aim is to use Node Red as a Fixture testing Linux embedded system for electronic boards. Everything works for me but I wanted to try this node and I can't use it. I tried to email the author Ocean but got no reply. Anyone have a sample flow on how to use it? Thank you in advance for the support Macs - Italy Welcome to Node-RED 14 Oct 01:14:48 - [info] Node-RED version: v…

May be a different node like try on single mcp342x

> **[node-red-contrib-i2c](https://flows.nodered.org/node/node-red-contrib-i2c)**
>
> A Node-RED node to talk to the Raspiberry PI's I2C port

---

<div class="post-metadata">

**Author:** ![Crashy77](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@Crashy77](https://discourse.nodered.org/u/Crashy77)\
**Post date:** [25 October 2021 17:13 UTC](https://discourse.nodered.org/t/mcp3424-with-redplc/52623/5 "2021-10-25T17:13:19Z")

</div>

I´ve installed the i2c node, but it´s not working, because I don´t know the command.

---

<div class="post-metadata">

**Author:** ![iiLaw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iilaw/32/14782_2.png) [@iiLaw](https://discourse.nodered.org/u/iiLaw)\
**Post date:** [26 October 2021 08:45 UTC](https://discourse.nodered.org/t/mcp3424-with-redplc/52623/6 "2021-10-26T08:45:11Z")

</div>

> [@Crashy77](#):
>
> MCP3424.

Ok let's approach this in a different way. You can call Python script from node red via the exe node. But start with the Python code on RPI get that working with the port expander  
Once that is working you can look to process the output of the python script in Node-RED.

> **[MCP342x](https://pypi.org/project/MCP342x/)**
>
> Access Microchip MCP342x analogue to digital converters.

---

<div class="post-metadata">

**Author:** ![iiot2k](https://avatars.discourse-cdn.com/v4/letter/i/8baadc/32.png) [@iiot2k](https://discourse.nodered.org/u/iiot2k)\
**Post date:** [26 October 2021 10:40 UTC](https://discourse.nodered.org/t/mcp3424-with-redplc/52623/7 "2021-10-26T10:40:55Z")

</div>

Hello Thorsten,  
I am the devoloper of RedPlc.  
After a long illness, I will continue to work on RedPlc.  
The first part was digital handling (Contact, Coil, Timer..).  
The second part is analog handling (Compare, Store ..).  
But this takes time.  
Sorry for that.  
I know that RedPlc needs better documention and examples.  
I work on it.  
Ocean

---

<div class="post-metadata">

**Author:** ![iiLaw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iilaw/32/14782_2.png) [@iiLaw](https://discourse.nodered.org/u/iiLaw)\
**Post date:** [26 October 2021 13:36 UTC](https://discourse.nodered.org/t/mcp3424-with-redplc/52623/8 "2021-10-26T13:36:28Z")

</div>

@iiot2k sorry to hear your news & glad to hear you "back at the coal face" as we say in the UK 🙂

---

<div class="post-metadata">

**Author:** ![Crashy77](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@Crashy77](https://discourse.nodered.org/u/Crashy77)\
**Post date:** [28 October 2021 07:18 UTC](https://discourse.nodered.org/t/mcp3424-with-redplc/52623/9 "2021-10-28T07:18:09Z")

</div>

@iiot2k  
Hi, hopefully you´re right after your long illness.  
For now, digital handling is working fine and also easy to understand without documentation and examples.  
For me it´s important to have the analog handling working, because I want to change my system and without MCP3424 it can´t work.  
Maybe you know how to handle this chip.

---

<div class="post-metadata">

**Author:** ![Crashy77](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@Crashy77](https://discourse.nodered.org/u/Crashy77)\
**Post date:** [6 November 2021 13:07 UTC](https://discourse.nodered.org/t/mcp3424-with-redplc/52623/10 "2021-11-06T13:07:03Z")

</div>

Hi.

I´ve tried the example of the developer (Python & Tkinter) with Geany and it was working.  
But it´s not working in node-red.  
Maybe I´ve done something wrong, because Tkinter is not neccessary and I´ve deleted the lines.  
Or maybe the function is wrong, because it crashed and I had to reload the backup.  
[You can find the example here.](https://www.horter.de/blog/i2c-mcp3424-analog-in-18bit-modul-mit-python-und-tkinter/)

---

<div class="post-metadata">

**Author:** ![Crashy77](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@Crashy77](https://discourse.nodered.org/u/Crashy77)\
**Post date:** [6 November 2021 16:41 UTC](https://discourse.nodered.org/t/mcp3424-with-redplc/52623/11 "2021-11-06T16:41:24Z")

</div>

@iiot2k What should be the output value with MCP3424 node ? I got blinking input/output message.

---

<div class="post-metadata">

**Author:** ![Crashy77](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@Crashy77](https://discourse.nodered.org/u/Crashy77)\
**Post date:** [7 November 2021 12:48 UTC](https://discourse.nodered.org/t/mcp3424-with-redplc/52623/12 "2021-11-07T12:48:06Z")

</div>

@iiot2k  
Hi again.  
After lost days for finding a solution I´ve find an adapter for iobroker.  
On iobroker it´s working fine except the scale factor of 5.  
Maybe you can talk to the developer. Here it is: [GitHub - UncleSamSwiss/ioBroker.i2c: ioBroker adapter for I2C interface on Raspberry Pi, C.H.I.P., BeagleBone or Intel Edison](https://github.com/UncleSamSwiss/ioBroker.i2c)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [6 January 2022 12:48 UTC](https://discourse.nodered.org/t/mcp3424-with-redplc/52623/13 "2022-01-06T12:48:24Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
