DIY Water Level Indicator – Part 2: Improving battery life up to 40 times
May 3, 2021
A sea-level measurement station is a good example of an IoT use case of monitoring at remote locations, where requirements on the internet accessibility and long battery life are high. It is also a good showcase of few steps that can be taken in the product development to assure low current consumption hence less battery drainage. In this blog post, we go through two of the steps, with detailed measurements shown in the associated part 2 video that you can watch below.
DYI device and set-up
As a recap, the DYI sea-level indicator device is based on an Arduino MKR1400 GSM, which contains a SAMD21 Cortex-M0+ 32bit low power ARM MCU, and a SARA-U201 HSPA module from u-blox, that with an added SIM card provides 2G and 3G connectivity. You can read more about the functionality here and in the video Part 1 below. It is connected to an ultrasonic transducer, KS103 for the actual water level measurements. The entire set-up is powered by a 3.7V LiPo battery, in this case, simulated by Otii Arc.
In this set-up, with no energy optimization efforts made, the results show an average power consumption of 16.6 mA, for a simple activity: Send Data (SMS), Wait 1h, and Repeat.
Lowering the energy consumption
The first step of the optimization would be to put the MKR1400 in sleep mode using the Arduino RTCZero library and making sure unused pins are not floating.
Unused pins of a microcontroller can cause additional current consumption if configured as an input, and the voltage on the pin is in the no-mans-land between a digital 0 and 1. Either configure the pin for pull-up, pull-down, disable the input (available in most MCUs, same thing you need to do if using the pin for analog functionality), or simply configure the pin as an output driving it high or low (as it’s not connected it will not matter which level it is configured to).
This brings the average current to 3.3 mA. However, there are still peripheral components awake which means that this Idle state is still using a lot of energy, more precisely 90 % of it.
Adding a MOSFET for Arduino
To further lower the power consumption we added Arduino Pro Mini with a MOSFET to control the power to the entire MKR 1400 and KS103.
Any P-channel enhancement mode MOSFET will do if it has:
a continuous drain current (Id) capability exceeding the load current,
a drain-to-source voltage (Vdss) and max gate voltage (Vgs max) capability exceeding the supply voltage,
and with a sufficiently low gate threshold voltage (Vgs th) for the supply/logic level in use.
We used a chunky sample with those characteristics but one example that will work for more integrated solutions is the DMG2305UX. Always verify that the drain-source on-resistance (Rdson) is sufficiently low when the gate voltage is at the supply level. How low this resistance depends on how much the load current is and what the acceptable voltage drop in the design is. The DMG2305UX is specified to have a Rdson of max 100mOhm with a gate voltage (Vgs) of -2.5V (at room temperature). In this application, the load current is less than 200mA so the 100mOhm resistance can cause (in this case an insignificant) maximum voltage drop of 20mV.
Adding Arduino Pro Mini as a power switch to peripheral components results in the current decreased to 5uA, which then results in the average current of 0.4 mA, for the activity: Send Data (SMS), Wait 1h, and Repeat.
Battery life improvements
The hardware design considerations such as adding the possibility to switch off the peripheral components besides putting the modem and CPU in idle mode can give significant improvements in energy consumption. As showcased here, the increase of the battery life of this sea-level indicator can be up to 40 times, compared to the initial non-optimized setup. An additional thing to consider is the activity type, what is its purpose, and if the active part (sending data) can be less frequent without losing the purpose of the device.
Regardless of what steps are being taken in the development of the IoT device, the important thing is to measure the performance at all instances, to get better insights into the system performance of the device when optimizing.
The Qoitech Team
Don’t want to miss any new tech content?Subscribe to our monthly newsletter!