There’s a home decor store that I like to visit every now and then which has some neat things. For each visit, I like to think about how to somehow integrate electronics to whatever I find most interesting.
In my most recent visit, I found a cute brass pillbox and bought it. I decided to make a digital thermometer and have the pillbox house it. I also had to make a gift for my sister as her birthday was coming soon so I thought that this would make a pretty neat gift.
I’ve been wanting to play around with the ATTiny microcontrollers for a while and since the pillbox was pretty small, I thought that this would be the perfect opportunity to use such a microcontroller.
When I first bought the pillbox, there was a plastic divider that was glued on by a really strong adhesive. Once I got that off, it was time to start planning the circuit board. I thought about making the circuit on a perf board, then cutting it to fit inside the box but I ended up deciding to make the board using paper and some copper tape. The board was glued onto a thin plastic backing to give it some support.
I used the ATTiny84 microcontroller and 10 of its GPIO pins to light up LEDs which correspond to a certain temperature range. For example, the third LED from the bottom indicates a temperature within -5 and -9˚C. One ADC pin is reserved for reading the voltage sent by the TMP36 temperature sensor from Analog Devices.
After the build, I got something that sort of worked. The thermometer worked pretty well at warmer temperatures but once the mercury dipped below 0˚C, that’s when the thermometer was most inaccurate. In one case, the outside temperature may have been -15˚C but the thermometer would read somewhere around 0 to -4˚C. I think that this might be due to the cold affecting the battery which might output a lower voltage and skew the ADC results. Another problem is that the temperature sensor isn’t very well thermally coupled to the case so it could delay the proper temperature reading by quite a bit.
Here’s a video of the thermometer in action.
In the end, I got something that didn’t work perfectly – although it was a pretty good proof of concept. The code for this little project can be found here