Having recently bought a smoker, and not being very good at it, I thought it would be a good idea not only to document the process for repeatability (on the occasions I get it right!), but to be alerted if temperatures exceed a preset range. This project uses a MAX31855 K-type thermocouple amplifier, along with a TPS61291 low power switching regulator for maximum efficiency and, of course, a way to transfer data wirelessly

Data is sent over long-range 802.15.4 protocol and logged in Grafana. Out of range temperatures are forwarded to a small IFTTT Applet that sends a notification to a phone, so no need to regularly check on the smoker itself!

Ultra low power consumption was a goal for this project. For the most part, the system sleeps and only wakes up periodically for measurements. The MAX31855 uses about 1 mA in standby mode, so the circuit includes a PNP transistor to turn it off between readings. It's also necessary to run that IC at around 3V, otherwise it becomes a bit unreliable. By default, the regulator is set to pass battery voltage through, saving a few microamps, but if the battery drops below 2.9 V, the microcontroller enables the regulator's boost mode to 3.3 V during measurements. This allows the system to run very efficiently, as the CC1312 will work down to 1.8 V, allowing boost mode to be enabled only during a measurement.

Using a partially depleted battery to test boost mode

Once the hardware was finalized, I needed a (cheap) way to measure consumption as I developed the firmware. I use a CurrentRanger, which is able to switch from the nA to uA and mA range automatically, and fast enough not to cause brown-outs. 

One of the first issues I had was, in fact, brown-outs (!) when the radio woke up and current demand increased suddenly. Felix over at lowpowerlab.com was super helpful with suggestions, and it turns out the issue was battery impedance being too high for measurements. During tests, using a couple of D batteries solved the problem:

Using D batteries during tests

Then, I chose redis and redis-timeseries for Grafana to store power samples at 1 ksps. I modified the CurrentRanger firmware a little to format the output in a way that was easily used by redis, and slapped together a small python script to send data over, and:

First pass shows about 1 year life on a CR2032 battery

In the image above, you can see temperature being taken every 5 minutes, and corresponding energy consumption. While sleeping, the system uses around 80 nA, and temperature readings use ~25 mA (radio + 31855). The dashboard shows ~25 uA continuous consumption, meaning a lifetime of about a year on a 220 mAh CR2032 battery.

The detailed view of a sample/transmit event shows, first the temperature sample measurement, roughly 6 mA for 100 ms, which is just about as short as possible, since the 31855 needs some time to stabilize after waking up. Then, radio transmission takes place for about 200 ms at ~25 mA. The radio is configured for long range (5 Kbps) and relatively high transmit power (13 dBm in the image below). 

A closer view on a measurement/transmission

There is a good opportunity to improve power consumption by lowering tx power. For example, a 0dBm transmit power more than doubles life expectancy, but still retains excellent range (averaging around 10uA continuous):

Doubling lifetime by reducing transmit power

The next opportunity for savings is shortening transmission time. Increasing data rate from 5 Kbps to 50 Kbps, transmissions are roughly 10 times faster at about 20 ms, yielding the best power savings so far (3.4 uA continuous!):

Increasing transmission speed by a factor of 10
Faster transmissions drastically improve battery life

Over 7 years on a 220 mAh coin cell, not bad! I'll consider this one done.

The board can be found here, and uses this project for wireless communication.

Like all other projects ...

Read more »