Turning an LED Strip On and Off with Arduino with Microsecond Precision - Page 1
Forum section: electronics / projects

author: christopher_gabaldon
author_rank: Newbie
timestamp: August 25, 2024, 08:06:47 pm
content: Hi! I need help with a project that involves turning an LED strip on and off, which was originally part of the backlight of an LCD monitor. The goal is to control the pulse duration (square wave signals) with an Arduino. We tried using a voltage source with a MOSFET and a MOSFET driver, where the gate was connected to the Arduino, but we only achieved switching times in the millisecond range. What we’re aiming for are fall/rise times below 1 microsecond. We’re considering building a current source since we need to control at least 30 LEDs, as it’s for a monitor backlight. We don’t have much experience in electronics as we’re physics students. We’d appreciate any advice on how to approach the design of the current source.

author: Smokey
author_rank: Super Contributor
timestamp: August 25, 2024, 08:25:14 pm
content: Thoughts:Use an LED driver chip. Don't make your own circuit. Lots of solutions for 1/many LEDs, constant current, linear/switching, etc:https://www.digikey.com/en/products/filter/led-drivers/745?s=N4IgTCBcDaIDYFMAmACJAnAlgNwekAugL5AIf you are getting ms delays you are probably running into Arduino high level code overhead. Tighten up your code, go lower level (register toggles), or ditch arduino and go straight to the chip SDK (avr or whatever).You should be able to find many examples of app notes/projects that switch LEDs (for a backlight). Go copy something that someone else already got working.Good luck!

author: DavidAlfa
author_rank: Super Contributor
timestamp: August 25, 2024, 09:30:09 pm
content: You might actually be able to turn the leds with microsecond speed, but the emitted light won't, phosphor on white leds has some persistence and won't stop glowing instantly.

author: pardo-bsso
author_rank: Frequent Contributor
timestamp: August 25, 2024, 09:43:39 pm
content: As others said here, even if you can switch them on-off that fast the response of the phosphors is still quite slow.How did you arrive at that speed?

author: Benta
author_rank: Super Contributor
timestamp: August 25, 2024, 11:28:20 pm
content: Who said they are white LEDs? It might be a green LCD.But the phosphor issue is a bit of a killer if it's white LEDs.Controlling LEDs in the sub-us range is certainly possible, but not easy.We need to know what the objective is here.

author: Someone
author_rank: Super Contributor
timestamp: August 26, 2024, 01:13:39 am
content: Have any of you tried measuring phosphor response? microsecond is feasible and not out by orders of magnitude

author: DavidAlfa
author_rank: Super Contributor
timestamp: August 26, 2024, 01:22:48 am
content: Quote from: Benta on August 25, 2024, 11:28:20 pmSo where have you seen a green LCD monitor?

author: Someone
author_rank: Super Contributor
timestamp: August 26, 2024, 02:37:51 am
content: Quote from: DavidAlfa on August 26, 2024, 01:22:48 amRGB backlight

author: Doctorandus_P
author_rank: Super Contributor
timestamp: August 26, 2024, 06:42:59 am
content: I assume here that the "microsecond" stuff is mainly intended to manage heat loss in the FET. Switching a MOSfet from a microcontroller is going to be slow, because the uC pin can only deliver a low current and therefore charges the gate capacitance of the fet "slowly".For DIY experiments an NE555 is a decent FET driver. It can deliver 200mAdc on it's output (Don't know peak current), and it can also boost the voltage. But real mosfet driver IC's are better. Some can deliver peak currents of several amperes.If you just want to control the amount of light coming out of the LED's, then a dedicated LED driver IC is probably a better Idea. These exist both in buck and in boost variants and are readily available and cheap.

author: Phil1977
author_rank: Frequent Contributor
timestamp: August 26, 2024, 08:09:10 am
content: Quote from: pardo-bsso on August 25, 2024, 09:43:39 pmA typical decay time of YAG-phosphors as used it white LEDs is around 50ns. That´s indeed quite fast.

