Weather Station

What is it?

The Small Weather Station is a battery-operated, wireless, weather station. I have been working on the project for almost a year now, and now I have an unshielded prototype that is partially functional. I say partially functional, because it does not have any wind/rain sensors installed, only the connections for them. So far it can log several things: temperature, humidity, atmospheric pressure, and battery voltage. However, the connectors for the rest of the sensors are functional; the only thing they require are several magnetic reed switches.

Data collected from the Small Weather Station can be logged on a computer or published to the internet. This is accomplished by connecting the computer to the receiver radio, and running the server software I have written.

You can download all the code I used for this project at the bottom of this page.

How it works:


There are three sections of this project that work together to bring weather information online. The weather station, the receiver, and the server software:

Weather Station:

The weather station is connected to the following sensors: BMP180, DHT22, rain, wind, and wind direction. The rain, wind, and wind direction sensors are made up of switch circuits. The radio used is the 433MHz Superhetrodyne RF Kit. It’s about $7, which makes it more expensive than other RF kits on eBay, but it has a very realistic range of 50m, and the signal can penetrate walls easily.


The weather station Atmega does a loop every 12 minutes, sleeping in-between using the Rocket Scream Low Power Library. The loop gathers data from the sensors, transmits them using the radio, then goes back to sleep.

The weather station gets its power from a 12v, 5 watt solar panel. The setup I use is quite efficient:

  • For every 1 hour of sunlight the weather station runs 48 hours
  • The weather station can run 30 days, or 720 hours without any sunlight at all
  • Power consumption is between 3.8mA and 5mA when in sleep mode


The receiver is simply another Atmega328 with the receiving end of the Superhetrodyne RF Kit attached. Every character that comes in through the radio is sent via serial to the Serial to UART bridge. It is then picked up by the server software on the other side:

Circuit Diagrams:

There are two layers to the weather station. The top layer contains the Atmega328 and the sensors, while the bottom layer provides power regulation, battery charging capability, and space for a heatsink.

top layer

Circuit for the top layer. The separate section in the right is the flip-flop switch for the rain sensor.


Bottom layer. 18 pin connectors are used to support the top layer, and transfer power.

Server Software:

There are two parts to the server software: serial to mySQL, and mySQL to Web. The serial to mySQL software was programmed by myself in Visual Studio C# with the help of Oracle mySQL connector.

Functions of the weather station server software include: charting graphs, displaying live input, and posting data to a mySQL server. The program didn’t take too long to build, and it is based mostly on timers which check if there is enough data to post.


The second part of the server software is the web based portion. This was done through php, with the help of Libchart for the graphs. The premise of the software is basic, connect to the mySQL database, get the data, draw a graph, then display some record statistics. The data you see at the top of this page was generated through this system.


  • Version 1.0: Includes Atmega328 code, web/server software, example mySQL table, and necessary installers to run the server software.

To-do list:

  • Make a sidebar widget for the weather data
  • Build a case for the weather station
  • Build wind and rain sensors
  • Place the weather station in a more suitable place

More info:

I have been writing blog posts on this project for quite some time now. If you want more information you could find it here, or leave a comment:


10 thoughts on “Weather Station

  1. Nice this is very well done. Its nice to find somebody working in the same vain as I am at the same time. I almost bought that exact case for god snakes :). I have to collect data from a moving car anywhere in the world. My topology is: sensors->teensy3.1->Ethernet(or maby wifi)->3G router->far away mySQL server. Which leads me to ask if you are aware of Telnet, the defacto standard of ascii over internet. It is very easy for example, to give a weather station an IP/port of a server and a WiFi or Ethernet module, and have the server receive the clients text. You could have your weather station anywhere and without the need for an Arduino receiver and Serial system. Although the downside is that Ethernet and WiFi chips can consume a relatively lot of power, ~150ma when running, and the client has to be pre-programed with IP, wifi pass, ect. Anyway good work and I hope to be stealing your mySQL tricks soon! Check out my blog too, it may be a while yet untill I post about my project.

    1. Thank you! What a coincidence, it’s a waterproof case btw.
      Yeah, I thought of using telnet, I even picked up the ESP8266 Serial Wifi chip. They say it’s really easy to use, but I’m waiting for some good tutorials before I dive in. I agree, my method is not the best, but I used the materials I had available.
      I also checked out your blog, I’m a piano kind of guy, never got the appeal of synths :)

  2. Fantastic work there, I’m aiming to achieve something similar myself. Would you say it’s important to use a 12v panel to charge a 6v battery – due to all the losses through various regulators and the LM317 etc? I have a bunch of 6v panels to charge 4xAA batteries.

    How do you handle the over-charge protection?

    1. Hi! Yes I would say a 12v panel is necessary because there’s a 3v drop across the LM317. I tried a 9v panel but it only worked when the skies were clear. Don’t use a diode either, it’s unnecessary voltage loss.
      What kind of battery chemistry are the AA batteries? Lead acid is different from NiCD and NiMH. With lead acid you just specify the float voltage (also called standby) and the battery will not over-charge that way (In my case this was 6.85v).

  3. it’s taking from 3.8 to 5mA. it’s about 1000 more than it should. Maybe You should switch the rf transmitter off during sleep period? But anyway good work!

  4. Linear regulators are very inefficient for dropping 12V to 3.3V. It’s no wonder your idle current is 5mA, about 1000x higher than it should be.

    With that micro and careful power management, 5uA is easily possible. A switching regulator with very low quiescent current should get you down to maybe 50uA with little effort, still 100x better than your current set up. Then you can use a much, much smaller battery too.

Leave a Reply

Your email address will not be published. Required fields are marked *