Author Topic: Controlling led strip with a uC  (Read 876 times)

0 Members and 1 Guest are viewing this topic.

Offline 24ariel3Topic starter

  • Contributor
  • Posts: 11
  • Country: 00
Controlling led strip with a uC
« on: November 08, 2018, 01:23:52 am »
Hi,
I want to control a 12V 100mA led strip with a microcontroller, what is the best way to do it, darlington transistor, MOSFET or other way?

Thanks
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2252
  • Country: ca
Re: Controlling led strip with a uC
« Reply #1 on: November 08, 2018, 04:31:48 pm »
NPN transistor: emitter to ground, collector to the - side of the LED strip. LED strip + connected to 12 V supply +. Connect 1 kOhm resistor from micro output pin to NPN base pin. Output high = LED On.  12 V and micro (5 V?) must have their ground (-) connected together.   Use any 'jellybean' NPN like 2N2222, 2N3904, BC547, any of them can handle 100 mA when saturated.
 

Offline 24ariel3Topic starter

  • Contributor
  • Posts: 11
  • Country: 00
Re: Controlling led strip with a uC
« Reply #2 on: November 08, 2018, 04:35:03 pm »
What about voltage drop over the npn, won't it make the led strip abit dimmer?
(The uC is 3.3V)
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2252
  • Country: ca
Re: Controlling led strip with a uC
« Reply #3 on: November 08, 2018, 04:53:27 pm »
Drop will be equal to VCE(sat) at 100 mA, which should be around 0.35 V.
If that is a problem, then you can replace the NPN with a small logic-level N-channel MOSFET, as long as the output voltage of the micro is higher than the turn-on threshold of the MOSFET, and keep the RDSON low (like < 1 ohm) to minimize voltage drop. Something like BSH103 would work. They cost more than a simple NPN, and its a SMT part.
 

Offline 24ariel3Topic starter

  • Contributor
  • Posts: 11
  • Country: 00
Re: Controlling led strip with a uC
« Reply #4 on: November 08, 2018, 04:58:46 pm »
Mosfet sound good.

What about SSR or is it an overkill?
When to consider to use SSR?
 

Offline brybot

  • Contributor
  • Posts: 20
  • Country: us
Re: Controlling led strip with a uC
« Reply #5 on: November 08, 2018, 06:58:56 pm »
A SSR could work, but is probably overkill. You can use a SSR like a mechanical relay where you are using a small signal to switch a larger one, or a DC signal to switch AC. In your case a BJT or FET is cheap, simple and will do the trick.  SSRs usually use some combination of FETs or TRIACs, depending on the application. In some cases, they can also isolate the signal and load, but that probably isn't a concern in your application.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf