My current setup is a Raspberry Pi 3 connected to and controlling an Arduino Uno R3 through USB and pyfirmata.
I have a BMP180 sensor that connects to the Arduino through SDA/SCL so with I2C protocol. I will have multiple sensors using SDA/SCL so RPi GPIO will not be sufficient but for a single sensor.
I am trying to figure out how I can read this sensor through pyfirmata. The sensor libraries are C++ and set up to use the Arduino Wire library and I am still trying to figure out if I should wrap these libraries into python or translate them into python.
Any guidance on this matter is much appreciated.
-
1The Pi can support multiple I2C devices. They just need to have different addresses.Steve Robillard– Steve Robillard2016年08月30日 05:12:16 +00:00Commented Aug 30, 2016 at 5:12
1 Answer 1
you can connect multiple i2c devices with pi as long as 2 devices Doesn't have same address. to connect hardware check few things.
make sure all work at 3.3V or if you have 5V device you will need level sifter.
make sure your pull ups are connected.( 4.7k is really good choice)
once everything is setup correctly you can run the I2C scan and you will see all the device addresses.
if you want to connect multiple sensor look into this raspberry Pi I2C shield, it will solve all your problems and its really low cost.
for python library checkout this git repo it has hundreds i2c lib, you can find BMP180 over here.