If you want to run your meter off of battery from perhaps a remote location, it's good to know what kind of battery life you can expect. Even when using deep sleep mode on the microcontroller, there is a tiny amount of current draw. And while awake, the radios can chew up battery a bite at a time. So, rather than guess, one may use science!
The Nordic Power Profiler Kit II works great for measuring current draw on a project like this. Check out this guide for setup instruction here. Once you've installed the nRFConnect for Desktop app and have the Power Profiler app running, you can wire it up.
This is totally optional for this project.
Wiring up the PPK
The first step is to connect your microcontroller to the PPK using the JST battery connector.
The PPK comes with two cables. For this, you'll need the 1x4 pin cable comprised of a black wire, red wire, brown wire and black wire, in that order.
Plug it into the 4-pin header on the PPK, so that GND is black, VIN is brown, VOUT is red, and GND is black, as shown
Then, connect it to the Feather JST-PH battery connector as follows:
- PPKII VOUT (red wire) to positive on the Feather JST-PH connector
- PPKII VOUT-GND (black wire on the right) to negative on the Feather JST-PH connector
Profiler App
Plug the PPKII into your computer using a micro USB cable, being sure to plug into the PPKII's USB DATA/POWER port, NOT the USB POWER ONLY port. Ask me how I know this.
Turn on the PPKII (LEDs will glow and blink!), then select PPK2 from the dropdown list at the top left of the app.
- Set the Power Supply Mode to Source Meter. This allows us to supply power to the Feather while measuring the current draw
-
Set the supply voltage to
3500 mV - Set Enable power output to the on position
Click the Start button and you will see the Feather power up and the graph will record the current draw.
Power Report
You should see something like the graph here. The Feather powers on, connects to WiFi and Adafruit IO, checks the ultrasonic sensor, reports the data, and then goes into deep sleep mode until the alarm wakes it up again to repeat. Press stop when you're done measuring.
You can shift + click-drag a section of the graph to see values for that selection. The data tells us these things about the Feather while it's awake:
- it's active for about 8.636 seconds
- it draws a maximum of 335.50mA
- it draws an average of 58.88ma
By checking a selection while it's in deep sleep mode we learn:
- max draw is 2.65µA
- average draw is 197.21µAma
Battery Life Analysis
We can use the power report data to determine our ideal battery life expectancy between charges. I'm using a PKCELL ICR18650 2200mAh 3.7V Lithium Ion battery.
These are my values going in:
- Capacity:
2200mAh - Voltage:
3.7V - Sleep current:
197µA - Active current:
58.88mA - Wake-up interval:
10 minutes - Active duration:
9 seconds - Operating hours per day:
9(6am to 3pm)
This comes out to (thanks to Claude AI for doing the math):
Operating hours consumption (9 hours):
- Active duty cycle:
1.67% × 58.88mA = 0.98mA - Sleep duty cycle:
98.33% × 197µA = 0.194mA - Average current when operating:
1.174mA - Operating period usage:
9 hours × 1.174mA = 10.57mAh
Non-operating hours consumption (15 hours):
- Sleep current:
197µA - Non-operating period usage:
15 hours × 197µA = 2.96mAh
Total daily power consumption:
- Operating period:
10.57mAh - Non-operating period:
2.96mAh - Total daily usage:
13.53mAh
Battery life calculation:
- Battery capacity:
2200mAh - Daily usage:
13.53mAh - Theoretical battery life =
2200mAh ÷ 36.96mAh = 162.6 days
Practical estimated life (at 80% usable capacity): 162.60 × 0.8 = 130.08 days
Four months, not bad! You can adjust some parameters pretty easily if needed, for example with a larger capacity battery, or shorter operating hours.
Page last edited February 13, 2025
Text editor powered by tinymce.