(article continued from previous page)
This is the first weather station I’ve ever built. As such, I’m made some errors.
In my rush to deploy the weather station, I used a clear plastic pencil container rather than a properly designed weatherproof enclosure. No big deal, I figured.
Graph of ambient air temperature vs. clear project box temperature.
In less than an hour, the temperature inside the box rose to nearly 140 degrees Fahrenheit. The LCD started turning dark blue and the high temperature probably wasn’t very healthy for the batteries. Fortunately, the project included a temperature sensor inside the box, and I freaked when I went to check on it.
The high temperature inside the project box was caused by:
My temporary solutions include:
Whenever the TV weather forecasters get specific, they’ll describe the temperature as ## degrees in the shade. I never quite appreciated the reason until now.
Graph of weather station errors due to unshaded temperature sensors.
The line graph above captures the four ambient air temperature sensors as the sun goes down. I can understand why the air temperature lowest to the ground is the warmest at the end of a summer day, since the soil has heated up from the sun. But why would each temperature drop in a staggered fashion rather than together?
The sensors are attached to a bamboo pole that is exposed to the sun. This means the sensors themselves are being heated by sunlight, as opposed to measuring the temperature of the air. Secondly, as the sun sets, a shadow from our house creeps slowly up the pole, gradually covering the lowest to highest sensor one at a time.
Thermistor temperature sensor exposed to sunlight, with a shadow sneaking up the pole.
As you can imagine, the measured temperature is going to drop quickly when a sunlit probe passes into the shade. That means that all of the air temperature data that I’ve captured so far does not correlate to actual air temperatures.
I need to construct opaque covers with vents that will permit air to pass through but will not heat significantly due to sunlight.
Shadows and sunlit temperature probes are bad for a weather station.
Upon applying greater scrutiny to the weather station location, I realize that all of the trees, fences, and other shadow sources alter the temperatures and solar panel voltage measurements. In summary, for accurate measurements you must carefully plan the location of your weather station.
I’m just as fallible as the next guy. Even after proofing my board before sending it off, I forgot about a couple of traces:
Oops! PCB wire patch fix.
It isn’t a disaster. I just needed to solder a wire to bridge the connections.
Also, the silkscreen for the voltage regulator was backwards. I had to cut out the regulator (destroying it) and suck the solder out of the holes to fix that.
In order to survive the night, the weather station must either run on batteries or from a power cable from the house. I chose batteries.
To extend the life of the batteries, I did everything I could to reduce power consumption:
Without the LCD, the weather station uses only 1 mA on average. Not bad.
After a several days of operation, I discovered a few copy and paste errors in my code where 7 unused pins were not having their pull-ups enabled. This saves a paltry 9 µA normally, but as much as 300 µA when the pins are subject to current leakage due to humidity or a person touching the PCB. Although it might seem that enabling power to a resistor would consume power, the reality is that enabling pull-ups on unused pins saves power.
Pull-up resistor disconnected.
A whopping 71 µA was saved by cutting off an external pull-up resistor that I connected to the LCD enable pin. Unlike the flash enable pin, this pin needs to be low to disable the LCD interface, which is the state most of the time. Therefore, the pull-up resistor was spending current whenever the microcontroller pulled this pin down.
This should have been a pull-down resistor, not pull-up.
The Atmel AVR has a power reduction register (PRR) that controls most of the modules. I say “most” because I ran across the Analog Comparator Disable (ACD) bit in the Analog Comparator Control and Status Register (ACSR). That saved 43 µA.
Putting the AT25DF251 flash into deep sleep and disabling the SPI modules between sample writes saved another 43 µA.
After all of those corrections (mostly software), the weather station only uses 0.8 mA, which is a 20% savings.
Although I’m somewhat proud of a sub-milliamp device, most professionally-designed devices perform at much lower currents. If I could design it all over again, I would:
This isn’t to say that the weather station isn’t a successful. I learned a lot and it works pretty well. But, I hadn’t thought through the use cases well enough in advance.
Here are the results of analysis of six months of weather station data.
Here are the weatherproof cases.