HTU21D SHT21 connect to Beagle Bone Black Industrial via I2C

Hey,
Unfortunately I’m struggling really reading the temperature and humidity with the HTU21D SHT21 sensor from the makershop with the Beagle Bone Black where Debian 11.7 is running. I tried a bunch of things including all available i2c on the BBB manipulation of the pin mode and so on but for some reason the I2C communication wont work. Is there someone out there who can give me in best case scenario a step by step manual to install all necessary packages and maybe also share a running python example to read the data? But anyway every help would be awesome. i2cdetect -l Shows the available buses and i2cdetect -r -y 0/1/2 shows only fixed addresses i cant use. Connecting and disconnecting the sensor does not change the output. The sensors works at 0x40 and is also working fine with arduino but as i said not on BBB and Debian 11.7
Thank you very much!!

In most cases, it’s an issue with the pin muxes and/or the overlays in the device-tree.

Why don’t we start by you telling us what the pin numbers you’re connecting to are?
If you are able to connect to the boot console, a dump of the boot log would be helpful too.

Are you able to “wiggle” the pins with gpioset manually?
You could also share the output from gpioinfo

I don’t have any good python scripts, but maybe google could help you with that?

I know this all sounds very pedestrian, but perhaps it could eliminate some
of those pesky details to start with.

Also, can you link that little module you’re using?
I’m curious as to whether it has pull-ups on the board or not.
I2C is an open-drain bus, so you’ll need around 2K pull-ups to 3.3V.

Oh, and I found this for you, when we get the particulars sorted.

not sure which I2C pins your using, but I2C2 is enabled by default, P9 Row 10, scl outside, sda inside
for I2C1 you will need to enable this via uEnv.txt after
running make at /opt/source/overlay-utils/
then copy the i2c1.dtbo to /boot/dtbs/5.10.168-ti-r68/overlays/
and adding i2c1.dtbo to uEnv.txt
for example, uboot_overlay_addr4=i2c1.dtbo
this is using pins P9 24 (scl) and 26 (sda)
i2cdetect will detect it on the corresponding bus, provided everything is wired up correctly.

1 Like