Wednesday, 19 April 2017

Arduino powered GSM weather station VERSION 2

Hello and welcome to version 2 of my Arduino GSM weather station.

This new version uses the Adafruit wind speed sensor, with analogue output.  This isn't susceptible to interference like the old wind speed system.   I also use 2 INA219 current sensors in parallel in this version.  This allows me to measure twice the current (6.4amps)  You may not need this, I have a 75watt solar system but it doesn't need to be this big. (also powers an electric fence - sheep)

Here's a rough drawing of how its all connected...

The system runs off a 12v 90ah car battery.  The power for the arduino and GSM shield comes from the Turnigy BEC (bottom left of above)  This kicks out upto 5amps at 5v so more than enough to run all of the 5v stuff.

How the system works...

The main board is an Arduino Mega 2560.  I chose this bard because earlier versions of the code were too big for the Arduino UNO, although now an UNO would probably work just as well.
This Mega is the main board.  Its' job is to collect information from the sensors and send this over the GSM network, using the SIM900 board, to a website called

The SIM900 board is the main board's connection to the internet.  The main board has to send AT commands over a virtual serial port.

The light sensor is used to detect when the lock out box is opened. If its open - someone is flying.
The LED lights up while an update is being sent to dweet over GSM
The BEC converts 12v to 5v
The temperature sensor is a thermistor and a voltage devider to give analogue voltage.
The INA219 is current/voltage sensor over I2C.  Each one needs its own address (solder pad)

The system sends an update every minute to...

This site is really just for raw information.  It all gets collected and displayed for the club members at...

Parts List...
Arduino Mega 2560  - eBay - £11 - £45(Clone or Genuine)

SIM900 GSM Module - eBay - £13 - £50(China or UK Sellers)
                                       (There are a few versions of this module.  The one in the picture above 
                                        definitely works with arduino.  Some other versions use a different serial 
                                        interface and don't work with arduino)
INA219 Current Sensor - eBay - £2.50 - £7 (China or UK)
Adafruit Wind Speed Sensor W/analogue output - Mouser -£32
WindDirection N96FY - eBay - £9.99
5v Power supply - eBay - £6.50 - Also hobbyking sell these
Resistors and wire

Here is a table of connections...

Wiring the Wind Direction sensor...

The wind direction sensor is made up of 8 reed switches and a magnet on the vane.  Each reed switch has a different resistor in series with it so as the magnet passes over a reed switch, it changes the resistance of the circuit.  
We then use a voltage divider to turn this resistance into a usable voltage that the main board can use.  To do this we need a resistor around 9kOhm and wired as the picture above. 

The code...
It has taken a long time to get this to where it is now.  I am not trained in writing in C and everything here is a result of extensive googling and trial and error.  If you can improve this in any way please let me know.
All the latest VERSION 2 code can be found here Now each line is explained in the file.
(Open the link and then click the download button - top right of the new page)

To open the code you will need the latest Arduino software.  Its free from here...

Once you have installed Arduino, you will need the libraries that I have used in my code installed.  This is like installing drivers on a computer.  
Here's how to do it...
Download the file from here... (Download button - top right of new page)

Unzip the files in the following location...
My Documents > Arduino > Libraries >

I will update this later with what you might want to change in the code to suit your needs.

Please leave a comment if this was helpful.



  1. This is incredible! I can't thank you enough for taking the time to document all your work.

    I'm currently working on something similar to create a cheap remote weather station kit for paragliding sites out in the western USA. A lot of our sites are pretty remote, and don't have access to power or internet, so this looks like it will fit the bill quite nicely.

    In an attempt to sort out my power and data needs, could you let me know how often you're pushing data and how much data that uses per month? Also, do you have an idea of how much power the whole system uses? You mentioned the solar panel also runs an electric fence and that it's much more than the system needs...

    Thanks in advance!

    -Carl Marvin

    1. Hi Carl, thanks for your comment. I have it so that it uploads an update every 60 seconds but it’s measuring wind speed and direction every 5 seconds, to catch gusts of wind. The upload is only a few bytes of data and it probably only adds up to a few megabytes each month. I pay around 10 pence per day in data charges.
      Power wise, the fence takes up a lot op power. The weather station takes around 175ma and upto 2 amps for the split second it is sending an update.
      Hope that helps,


    2. Thanks Russ! That's incredibly helpful.

      I've ordered all the parts I need, so hopefully I'll have a working prototype soon. I'll let you know once I have one up and running! I was pretty daunted taking this on initially, but this page has alleviated 99% of my fears.

      Thanks again!


  2. This comment has been removed by the author.