Close

This is Where Weather Stations Start to get Interesting

A project log for Low Power High Accuracy Weather Station

'Professional' wind instruments are mounted high on a pole in an exposed location with LoRa data transmission

Tegwyn☠TwmffatTegwyn☠Twmffat 04/27/2019 at 15:150 Comments

It could be said that building a weather station is trivial - it's just a bunch of sensors plugged into an MCU - too easy to take seriously. But once we get stuck into the details of low power everything becomes more challenging (thankfully). The photo below shows a 'state of the art' watchdog chip and circuit which lurks underneath the Adafruit LoRa Feather module:

The main chip is a Texas Instruments TPS3430 and it's programmable by means of a capacitor (middle right). The resistor in the foreground is 0805, so it can be seen that the chip is rather small, but not too difficult to solder thanks to good PCB design with the four square pads for positioning rather than relying on the screen print. The chip requires a short pulse every 5 seconds to to keep it from setting the MCU's reset bus low. This is not difficult until it's combined with a 'deep sleep' library such as Sleepy Dog, which effectively throws a 5 second delay into the runtime and turns off the MCU, which results in no more serial console for debugging, but keeps all the variables in RAM and Flash.

One of the other restrictions with Deep Sleep and the Adafruit Feather M0, is that the rain gauge can no longer be on a simple interrupt and instead I used the gauge filter capacitor as a memory block. Every 5 seconds the capacitor is kept charged up using analogWrite and if it rains, the gauge discharges that capacitor. Then, after every Sleepy Dog deep sleep, the value of the voltage on the capacitor is read using analogRead and if it's less than '20' out of a possible 1024 it indicates that it has rained. Simple! (Apparently this is similar to how DRAM works: https://en.wikipedia.org/wiki/Dynamic_random-access_memory)

Discussions