Introduction: Arduino Weather Station
Hello, and welcome to this instructable on building an Arduino weather station.
For this project, I will be using the 'Arduino weather station' shield (purchasing link available on the last page of this instructable). It has many sensors that you would expect on a weather station, including:
- Rain Detector
- Soil Moisture
It also has a handy micro-SD card slot that we will be using to record the data that is collected. This data will be recorded in CSV format so that it can easily be imported into programs like Microsoft Excel.
Let's get building!
Step 1: Installing Libraries
First of all, some libraries need to be installed. If you don't know how to do this, check out this guide.
The libraries that need to be installed are:
After that is done, you are ready to move onto the software.
Step 2: Software
The software that we will be using is the 'Datalogger' example that comes with the weather station library. This can be found in File > Examples > WeatherStation > Datalogger
It will read the values from the sensors, and then record them to the SD card.
Note: The SD Card should be formatted to FAT32 or FAT (Don't worry about this unless you have a problem with the SD card).
After uploading the code to the Arduino., we need to build a case.
Step 3: The Case
Since the Arduino is not weatherproof, it wouldn't last long outside. So to fix this, we will build a case. The case will also include the battery to power the Arduino.
For this, I got an old ice-cream tub and drilled two holes in it- one for the raindrop sensor, and the other for the soil moisture sensor.
Also, you will need a power source. For this, I used a small portable power bank connected via USB to the Arduino.
Finally, it all needs to be assembled, I used blue-tac to seal around the wires going out of the case and it was ready for testing!
Step 4: Testing
I placed the weather station in the corner of my garden and left it there until the batteries ran out - about a day.
Note: The Tx light on the Arduino flashes every time something is written to the SD card, so ensure that this is happening before you leave the weather station. If the light flashes one or twice at startup, but then remains off, there is a problem so check your code and try replacing the battery.
After bringing the Arduino back inside I took out the SD card and waited until it had warmed back up to room temperature (I didn't want condensation shorting something out). Putting it inside my computer revealed the file that the weather station had generated - datalog.csv. I loaded the file into excel and removed the first 100 seconds of data - the time taken to put it outside and get it set up.
After adding graphs, the data looked pretty accurate (apart from the humidity sensor, which was trapped inside the waterproof box - probably should have thought of that before!).
And with that, the weather station project was complete! If I was to do this again, I would definitely make sure the humidity sensor could properly record the outside humidity - not the humidity of a sealed box! I would also try to get a bigger battery to get more data.
A project like this has lots of potential. The addition of a HC-06 Bluetooth module could make this into a 'live information' weather station. Add a bit of machine learning and you've got a weather forecasting station that can send notifications to your phone - pretty cool, right!
If anyone makes this project, feel free to leave images in the comments below, I would love to see them!
Step 5: Purchasing Links
The weather station board is not yet available for purchase. Check back here soon!
Battery Pack: I used one I had lying around, but they can be picked up almost anywhere these days, from eBay to Poundland. Just make sure the power bank can supply low enough current to power the Arduino, I had problems with one of mine turning off because it thought nothing was connected since the current draw was too low.