Introduction: Web Connected Weather Station
Build a weather station to show and log wind speed, wind direction, atmospheric pressure, rainfall, humidity and temperature.
I made use of the panStamp NRG 2 chip to send the data from the weatherstation to a WiFithing master device.
I am a cofounder of WiFithing and it is currently on Kickstarter, you can find it here.
You could replicate this project by using an arduino or similar, the advantage of the WiFithing is it has been built to be a code free platform, this project was completed without writing a single line of code.
Heres a list of parts needed to replicate this weather station:
- Weather Kit (SparkFun)
- Humidity and Temperature Sensor [RHT03] (SparkFun)
- I2C Barometric Pressure/Temperature Sensor [MPL115A2] (Adafruit)
- Digital Light Sensor [BH1750FVI]
- Hammond Watertight Enclosure [1554CGY] (Newark)
For communication from the weather station to the web:
Step 1: Assemble Your Weather Station
First step, assemble the SEN-08942 weather kit.
The rain gauge is a self-emptying bucket-type rain gauge which activates a momentary button closure for each 0.011" of rain that is collected.
The anemometer (wind speed meter) encodes the wind speed by simply closing a switch which each rotation. A wind speed of 1.492 MPH produces a switch closure once per second.
Finally, the wind vane reports wind direction as a voltage which is produced by the combination of resistors inside the sensor. The vane’s magnet may close two switches at once, allowing up to 16 different positions to be indicated. For more information on how this works, as well as a table of voltage and resistance values for each position, see the data sheet.
Step 2: Preparing the Slave and Breadboard Connections
Now you need to assemble the electronics to connect your slave to the various sensors which make up the weather station. I used an Adafruit permafruit 1/2 sized breadboard to do this.
First solder male headers on to the rows of pins on either side of your WiFithing slave. You need two five pin headers and two 9 pin headers.
See picture of my slave with the headers soldered on with the pins projecting from the component free side.
Step 3: Breadboard Preparation
The next step is to solder female headers (i.e. sockets) on to the breadboard so you can plug in the WiFithing slave and the various sensors. I used 15 pin female headers which I arranged as you can see in the diagram below.
I only realised that I needed 16 pin female headers for the WiFitihing slave after I had soldered on the 15 pin headers, so I had to add the extra socket you can see in row 16 on either side of the bread board. On reflection, I probably should have just soldered the two 15 pin sockets in line but it is easy to be wise after the event.
You will also need to solder a 3 pin female header onto the -v (earth) rail of the breadboard to connect one of the leads from the the rain sensor, anemometer and wind vane. Once you have all the headers in place, I suggest marking the various sockets with a marker pen so you know which socket is which. You can leave out the header on the VCC rail. This is not needed.
The next stage is to wire the sockets to the pins and add the other
components. This is where I realised, after I had built the board in the photos, that I had made a mistake and connected the two capacitors directly to the pins on the slave. The capacitors are there to “debounce” the switches in the anemometer and rain gauge. Otherwise there is a risk making multiple counts as the switch bounces as the contacts come together.
What I forgot, is that when a WiFithing slave resets, all the pins are connected to ground (technically set to output low). If the capacitors are fully charged at that point they will discharge through the microcontroller pins and there is a risk of damaging the micro controller. Adding a 1KOhm resistor will avoid this risk. This is shown in the diagram but not in the photo!
Step 4: Assembly of Parts in Enclosure
I used a watertight ABS enclosure(120x65x40.5mm) made by Hammond, part number 1554CGY. Available from RS components for £6.40. Pricey, but it looks the part. For the ambient light lens on top I used a "White lens for panelmount indicator base" (also from RS at £4.60. If you can scrounge a transparent plastic top from something else, that would do fine. I used simple white plastic plumbing pipe clips to clip the enclosure to the pole.
We developed a codefree approach to controlling devices which you can see in these pictures.
By allocating prewritten functions such as reading values to certain pin numbers on the slave device, fully customisable applications can be developed without writing or compiling code.
This process was carried out for all the sensors and some maths logic was used to retrieve the correct data so that it was displayed properly on the web app.
The system works so the panStamp slave sends information to the WiFithing which then sends the data over wifi to the web app. The data is stored on the account corresponding to the device and then displayed on the custom weather page.
Result, quick codefree weather station. WiFithing is here.