My projects consists of:

  • Arduino Nano
  • 1m 60Leds 12V LedStrip (white)
  • 1m 60Leds 5V controllable LedStrip (RGB)
  • 5V power supply
  • step up converter (from 5V to 12V)
  • potentiometer
  • some trigger buttons
  • some sensors

I'm making a "lamp" of sorts, that would be controlled through Arduino Nano.

I'm powering it with 5V power supply (phone charger); I have step up converter setup for 12V; potentiometer output 0V-5V to Arduino analog input.

One of the functions would be "dimmable LEDs", controlled by Arduino, according to audio and light sensors.

This is no problem for the RGB strip, as they have additional data pin and I can control them that way, but when it comes to 12V white LEDs...

Using lab bench power supply I found out, that white LED strip turns on at 8V and with voltage rising to 12V it gets brighter.

The natural thought was "put a potentiometer there", but I'm already using one potentiometer, as analog input for Arduino (so 5V).

I don't want to use another potentiometer, as it would be against DRY (Don't Repeat Yourself).

I've seen "solutions", as to use PWM together with MOSFET to run the 12V LEDs, but I don't want to introduce "flickering" (even though it might be insusceptible to humans, it may affect my kids falling asleep [they seem to not be able to fall asleep with LEDs connected to mains, while they can with old incandescent bulbs]).

I've also taken a look at "digital potentiometers" (like FM62429 or X9C104), but they all seem to be made for audio signals or lower voltage usages, not 12V.

Soo, my questions are:

  1. Is it possible to make "nice" 8-12V DC using MOSFET and PWM?

  2. Can I make some circuit that would use digital potentiometers and not overheat them?

  3. Is there a better way to make that project work?

  • \$\begingroup\$ What I meant about the PWM and MOSFETs - I don't really want pulse modulated brightness. What I want to do, is something like "Arduino controlled step down converter". \$\endgroup\$
    – Gaben
    Commented Jun 25, 2020 at 22:46
  • \$\begingroup\$ Without a built-in feature in your LED item, you can control brightness by: (1) controlling the current with a sufficiently high compliance voltage capability; (2) by controlling the voltage with a sufficiently high compliance current capability; (3) setting a fixed voltage and using PWM; or (4) setting a fixed current and using PWM. That's not all the options. There are still more complex ones. But those are the easier ones. Which of them you use depends on what you have at hand. Your 5 V LED chain seems to have a "feature." That's good. The white LED appears to need one of the above ideas. \$\endgroup\$
    – jonk
    Commented Jun 25, 2020 at 22:53
  • 1
    \$\begingroup\$ If you pulse well past the flicker fusion frequency (say, pulse frequencies well above 150 Hz) then it shouldn't be a problem. You could just "go crazy" and pick 1 kHz or even 10 kHz, if you want. Fast enough and it is very unlikely to be an issue. The eye "integrates" over short periods for which these very fast frequencies are "fast." But if you must do it linearly without flicker at all, then set up 12 V and use a current controller. Even then, you'll want geometric progression for brightness control as humans perceive the log of current (needed to survive on planet Earth.) \$\endgroup\$
    – jonk
    Commented Jun 25, 2020 at 22:56
  • \$\begingroup\$ Could you point me to current controller schematics or some link, where to buy one? \$\endgroup\$
    – Gaben
    Commented Jun 25, 2020 at 23:02
  • \$\begingroup\$ Are you saying your kids are not humans? \$\endgroup\$ Commented Jun 25, 2020 at 23:02

1 Answer 1


I'll try concluding on the comments a bit, and add personal commentary.

  • The standard way is really PWM'ing LEDs. When using a high PWM frequency, humans can't detect that it's PWM. There's relatively solid statistics and theory behind that's the case.
  • If you don't want PWM, the appropriate way to dim an LED is to vary the current (illumination strength is pretty much proportional to current, which itself is pretty much exponential with voltage).
  • You can build a controlled current source using your MCU, and MOSFETs

Personal notes:

  • if your child can't sleep with a given light, but with another:
    • account for external control factors (sound emissions, light position, time of day, the fact that an incandescent bulb makes more infrared heat radiation than visible light and your child might just like the warming effect)
    • it's well-known that "bluer" lights tend to keep people awake more than warmish white tints. (and the latter is exactly what the incandescent light provides) You can buy "warm" white LEDs. What you're looking for is "color temperature", and that should be relatively low (2700 K - 2900 K).
  • You could use a step-down converter LED driver IC. That has the advantage of not being a linear solution and hence not getting as hot.
    • Many come with a current limit pin, which needs to be connected to a low-side shunt resistor. When the current is high, the voltage over that resistor is high. You can use an opamp voltage adder to add a voltage to that voltage so that you can adjust the current externally.
    • You could use the PWM followed by a simple RC low-pass filter to generate a voltage to add to that, giving you software. That's a voltage DAC!
  • Of course, you could also build a linear regulator:
    • PWM -> low pass for a voltage DAC
    • 12V -> high-side MOSFET configuration (that's nontrivial) driven by opamp -> LEDs -> Ground as the power chain
    • low side of MOSFET -> Voltage divider to a voltage range your DAC could also produce (e.g. 12 V maps to 3V)
    • connect divided voltage to non-inverting input of opamp from above. The opamp is now in a negative-feedback configuration, which means it will try to output exactly as much as necessary to make the voltage at its two inputs equal.
    • connect DAC to non-inverting input. This now allows your MCU to control the voltage at the voltage divider's output, and hence the voltage that the LEDs see.
    • pull down non-inverting input via 1 MΩ to ground. That way, when your MCU is off/malfunctions, the lights turn off.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.