Page 1 of 1

DHT22 or AM2302 Sensor with micro:bit

Posted: Mon Dec 11, 2017 1:54 pm
by jmo
I was trying to connect a temp/humidity sensor that I have used previously with a raspberry pi. From what I have found, there is no library available for the micro:bit. The closest I have found is https://github.com/polygontwist/uPython-DHT22 but this is designed for the pyboard.

Has anyone successfully used this sensor with the micro:bit?

Is there a library available and I have just failed to locate it?

Is anyone able to port the above version so that it will work with the micro:bit?

Thank you.

Re: DHT22 or AM2302 Sensor with micro:bit

Posted: Wed Dec 13, 2017 11:42 am
by mcauser
DHT11, DHT22 and AM2302 only support the 1 wire interface.
I haven't tried using one with a micro:bit yet.

If you switch to a DHT12 or AM2320 (roughly same price), you can use their more user friendly I2C interface.
You could try porting these to the micro:bit. You may need to change some method names.
https://github.com/mcauser/micropython- ... /am2320.py
https://github.com/mcauser/micropython- ... r/dht12.py

Re: DHT22 or AM2302 Sensor with micro:bit

Posted: Fri May 18, 2018 7:44 pm
by rhubarbdog
I've written microbit code for dht11 and am2320 (in one wire mode) neither worked. micropython on a microbit runs too slow