author: brucehoult
author_rank: Super Contributor
timestamp: August 26, 2024, 08:34:34 am
content: https://web.archive.org/web/20120929044003/http://www.siemens.com/innovation/en/news/2010/500-megabits-second-with-white-led-light.htm

author: Benta
author_rank: Super Contributor
timestamp: August 26, 2024, 11:08:20 am
content: Quote from: DavidAlfa on August 26, 2024, 01:22:48 amWith 30 LEDs, I'd expect a dot-matrix display, not a monitor. And I've seen plenty of those in green.

author: ArdWar
author_rank: Frequent Contributor
timestamp: August 26, 2024, 11:27:33 am
content: We really need to take a look at your previous attempt to offer any meaningful advice. Schematics, parts, input signal waveforms, observed waveform/performance (if applicable), etc. It appears there are something that slows down your output. A linear modulated sources should give you much finer control than milliseconds for sure. High dynamic range LED drivers routinely control in microseconds.All else fails, you can even use LED laser driver that can drive sub-nanoseconds.

author: Zero999
author_rank: Super Contributor
timestamp: August 26, 2024, 12:33:59 pm
content: Quote from: Phil1977 on August 26, 2024, 08:09:10 amThe experiments I conducted awhile ago, show phosphor LEDs to much slower than that.https://www.eevblog.com/forum/chat/20w-halogen-bulb-viewed-by-a-photodiode/msg2388798/#msg2388798

author: Phil1977
author_rank: Frequent Contributor
timestamp: August 26, 2024, 01:01:49 pm
content: The only LED phosphors I know that are in the microsecond-range are red ones. So it´s easily possible that the phosphor converted amber LED of the linked thread is somehow slower.But with own experiments I´ve never managed to see a delay of the usual yellow cerium doped YAG phosphor that delivers by far the largest contribution to the spectrum of usual white LEDs. Maybe some strongly warm white devices may differ.A while ago I wired up a Hamamatsu S10942-01CT photodiode for a similar purpose. It has a typical rise time of 0.1us and we couldn't see any difference in the blue and green channel when we were analysing white LEDs. If the phosphor would have a significant delay, then the green channel (mainly affected by converted light) should show some "latency" compared to the blue channel (coming directly from the LED emitter).If there is interest and I find the S10942-01CT anywhere I can upload a few measurements of different LEDs.

author: Zero999
author_rank: Super Contributor
timestamp: August 26, 2024, 03:54:10 pm
content: Red LEDs are normally not phosphor converted, unless they're designed to be used in parallel with blue or violet ones, so the forward voltage is the same.I didn't test any cool white LEDs, only warm white LEDs. I wonder if they're LEDs with a mixture of phosphors for higher colour rendering index?

author: Phil1977
author_rank: Frequent Contributor
timestamp: August 26, 2024, 05:05:24 pm
content: Many new red LEDs are phosphor converted - even if they look very normal.I got a batch of red 3mm LEDs that have a suspiciously high forward voltage around 2.8V. I first really wondered if they have some kind of defect, but then I shined with a UV-flashlight on them and they started fluorescing. They clearly are phosphor converted, even if they look completely normal.Many red high power LEDs are also phosphor converted because direct emitting red LEDs get very inefficient with higher temperatures. If you need a red LED that is still powerful at an ambient temperature of >80°C, like in a video beamer optical engine or potentially in the brake light of a car, then it can be more efficient to use phosphor converted red, although it needs more voltage.And yes, the white LEDs with "classical" cerium doped YAG phosphor indeed have a catastrophic CRI because they principally just mix yellow with blue light. To get a better CRI you also mix gadolinium dopant into the YAG which just broadens the yellow emission into longer wavelengths. I suppose that doesn't influence the decay time. If you want even better CRI, you really mix different phosphor types with different emission maxima.two 3mm LEDs in daylight:the same LEDs in UV-light:the same LEDs in operation:

author: Zero999
author_rank: Super Contributor
timestamp: August 26, 2024, 09:26:39 pm
content: Where did you get those phosphor converted red LEDs from?I'm interested in getting some, but yellow, rather than red. The only PC yellow ones I've seen are SMT. The through hole ones tend to be inefficient GaAsP.

