Close

Concept

A project log for Gecko Node - Wireless Low Power Sensor

Low Power Temperature/Humidity Monitoring

maxkMax.K 12/25/2017 at 18:260 Comments

Almost all of my electronics projects of the past five years have been built around an Arduino or used Arduino code. A recent example is the low power Arduino Mini board that I made last year: https://hackaday.io/project/16724-lp-mini-low-power-dev-board. I have been using this board in combination with a rf24 module and temperature sensor to monitor my cat's outdoor house during winter: https://hackaday.io/project/16724-lp-mini-low-power-dev-board/log/51421-a-more-complex-example-cat-logging. Unfortunately there were some problems with this setup that led to the battery suddenly draining after only two weeks. I couldn't find the source of the problem, so the plan for this winter was to make an entirely new non-Arduino-board. 

The basic concept is this: There are several sensor nodes including rf24 chips that send measurements to a ESP8266 base station. The base station then transmits the data to Adafruit.io or a similar service over WiFi. The nodes will be powered by a coin cell, while the base gets continuous power via USB.

Instead of an Atmega328, the new board uses an EFM32 Gecko MCU from SiLabs. The Gecko family of microcontrollers is designed for low power applications and has some of the best development boards. I chose an EFM32ZG110F32, which is one of the cheapest EFM32s at less than 1€. Still, it has all features that are needed for this project: 32KB Flash, 4KB RAM, 17 I/O Pins, I2C, SPI, a RTC. And it runs at just under 1µA with the RTC powered on. 

I started with the Zero Gecko development board. It features the EFM32ZG222F32, which is the 48-pin version of the zg110 (https://www.silabs.com/products/development-tools/mcu/32-bit/efm32-zero-gecko-starter-kit). The dev board also includes a Sharp Memory Display (similar to the one I used for the Chronio watch: https://hackaday.io/project/12876-chronio), and mechanical/capacitive buttons. While Microchip PIC boards usually need a separate 40€ PICkit programmer, this 20€ boards has an on-board Segger J-Link debugger, which can be used to program the dev board as well as external MCUs. There also is a very handy energy profiling feature which lets you measure the power consumption of the hardware in real-time. 

As a first step, I plugged a rf24 module into the expansion port of the dev board and tried to get it to work. After the SPI was working, the RF24 Arduino library (https://github.com/nRF24/RF24) had to be ported to the EFM32. The sending of files as well as many other features work now but I didn't test the functions for receiving. A logic analyzer was very helpful during this part (I am using a cheap Logic Pirate by Dangerous Prototypes). I also tested the i2c port with an oled display. 

The most complicated step was getting the power consumption down. Usually, this means putting the microcontroller in sleep mode for most of the time and waking it up in intervals to perform measurements and to transmit the data. The EFM32 has different sleep modes / energy modes:

The best mode in this case is EM2, because the RTC must be running to wake up the device. This part was not trivial. You have to choose the right clock source, configure interrupts and set the interval. 

With a simple command the rf24 can be put into sleep mode as well. In theory, this reduces its power consumption to under 1µA. I ended up with an overall current draw of ~3µA during sleep. The power consumption while measuring and sending is almostnegligible considering it's only needed for a few milliseconds every 10 minutes or so. There is still a strange 'charge/discharge-curve' visible after the data was send and the rf24 was put to sleep.

Next up: The PCB

Discussions