One of the goals of this project is to use CircuitPython alarms and deep sleep to conserve power and extend battery life. The project code ends by setting up two alarms, and entering deep sleep until the alarms are triggered. However, you can't always trust the code.
There are a number of hardware variables that affect the current draw during sleep. The code may say it's entering deep sleep, but if those variables are not also accounted for, you may not actually be getting deep sleep current draw numbers. So, how do you know for sure that your microcontroller is drawing the lowest possible current? You use a precision power monitor, such as the Nordic Power Profiler Kit II, to measure the power usage!
This page will show you how to wire the PPK II to a microcontroller using a JST connector, and what the current draw looks like on the Feather ESP32 V2 running this project code.
Wiring up the PPK
The first step is to connect your microcontroller to the PPK. This is most easily done using a microcontroller with a JST battery connector built in, such as the Feather ESP32 V2.
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 red, VOUT is brown, and GND is black.
Then, connect it to the Feather JST-PH battery connector as follows:
- VOUT (brown wire) to positive on the Feather JST-PH connector
- VOUT-GND (black wire on the right) to negative on the Feather JST-PH connector
Measuring the Power Usage
Now that everything is wired up, you're ready to measure the current draw of your Feather once it enters deep sleep.
This first graph shows the current draw while the code is running, and the dip as the Feather enters deep sleep. While the code is running, the average draw between data being sent is around 50mA, and usage spikes to around 280mA when data is sent.
This is the usage while in deep sleep. Current draw in deep sleep averages around 420uA.
Text editor powered by tinymce.