Monday, July 28, 2014

Weatherstation - Programming the Chip

The MSP430G2553 was programmed using Energia. This final script is essentially a culmination of code from my previous posts, with an emphasis on maximizing battery life. As such, I have decided to only have the microcontroller poll the sensors every 30 s, so most of its operation will be in deep sleep mode.

What the Code Needs to Do

  1. Wake from deep sleep mode
  2. Read temperature/relative humidity
  3. Read barometric pressure
  4. Read voltage
  5. Compile readings into a string
  6. Transmit string
  7. Enter deep sleep mode

Power Consumption

I found a very informative post on the 43oh forums detailing deep sleep mode, specifically how to enter it. For my purposes, I want the deepest possible sleep mode without relying on an external signal to wake the microprocessor. As such, LPM3 is as "low" as you can go before requiring an external "wakeup" signal.

I did some very rudimentary current measurements with a multimeter. The current  peaks at around 7 mA for ~1 s, then idles at around 90 μA.

Areas For Improvement

  1. The BMP180 returns temperature readings. Either use this value or edit the library so it doesn't read the temperature.
  2. All unit conversions are processed at the weatherstation. It might be more efficient to simply transmit the raw data and have the receiver, which is not battery powered, process it.

Show Code