sparkfun / BMP180_Breakout

Breakout board for the Bosch BMP180 barometric pressure sensor
Other
69 stars 101 forks source link

Can you send the data from 1 BMP180 sensor to 2 different Arduino Unos? #4

Closed pradk1 closed 9 years ago

pradk1 commented 9 years ago

Can you send the data from 1 BMP180 sensor to 2 different Arduino Unos? This is so I can simulate the data in 2 different ways using 2 different serial ports. There would only by 1 3.3V power supply and the grounds would all be connected together properly, but the SDA and SCL pins would be connected to both Arduino Unos on the same pins (A4 & A5). I'm not sure if it's possible, but I thought I would ask. Thank you!

jbdatko commented 9 years ago

So the way i2c works is you need a master and a slave. The master requests data from the slave, in this case, the master would be one UNO and the slave the BMP180.

The easiest way to have data go to both UNOs would be something like this:

UNO1 is a master BMP180 is a slave UNO2 is also a slave

UNO1 reads the data from BMP108. UNO1 then WRITES that data to UNO2.

UNO2 would have to have a call like Wire.begin(0x42) or some made up address.

But honestly, I'm not sure why you just wouldn't have both UNOs read the BMP180. I'm pretty sure the i2c peripheral on the UNO is smart enough to handle collision detection. I2C supports multi-masters.

On Thu, Dec 11, 2014 at 9:44 PM, pradk1 notifications@github.com wrote:

Can you send the data from 1 BMP180 sensor to 2 different Arduino Unos? This is so I can simulate the data in 2 different ways using 2 different serial ports. There would only by 1 3.3V power supply and the grounds would all be connected together properly, but the SDA and SCL pins would be connected to both Arduino Unos on the same pins (A4 & A5). I'm not sure if it's possible, but I thought I would ask. Thank you!

— Reply to this email directly or view it on GitHub https://github.com/sparkfun/BMP180_Breakout/issues/4.

arashmarzi commented 9 years ago

What if the scenario is that you have a Raspberry Pi that is the master, an Arduino Micro is a slave to the Pi, and the BMP180 that is a slave to the Micro, so something like this: Pi (gets data from) <-- Arduino (gets data from) <-- BMP180 (collects data)

would this be possible?

mgrusin commented 9 years ago

You may be overcomplicating things. The data you get from the BMP180 is what it is, and would be the same for both Arduinos. How about having one Arduino retrieve the raw data, process the data both ways, and send one result to the hardware serial port, and the other result to a software serial port?

ToniCorinne commented 9 years ago

Closing this issue out as two possible fixes have been addressed. Please reopen if you have additional questions.