Personal Weather Station

A weather station based on the Raspberry Pi

1.5 Design considerations

There are numerous design considerations to take into account. It is important to think of the big picture when designing the weather station or any other system for that matter. However, we also need to consider some of the design details up front so that we don't have to go back and make major design changes later due to a fundamental system design issue.

1.5.1 Wireless link

The obvious choice for the remote sensor units is a wireless link. We don't want to be drilling holes through brick and running wires from inside the house to outside to connect our remote weather station sensors.

For the wireless link we have a couple of choices. We could use a simple RF transmitter and receiver module or we could go with a wireless modem type of wireless link.

The simple RF transmitter and receiver has the advantage of being simple on the hardware side, and inexpensive. You can purchase a simple 433MHz RF transmitter or receiver for less than $10. However, a simple RF transmitter is exactly that, simple. It simply transmits whatever you send into its input. The simple RF transmitter has no brains to it, and the same goes for the simple RF receiver. It is up to us to deal with RF transmission related errors. We would have to deal with filtering out RF noise, bit errors in the received data stream, missed messages and corrupted transmissions.

In our software design we would have to introduce error detection and correction logic. We would need to deal with identifying if the data received by our base station is data from our remote sensor or if the data came from another source operating nearby on the same frequency. The simple RF transmitter adds a significant layer of software to the design simply to deal with a crowded and noisy RF spectrum.

On the other hand, we can use a RF modem type device. A RF modem handles all the messy RF communications including dealing with noise and other nearby devices while keeping the interface to the user simple. With a RF modem, you simply send data to the input of the transmitting modem, and receive the data on the output of the receiving modem. If a bit error or noise occurs during transmission, the modem's data processing circuit deals with detecting the error and requesting a re-transmission of the data. This error detection and correction is handled behind the scenes and is transparent to the user.

The major disadvantage to using a RF modem type device is the cost. A typical RF modem can go for anywhere from $20 to $100. A relatively low cost series of RF modems is the XBee series of radios. Simple XBee radios are priced between about $20 and $40.

If we were designing a system for high volume sales on the consumer market, we would be interested in the lowest cost solution for each and every component. In that situation we would choose the simple low cost RF transmitter. Since we are designing this for personal use and plan to only build one or two remote sensor units a better choice would be to use the more reliable RF modem type device. In this case we will select the XBee series of RF modules for our weather station design.

1.5.2 Battery life and low power design

Since our remote sensor will be powered using batteries, we need to consider the overall power consumption of the remote sensor unit. The more current drawn by the remote sensor unit, the shorter the battery life.

Battery capacity is measured in milliamp hours (mAh). An AA battery has a nominal capacity of between 1800 and 2600 mAh. Milliamp hours tell you how much energy is stored in the battery. If we take a 2000 mAh battery as an example, it means that you can draw 20 mA for 100 hours, or 2 mA for 1000 hours.

@ 20mA current draw: 2000mAh/20mA = 100 hours
@ 2 mA current draw : 2000mAh/2mA = 1000 hours

Lets apply this example to our weather station sensor module. If we assume a 10mA consumption of the entire sensor, microcontroller and transmitter circuit, an AA battery with an average capacity of 2000mAh would last:

2000mAh / 10 mA = 200 hours.

Two hundred hours might sound like a long time, but remember this is continuous current draw of a sensor that will be powered day and night, therefore:

200 h/(24h per day) = 8.33 days

If we were to draw 10mA continuously, we would need to change the batteries in the remote sensor unit every 8 days!. If we can reduce the consumption to 1mA, we would need to change the batteries every 83 days or slightly under 3 months. This is better, but still not ideal.

Lets take a look at the specs for our XBee transmitter. During a transmission the maximum current draw is 40 mA and during idle time when there is no transmission taking place, the maximum current is about 15 mA. A dsPIC30F3013 microcontroller running on an 8 MHz oscillator has a maximum current draw of 10 mA and a typical current draw of 6 mA.

If we take the maximum possible current draw of each, even during idle time when we are not transmitting but simply sitting there powered, our system will take a total of 25 mA. It does not get much better by using the typical currents rather than the maximum current. We are still close to 20 mA. If we draw 20 mA continuously from a set of AA batteries our battery life would be approximately :

