Interfacing htu21 over i2c with Beaglebone Black

I got an HTU21D temperature and humidity breakout board from Sparkfun (https://www.sparkfun.com/products/12064). Since I’m a novice at electronics I’m unsure if I’ve made an error in connecting the device or there is some device driver issue. I connected the breakout to my beaglebone black as follows:

  • : Pin 3 (VDD)
  • : Pin 1 (GND)
    CL : Pin 19

The datasheet says 3.8V maximum and since the VDD is 3.3V, I thought no logic level converter would be necessary. Running i2cdetect doesn’t show anything connected. The output is as follows:

i2cdetect -r -y 1

0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- UU UU UU UU – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --

I tried to initialize the driver by running:

echo htu21 0x40 > /sys/class/i2c-adapter/i2c-1/new_device

This is what I see in dmesg:

[215690.914098] i2c i2c-1: new_device: Instantiated device htu21 at 0x40

But there are no directories created under ‘/sys/bus/i2c/drivers’ corresponding to this driver.

Rushi

Do you have the pullups on the board enabled, or disabled ?

Are you using 3.12 or later kernel ? The driver for this was only merged in 3.12.

Did you 'modprobe htu21' or is the driver compiled into your kernel ?

I've come across a few things recently that i2cdetect doesn't see, but if you access them directly they work fine.

I decided to give up on Angstrom and move to Debian using Robert C. Nelson’s images/scripts. On kernel 3.13, I’m able to access this driver and read temperature and humidity. However, the temperature reading is at least 10F too high. I don’t have another calibrated humidity sensor to compare this against. I’ve kept the pull-up resistors onboard (i.e. I haven’t desoldered them). Could that be the problem?

Thanks,
Rushi