User Tools

Site Tools


projects:blinker:work_logs:6_power_consumption_testing

This is an old revision of the document!


Power consumption testing

The Plan

I want to measure the voltage over time as the device discharges so I can calculate how much power each component uses. I will run the following tests:

  • JP1 open, disconnecting the LED and microcontroller,
    • This should measure the self-discharge and leakage across the Zener D2.
  • JP1 closed, running unoptimised naive code, blinking the message “ss s”
    • This should set a baseline for comparing power saving improvements to code.
  • JP1 closed, and power-optimised code blinking the message “ss s”.
  • LED on 100%,
  • LED off 100%,
    • These two tests should isolate the power consumption of the microcontroller from the LED.

Then graph everything and crunch the numbers.

My 121GW multimeter can log measurements to an SD card. For each of these tests I will charge the supercaps to maximum and then let it discharge to 1.4v.

The Results

Unoptimised code vs passive losses

As of running these tests the blinker has only one 25 farad supercap installed. The final design allows for six 40 farad caps, so it currently has around 10% of the design energy capacity.

Raw multimeter logs are available here.

In this graph the red line shows the voltage over time of the capacitor when the microcontroller and LED are isolated. The blue line shows the voltage over time with the microcontroller and LED running the naive code.

This graph shows the difference between the two curves above - the voltage drop that can be attributed to the microcontroller+LED doing their job. Somewhere between 1.5v and 1.4293v the LED became too dim to see in a dark room.

At T=20000s the voltages were 1.4723v and 1.5933v from a starting voltage of 2.258v. This gives us a voltage drop of 0.7857v and 0.6647v. 0.121v / 0.6647 = 18%. This means that 82% of the energy in the system was lost to supercapacitor self-discharge and leakage across the zener. This sets the upper bounds of power savings we can hope to achieve with clever code improvements.

Optimised code vs passive losses

After optimising the code to disable unused peripherals and enter deep sleep between blinks, using the watchdog timer to wake to process the next frame, I was able to reduce power consumption to very close to the passive drain of the system. This represents roughly a 95% improvement in energy efficiency over the naive approach.

Video

Next Time

I don't think there's much point in trying to further improve energy efficiency of the code. The next steps might be adding features like multiple message sequences.

projects/blinker/work_logs/6_power_consumption_testing.1645963948.txt.gz · Last modified: 2022/02/27 12:12 by tjhowse