Connect two i2c boards at once

Hello. I'm trying to use two PCF8574 i2c boards at the same time, which are connected to a matrix keyboard and a 16x2 lcd display. One of them i connect to A4 and A5, and the other to SCL and SDA pins. But when I use the i2c scanner i only get one address, which is 0x27. I even tried connecting them in parallel to A4 and A5 pins, still no sign of the second address. Is there a way to connect those two?

Did you set the 2nd thingy to another I2C address or are both devices using the same address?

Perhaps you could look up your thingy to see if there is a way to set the alternate address.

1 Like

Well, I trust you realise that SCL and SDA are - on a UNO at least - the same pins as A5 and A4 so it is only a matter of convenience in connecting them.


So on your PCF8574 boards, you need to set two different addresses using either the jumpers ...

or DIP switches

or wiring the "A0" to "A2" pins to different combinations of 5 V and ground.

or you get a PCF8575 module instead!

Hey paul, yes, i'm aware of them being the same pins, but kudos for taking the effort to post all the pictures!

The problem is, im using this board:

I know its used for lcd displays, but i shorted the p3 pin so i can use it for a keypad as well.

So my setup consists of two of this particular i2c board, one on the display and the other on the keypad. As you can see, there are no jumpers on this board, so no way to change the address.

I tried giving them different addresses in the code, but the only address that seems to work is 0x27. Its like its hardcoded. I used the i2c scanner program, and that detects only one device, with the address 0x27.

EDIT: I think by now i realize that the address is hardcoded, and i have to get the one with the dip switches to set another address.

But as a last ditch effort, is there any way to change the i2c address on this board?

Indeed! right next to the blue potentiometer there are 2 x 3 soldering points labeled A0, A1, A2. for example, you can bridge A0 with an SMD 0 Ohm resistor, or with a short piece of wire (solder on both points)

Here is a photo of your module (with me, it is on a display), where I circled the 2 soldering points that belong to A0 in yellow.
PCF8574

The viewing angle for your photo is unfavorable, so I couldn't mark the points in your picture, so I quickly photographed the module, one of my displays, to show the position of the address setting.
951616e9e0601757b0fb62a69f77d488f59982a5_2_500x500

OK, so it clearly has the address selection solder bridge points.

I shorted the three solder bridge points, and that changed the address from 0x27 to 0x20. Thanks a lot for your help guys!

You are welcome. Thanks for the feedback.

Of course, you only need to short one to alter the address. There are eight available addresses.