School me on LED driving quick? Have ARM still want LED driver? - Page 1
Forum section: electronics / general

author: jnz
author_rank: Frequent Contributor
timestamp: March 25, 2016, 11:18:26 pm
content: Have:3.3V STM32F1, 5V tolerant inputsfree PWM outputsSix of these integrated switches: See attached picmore money than room for partsMy meter reports diode check at LED1/2 1.85V, so this is the forward drop I think.Need to drive 6x 12V old school bulb LEDs, LED1 in the pic with dimming all tied in parallel. LED2 is driven automatically when the switch is pressed. The specs for the LEDs aren't available but says "typical draw is 20ma", classic leds (https://tse1.mm.bing.net/th?id=OIP.M53b38da8bdd33d2ed40d72c213e06cd6H0&pid=15.1).I can't get a resistance reading on the meter, but this switch is designed be wired right to a battery, so I'm pretty sure there ukv resistors internal already.The issues:It's all 12V and I'm not sure how to determine my power needs or when an LED driver is appropriate. Is this something a transistor hooked to my PWM output on my micro would do just as well as LED Driver IC?Does anyone have parts they like for something like this?I think it would be better to PWM at the low side of LED1, but I can't do that, because LED2 would also be dimming along with it. Which means PWM high side switching LED1, this circuit does already have an integrated PWM capable high side switch I'm not using that can source 600mA so that seems apt... But maybe I'm missing something smarter-er?I need to buffer the switch output to the micro anyhow so I'm looking for efficient and clever ways to make this whole thing easyI don't really have a solid plan for reading the switch inputs back to the micro yet, so any comments there would be helpful too.Thoughts? Thanks.

author: jnz
author_rank: Frequent Contributor
timestamp: March 28, 2016, 03:43:20 pm
content: Damn. I must not have worded that well.Um... Using a high side PWM driver - is there anything I need to be aware of when driving 120ma of unknown LED circuits?

author: picandmix
author_rank: Frequent Contributor
timestamp: March 28, 2016, 04:12:44 pm
content: Rather than having the switch connected to the leds why not connect the switch directly to an input port, via a pull up resistor to 3v3 and control led 1 and led 2 on separate output pins ?For driving leds you need a simple transistor driver as this link shows, but the transistor shown ,2N3904 is only rated to 200ma max so you might need something that can handle a bit more current if its in continuous use.https://learn.sparkfun.com/tutorials/transistors/applications-i-switches

author: jnz
author_rank: Frequent Contributor
timestamp: March 28, 2016, 04:31:45 pm
content: Quote from: picandmix on March 28, 2016, 04:12:44 pmI didn't design the switch. Pre-made item. If I have to custom order switches, I'll likely change the layout and do just that. I'm trying to not custom order if I don't have to. If I do get to change the switch, yes, it'll be two separate LEDs with an independant switch. Then I can just run 12V LEDs to keep the amerage low but low side drive them easier.I guess, most of my question was when to use an LED Driver specifically over a transistor. If I'm stuck dealing with this particular switch, everything is an issue from driving the main LED, to the switch included LED, to the registering each input (I'll need a buffer or something).

author: picandmix
author_rank: Frequent Contributor
timestamp: March 28, 2016, 05:04:58 pm
content: I would wire it this way, switch open 0.1v , switch closed 3.3vFor simple leds then a transistor driver is all thats needed.For the more high powered leds, they best suited to constant current drivers.

author: jnz
author_rank: Frequent Contributor
timestamp: March 28, 2016, 05:08:20 pm
content: That looks like a good idea except that...1. The 12V rail is a suggestion (automotive), so I'd need to regulate that (not a big deal).2. If I do that and pulse D1 to dim with a PWM, I'll also be dimming D2, which is not exactly desired behavior. I could live with it, but it wouldn't be my first choice.(Also, what program are you using there? I mean, who's version of SPICE)

author: ade
author_rank: Unknown
timestamp: March 28, 2016, 05:54:30 pm
content: QuoteIt depends on your exact application...Not all LED drivers have the same features. Some are functionally just like a transistor plus a few passive components (diodes + resistors); You could easily construct an equivalent transistor circuit. So the main advantage of using a LED driver in this case is from reduction of components + cost (one LED driver vs. many discrete parts), reduced board space, plus you have a ready solution that's been engineered & tested to specifications over all of its operating range.Other LED drivers have more features. Many can internally generate PWM to control dimming (perhaps from an analog input). Some have precision matching circuity so if you have many LEDs in parallel you can have very even brightness across all of them. Others have low-voltage cutoff circuitry, and over-voltage / over-temperature protection -- important in automotive applications because when the alternator kicks in the voltage can really spike up. In some cases you might want short-cicuit protection as well.If you need any of these features then it's probably more economical to use a $0.50 LED driver than to construct your own solution.Also a transistor may not be the most efficient way to control LEDs. So some LED drivers are specifically designed to provide high-efficiency for battery-operated devices, and/or over a very wide voltage range.

author: jnz
author_rank: Frequent Contributor
timestamp: March 28, 2016, 06:45:15 pm
content: Quote from: ade on March 28, 2016, 05:54:30 pmThanks! That makes sense. I'll look and see what I'm working with on these specific LEDs.That was most of the original question, that given my ARM I have PWM covered, so what else would a driver be getting me, but it's too broad a question.One annoying thing is I can't see what value resistor they are using without opening the sealed unit up. I'm not even certain there is a resistor, but very likely is. I don't need one if I'll drive PWM, but still, seems like I need to know. If it's a 12V LED, the typical draw is 20ma, and forward drop is 1.8-1.9, there should be a ~500ohm resistor in there I think.

author: picandmix
author_rank: Frequent Contributor
timestamp: March 28, 2016, 07:14:56 pm
content: The led you show in your opening post could be any voltage, so have you connected it to a power source and checked its current ?Start with 3v and work upwards and see how it performs.For testing one assembly almost any general purpose transistor you have will do, you can decide about drivers once you have proven your design.For a 2 channel layout try something like this.