Controlling 2 PCF8574 boards

I am trying to control two PCf8574 boards (8 port IO expanders) in Node-red using the @joe-ab1do/mcp-pcf-aio node.

This works fine with 1 board, but not with 2 boards.

I connected the 2 PCF8574 boards to the Raspberry Pi's i2c bus.
Running 'i2cdetect -y 1' lists the 2 addresses as '20' and '24' .

Both addresses are accepted by the 'mcp pcf out' node, but only with 1 node on the canvas.
It seems impossible to define 2 nodes with 2 different addresses.
After a deploy, one of the nodes changes its address and both now have the same address.

Is my assumption correct that there can only be 1 configuration node and that I cannot control 2 boards ?
How do I control 2 PCF8574 boards ?

I haven't used that node, but I see it uses a config node for the chip. Have you added a second one for the second board, or have you just changed the address in the same config node that the other node uses?

How do I add another configuration node (with another i2c address) ?
The current configuration nodes was created automatically when I added the first 'mcp pcf out' node. Every additional 'mcp pcf out' node that I add seems to use the same configution node.

Show us a screenshot of the nodes' configs
It crashes node red when I install it here so I can't look at it.

[Edit] You can paste screenshots directly in here.

I'm using :
"@joe-ab1do/mcp-pcf-aio' version 3.2.1"
Node-Red 3.1.5
On a Raspberry Pi 3

And the In or Out node?

You can create multiple configs. Where you select the config, chose "add new" and create a 2nd one.

It took some trial-and-error but I managed to "create" a second configuration with another i2c address.

The trick is indeed that you have to "create new mcp pch chip" even if it is the same type, but has another address.

Problem solved. Thanks all !

1 Like

Same chip type, different physical chip.

Hi GammaKappa,

I think I know what is going on: when you created the first instance of the PCF8574, under chip type you added a new chip, selected PCF8574 and set it to address 0X20 (20H). Question is, when you added the second PCF8574 board, did you select the PCF8574 chip type you had already created initially (which I suspect happened) or did you select add a new chip (which should have happened). On the right of the image you attached, I should be seeing two PCF8574 chip nodes and I only see one. If you did select the PCF8574 chip type you initially created, all you are doing is changing the address (from 20H to 24H) of the existing chip. You need to add a new instance of the chip (even though it is the same chip type) select PCF8574 and set its address to 24H. You will then see two instances of the chip node on the right.

Hope this makes sense. If not, please export your flow and send to me and I will take a look.


You are right, initially I did select the same PCF8574 chip and only changed its address.
I understand now that that was not the right procedure.

After the comments, I created another PCF8574 chip with the new address for the second IOExpander board and the problem was solved. See my second screen shot which now shows 2 configuration nodes, one for each address.

This forum is amazing for getting fast and to the point solutions. Thanks again.

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