Multiple SI7021 Sensors using i2c-gpio #285

Open
opened 2020-01-27 05:50:10 +00:00 by rrydman · 0 comments
rrydman commented 2020-01-27 05:50:10 +00:00 (Migrated from github.com)

I've been trying to setup i2c-gpio with multiple SI7021 sensors but to no avail. For starters, when the sensor is plugged directly into the i2c pins it works great as expected.

To setup i followed this guide: https://www.instructables.com/id/Raspberry-PI-Multiple-I2c-Devices/

I added the following to /boot/config.txt

dtoverlay=i2c-gpio,bus=4,i2c_gpio_delay_us=1,i2c_gpio_sda=20,i2c_gpio_scl=16
dtoverlay=i2c-gpio,bus=3,i2c_gpio_delay_us=1,i2c_gpio_sda=19,i2c_gpio_scl=26

When running sudo i2cdetect -l I get the i2c adapters,

i2c-3   i2c             3.i2c                                   I2C adapter
i2c-4   i2c             4.i2c                                   I2C adapter

And the addresses show up on sudo i2cdetect -y 1, (note they are 45 and 38)

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- 38 -- -- -- -- -- -- --
40: 40 -- -- -- -- 45 -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- 65 66 67 -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

But when I use the addresses 45 and 38, I get very wrong temperatures in the UI (ignore the top two sensors, they are previous DHT11 sensors):

image

I've been trying to setup i2c-gpio with multiple SI7021 sensors but to no avail. For starters, when the sensor is plugged directly into the i2c pins it works great as expected. To setup i followed this guide: https://www.instructables.com/id/Raspberry-PI-Multiple-I2c-Devices/ I added the following to /boot/config.txt ``` dtoverlay=i2c-gpio,bus=4,i2c_gpio_delay_us=1,i2c_gpio_sda=20,i2c_gpio_scl=16 dtoverlay=i2c-gpio,bus=3,i2c_gpio_delay_us=1,i2c_gpio_sda=19,i2c_gpio_scl=26 ``` When running sudo i2cdetect -l I get the i2c adapters, ``` i2c-3 i2c 3.i2c I2C adapter i2c-4 i2c 4.i2c I2C adapter ``` And the addresses show up on sudo i2cdetect -y 1, (note they are 45 and 38) ``` 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- 38 -- -- -- -- -- -- -- 40: 40 -- -- -- -- 45 -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- 65 66 67 -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- ``` But when I use the addresses 45 and 38, I get very wrong temperatures in the UI (ignore the top two sensors, they are previous DHT11 sensors): ![image](https://user-images.githubusercontent.com/1332864/73152698-b3d30300-4085-11ea-8fc1-d7d8793a5096.png)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Gandalf/OctoPrint-Enclosure#285