Smart Home Weather Station
The objective of this project is to design and build a networked weather station that is an integrated part of our smart home. This means that it is implemented as a slave processor within our Home Control System (HCS) and all of the data is part of our smart home control system.
The main reasons for have it integrated as opposed to simply networked are:
- Our Home Control System (HCS) will 'see' all of the collected sensor data and can make decisions and take action based upon it. This might include things like closing vents if the wind speed is too high or it is raining. It could also change the way air is circulated if the air quality is low.
- All of the data can be exposed and queried via our Home Control System (HCS), including audio announcements of important data.
- As with all the sensors in our smart home, alerts can be generated and sent via IP or SMS, if values exceed threshold limits.
- Our Home Control System (HCS) can infer things from the data and take appropriate action. This might include an approaching storm or heavy rainfall.
- Our climate control system can take account of all external conditions and operate more efficiently because of this.
This project also uses a high-efficiency 12V to 5V dc-dc converter with a micro-USB plug output. It provides an accurate and stable 5V dc supply for a wide range of input voltages.
The 1-Wire sensors and devices are all connected via a DS9490R USB adapter.
1-Wire Weather Station
We are using a Dallas 1-Wire weather station which provides temperature, wind speed and wind direction measurements. We have been using one of these for many years now.
Analogue Input Board
The RPi has an ADC Pi V2 - Raspberry Pi Analogue to Digital converter from AB Electronics. This provides 8 analogue inputs for connection of a number of analogue sensors. To avoid taking too much current from the Raspberry Pi GPIO pins, we use a custom PCB on which the sensors are mounted. It also features an on-board regulated 5V dc power supply board, with enough power for 8 sensors. Note: There are newer versions of this board available now and they have different layouts. We are using V2.2 for this project.
Analogue Header Board
We have built a bespoke header board on which some sensors are mounted and others are attached. This connects to the above board. It also features an on-board 7805 regulator to provide an accurate 5V dc supply for the sensors.
Measurement of atmospheric pressure is useful for two things. The first is to measure altitude as air pressure decreases with height. Secondly, atmospheric pressure can be used to help predictor the weather.
This sensor requires a 3.3V supply and will be damaged if a 5V supply is used. The BMP085 is also the air pressure and temperature sensor used on the AirPi. In our experience the temperature sensor is not very accurate and provides a reading that is consistently higher than all of the other sensors we are using.
We bought one of these sensors for less than £4 on eBay. Connecting this sensor up was very easy with just 4 wires required. The process is well described on the Adafruit website. We have also connected one to an Arduino UNO by following this SparkFun guide.
We re-used some of the Adafruit Python software as well. The software provides measurements of air pressure, temperature and altitude (estimate). The latter is not a lot of use in this application. One downside of this software is that it only works with Python V2.7 and earlier.
The sensor outputs air pressure in Pascals (Pa). Typically this means a value of around 100,000. A much more useful measure is if we divide this by 100 to get Hectopascals (hPa) and this is then the same as millibars (mb or mbar). We work with millibars to one decimal place. For reference the highest air pressure recording seen in the UK was 1053.6mb and the lowest was 925.6mb.
Most weather maps report air pressure as Mean Sea Level Pressure (MSLP), so you have to correct the output values for your given altitude. The easiest way to get you altitude is to use a service like this one, which says I live at about 35m altitude. There is a simple algorithm to do this in the BMP085 datasheet.
As of 3rd November 2014 the lowest air pressure we have seen is 987.8mb and the highest 1028.5. These values are logged as part of our Home Control System (HCS) monitoring.
We are also logging the rate of air pressure change to see how closely this is linked with incoming storms and strong winds. We measure the rate of rise/fall in millibars per hour. Typically this is a number between -1.5 and 1.5. A fall of -1.2 is a good indicator of a pending storm or stong winds.
This is covered as air quality monitoring project.
This is covered as part of our air quality monitoring project.
There are numerous LDR devices with varying specifications. The ones we are using vary in resistance from about 150Ω in direct sunlight, to around 1.2MΩ in complete darkness.
We connect one side to +5V and the other to the analogue input, which is also connected to GND to via a 10KΩ resistor. In darkness, the voltage at the input is thus ~0.04V, rising to ~4.91V in the brightest sunlight.
This is covered as a separate project.
This is covered as a separate project.
The 1-Wire weather station has a wind direction indicator. It provides 16 possible values (directions) and thus has a resolution of 22.5°.
The 1-Wire weather station has an in-built anemometer for wind speed measurement. It is basically a pulse counter, driven by the 'cups' rotation.
The Reyax UVI-01 is able to detect ultra-violet radiation in both the UVA and UVB band. It can provide an direct UVI (Ultraviolet Index) and it has a linear voltage output directly proportional to the incident UV radiation. These sensors are not easy to find in the UK. Rayax sell them direct on eBay though (from the Taiwan).
The main weather station components are housed in custom made housing, designed to ensure good air flow, reflect sunlight and to keep rain and moisture off the sensors.
The Raspberry Pi is installed in an IP65-rated enclosure, with all cable entry points sealed to prevent moisture ingress.
The analogue sensors are connected via an I2C 8-channel analogue input board using a bespoke header board. This makes it easier to mount and connect them.
- Ultra-violet radiation
- Carbon Monoxide
- Hazardous gases
- Currently unused
- Ambient light level
- +5V reference monitoring
- Remote supply voltage - we are basically measuring the voltage drop (12V dc feed) at this remote slave processor, to check it is not too low. Having tested this over a voltage range of 6.0 to 14.0 volts, the recorded voltage was within 0.03V of a digital multimeter across this range. This shows a very linear response.
The UV sensor needs to be mounted exposed to the air and light. When we tested it, we saw an output voltage of ~160mV in direct sunlight. When placed behind a sheet of glass, this dropped to ~50mV.
Data Feeds & Analysis
As well as locally generated and collected data, we also have a Java class that collects and analyses relevant weather data feeds.
If analysis of these data feeds indicates something of concern, then our Home Control System (HCS) will provide a weather warning. This is provided via a voice announcement when the first person gets up in the morning. These are also sent to our smart home Twitter account.
We are using the Maxim 1-Wire API for Java Software Development Kit to access all of the 1-Wire devices.
- Smart home weather design section
- Rain sensing project
- Air quality measurement project
- Lightning detector project
Some weather events from this project are tweeted by our smart home: