News:

Let's find out together what makes a PIC Tick!

Main Menu

2 i2c devices on 3 wires

Started by TimB, Jan 31, 2022, 09:14 AM

Previous topic - Next topic

TimB


I need to talk to 2 i2c devices. They have fixed addresses. Currently I use a I2CIn pSDA1, pSCL1 / I2CIn pSDA2, pSCL2 etc command on each device

Now the total cable count going out to the 2 devices is 6. +5, Grnd and the 4 lines

I'm looking to reduce it to 5 wires and want to know can I share say the SCL lines or is that a NO NO

Thanks

Tim




SCV

Officially not, however depends upon the devices on the bus...

Only one way to find out. Would suggest sending a START condition then a STOP to clear any false starts when changing devices.
Tim.

david

I had to read that several times.  Are you saying these are two identical I2C devices that have only a single address option? I'd be looking for an equivalent function device that offers more than one address so you could use 4 lines total (Pwr, Gnd, SDA, SCL).  Is it a truly unique device?   I'm surprised that a manufacturer would limit their application to one device per system bus.

Cheers,
David

TimB


Hi

The device is a pressure sensor. https://shop.bb-sensors.com/en/Measurement-by-branches/Mechanical-engineering/Pressure-transmitter-with-M12-connector-bub.html

You can pay 1/2 the price of the device to get the address changed. But that means if you want to keep stock you have to pay for stock that you may not need.

My issues that I need to talk to 2 pressure sensors and a PT100. That adds up to 9 lines. I thought about making a remote board but that was more work. If I can combine one of the i2c lines then I can reduce it to 8 wires and that makes it a lot easier to find the connectors I want.

Tim




See_Mos

#4
I have used multiple I2C devices with common data lines and separate clocks if that helps?

I'll need to go back in time to see exactly how I did it

TimB

Quote from: See_Mos on Jan 31, 2022, 11:24 AMI have used multiple I2C devices with common data lines and separate clocks if that helps?

I'll need to go back in time to see exactly how I did it

That's good news for me :)   I will try it out on a couple I have here.

Tim

david

Quote from: TimB on Jan 31, 2022, 10:58 AMHi

The device is a pressure sensor. https://shop.bb-sensors.com/en/Measurement-by-branches/Mechanical-engineering/Pressure-transmitter-with-M12-connector-bub.html

You can pay 1/2 the price of the device to get the address changed. But that means if you want to keep stock you have to pay for stock that you may not need.

My issues that I need to talk to 2 pressure sensors and a PT100. That adds up to 9 lines. I thought about making a remote board but that was more work. If I can combine one of the i2c lines then I can reduce it to 8 wires and that makes it a lot easier to find the connectors I want.

Tim


That's a bit miserable - one address or pay a premium to have two of their devices on the same bus.
I assume you're looking for ruggedized, bolt-on industrial sensors and not bare chips like the Bosch BMP390 (which has a nice temperature sensor built in but may be limited in maximum temperature)
Hopefully See_Mos can get you sorted.

Cheers,
David

m.kaviani

Quote from: TimB on Jan 31, 2022, 10:58 AMHi

The device is a pressure sensor. https://shop.bb-sensors.com/en/Measurement-by-branches/Mechanical-engineering/Pressure-transmitter-with-M12-connector-bub.html

You can pay 1/2 the price of the device to get the address changed. But that means if you want to keep stock you have to pay for stock that you may not need.

My issues that I need to talk to 2 pressure sensors and a PT100. That adds up to 9 lines. I thought about making a remote board but that was more work. If I can combine one of the i2c lines then I can reduce it to 8 wires and that makes it a lot easier to find the connectors I want.

Tim





you can use one I2c (2wires) and 2 I2C buffer chips that need 1 wire to enable or disable. put a chip on the head of sensors on the control
the flow of data and clock line.
2 3stat back to back buffer with enable. the clock line does not need to be put into the buffer. every device can give the clock
try this concept.

TimB

Quote from: david on Jan 31, 2022, 07:36 PMThat's a bit miserable - one address or pay a premium to have two of their devices on the same bus.
I assume you're looking for ruggedized, bolt-on industrial sensors and not bare chips like the Bosch BMP390 (which has a nice temperature sensor built in but may be limited in maximum temperature)
Hopefully See_Mos can get you sorted.

Cheers,
David

I'm currently using this device https://shop.bb-sensors.com/en/Pressure/Pressure-sensor-modules/Pressure-sensor-module-in-the-housing.html
They are mounted in the case. So giving 2 lines each is no issue.

However I have to route the pressure lines to the case and its making a messy looking system. So I am looking at mounting the pressure sensors near the source and rather than use 2 pressure lines and one PT100 cable I want to just have the one cable with the 3 data lines and the 3 PT100 lines to one plug.

m.kaviani
Thanks for the help, really appreciated. I would have to put a small board on the cable. Not an big issue though.

Tim