layout | title | permalink | sequence | power | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
power |
Power |
/power |
6 |
|
Using nRF Power Profiler PPk2, the power consumption of the PCB can be measured. Follow a simpler ESP32-C3 dev board tutorial to learn how to use PPK2.
![Measure power consumption with nRF PPK2]({{ site.url }}/images/power/measure-power-ppk2.jpg)
The average power consumption of the PCB no optimisation:
- with 2 power LEDs
- no firmware optimisation
- radio is on
The average power consumption is:
3.87mA
in deep sleep mode25.69mA
for30s
during the timeout after the bell is pressed and the Ding Dong sound is played31.94mA
for34s
during the entire cycle of the bell press and going to sleep70.62mA
for6s
during the Ding Dong sound
[![Demo power consumption graph with no optimisation]({{ site.url }}/images/power/demo-power-consumption-no-optimisation.jpg)]({{ site.url }}/images/power/demo-power-consumption-no-optimisation.jpg)
Firmware and hardware optimisation can be done to reduce the power consumption:
- remove the power LEDs, TX and RX LEDs
- optimise the firmware to turn off the WiFi and radio as soon as the function is done:
WiFi.disconnect(true);
andWiFi.mode(WIFI_OFF);
- optimise the firmware to not blink the user LED
The average power consumption of the PCB with optimisation:
73.04uA
in deep sleep mode17.11mA
for30s
during the timeout after the bell is pressed and the Ding Dong sound is played24.93mA
for34s
during the entire cycle of the bell press and going to sleep63.99mA
for6s
during the Ding Dong sound
Download nRF PPK2 file with no LED
Download nRF PPK2 file with no LED and radio/WiFi [![Demo power consumption graph with optimisation]({{ site.url }}/images/power/demo-power-consumption-optimised.jpg)]({{ site.url }}/images/power/demo-power-consumption-optimised.jpg)
Based on the above values, the battery life can be calculated with this python code:
Estimated battery life: 410.14 days or 1.12 years
{% highlight python %} {% include_relative power/calc_battery_life.py %} {% endhighlight %}
The battery measurement circuit is simulated in Falstad.
$ 1 0.000005 5.023272298708815 78 5 50 5e-11
172 224 240 176 240 0 7 0 3.3 0 0 0.5 Gate Voltage
w 352 224 352 176 1
f 288 240 352 240 33 1.5 0.02
R 352 176 352 144 0 0 40 4.2 0 0 0.5
c 224 240 288 240 0 0.1 0.000999999998577626 0.001
r 288 192 336 192 0 1000000
w 336 192 352 192 0
w 288 192 288 240 0
g 352 352 352 368 0 0
r 352 256 352 304 0 100000
r 352 304 352 352 0 100000
w 352 304 256 304 0
o 2 64 0 4099 0.001220703125 0.00009765625 0 2 2 3
With a p-channel MOSFET, when the gate voltage is 0V
or LOW
, the battery voltage is measured. When the gate voltage is 3.3V
or HIGH
, the battery voltage cannot be measured.
The battery is charged with a USB-C cable. Plug in the USB-C cable to a power socket on-the-wall or a power bank.
[![Charging on-site]({{ site.url }}/images/power/charging-onsite.jpeg)]({{ site.url }}/images/power/charging-onsite.jpeg)