I finished writing and testing the code for my project. I do not know if you remember, but in one of my previous posts I measured the average current consumption of a simple, cheap CO detector to be around 500 uA (@3,3 V) – that is being consumed by the whole standby and sensing functionality. This is a way over what I can supply from the TEG when harvesting energy from hot water tap. That is why I used Energy Micro STK with EFM32 Giant Gecko on board to create my own CO detector device. Before you continue to read the rest of this post, try to guess what average current consumption I did manage to achieve. Later on you can compare your estimation with my score and that will give you the idea how low-power the EFM32 family really is. But let's start from the beginning.
The device uses Figaro TGS 5042 carbon monoxide sensor. The datasheet says that the max response for even small CO gas concentrations is around 60 sec. In large CO concentrations, for instance over 500 ppm, the sensor response time is only couple of seconds (if you missed the short movie in which I tested the sensor in a jar filled with CO, you can check it in my previous post). So, the whole device should be in some sleep mode. And here starts the fun! The EFM32 chip's EM4 (Standby mode) comes very handy. In this mode - according to Energy Micro data - chip draws only 20 nA. But I needed to implement some extra functionality. The Giant Gecko comes with RTC and BURTC (BackUp RTC). BURTC can operate in EM4 and wake up the chip when time compare event occurs. Ultra Low Frequency Clock (internal - 2 kHz) can be used with the BURTC in order to use as little energy as possible. This clock is usually not exactly 2 kHz, so if you would like to use it in your application, you should calibrate it with the oscilloscope and check the temperature stability data in the datasheet to get the best possible time accuracy.
Having the BURTC to wake up the processor every 60 seconds to check the CO sensor response is one thing, but the CO detectors usually do have the TEST button. Thus, EFM32 Giant Gecko also provides the possibility to wake up the processor from EM4 with an external pin interrupt (apart from the reset pin) and this is exactly what I have implemented. To sum up: the device is in the most energy friendly mode EM4 for approximately 60 seconds or less, if one press the TEST button.
After a wake up, EFM32 checks the CO gas concentration and: if the concentration is higher than some threshold level (right how I set it on 35 ppm) or the wakeup is a result of the TEST button, the value in ppm is presented on LCD; if the TEST button was not pressed of the concentration is lower than the threshold, the result is not being displayed. Regardless of the case, the EFM32 goes into EM4 again. Below you can check two graphs, which represents the current consumption from the mentioned cases.
The average current consumption in the first case is around 2.4 uA and in the second case only around 400 nA. Is it even close to what you have guessed? In the next graph you can check the close up of current consumption between the wake up and going back to EM4 (case where the ppm value is being displayed). The whole action takes around 1.35 sec. The average current consumption in this time is around 80 uA.
80 uA is not so little for the energy harvesting power supply, but since this occurs only once every 60 seconds and takes 1.35 sec, it is bearable. Nevertheless, it could have been far more than 80 uA – even couple of mA. The reason why the value is so low is that some other energy friendly coding, functionality and other energy modes were implemented.
Shortly, I will try to post what exactly the microcontroller does in this 1.35 sec and which features were used. Also I will tidy up the code and post it somewhere for you to check it.