1
\$\begingroup\$

I want to connect my 12v LED circuit powered by an external 12v adapter to my Arduino so I could control the LEDs

First, I'm a beginner in Arduino and have little knowledge on electronics. I know that my Arduino Uno can only support 5v and 400mA. I could have easily connected my circuit to it but I'm using 80 LED with a total of 1600mA. As a resort, I found this design (for 50x 2.2v LED just a part of the 80 LED circuit).

50 Red LED 2.2v 20A

Is there a way for me to hook up the 12v circuit to Arduino so that I can control the LEDs? Any ideas? Suggestion?

\$\endgroup\$
3
  • \$\begingroup\$ Do you want to light up all the leds together? All on, and all off, at the same time? \$\endgroup\$
    – mguima
    Nov 11, 2017 at 23:52
  • \$\begingroup\$ I'll be lighting them all together and also be able to change brightness. I received a tip that it is possible with a MOSFET connected to a PWM digital pin. \$\endgroup\$ Nov 12, 2017 at 3:19
  • \$\begingroup\$ If I understand this correctly, I will only need a MOSFET that can support the voltage and current of my load which will be the LED circuit. The MOSFET is connected to Arduino and will act a gate. Is there anything I should be concerned? \$\endgroup\$ Nov 12, 2017 at 4:01

3 Answers 3

1
\$\begingroup\$

You can do this with the right FET acting as low side switch:

With 4.5 V gate drive, this FET goes down to 45 mΩ. With your 1.6 A load current, it will drop 72 mV and dissipate 115 mW. That's fine since its absolute maximum rating is 800 mW at 70 °C ambient.

In this case the gate can be driven directly from a 5 V logic digital output.

If it matters that the LEDs don't come on for the few 10s of ms while the microcontroller is starting up and before it can set the digital output to low impedance and drive it low, then add a small pulldown on the gate to ground. 100 kΩ will do.

Logic Level FETs

I see there is some discussion about other FETs and what is really needed in this application. Lots of very beefy FETs are available if you can give them 10 to 12 V of gate drive. While that could be done here by using a gate driver chip powered from the 12 V, it is unnecessary.

There are FETs that can get to nicely low Rdson with less than 5 V gate drive. The tradeoff is that they can't withstand a lot of D-S voltage, usually up to 20 or 25 V, sometimes as high as 30 V. That's no problem in this case since only a 12 V power supply is being used.

The marking term for these are "logic level", because digital logic used to be 0-5 V signals. The datasheets promise what the maximum Rdsonwill be with a little less than 5 V, like 4.5 V. That allows you to safely drive them from 5 V CMOS logic outputs.

Of course nowadays, logic isn't 5 V anymore, so the "logic level" marketing term isn't very useful. You have to dig around to see which of those FETs are also specified for a little less than 3.3 V gate drive. The IRLML2502 I show above is one of these, although that isn't relevant in this particular case since the logic signals are actually 5 V.

However, you should not use a FET with 5 V gate drive unless the datasheet tells you what you get. The IRF530 mentioned in another answer is one of these. Here is the relevant snippet from its datasheet:

Note that a maximum of 90 mΩ Rdson is promised, but only at 10 V gate drive. Nowhere in the datasheet does it tell you what Rdson you get at any other gate voltage. All it mentions is that the gate threshold voltage is somewhere from 2.0 to 4.0 V. But, that's where the FET starts to come on, which is also defined in the datasheet as allowing 250 µA of drain current. That's a totally irrelevant spec when you want to switch 1.6 A.

The IRF530 is gross overkill in other parameters. That by itself does no harm, but it's a totally inappropriate FET for this case. All you know is that with over 4 V of gate drive, you get more than 250 µA of drain current.

Wishful thinking and designing to specs not promised in the datasheet have no place in engineering. The fact that a part is included in some hobbyist kits for use in a certain unspecified way is no evidence of anything other than irressponsible engineering. Individual parts found to work in certain ways is also not relevant. There is nothing guaranteeing that the next part out of the box will exhibit that same behavior.

\$\endgroup\$
4
  • 2
    \$\begingroup\$ I don't know why would someone downvote this answer (wasn't me). But it seems really too complex to an OP that "have little knowledge on electronics" and just want to hook up some leds to an arduino output. \$\endgroup\$
    – mguima
    Nov 11, 2017 at 23:51
  • 1
    \$\begingroup\$ If I understand this correctly, I will only need a MOSFET that can support the voltage and current of my load which will be the LED circuit. The MOSFET is connected to Arduino and will act a gate. Is there anything I should be concerned? \$\endgroup\$ Nov 12, 2017 at 4:02
  • 1
    \$\begingroup\$ @mguima: How is using a single MOSFET too complex? If he just wants to hook it up and have it work, all he has to do exactly that as I showed in the schematic. The explanation about why it works and what issues should be considered can be ignored. However, they may be useful to the OP once he learns more and comes back to understand the details. They are also part of the archive we are trying to build here, so may be useful to others. The part about logic level FETs was in response to the erroneous answer and comments by Passerby, but is also useful in general. \$\endgroup\$ Nov 12, 2017 at 13:36
  • 1
    \$\begingroup\$ If the OP isn't a engineering student nor a professional, this kind of deep learning about FETs is still a few years ahead in his learning path. For now he just want turn on some leds. BTW, Olin is rep. 244k, Passerby is 48k, and mguima is only 0.48k., so, mguima is getting out of this arguing. \$\endgroup\$
    – mguima
    Nov 12, 2017 at 16:08
-1
\$\begingroup\$

Here is a suggestion for you, using a simple mosfet to switch the external circuit. R1 is the pull-down resistor for each mosfet.

enter image description here

LOAD would be one of your LED strips with series resistor.

If you have 10 strips, you have to use 10 digital pins of Arduino and hook up each one of them like this.

GND of Arduino -> GND of the 12 V external supply

\$\endgroup\$
8
  • 1
    \$\begingroup\$ A 2N7007 is totally inappropriate here. 4.5 Vgs is specified, but the result is 45 Ohms Rdson. \$\endgroup\$ Nov 11, 2017 at 19:17
  • \$\begingroup\$ 2N7007 is just a hobbyst MOSFET and cheaply available. With 45 ohms on resistance, and 10 mA still flowing (through 5 LEDS in a strip), the LEDs will still glow anyway. Well, if a single mosfet is the requirement to control all the strips together in one go, power mosfets have to be used. I am Not being too stringent on the technical requirement of such a simple LED control circuit here. \$\endgroup\$
    – Mitu Raj
    Nov 11, 2017 at 19:51
  • \$\begingroup\$ The OP wants to run 1.6 A thru the LEDs total. \$\endgroup\$ Nov 11, 2017 at 20:54
  • \$\begingroup\$ yea, I was talking about one mosfet per one strip. Maybe he wants to control the whole panel in one go. Then one mosfet with 1.6 A rating is needed. \$\endgroup\$
    – Mitu Raj
    Nov 11, 2017 at 21:08
  • \$\begingroup\$ Even with 10 strips and 10 FETs, each FET still needs to support 160 mA. With 45 Ohms Rdson, that would drop 7.2 V and dissipate over 1 W per FET. Again, the 2N7007 just isn't appropriate here. \$\endgroup\$ Nov 11, 2017 at 23:02
-3
\$\begingroup\$

Any common logic level or 5V VGS n channel low side mosfet would allow you to control this 12V 1.6A panel. IrF520 or 530 are commonly used for this but better mosfets exist. You could control a transistor controlling a relay as well.

\$\endgroup\$
6
  • \$\begingroup\$ The IRF530 isn't a logic level MOSFET. It's Rdson is only specified for 10 V gate drive. It could handle switching the LEDs in question, but would require a gate driver. You don't explicitly say so, but this answer gives the impression that the '530 is "logic level", and can be driven directly from a 5 V logic signal. By the way, I didn't do the downvote. That was already here when I first saw this question. \$\endgroup\$ Nov 11, 2017 at 20:59
  • 1
    \$\begingroup\$ At 5V, it allows 4 amps, and is commonly included in arduino kits. It works fine for this application. \$\endgroup\$
    – Passerby
    Nov 11, 2017 at 22:15
  • 1
    \$\begingroup\$ No, it doesn't! At 4 V, only 250 uA is promised. See addition to my answer. Other people getting away with uses beyond the datasheet is no proof of anything about what the next part out of the box will do. This is irresponsible engineering at its worst. You really should retract that statement. \$\endgroup\$ Nov 11, 2017 at 22:59
  • \$\begingroup\$ FET's aren't the only thing that exists. BJT lives! I suggest a TIP31. \$\endgroup\$
    – mguima
    Nov 12, 2017 at 0:01
  • \$\begingroup\$ @mguima the tip 31 gain is too small for this. 25 hfe at 1 amp Ice. Even maxing out the arduino gpio at 40 mA it would not pass the 1.6 amps needed. \$\endgroup\$
    – Passerby
    Nov 12, 2017 at 4:00

Your Answer

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

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