Thursday 20 August 2015

Arduino Weather Station

 

Overview


A quick rummage through eBay and you soon realise how many sensors types there are for the humble Arduino so in this project lets get to work with six interesting ones.  A weather station is the perfect scenario to combine data from all of these sensors and turn it into an interesting view of your surroundings.  I've captured the readings to an SD card but there's no reason why the data couldn't be sent via a network card, Wi-Fi to a remote location anywhere on Earth!


Here's a quick radar graph focusing in on the air around the Arduino during a 24 hours period, specifically studying its quality, humidity and temperature.

The five Keyes sensors (from left to right):



  • Ambient light
  • Air Temperature and humidity
  • Air pressure 
  • Air quality
  • Soil moisture

You could keep going with a rain drop sensor for example but after five sensors and an SD card you're going to run out of I/O pins on the Ardunio Nano and Uno, but if you want to keep expanding the Arduino Mega is your way forward.


Be autonomous...


You are going to need power and lots of it with all of those sensors, I've been using the EC Technology® 22400 mAh external battery which I bought from Amazon for £20 in July 2015.




Next you are going to need somewhere to keep it out of the rain, direct sunlight which really messes up you temperature readings, its proper name is a 'louvres' or 'Stevenson Screen'.





With all that information being captured you need to store it safely, I found the most reliable way is an SD card via the Arduino Shield which simply means you can add you prototype board on top, hence the three layers in the photo earlier.  The other reason to go for the shield is the real-time clock which you need to track the date / time when the readings are made.




To conserve power I didn't add an LCD screen but opted for a single LED based set of lights.  The green LED pulses on/off as the Arduino enters the sensor reading loop, if there is a problem (a bit like a try catch) then the red LED illuminates.  This way at a glance you can see if all is well or there is a problem.  To debug an issue such as a failed sensor the best way it to plug it into the computer and enable the serial.println debug command to see what the root cause is.




The Weather Station in action!

The source code ...

Good luck and here is the source code for the Weather Station project which you are free to download and use.

Any problems or a thank you leave a comment!