Brightness Potentiometer Help!

I am trying to use a potentiometer to adjust global brightness. I’m new to wled, but I have read all the documentation I can find. Still, I can’t seem to get this working… Please feel free to relocate the post if I’m in the wrong place.

I am running v0.12.0 hikari on an esp8266. I am doing my testing with a single color on solid mode. I am controlling 576 ws2812b, powering with a 3A USB battery pack. I have an A10K pot wired to 3.3V and GND with the wiper wired to A0. I have confirmed with a multimeter that my wiring is correct, I am seeing a voltage on A0 that is controlled by the pot. In “Sync Setup” I have enabled the On/Off button. In “Time & Macros” I have set the “double press” to 250. All others 0. In “LED Preferences” I have tried button pins 0 and 1. I feel as though I have toggled all combinations of these settings, but nothing I do will make the brightness respond to my potentiometer.

Any help? Happy to provide more info if needed!

I… I think I figured it out, and I think I’m an idiot. Per the wiki

Blockquote
Starting in WLED 0.13, analog “buttons” (e.g. a potentiometer) are supported. Set the Double column in Button Actions to one of these values to configure:
Blockquote

aaaand Im running 0.12.0. At work all day, but I know what I’m trying as soon as I get home.

This definitely solved my issue. For anybody following along at home, make sure you’re running 0.13 to make analog buttons work! The following is no longer a question, just extra information in case somebody finds this thread later and needs it!

Unmodified, this code will cause the LEDs to turn entirely off if you dial the pot back too far. This suits my needs fine, although it did confuse me at first. Should one view this as a “bug,” instead of the feature that it is, they should be able to replace the wire between the pot and GND with a resistor to prevent A0 from falling too low. This could be achieved by adjusting to the minimum desired brightness, measuring the resultant voltage on A0, and using a voltage divider calculation to determine the optimal resistor value. My testing suggests ~0.040V to be about the lowest the pin can read before it assumes it’s grounded and turns off. For a 10K pot, ~150 ohms should be sufficient. I am POSITIVE this can be handled programmatically instead, but my brain thinks in hardware more natively, and it’s always nice to have multiple paths to success.

Also, I have a logarithmic pot installed (A taper) but it seems it was the wrong choice for the job - there is a clear “knuckle” in my brightness control. A linear pot (B Taper) will likely suit my needs much better.

image

EDIT: After playing with the pot, I discovered maximum adjustment also turns everything off, not just the minimum adjustment. Deciding I liked the “minimum=off” setting, but not the “maximum=off” one, I set out to add a resistor to stop A0 from pulling all the way up. Some napkin math suggested I needed 577Ω between 3.3V and the pot. After some trial and error, 750Ω stopped the “maximum=off” behavior entirely.

2 Likes

Thanks for sharing the log. pot.meter results. I started to order a few just to see whether they have a more relaxed profile for the lowest values.
The linear character of the dimming does not suit very well the way our eyes work; the lowest brightness values jump very quickly compared to higher brightness

But log pot.meter is not the way, I guess :slight_smile: