Odd Software for Odd Jobs

Temperature & Humdity

This is one of my very early experiments with Arduino that succeeded in the move from idle breadboard tinkering into a "manufactured product".

I built a thermometer for my son. It comprises:

  • an Arduino Micro,
  • a DHT22 temperature & humidity sensor (labelled "AM2302"),
  • a two-digit, seven-segment LED display (labelled "CA15621BS", common anode),
  • a 10kΩ resistor for the DHT22,
  • seven 680Ω resistors for the LED display,
  • a SPST temporary action pushbutton,
  • a 9V battery,
  • and an iPod touch case

The result can be seen below:

Pasted Graphic 1

Pasted Graphic

(Probably could've made the black negative wire from the switch to the circuit board a little longer)

Why a momentary action switch? I didn't trust that my young son would remember to switch it off after quickly checking the temperature - so you need to hold the button down to check the temperature. So far I've never had to replace the 9V battery!

The LED display alternates between temperature and humidity. As I live in Sydney and the display is limited to two digits, there is no expectation that negative temperatures are needed. Actually, checking the code I wrote, it seems that I don't bother checking the temperature result at all - I think I assumed that the temperature returned by the DHT22 will always be above freezing point (0 Celsius)! Maybe I need to do some cold weather testing, or at least add some sanity checking! Anyway, it's safe for Sydney usage at least.

The code is here.

Here's a short video of it in action.