Use button/switch to toggle power limits

Hey everyone!

Is it possible to have a push button or switch toggle between different pre-defined power limits?

I have a design which uses a high current supply as main power, and a medium current supply as backup power. Both are connected at the same time, but the main power input inhibits the backup power input.
The Wemos D1 Mini is able to tell which supply is currently used with a digital pin.
I want the software to change the power limit when it detects a change from main power to backup power and vice versa. I know that I can use presets and make the backup preset less bright, but changing the current limit would be the best solution.

Best regards,


Circuit simulation here:

I don’t see anything in the API that will enable this, although I may be wrong.

As far as designing this at all, I disagree with the concept of using the ABL in this fashion.
To my mind Step1 is Supply Proper Power for the # of LEDs you want to display.
My opinion has always been the ABL is a (useful) kludge to deal with power issues.

In your scenario you have a need for (hopefully temporary) backup power that is not up to the needs of your entire display. If you have to do that, I submit you should take control of what is displayed with appropriate presets. At minimum it gives you control over how you manage the low-power display which may be very different from the ABL’s blanket “drop the brightness”.

For eg. if you want the low-power mode to max out at 50% power, you can have a preset that uses an ledmap to move every other LED to the end of the strip so you can have 100% brightness but only 1/2 the LED’s.

As always Design == Choices.

just my $.02

Thank you for your input.

My design is a bit different in that it does not use normal addressable LEDs, but PWM controls cheap monochrome copper wire LED strips with WS2811 ICs.

But I found a different solution: The signal that tells the WLED software which power source is in use is now also used to control the power flow to a portion of the LED strips with a PMOS. Now, when the main power supply fails and backup power is needed, a part of the LED strips are turned off by the hardware, and the software can switch to a lighting effect suitable for the remaining LEDs.

You can find a simulation of the power circuit here:
Top supply is the main supply, bottom supply is the backup supply.