How to control 12V with Arduino

Hello everyone,

I bought myself a LED strip which works with 12v. I cut a small piece of it off, so the current wouldn't be too high for my breadboard. It works now.

I'd like to be able to do "dumming" effects on it or maybe some kind of fade-in when I turn it on but I'm not sure what is a good way to go about doing that.

  1. At first I thought I'd use analog output and somehow scale the 0-5V output to 0-12V.
  2. My other thought is that I could use a PWD signal with ever-changing duty cycles and high enough frequency that I don't see the "flickering".

What do you people think, are both of these approaches viable?
How would you go about making a circuit for No. 1 (basically I'm asking to google search keywords :slight_smile: )

Thanks!

As LEDS are non-linear, the first approach would not work.
I would use the second and switch the LEDs with a logic level N-Type MOS FET.

I'm assuming your LED strip consists of just dumb LEDs and resistors.

1 Like

Something like this:

Use a logic level MOSFET.

How dumb do you actually want it to be? :rofl:

Do you realise that these are both the same description? For most Arduinox, an "analog output" is a 5 V digital PWM stream. To "scale" it to 12 V you just use a FET as Larry indicates, to switch the 12 V according to the 5 V control signal.

Note the importance of a "logic level" MOSFET.

A Google of Fade In and Fade Out LED Arduino should get you some results for code samples. You want to use PWM (Pulse Width Modulation) for the effects. Using a RGB 12 Volt LED string I used the below circuit. You also want to add the gate resistor as shown above. It is omitted in the below schematic. The MOSFETs are FQP30N06L Logic Level Mosfets.

If you only have a single color LED you would only use 1/3rd of the circuit. In the image I used 3 digital PWM outputs. Anyway to fade in or fade out a LED you want PWM.

Ron

I think that some newer boards have a couple of true analogue output pins, but indeed there is often some confusion between analogue and PWM. The silly name that was given to so-called analogOutput() does absolutely nothing to help, does it? It always evaded me why they didn't give it a more sensible name, like pwmOutput().