author: Phil1977
author_rank: Frequent Contributor
timestamp: August 27, 2024, 06:40:01 am
content: Unfortunately from the most unreputable and non-traceable source I know: These 3 parts for 2€ each deals at aliexpress (I think it was a box of 500 3mm LEDs for 2€)For yellow you can find three types on the market, without necessarily being exhaustive:- The old-style GaAsP: They are really quite dim. GaAsP has only a small ratio of direct recombination in the semiconductor crystal - so it can't be efficient- The newer style AlInGaP: AFAIK they are most efficient in lm/W for yellow- The phosphor converted ones: They are again more efficient at higher temperatures, as the red LEDs.You can get AlInGaP as well as phosphor converted ones with crazy intensities and good efficiencies from the automotive portfolios of the major suppliers. But for sure not as through-hole 3mm types

author: christopher_gabaldon
author_rank: Newbie
timestamp: August 27, 2024, 03:32:03 pm
content: We use a phototransistor to verifie that times, so you think that if we use another type of LED we could achieve the sub us range, although using a supply voltage instead of a current suply? We where using the strip carried in the original LCD monitor . I upload an image of that strip.Thanks!

author: christopher_gabaldon
author_rank: Newbie
timestamp: August 27, 2024, 03:37:51 pm
content: Thanks for the quick response.the LEDs are white. I upload an image of the strip we are using. Do you know how could we find out the material of this strip? i think its a generic one.On the other hand, do you think that employing another type of LED we could achieve the us range altought using a supply voltage power?Thanks again

author: Phil1977
author_rank: Frequent Contributor
timestamp: August 27, 2024, 04:09:06 pm
content: The problem is that the LED-stripes of the LCD screens are usually not intended for pulse operation.It should be quite easy to switch it on and off with an arduino output controlling a mosfet. You could use a standard N-channel mosfet specified for a few amperes. Connect it´s gate with a small resistor to the arduino IO pin, connect the source to GND and the drain to the kathode of the LED-stripe.Then use a laboratory power supply, connect it´s negative output to GND and it´s positive output with a power resistor to the anode of the LED-stripe. Resistor value needs to be (V_powersupply - V_LED)/I_LED . The difference between V_powersupply and V_LED should at least be 25% of the LED voltage. For fast switching applications the current limiting resistor is much easier and more reliable than other types of current regulation.The problem here will be the LED current I_LED. The single LEDs in such a stripe won't be specified for much more than 350mA. Driving them out-of-spec with e.g. 1A may be possible - though it means you are constantly risking acute failure.But with 1A very short pulses won't produce a decent brightness. Can you tell more about the desired pulse length, repetition rate and the required brightness?

author: christopher_gabaldon
author_rank: Newbie
timestamp: August 28, 2024, 07:42:24 pm
content: Quote from: Phil1977 on August 27, 2024, 04:09:06 pmYes, indeed, we did what you mentioned, and we also used a driver to control the MOSFET. However, with our photodiode connected to the oscilloscope, we observed a t-fall of approximately 3ms. What we aim to do is project images in short times; practically speaking, the LED strip would need to be on for T seconds, in a sub-millisecond regime. Our problem was that the t-fall and t-rise were on the order of the pulse duration. We are aiming for t-rise and t-fall times on the order of 1 microsecond or less. In fact, we are also considering building a custom LED strip from scratch for these purposes, with approximately 35 LEDs that can achieve these times. Regarding illumination, it should be around 200 cd/m² (typical for an LCD monitor).Thanks for your help!!

