Week 10: Input Devices

I recently started doing some home cheesemaking. To age cheese properly, you want to store your cheese in a "cheese cave" at an ideal temperature and humidity range. This week I made a microcontroller board with a humidity and temperature sensor to monitor the surrounding conditions for aging my cheese.

Making the board

I designed the board using EAGLE and followed the fabduino example and used an ATMEGA328P microcontroller. For the sensor, I bought a DHT22 sensor from Adafruit. The Adafruit website is provides a lot of guidance and project ideas for the sensor.

I milled the PCB using a Modela desktop CNC and soldered all the components on. Again, I had the problem with traces being too close together and had to use a knife to scrape them away. Some people never learn...

I had to drill through-holes for the sensor to fit in. I used a double-sided copper board, which was a mistake. To fix this, I (again) used a knife to scrape away around the holes on the other side of the board to electrically disconnect them.

Programming the board and troubleshooting

I initally had trouble burning the bootloader. I got an error that the device signature was invalid. I had to change the device signature in the avrdude.conf file in the Arduino application folder. The board.txt file that I was using for the fabduino is for programming an ATMEGA328, so I had to change the device signature for the 328P to that for the 328. However, I still had the problem where I had to burn the bootloader again everytime I wanted to re-program the board.

After I burned the bootloader, I tried the Arduino library and example code for the DHT22 humidity and temperature sensor from Adafruit. The temperature and humidity readings were all zero. I suspected perhaps that I had destroyed the sensor from plugging in the board when there was a short, so I decided to try another sensor (I had bought an extra one) and test it out with an Arduino, using the setup shown on the Adafruit page.

However, the other sensor on the Arduino also read zero for both temperature and humidity. I thought it was unlikely that both sensors were shot, so I decided to try another libary that I found on the Arduino website. This worked and I was able to read actual temperature and humidity values. When I blew on the sensor, the temperature and humidity increased, which further verified that everything was working well. I then tried programming my board with the new library, and I successfully got real temperature and humidity readings.