Dear friends
I'm trying to implement a HTU21D temperature + humidity sensor on a Picaxe 18m2. This sensor by MEAS is a very tiny, but apparently very high spec'd (14-bit temperature and 12-bit humidity resolution) sensor at a very reasonable price (i.e. <$15 ea). The Datasheet for this sensor is beautifully detailed and laid out. My problem is that I just can't get it to work. Hopefully this is because I'm just not experienced enough at reading data sheets. Hence, would love your advice!
I have the sensor directly wired up to the SCLK and SDA lines of the 18m2 with a 4.7k pullup resistor on each line. I also have a 100 nF ceramic capacitor between the Vdd and GND lines as per the data sheet. My 18m2 is powered by the 5v IC on my Axe91u development board. My HTU21D sensor is powered by 2.5V via the Pot on the Axe91u board. My code is my interpretation of what is asked for in the data sheet (p10):
In debug I am just seeing "255" being returned in w0, meaning either the wrong i2c hardware configuration or wrong i2cslave data used (according to p72 of Picaxe Manual 2). I've tried swapping out sensors in case the first got a bit harshly treated with temperature (soldering) or voltage. The second sensor definitely had the "proper" treatment. Alas to no avail.
I think I've gone as far as I can with available resources and my skill level. I'd love some help to move me along on this?
Thanks
I'm trying to implement a HTU21D temperature + humidity sensor on a Picaxe 18m2. This sensor by MEAS is a very tiny, but apparently very high spec'd (14-bit temperature and 12-bit humidity resolution) sensor at a very reasonable price (i.e. <$15 ea). The Datasheet for this sensor is beautifully detailed and laid out. My problem is that I just can't get it to work. Hopefully this is because I'm just not experienced enough at reading data sheets. Hence, would love your advice!
I have the sensor directly wired up to the SCLK and SDA lines of the 18m2 with a 4.7k pullup resistor on each line. I also have a 100 nF ceramic capacitor between the Vdd and GND lines as per the data sheet. My 18m2 is powered by the 5v IC on my Axe91u development board. My HTU21D sensor is powered by 2.5V via the Pot on the Axe91u board. My code is my interpretation of what is asked for in the data sheet (p10):
Code:
Main:
Pause 20
hi2csetup i2cmaster,0x80,i2cslow_8,i2cbyte '%10000000 (hex 0x80) is device i2c bus address
Pause 20
hi2cin 0xE5, (w0) '%11100101 to trigger humidity measurement, store in w0
pause 15
bintoascii w0,b2,b3,b4
debug
goto main
I think I've gone as far as I can with available resources and my skill level. I'd love some help to move me along on this?
Thanks