author: Manul
author_rank: Super Contributor
timestamp: August 28, 2024, 08:31:40 pm
content: Quote from: christopher_gabaldon on August 28, 2024, 07:42:24 pmWhat amplifier you used for the photodiode? My point is that if you don't have characterization of your measurement equipment, you can't move forward. If you are physics students, maybe you could ask for help in lasers lab. They should be able to test rise and fall times of your photodiode and amplifier. Ideally your measurement setup should have rise and fall of 100ns or so. When you are absolutely sure, that you can really measure such fast transitions (it's not trivial, really), proceed testing various LEDs and drivers.

author: tooki
author_rank: Super Contributor
timestamp: August 28, 2024, 10:09:51 pm
content: Quote from: Phil1977 on August 26, 2024, 05:05:24 pmThanks for the pictures of the red LED. I’m kinda flabbergasted that they bother doing that!As for powerful red LEDs: I have a little project at work that I need to resume, using 150W LEDs that are not phosphor-converted! They’re apparently intended for video projection*. As you might imagine, they require robust cooling.When testing with the smaller 50W version, I forgot to remove the Kapton protective film before powering it up (at below the 50W maximum in fact), and within a few seconds, it simply vaporized the Kapton that was touching the die. 😂 And yes, with a heatsink attached.(OSRAM P3MQ, for anyone who is curious. The updated versions they sell now are slightly lower power, as they managed to improve them to give the same light output at lower voltage.)*FYI, in English, the word “beamer” is completely unknown for video projectors. Native speakers do not know what it means, other than guessing from context!

author: SteveThackery
author_rank: Super Contributor
timestamp: August 28, 2024, 10:51:33 pm
content: As an aside, I think the standard microsecond timing function in Arduino only resolves to 4 microseconds. You mentioned "microsecond precision" in the thread title, hence mentioning it.

author: brucehoult
author_rank: Super Contributor
timestamp: August 28, 2024, 11:08:30 pm
content: Quote from: SteveThackery on August 28, 2024, 10:51:33 pmOn a 16 MHz AVR, yes."Arduino" covers many other CPU types and clock speeds.

author: Phil1977
author_rank: Frequent Contributor
timestamp: August 29, 2024, 06:11:55 am
content: Quote from: tooki on August 28, 2024, 10:09:51 pmYep, there are scary LEDs for projection on the market.Quote from: tooki on August 28, 2024, 10:09:51 pmYes, thanks... I take it as a compliment that you value my postings worth of language corrections. These "false friends" are really annoying.Back to topic:Quote from: christopher_gabaldon on August 28, 2024, 07:42:24 pmAs mentioned, the ms-rise time you are measuring is nearly for sure not fault of the LED. I think you should check the following:- switch time of the mosfet: If you are running the LEDs with a current limiting resistor, then you can connect a scope to the resistor to measure the current pulse. Needless to say, if the current does not rise or fall fast enough, then the LED can not save the day. If the resistor is on the high side then you may have to care about ground loops with the scope probe or use -if available- a current clamp. If the FET is the problem, please post all the circuitry from the AVR to the LED.- What photodiode do you use? How is it connected and terminated at the scope? If you use e.g. 10MOhm input impedance then you get very bad frequency response.- If you don't have a fast photodiode available you can also try to use e.g. a red or yellow LED as a photodiode for the white light. Just connect it to a 1:1 scope probe, set the scope input to 50Ohm and put it directly in front of the emitting LED. You usually only get a few tens of mV, but it´s okay to see the modulation.- Some laser lab would fore sure be a good source for support.- Switching the LEDs on and off fast enough should absolutely be feasible. Reaching sufficient brightness may not be.

author: brucehoult
author_rank: Super Contributor
timestamp: August 29, 2024, 07:48:43 am
content: Quote from: Phil1977 on August 29, 2024, 06:11:55 amI'm not sure it's "false", just not the usual term. It makes some kind of sense. Like when Russian-speaking friends tell me that after the latest attacks they only have light for a couple of hours a day, when what they mean is electricity.For many years I've used software called "Beamer" that lets me play movies from my computer to my TV (the only thing I ever use my TV for...)

author: Someone
author_rank: Super Contributor
timestamp: August 29, 2024, 07:55:41 am
content: Quote from: brucehoult on August 29, 2024, 07:48:43 amInterestingly that one doesnt make the wikipedia list of uses:https://en.wikipedia.org/wiki/BeamerThe euro term for projector did make its way back to english: "Beamer (LaTeX), a document class for creating presentation slides" but only in some niche circles.

author: Phil1977
author_rank: Frequent Contributor
timestamp: August 29, 2024, 08:30:42 am
content: Just FYI, this is the signal of a standard yellow 3mm-LED that captures the PWM of a standard white LED (small flash-light):It´s not necessarily ns-resolution but it´s at least in the us-range.I just clipped the LED into the scope probe and switched a 5kOhm resistor in parallel. I remember doing the same with 50 Ohm, but maybe I had a better scope or more efficient LED that time.

author: brucehoult
author_rank: Super Contributor
timestamp: August 29, 2024, 09:05:49 am
content: Quote from: Someone on August 29, 2024, 07:55:41 amhttps://softorino.com/beamer

author: Someone
author_rank: Super Contributor
timestamp: August 29, 2024, 10:58:47 am
content: Quote from: Phil1977 on August 29, 2024, 08:30:42 amLove it! Here is a red LED terminated into 210 ohms:Some ringing from the voltage preamp which I believe is the bandwidth limiting part of this quick setup. Reverse bias and/or transimpedance amps not needed yet.

author: tooki
author_rank: Super Contributor
timestamp: August 29, 2024, 11:31:14 am
content: Quote from: brucehoult on August 29, 2024, 07:48:43 am"False friend" is an established term in language study:https://en.wikipedia.org/wiki/False_friendTechnically, "Beamer" is less of a false friend (since English doesn't really have a common word "beamer"), but rather apseudo-anglicism, for which it is a poster child, alongside "Handy".Quote from: Someone on August 29, 2024, 07:55:41 amWhy would it? Wikipedia isn't a directory of all software that exists. That program probably does not meet the notability requirements to be included.Quote from: Someone on August 29, 2024, 07:55:41 amIt's only in German and Dutch (which borrowed it from German), AFAIK. It isn't used in other European languages.Quote from: Someone on August 29, 2024, 07:55:41 amSure, but both of these examples are just invented names (not words!) for things. The title of the LaTeX package was created by nonnative speakers who simply didn't know that we don't use that word in English for a video projector.As for the software, again it's a title, not a word that's been adopted into the language. And I'm not convinced it's actually related to the German/Dutch "Beamer" (video projector), but rather a "cutesy" novel invented title based on the idea that it "beams" the video to a particular output device.

author: brucehoult
author_rank: Super Contributor
timestamp: August 29, 2024, 11:47:48 am
content: Quote from: tooki on August 29, 2024, 11:31:14 amSoftorino was founded in Ukraine (though they have a Delaware address now) and almost all the staff have Ukrainian names. Many Ukrainians study German, and of course many go there, so I would not be at all surprised if they picked up the German usage. The software is essentially a projector from your Mac to a large screen.

author: ftg
author_rank: Frequent Contributor
timestamp: August 29, 2024, 01:12:41 pm
content: Photodiode vs. Phototransistor also matters.The later is much slower than the former.Wurth mentions their phototransistors having microsecond scale switching speed and their photodiodes having nanosecond scale switching speeds.https://www.we-online.com/components/media/o164119v410%20BCF_IR-LED_Overview.pdfSo potentially using a phototransistor for detecting the rise and fall times might give artificially slow results.

author: tooki
author_rank: Super Contributor
timestamp: August 29, 2024, 07:18:44 pm
content: Indeed. At work, the research groups that use extremely fast laser pulses to measure... whatever it is they're measuring (I am not a chemist, it's magic to me) use photodiodes exclusively.

author: Someone
author_rank: Super Contributor
timestamp: August 29, 2024, 10:03:42 pm
content: Quote from: tooki on August 29, 2024, 11:31:14 amI used that as an example of the obscurity of the reference toblahsoftware, while showing beamer has other much better known English uses. USians need to get used to having to translate some foreign slang/shorthand rather than expecting the rest of the world to always adjust to theirs in a one direction relationship.

author: tooki
author_rank: Super Contributor
timestamp: August 31, 2024, 10:24:03 am
content: Quote from: Someone on August 29, 2024, 10:03:42 pmWhat’s that bigoted tirade all about?!?“Beamer” to mean “video projector” is unknown to native speakers ofalldialects of English, not just Americans.Your intent in posting the wiki link was not obvious in the slightest. (Heck, even your explanation of your intent is unclear.)