How One Maker Built an Ultra Low-Power Arduino Pro Mini
Designing and building battery-powered devices poses a much larger challenge versus ones that can be powered from the wall, mainly due to the extra components required for charging and power management.
But there's another one too: the firmware needs to be written in a way that conserves the device's power until something external triggers it. So when taking an Arduino prototype from the breadboard to product stage, there can be several significant hurdles to overcome.
An unmodified 3.3V Arduino Pro Mini draws 4.5milliamps under normal conditions with nothing else connected while running the default blink sketch. This results in a run-time of around a month when being powered from a 3000mAh battery.
The lifetime might seem good at first, but keep in mind that this is with no other components attached, so if this device had a sensor attached instead, the estimated lifetime would drop considerably.
Some methods for reducing power consumption are quite apparent, including not attaching components that require ample amounts of current (such as motors) and running the processor at lower voltages.
But other ways might not be so obvious. That's why Michael Klements from The DIY Life published a guide on how he was able to tackle this issue.
Klements first looked at which which parts of the circuit draw more power than needed, and he zeroed in on a few:
- The onboard power LED
- The voltage regulator
- No low-power modes in the sketch
- Making the Modification
Removing the onboard power LED is one of the best ways to considerably reduce the current draw. This is because the light stays powered on all the time regardless of what the sketch does.
By removing this part with a heat gun, Klements was able to get the current consumption down to a mere 0.05 mA or 54 uA- a massive improvement. It also increased the battery life by 2900 days or 10,000% from that single month originally.
The second point of concern was the original voltage regulator, a Micrel MIC5205. Although it's reasonable efficient most of the time, under low load its performance drops off drastically, consuming 50 microamps on its own.
This means that it wastes energy when the device isn't doing anything, such as in a low-power state.
To remedy the situation, Klements replaced it with a Microchip MCP1700 that is able to supply 3.3V at up to 250mA while also staying efficient at a low load.
And although it can only take an input voltage of up to 6V, it shouldn't be an issue for a single 3.7V LiPo battery. The original regulator was in an incompatible SMD package, so Klements had to use the through-hole variant and solder it off to the side.
Finally, there's the problem with the firmware. The classic delay() function in an Arduino sketch just causes the processor to enter a loop for an extended period of time until it's time to resume, which wastes clock cycles.
Instead, periodic events can be triggered by either using the LowPower library for AVR architecture devices, or with RTC, external pin, or other interrupts in more advanced Arm processors. This is especially useful for tasks such as blinking an LED or reading from a sensor, since they only happen occasionally.
After making each of his three modifications, Klements was able to reduce the current consumption of his Arduino Pro Mini from 4.5mA to 7uA, 640 times less! This means the improved version can run off of a single 3000mAh battery for nearly 50 years rather than a mere month.