2000mAh/20mA = 100h =~ 4 days.

So how do commercially made wireless thermometers last for almost a year on a set of AA batteries? The answer is they don't stay powered all the time, instead they spend the majority of the time in a deep low power sleep.

If we look at the specs for the XBee transmitter we see that in low power sleep mode, the maximum current draw is about 1 uA (micro-amp) . For the dsPIC30F3013 the low power sleep current is about 10 uA. If our XBee and microcontroller circuit is always asleep, we would get a battery life of:

2000mAh / 10uA = 200000 h

However, if our system was always asleep, it would be pointless. Instead what we will do is to power up the microcontroller and XBee transmitter for a short period of time to take a sensor measurement, transmit it to the base station and go back to sleep.

Weather conditions can change quickly but these changes happen over a time period of many minutes rather than seconds. If we take a measurement every 5 minutes, it should provide us with plenty of interesting data. We are only transmitting a small amount of data so let's assume that worst case it takes one second to read the sensor and transmit the data to the base station. Let's also assume that we draw the transmission power plus the microcontroller power the entire time period. We would then consume 50mA for 1 second every 5 minutes (12 times an hour). Here is what our battery life would look like:

(50mA * 1 second)*(12 times per hour) = 600 mAS
(milliamp seconds)per hour
600 mAS / 3600 = 0.167 mAh per hour

Therefore our battery would last:

2000mAh/0.167mAh = 11976 hours = 499 days.

One thing to note is that we are assuming that we can drain the battery completely which is not realistic. If we assume that we can only drain the battery to 30% capacity, we would have only 70% of the 2000mAh capacity available to us. Therefore our battery would actually last:

(0.7)* 2000mAh/0.167mAh = 8383 hours = 349 days.

In actuality we most likely won't take an entire second to take a measurement and transmit the data. The 50mA current we assumed is based on the maximum current in the specs of both devices when in reality we would most likely draw less than that.

We should expect to get more than 349 days of battery life for our remote sensor but we want to set a reasonable target for our battery lifetime. It seems reasonable to set our initial battery lifetime goal for the remote sensor units at about 1 year for a set of AA batteries.

1.5.3 Physical design of remote sensor enclosures

The remote sensor for the weather station will be located outdoors and exposed to the elements. We need to design an enclosure that will protect the sensors from the elements but still allow the sensors to measure the environment.

We have a few other design considerations to take into account. The enclosure can't be metal since that would block the RF signals from the XBee transmitter. The enclosure can't be airtight either as we could not measure humidity accurately. The enclosure should also maintain a constant temperature between the inside and outside of the enclosure otherwise our temperature readings would be incorrect.

One suitable enclosure that comes to mind is an outdoor PVC plastic electrical box. These are designed to be used outdoors so they can handle extremes of temperature without cracking and will not get brittle with exposure to the sun's UV rays. Plastic electrical boxes are available in many different sizes so we can find one to fit the microcontroller, sensor and XBee transmitter unit.

PVC electrical boxes are designed to be completely weather proof so they are very close to being air tight. This would pose a problem for measuring humidity since we need access to the outside air to get a reliable humidity reading. This can easily be solved by drilling some small holes in the side of the electrical box. By drilling the holes on an upward angle, we can prevent rain from getting in but still allowing air and humidity into the sensor.

One other consideration for the enclosure is where to mount it. If we have a temperature sensor located inside the enclosure, we need to ensure that the enclosure is mounted away from direct sunlight. If the sensor is located in direct sunlight, the sensor will read a temperature higher than the actual air temperature. The sensor will read an even higher temperature if the enclosure is black or a dark colour since dark colours tend to absorb energy better than light colours.

Try to find a location where direct sunlight never falls. In many urban environments, the houses are so close together that placing a temperature sensor between the houses provides adequate protection from direct sunlight. Another possible location would be under a porch where the sensor could be shaded from the sun.

If you don't have a location where direct sunlight never falls, you can also shield the enclosure with a small plywood box that you paint white. Painting the box white will reflect the sun and minimize the effects of direct sunlight. Most professional weather stations can be mounted in direct sunlight with the use of a white box to shield the sensors from direct sunlight.

© Copyright 2015 OwlCircuits.com
Updated: March 3, 2015.

About | Contact | Privacy Policy