Question

I am working up a sensor package for my PI. I have already added the TMP102 temperature sensor from Sparkfun. On the GPIO it is powered from pin 1, grounded on pin 6, with pin 3 and 5 handling the serial data. I have written a python script to read the data and everything works fine.

My problem is that I now want to add a second sensor to the GPIO, the BMP085 pressure sensor also on a breakout board from Sparkfun. What wiring examples I have found suggest that it needs to hook into the same GPIO pins as the TMP102. They should both register as serial devices, but I am unsure how to wire everything together.

I'm a programmer at heart, so hooking up electronics makes a nervous. :-)

Any suggestions will be greatly appreciated.

Thanks.

Was it helpful?

Solution

If your sensors use I2C and it looks like the TMP102 and the BMP085 do, you are in luck.

I2C is designed to have multiple devices sharing the same 2 wire interface. Each device must have a distinct address though so you need to make sure your devices don't conflict. You will have to read the datasheets or other documentation for your sensors to find out how to set the address.

Once you configure the address for each sensor you should be able to connect both devices to the same SDA and SDL pins.

OTHER TIPS

Yes, more than one sensor may be connected to the i2c bus as long as there is no address conflict. One caveat: a number of sensors on small boards (break-out boards) have pull up resistors on the SDA and SLC lines. Since it is theoretically possible to add up to 128 sensors on this bus a multitude of pull up resistors will become a problem. One is required, two is definitely OK, but I don't know how many you can add after that. It will be necessary to remove them from the breakout boards.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top