atuline / WLED

Control WS2812B and many more types of digital RGB LEDs with an ESP32 over WiFi.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suspend intensive calculations when LEDs are off, to reduce power consumption

B0rax opened this issue · comments

commented

I have WLED SR lamp as a desk lamp which is connected to power 24/7.

I couldn't help but notice that the ESP32 gets quite hot even when the LEDs are off. I also measured the power draw because of this.
The ESP32 seems to be using 200mA while displaying nothing. This is 1W standby power which seems quite high to me. This is almost 9 kWh per year.

Maybe it would be possible to drastically reduce this power consumption. I think this would be a great enhancement.

commented

Good observation. It is true that WLED-SR currently is never idle, even when LEDs are inactive.

  1. For the SR part, the microphone is sampled continuously, and sound analysis (filtering and FFT) also run all the time. We want to react on sound, so we have to keep checking for sound. FFT occupies one of the two cores completely, at 240Mhz...

  2. other possible inputs (buttons, USB, serial, network, etc etc) are also being checked regularly.

  3. Another well-known "power eater" is the WiFi connection. Wifi is actually responsible for a large part of ESP32 power consumption, it can go up to 600mW.

Currently there are no plans to implement a "low power" mode in WLED-SR.
The main reason is that the typical "300LEDs strip" consumes a lot more power than any ESP32, even when all LEDs are off. When users have power consumption issues, it's usually caused by the LED strip; 6-15 Ampere (30W - 75W)is typical for a "full bright" strip with several hundred LEDs.

My suggestion for your temperature problem: you might want tp try out cooling pads that can be put directly onto the chip; many are intended for "Raspberry Pie" controllers, however they might also fit onto the ESP32. If you still have too much heat, try cooling the board with a small fan.

We might look into the "low power" mode for a future version, however honestly speaking this is not on the priority list. Same for running the ESP32 on lower speed, like 160Mhz or 80Mhz.

cheers,
Frank.

commented

Like these ones (amazon Germany):

commented

Thanks for your reply, I understand that power consumption while displaying anything is not a concern.

As far as I understood it, the most intense calculations are the FFT analysis. Is it possible to pause these calculations when the LEDs are switched off or (even better) when no sound reactive animations are displayed?

If I read the code correctly there is already a place in audio_reactive.h where the FFT calculations are paused when sync is enabled (line 302):

    // Only run the FFT computing code if we're not in Receive mode
    if (audioSyncEnabled & (1 << 1))

maybe a additional condition could be placed here?

Again, I am not talking about reducing power consumption or heat while it is running, I am only concerned with the power draw while nothing is done in a 24/7 application.

commented

Hi
The code line that you point to might be a start, however it would also disable sound sampling because the FFT thread first pull new samples from I2S, then runs the FFT analysis.

As experiment to understand how much power can be saved, you could

  • comment out the if(...) condition, so that continue; is always executed.
  • Re-compile & upload to your device.
  • Then measure the power consumption again. I would be interested to hear if you really see a reduction in power consumption.
  • After measuring, please un-do the change, as it makes WLED-SR ignore all sound inputs.
  • Re-compile & upload again so you have a working WLED-SR.

For a clean solution, can you specify what "when nothing is done in a 24/7 application" means for you?
Is it about running a sound-reactive effect but brightness set to zero? Or a non-SR effect that sets a specific color? Turning the ESP32 off ? Are you expecting WLED to still respond to switches, timers etc when "nothing is done"?

commented

Just looked into the ESP32 datasheet from espressif (https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf).

It seems that your measurement of 200mA is already a low value when Wifi is active.

Screenshot_20220619-182608_Google PDF Viewer

Generally speaking, there are ways to reduce power consumption:

  • actively put ESP32 into sleep mode (many modes availeable)
  • put wifi radio into light sleep
  • reduce chip frequency (160Mhz or 80Mhz)

AFAIK, none of these is currently implemented in WLED. And for the typical use case, none of them would not make much sense.

There are many guides on ESP32 power saving on the internet, like this one https://www.mischianti.org/2021/03/06/esp32-practical-power-saving-manage-wifi-and-cpu-1/ . However none of them seems to suggest that keeping the chip idle (executing delay()) will help. Maybe embedded processsors are different from Desktop Computers in this respect...

.

Maybe you can create a usermod that puts the chip into sleep, reduces wifi power and cpu frequency - based on your own criteria for "nothing is done". Not sure if there are WLEDusermod available already for power saving.

@softhack007 perhaps look into how I added on/off button to AudioReactive usermod.