Tuesday, January 14, 2014

DHT22 Blocking Library for AVR

Some time ago a updated a DHT22 library posted at AVRFreaks forum. That lib returned float values which inplies that the AVR-GCC added a very large library. The code size was above 2kB.
With this update, float number is not needed anymore and the lib returns the integral and decimal parts of the values in a defined struct format. Is needed, the user can configure the lib to return raw values from the sensor. Code size now is only around 300 bytes.

DHT22 Interrupt Driven library for AVR

This lib can read temperature and humidity of a DHT22 sensor without blocking the microcontroller with unnecessary delay functions. The lib is interrupt driven, all the timing measurements of sensor signal is done with a timer and a external interrupt using a state machine.

This way, you can use this lib with multiplexed displays without flicker the display during the measurement of the sensor data.
I hope this lib can be useful to someone.

Intro

This is my first post.

I created this blog to post some of the results of my Do It Yourself (DIY) projects. I will use this blog to post some programing libraries that I developed, schematics, Printed Circuit Boards and some other stuff that I hope will be useful to someone.

Best regards!

Miguel