Long-range wireless sensor based on Whisper Node capable of running for over a year on a single CR2032, transmitting data every 60 seconds.
This article will discuss and demonstrate how to build a remote Temperature and Humidity sensor based on a Whisper Node and a DHT11 (worst sensor ever, I know), capable of running for well over a year on a single CR2032 coin-cell.
The remote node will be configured to transmit data every 60 seconds to another Whisper Node, acting as a gateway/base station and located 100 meters away. The data will be finally uploaded to a Google Could server running InfluxDB and Grafana to display the data.
Be aware that this won’t be a short 20 lines story! The information here will focus on low-power measurement and techniques, as well a detailed analysis of how much energy we really have available from a coin-cell.
This post will present many practical tests and some maths, sparing some common knowledge like: how to put your Arduino to sleep, which can be easily found on the Internet.
We all know, or at least have an idea, how to put a few sensors and an Arduino together. It’s great and lots of fun to see the data being collected and printed over a Serial Terminal. Unfortunately things start to get more complicated when we need to move this bench sketch to the real world scenario. Normally far away from a computers, power-outlets or USB cables.
Knowing there are difficulties and pit-falls, this article aims to guide the reader through how a real-life, remote, low-power solution can be built to work according to the expectations. The Temperature and Humidity sensor is just an example and similar principles can be tailored for many other project.
Finally, the reason for choosing the DHT11 and a CR2032 was to create a sense of bigger challenge. If you already had the opportunity to work with both parts you know that the DHT11 is a very slow and clunky sensor, theoretically incompatible with low-power. At the same time the CR2032 has very little capacity, no more than 650 milliwatts hour* of energy!
*For comparison, a single AA Alkaline has over 3000 milliwatts hour!
So readers don’t get bored, I’ve decided to show part of the final results before getting into the full technical details. Below you can see two Grafana screen-shots using the data published to the cloud, followed by the prototype and final hardware:
In terms of energy, we conclude that our solutions had only 171mA/h @ 3.3v available. In other words 564mW/h, and we’ll prove that we can make it run for almost over one year!
All calculations, together with practical scope captures will be demonstrated below. Although it might sound boring and difficult, you just need to know how to add, divide and multiply.
As a final word, low-power is not quite the most simple subject, some thinking, persistence and trial+error are necessary to get the most of a battery.
Understanding the problem
To understand better the problem, let’s have a look on what we’re trying to archive:
The basic idea is to publish the DHT11 sensor’s data to a server running in the Cloud. Again that it’s just a model, this can be easily adapted to similar projects.
Together with the diagram above, let’s suppose we gather the following requirements:
- The sensor node is located 100m away from any power source, in a enclosed area of difficult access – inside a factory’s attic for example;
- The data collected needs to be available on the Internet in the form of graphs, showing current and historical values;
- Data needs to be collected every 60 seconds and available 24/7;
- Temperatures on the attic varies from 0°C to over 40°C;
- The equipment needs to be small as possible, no thicker than 15mm.
Picking the components
Now that we have a list of requirements, presented above, it’s obvious that the solution needs to be powered by battery and rely on wireless communication.
The last requirement is pushing us to use a CR2032 battery as power source because of size constraints. On a real-life example different requirements will determine the options for your project.
There’s nothing forcing the usage of a DHT11 sensor, which is indeed a very poor option for this kind of application. The decision to use the DHT11 is just to make it a better exercise, showing how hardware and software can be adapted to run in a low-power configuration. For a real-life application a more robust sensor could be used, like the TE HTU21D.
For the wireless communication, it needs to be based on radio as there’s no visual/line-of-sight for IR or Laser beans. Because the solution needs to be powered by battery, WiFi (802.11) or any other high-level protocol is out-of-question* – ESP8266 is a no no!
For that reason simple sub-GHz digital radio based on FSK modulation is the best option in terms of reliability and power-consumption. Although OOK modulation consumes even less energy, the transmission speed is normally lower, making the FSK a more efficient transmission method.
*The power requirements to communicate using sophisticated protocols like WiFi is incredibly high, making the use of those not possible!
The Whisper Node has been chosen because it has a built-in RFM69 sub-GHz radio module and it’s designed with low-power in mind. The board can be powered by standard batteries while providing a stable 3.3V from any source, down to 0.9V. The stable voltage is essential for reliability, specially when dealing with devices that only work at certain voltage levels or can suffer with voltage variations: like most of the sensors.
Choosing ready-to-use boards and modules saves development time and improves the reliability, significantly cutting down research, prototyping and implementation costs for experiments and low to medium volume production.
How much energy do we got
Ok, now that we have an idea which components to use, the nest step is to understand if the solution is feasible or not. The most critical component in our application is the power source, the coin-cell battery, so getting familiar with it is essential.
A CR2032 battery has no more than 250mAh, and this is only true if you use the energy in a very low constant current or quick pulses. Additionally the cell’s voltage, when band new, is around 3V and this value will drop down to 2V by the end of the battery’s life. For that reason it’s important to know the Battery Energy in milliwatts as well. According to the Energizer CR2032 datasheet, each coin-cell holds around 653 milliwatts hour.
If we expect to run our solution for a whole year without need to change batteries, here the average consumption we need to archive at the battery side:
1 year = 365 days * 24 hours = 8760 hours
250mAh / 8760h = 0.0285mA or around 28uA of average consumption.
Note that this figure is not taking other variables like the battery self-discharge neither the voltage dropping and already that’s very little to consume!
Note that I’ve mentioned “at the battery side” before. That’s because we still need to consider the step-up regulator and its efficiency. Remember that the battery provides no more than 3V, but the Whisper Node runs at 3.3V.
To calculate the energy available to the board itself, after the step-up regulator, we simply divide the cell energy by the voltage:
653mW/h / 3.3V = 197mA/h
That give us the real capacity at 3.3V. But wait, 197mA/h of capacity would only be possible if we had an 100% efficient step-up. Looking at the Whisper Node step-up documentation, we can see it’s close to 95% efficient @ 2.5V with a 100R load (33mA).