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.

Main Components

Raspberry Pi
Our weather station is based around a Raspberry Pi, which is configured as another Home Control System (HCS) slave processor. This is mounted inside a waterproof enclosure and has 12V power and a wired network connection.

Power Supply

12V to 5V dc-dc converter
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.

1-Wire Adapter

DS9490R 1-Wire USB adapter
The 1-Wire sensors and devices are all connected via a DS9490R USB adapter.

1-Wire Weather Station

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

ADC Pi V2 - Raspberry Pi Analogue to Digital converter
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.

Sensors

Air Pressure

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.

GY-65 BMP085
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.

Our air pressure readings also tally nicely with those of a friend, who lives close by and quite nicely with the values displayed by the Met Office.

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.

Carbon Monoxide

This is covered as air quality monitoring project.

Hazardous Gases

This is covered as part of our air quality monitoring project.

Humidity

HIH-4021 humidity sensor
We have written a feature on humidity sensors in the smart home and we are using the HIH-4021 (datasheet) analogue humidity sensor. It is mounted on the analogue header board.

Light Level

Light Dependent Resistor (LDR)
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.

LDR circuit
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.

Lightning Detection

This is covered as a separate project.

Rainfall

This is covered as a separate project.

Temperature

Both the BMP085 air pressure sensor and our 1-Wire weather station have in-built temperature sensors. The latter is achieved using an internal Dallas DS1820.

Wind Direction

The 1-Wire weather station has a wind direction indicator. It provides 16 possible values (directions) and thus has a resolution of 22.5°.

Wind Speed

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.

Ultra-Violet Radiation

UVI-01 UV radiation sensor
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).

Implementation

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.

Hammond Watertight IP65 ABS Enclosure
The Raspberry Pi is installed in an IP65-rated enclosure, with all cable entry points sealed to prevent moisture ingress.

Analogue Sensors

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.

  1. Ultra-violet radiation
  2. Humidity
  3. Carbon Monoxide
  4. Hazardous gases
  5. Currently unused
  6. Ambient light level
  7. +5V reference monitoring
  8. 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.

UV Levels

UV Sensor
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.

I2C Sensors

  1. Air Pressure
  2. Air Temperature 1

1-Wire Sensors

  1. Air Temperature 2
  2. Wind direction
  3. Wind speed
  4. Rainfall

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.

Software

We are using the Maxim 1-Wire API for Java Software Development Kit to access all of the 1-Wire devices.

Further Reading

Twitter

Some weather events from this project are tweeted by our smart home:

Share ...
We are on ...
Facebook Twitter
YouTube Flickr Follow us on Pinterest