Category Archives: Hardware

Monitoring temperature and humidity

I bought a cheap DHT22 humidity and temperature sensor module from eBay. It comes with the jumper wires you need and, as far as I can tell, it doesn’t require a resistor, meaning you don’t have to mess around with a breadboard. The benefit of this is that it comes ready to plug straight onto your GPIO pins.

I connected the sensor to my Pi (+:VCC, OUT:data port, -:GND) and used the instructions from Adafruit to get it recording the data and adding it to a Google Spreadsheet. I changed the Python code to update my spreadsheet every five minutes. You can make a nice chart from this but the charts available don’t automatically expand the range if you add more data (i.e. if your Pi is updating the spreadsheet every few minutes). You have to use Script Editor if you want to make a chart from a dynamic range. Also, I found that Google Drive on my Nexus phone doesn’t display charts, so if I wanted to be nerdy and check my chart at any time of day, I couldn’t.

I created a GitHub Page as it looked like a quick way of making a website. It was! Then it was easy to use the Google Chart API to make a line chart for my site. This now shows the most up-to-date readings from my Pi sensor (provided I have my Pi turned on):


Doing it cheap

I didn’t know how much I was really going to use my Pi so I didn’t want to spend much money on it. I got it with a cheap case from then scrounged the other parts from elsewhere:

  • Display – my TV
  • HDMI cable – already had for plugging laptop into TV
  • Keyboard (with mouse trackpad) borrowed from my friend to set the system up
  • Ethernet cable from my friend
  • Power cable – the USB mains charger from my Kindle
  • SD card – 2GB one from my camera, reformatted (had to buy a replacement so I can take photos!)

The keyboard was just a temporary thing because I now SSH/Share Screen into my Pi from my MacBook. I also bought a USB wireless adaptor, so I don’t need the ethernet cable but I keep it plugged in for streaming TV.