Hacking cars LEDs 12V 47R internal resistor to 100mA max current limit ... - Page 1
Forum section: electronics / projects

author: szan
author_rank: Regular Contributor
timestamp: October 07, 2022, 04:29:47 pm
content: Hello,I bought such 12V LEDs in automotive cars case and after quick teardown I've discovered inside this thing ... 47R Ohm resistorinstead of any kind of current limitNot too much place there since diameter of this thing is around 19mm, but it looks like maybe LM317 LZ (100mA max) based current limiter circuit in small TO-92 package with 15R Ohm resistor (it gives around 83mA output current) we were able fit there instead of this bloody single resistor to have more stable light output eg. when powered from 3 x Li-on 4.2Vmax in series ?Any other ideas ?!

author: Benta
author_rank: Super Contributor
timestamp: October 07, 2022, 05:17:26 pm
content: Did you calculate the power dissipation in the regulator? If not, please do.

author: szan
author_rank: Regular Contributor
timestamp: October 07, 2022, 07:15:22 pm
content: Quote from: Benta on October 07, 2022, 05:17:26 pmNope, because of I need to know forward voltage of those LEDs at ~100mA current and didn't connected oryginal circuit with 47R to 12V before its teardownI haven't got any specyfication of those yellow LEDs.Anyway, I've managed to design circuit with LM317 LZ 100mA max, but during the tests plan is to use bigger LM317T capable to output 1.5A max and start with lower input voltages around 6V (2 x Li-on 4.2Vmax) instead of 12VBTW, LM317 LZ in TO-92 package nice fits on top of this small round PCB with additional resistor and bypass diode

author: szan
author_rank: Regular Contributor
timestamp: October 07, 2022, 08:07:38 pm
content: Quote from: Benta on October 07, 2022, 05:17:26 pmLM317LZ datasheet says its power dissipation (PD) is internally limited and in electrical characteristics of LM317L in its electrical characteristics Io(max) when voltage difference Vi-Vo is between 3V-13V Io(max) minimum 100mA, typical 200mA, which looks good when I use 15R 5% resistor in worst case scenario I have: Io: 1.25V/(15R*(1-0.05))+100*10^(-6)mA= ~88mAUPDATE: When we take into account not typical Vref=1.3V instead of typical 1.25V we get ~91mA, so everything so far looks good (for me) - let me know if I missed somethingLets solder test circuitand seewhat happends

author: Benta
author_rank: Super Contributor
timestamp: October 07, 2022, 09:03:02 pm
content: The parameter you need to watch is the junction-ambient thermal resistance, which is 200 K/W for the LM317LZ. This means that for every W you dissipate in the part, junction temperature will rise 200 K above ambient.In a temperate climate, ambient would probably be 40 C maximum.Maximum junction temperature for the LM317LZ is 125 C.125 - 40 is 85 K.This means you can maximally dissipate 85 / 200 = 0.425 W in your regulator.In a warmer climate it will be even less, and if it's a car left in the sun it can easily be 80 C inside. So even worse.The "Internally limited" power dissipation just means that the regulator will shut down when it gets too hot = no LED light.I think the 47 ohm resistor is not such a bad idea after all...

author: szan
author_rank: Regular Contributor
timestamp: October 07, 2022, 09:42:05 pm
content: Quote from: Benta on October 07, 2022, 09:03:02 pmThank you very much for figure out those junction temperatures.However, when we assume 3Vf of those LEDs (I didn't tested it yet) than at 12Vcc we have current I: (12Vcc-3Vf)/47R = ~191mA, so power dissipation in this 47R resistor will be as high as 1.7W ... but as we can see there is small 6mmx2.5mm 0.25W 47 Ohm 5% resistor ?!It is very bad idea or maybe simply my 3Vf estimation is too low at ~200mA currents in those LEDsThat is why - when I saw this tiny 0.25W resistor inside this thing I decided to do not connect it to 12V battery at all

author: Benta
author_rank: Super Contributor
timestamp: October 07, 2022, 10:48:46 pm
content: I can well imagine that there's more than one LED chip in that thing (in series). Reconnect the 47 ohm resistor, wire it to 12 V and see what the voltage across resistor or the LED(s) is. Or use a 470 ohm resistor to be on the safe side. Easy.Right now you're fumbling in the dark.

author: DavidAlfa
author_rank: Super Contributor
timestamp: October 08, 2022, 12:16:43 am
content: Smelling a little overthinking here.A running car will work at a pretty much constant voltage, about 13.7-14.4V depending on the car, so a resistor will do a similar job being way more cheaper.The lamp probably has 3 leds in series, each Led Vf=3.3V, total Vf=10VFor Vbat=13.7V, (13.7-10)/47 = 79mAFor Vbat=14.4V, (14.4-10)/47 = 92mA.Anyways those values look too high for that little resistor, with a power disipation of 0.3-0.4W.Nevermind! Chinese overpowered electronics. For sure that little 0.15W resistor is working at 200% of its nominal power.Not such great variation to justify adding a regulator, caps, and making the bulb to cost twice.Also the resistor will tolerate much better high temperatures or voltage spikes, a regulator would make the bulb more prone to fail.If you truly want to make it nice, remove teh resistor and add a constant buck current regulator instead a linear reg, will be a lot more efficient.

author: szan
author_rank: Regular Contributor
timestamp: October 08, 2022, 01:38:04 am
content: Quote from: DavidAlfa on October 08, 2022, 12:16:43 amI've already finished soldering prototype PCB with LM317LZ for current limit ~83mA and resistor ~15R made of two (22R||47R) 0.25W in parallel (1/22R+1/47R = 1/14.99)Power dissipation in this 15R @ 83mA resistor 2x0.25W will be around 0.1WI have also bypass diode 1N4007 between LM317 output and input just in case, as well as I've protected its input by second 1N4007

author: szan
author_rank: Regular Contributor
timestamp: October 09, 2022, 12:10:13 am
content: Quote from: Benta on October 07, 2022, 10:48:46 pmLooks like there are 12 light sources in hexagonal pattern.I've added also 470R resistor as current limit to prototype PCB, but no time today to play with this circuit and make experiments ...

author: Terry Bites
author_rank: Super Contributor
timestamp: October 09, 2022, 11:56:56 am
content: If you have one or can borrow one use a bench PSU. Put you power supply in cc mode. set to the current you need.The psu voltmeter shows Vf.Then you can calculate how much power will be sweated off by the LM317. Assume the LED will fail short at some time.You can do better with a PWM current source- save this planet!

author: szan
author_rank: Regular Contributor
timestamp: October 09, 2022, 12:08:39 pm
content: Quote from: DavidAlfa on October 08, 2022, 12:16:43 amI've connected those LEDs to 12.3Vcc (3s Li-on battery pack fully charged to 4.1V each) and with 470R current limiting resistor we have7.77Vf@10mA, while voltage drop on resistor in series was 4.52VrProbably Vf for those LEDs will be higher at bigger currents ~100mA, while when we calculate now for 14V running car voltage with its oryginal design 47R:(14.0V-7.77Vf)/47R ~132mALooks like it is around ~1W power LEDs (no electric markings on this aka light bulb metal case)However, power losses in 47R resistor are around 827mW but they put inside this thing something which looks like 0.25W resistor (maybe it could be 0.5W 6mmx2.5mm size)

author: strawberry
author_rank: Super Contributor
timestamp: October 09, 2022, 03:09:07 pm
content: carbon resistors fail when stressedLED 2S 6P ~20mA per diode (I bet its more like 10mA LEDs)

author: szan
author_rank: Regular Contributor
timestamp: October 09, 2022, 10:11:36 pm
content: Quote from: strawberry on October 09, 2022, 03:09:07 pmIt may also be a deliberate limitation of the lifetime of this LED lamp by the manufacturer(it was quite cheap one) through the accelerated destruction of this resistor and, as a result, possibly also LEDs - car users are used to the fact that the light bulbs burn outI've connected those LEDs now again to 12.3Vcc battery, but by using 100R 0.25W resistor and we have slightly higher 8.13Vf@41mA on those LEDs while 4.1Vr voltage drop over this resistorHowever, no supprise because of when I've estimated before this test LEDs current for custom battery 3s Li-on 4.2Vmax charged up to 3.9V to extend lifespan of its cells, we get nice LEDs cuttoff even when voltage on single battery cell will drop to 2.6V:(3*2.6-7.77)/100=0.1mAwhile when fully charged:(3*3.9-8)/100=0.036A~40mAWhen used in a car where I have around 14V when running:(14.0-8)/100= 60mAso estimated power dissipation in 100R resistor will be: 0.06^2*100~0.4Wwhich looks much better then oryginal design.LEDs will output then around: 8*0.060~0.5Wwhich is not so bad, while even at 40mA light is very bright from this thingNOTE: While we know expected forvard voltage of those LEDs there is poblem in using LM317, since as I know it need input voltage +4.25V higher than regulated output, so it doesn't look good now even in the case of 12Vcc battery (especially my custom 3*3.9Vmax=11.7Vmax) , while maybe it could be fine in a running car at 14Vcc:14Vcc-8V=6V

author: Benta
author_rank: Super Contributor
timestamp: October 09, 2022, 10:31:13 pm
content: Quote from: szan on October 09, 2022, 10:11:36 pmYes... every 5...8 years in my experience.It's still totally unclear what you're trying to achieve here.

author: szan
author_rank: Regular Contributor
timestamp: October 10, 2022, 09:48:52 am
content: Quote from: Benta on October 09, 2022, 10:31:13 pmMake things like those LED lamps usable and lasting longer while looks like manufacturer shortened its lifespanDo not turn on - take it apart !Hopefully, by adding 100R resitor to existing 47R one in series we can make this thing usable and lasting much longer by limiting current to a range 41mA-31mA at very low cost (+100R):(14Vcar-8Vf)/(100R+47R)= 0.0408 ~41mA0.04081632^2*147R= 0.245W ~0.25W(12.6Vcar -8)/147 ~31mA ~0.14WIn my design based on LM317 I've decided also use lower current limit around ~60mA simply by changing 15R to 22R:1.25/0.060=20.83R ~22R1.25/22=0.0568 ~57mA ~60mA

author: tooki
author_rank: Super Contributor
timestamp: October 10, 2022, 02:19:48 pm
content: Quote from: szan on October 09, 2022, 12:08:39 pmTotal fool’s errand, it seems to me.The 12 LEDs in the module are likely wired either as four parallel sets of 3 LEDs in series, or as 3 parallel sets of 4 LEDs in series. Given your 10mA test, I’m guessing it’s the first one. That means each LED was being run at 2.5mA, hence the very low Vf.Why are you even worried? What is it you think is being overstressed by the 47R resistor? Your calculations are all wrong since you can’t use the Vf at 10mA to calculate the voltage drop at 100mA. As current rises, Vf across the LEDs rises, and consequently the voltage dropped across the resistor drops.And since it’s multiple LED strings in parallel, it means each LED isn’t getting much current.If we assume 3.3V per LED (a much more reasonable value), 3 in series, then the resistor would dissipate 85mW at 12V or 340mW at 14V. Nowhere near the 827mW fantasy value you came up with.

author: szan
author_rank: Regular Contributor
timestamp: October 10, 2022, 10:39:50 pm
content: Quote from: tooki on October 10, 2022, 02:19:48 pmMaybe you missed one of my tests when I've connected those LEDS to 12.3Vcc battery with 100R resistor in series ?!We now know that we have voltage drop8.13Vf@41mASo, as we can see between 10mA and 41mA LEDs current there is only:8.13Vf-7.77Vf=0.36V ~0.4V differenceWhen we assume 9Vf@100mA then... we get:(14Vcar-9Vf)/47=106mA which gives ~0.5W power dissipation in a very small resistor 6mmx2.5mm which looks like 0.25WShow me better estimation of LEDs Vf since I wouldn't like to connect those LEDS via oryginal 47R current limiting resistor to runing car battery which is around ~14V in my car ?

author: tooki
author_rank: Super Contributor
timestamp: October 11, 2022, 09:07:46 am
content: So you’re still basing your entire argument on assumptions, and don’t actually know the behavior of the LEDs as delivered. You haven’t explained how you even came to believe that 47 ohms is too low a value.If you connect the LEDs to 12V and 14V via the 47 ohms, you can then measure the actual voltage drop and current. It’s not going to instantly fry anything, and it’s frankly not likely to fry anything in the long run.I saw the 8.13Vf test, but that’s not what you used for your calculations…The ~0.4V difference in Vf between 10 and 40mA doesn’t tell you much because the relationship is not linear. So you can’t use that to predict with any certainty what Vf will be at 100mA.

author: pcprogrammer
author_rank: Super Contributor
timestamp: October 11, 2022, 09:20:58 am
content: Quote from: tooki on October 10, 2022, 02:19:48 pmYour reasoning feels wrong to me. The resistor has linear behavior in voltage versus current, so at 10mA the voltage across the 47 Ohm resistor is 0.47V, and at 100mA it is 4.7V. So the voltage across the resistor will not drop when the current rises.You are right about the LED forward voltage not being linear, and will not go up very much at the higher current. For this you need the specifications of the LED's. But when assumed to be 3.3V with 3 in series it is 9.9V, leaving 4.1V for the resistor when the supply voltage is 14V. This means a current of ~87mA and ~0.35W dissipated in the resistor.

author: szan
author_rank: Regular Contributor
timestamp: October 11, 2022, 10:15:58 am
content: Quote from: pcprogrammer on October 11, 2022, 09:20:58 amIt is bad to assume 9.9Vf since this forward voltage depends on current.So far I made some measurements of Vf of those LEDs in experiments with current limited to ~10mA, ~40mA but I will make also experiment with ~100mA, as well as for a short time I can use also oryginal 47R and we'll see what we get.Using data from those experiments than I can make non linear approximation eg. by assuming:Vf(I)~ a*(I)^b , so we should be able better predict this forward voltage of those LEDs at higher current

author: pcprogrammer
author_rank: Super Contributor
timestamp: October 11, 2022, 10:35:45 am
content: Take a look at this sitehttp://lednique.com/current-voltage-relationships/iv-curves/You might find it helpful.And to make an example calculation it is not a crime to assume something. It was to show that the voltage across the resistor does not drop when the current increases. The whole relation between the current, the LED forward voltage and the resistor is that it will reach a balance based on input voltage.

author: Zero999
author_rank: Super Contributor
timestamp: October 11, 2022, 04:42:55 pm
content: Regardless of whether a resistor or linear regulator is used, the power has to be dissipated as heat.If it's overheating, use a higher power resistor, or a higher value, to reduce the current.If you want to use a linear regulator, it will need to dissipate the same amount of power, as a resistor for a given current and voltage drop. The TO-92 LM317L won't be able to dissipate ate 0.6W, at high temperatures, without overheating and going into thermal shutdown.Use the LM337 in the SOT-223 package, with the tab soldered to the lightbulb's metal can, which can act as a heat sink. The circuit is similar to the LM317, but input is negative and output positive. The reason I'm suggesting the negative voltage regulator is because the tab is negative, so it can be soldered to the can.https://www.ti.com/lit/ds/snvs778e/snvs778e.pdfAnother option is a switched mode power supply, such as the PAM2861, AL8862, NCL30160 etc..https://www.diodes.com/assets/Datasheets/PAM2861.pdfhttps://www.mouser.co.uk/datasheet/2/115/AL8862-1274720.pdfhttps://www.onsemi.com/download/data-sheet/pdf/ncl30160-d.pdf

author: szan
author_rank: Regular Contributor
timestamp: October 11, 2022, 10:55:59 pm
content: Quote from: Zero999 on October 11, 2022, 04:42:55 pmIn the case of LM317L I've changed current limiting resistor from 15R to 22R, so now we have:1.25V/22R~57mAcurrent limit, so power dissipated in this resistor (0.25W) will be:0.057^2*22~0.1WWhen those LEDs bulbs will be used in a car then:(14Vcar-9Vf)~5V difference which is good for LM317L since it needs +4.25V higher input voltage than regulated output as I know from its datasheetIn this case we have 5Vdiff@57mA difference in LM317L regulator, so estimation of dissipated power in this thing probably will look like this:5Vdiff*0.057A~0.28WI looks good, especially when we'll take into account such thing like those LEDs bulbs has metal back cover 14mm in diameter x cylinder 16mm high, so there is quite big heatsink for those LEDs car bulbs 9Vf*0.057A~0.5W

author: tooki
author_rank: Super Contributor
timestamp: October 12, 2022, 04:48:20 pm
content: Quote from: pcprogrammer on October 11, 2022, 09:20:58 amThe voltage drop across the resistor is, by definition, theresidualvoltage after the LED’s voltage drop. The current of the LED + resistor system finds an equilibrium. LED Vf rises —> resistor voltage drops —> current drops —> LED Vf drops —> resistor voltage rises —> current rises —> LED Vf rises. (Additionally the LED’s temperature also comes into play but let’s ignore that for today.)Suppose an LED that has a Vf of 2.7V at 1mA and 3.2V at 30mA, and a supply voltage of 5V.1. At 1mA, the resistor needs to drop 2.3V. (P = 2.3mW)2. At 30mA, the resistor needs to drop 1.8V. (P = 54mW)Using the voltage at one current as the basis for calculating the voltage at a totally different current is, thus, nonsense.Anyhow, the OP first got alarmed because they assumed a single LED Vf, such that a little 1/2W resistor would have to drop 9V, causing dissipation of nearly 2W. But since discovering that it’s multiple LEDs in series, they still are freaking out at the 47R value, when in fact it might be perfectly reasonable.This whole thread is about finding a new resistor value (or equivalent regulator). So what I was trying to say is this: as you select a value to increase (or decrease) the current, the LED’s Vf will increase (decrease) and the residual voltage the resistor must drop will decrease (increase). So when OP inserted a larger resistor value, this necessarily means the resistor will have to drop a larger voltage than the original one would.

author: pcprogrammer
author_rank: Super Contributor
timestamp: October 12, 2022, 06:06:12 pm
content: Quote from: tooki on October 12, 2022, 04:48:20 pmQuote from: pcprogrammer on October 11, 2022, 10:35:45 amWhich is what you and I understand, but the OP seems to fight this somehow, seemingly being obsessed with the led forward voltage being very variable over current.When I use a led and need to calculate a suited series resistor I just take the typical forward voltage from the spec and subtract it from the supply voltage. Then I take the typical forward current and calculate the resistor value. Match it to the nearest E12 or E24 range and use that resistor with the needed wattage of course. When it is to bright I just increase the resistor value, or when it is to dim I decrease it.When I have an unknown led I use my adjustable power supply with current limiting and directly connect the led to it and look for the forward voltage over current that way.

author: DavidAlfa
author_rank: Super Contributor
timestamp: October 12, 2022, 10:40:32 pm
content: When he finally plugs in that HiFi-UltraHD-4K-Nuclear-powered LED:

author: szan
author_rank: Regular Contributor
timestamp: October 12, 2022, 10:52:34 pm
content: Quote from: tooki on October 12, 2022, 04:48:20 pmNope, I can put many different circuits inside this quite big LEDs cover bottom (heatsing) case cylinder 14mm in diameter and 16mm high, including easy NPN transistor based current limit, but in more sophisticated scenario even small tiny MPU like ATTiny eg. to detect whether internal circuit is powered by car battery or higher voltage (~14Valternator) when engine starts and I can turn this thing on automatically as day light car lightsI have another LEDs based car replacement light bulbs (up to 5W) in similar case and as I noticed there is also bloody standalone resistor, so that is why my guess was than inside those LEDs mentioned in this thread in automotive case might be ONLY resistor to limit current, so that i swhy I wanted to make its teardown before using in a car

author: szan
author_rank: Regular Contributor
timestamp: October 12, 2022, 10:58:56 pm
content: Quote from: DavidAlfa on October 12, 2022, 10:40:32 pmI have much more comfortable seat in my room with 3m in diagonal projector output screen on white painted wall, since It is custom made based on F-16 fighter jets seats geometry

author: szan
author_rank: Regular Contributor
timestamp: October 13, 2022, 12:25:24 am
content: Quote from: pcprogrammer on October 12, 2022, 06:06:12 pmI do not have to use any adjustable power supply since... I have adjustable current limit based on LM317LNow I've connected those LEDs to 12.25Vcc battery (under load) via such LM317L based current limit with 22R and... and additional 1R(1%) resistor in series, and I've got exactly what we can expect:1.25V/22R=0.05681A~57mA based on LM317 datasheet and real mesurements gave us8.24Vf@57mAcurrentThis means that in this case we have:12.25Vbat-8.24Vf-1R*0.057A=3.95Vreg~4Vregvoltage drop on LM317L which gives us total power losses in regulator with added 22R resistor:4Vreg*57mA=0.228W~0.23WNOTE: I have also connected those LEDs to 12.28Vbat with 147R+1R(1%) current sensing resistor and we had:8.01Vf@29mAin this case

author: szan
author_rank: Regular Contributor
timestamp: October 13, 2022, 01:22:32 am
content: Quote from: pcprogrammer on October 12, 2022, 06:06:12 pmI have NO spec for those LEDs, but I've made a plot of a few measured Vf(I) and now we can see that we can expect at 100mA current LEDs forward voltage around ~8.6VfNow, when we connect those LEDs to 12.3Vbat I have with 47R we can expect ~8.4Vf@83mA since:(12.3Vbat-8.4Vf)/47R=0.0829~83mAwhich leads to expected power loses in this 47R resistor:0.083^2*47=0.3237~0.32Wwhile LEDs power ~0.7WHowever, when we connect to running car 14Vbat by using this plot Vf(I) we can expect something like 113mA LEDs current (total in -> out regardless how those small 12 LEDs are internally connected):(14Vcar-8.7Vf)/47R=0.1128~113mAso we have power dissipation in 47R:0.113^2*47R ~0.6W (teardown shows very small resistor which looks like 0.25W )as well as LEDs power:8.7Vf*0.113A=0.9831W ~1W

author: tooki
author_rank: Super Contributor
timestamp: October 13, 2022, 06:40:39 am
content: Quote from: szan on October 12, 2022, 10:52:34 pmSoooo… a regulator. (A regulator can be a circuit, doesn’t have to be an IC.)Quote from: szan on October 13, 2022, 01:22:32 amBut why are you insisting on such a low operating Vf for the LEDs? 8.4V Vf has to be 3 LEDs in series (since 2 in series would be 4.2V per LED, which is far too high for any visible-light LED, and 4 in series would be 2.1V per LED, which is not enough for a white LED to light). So 3 in series means 2.8V per LED, which is very much on the low side. They’re normally designed to be operated at around 3.2V, leaving less voltage to drop in the resistor.

author: szan
author_rank: Regular Contributor
timestamp: October 13, 2022, 11:57:57 pm
content: Quote from: tooki on October 13, 2022, 06:40:39 amYep, but sometimes it could be difficult to make a circuit with thermal protections capabilities similar to LM317 in current limit mode in such small package it offers.Now, only just thinking, that maybe we could add additional inductor, capacitor and fast shotky diode and treat those LEDs as load, where at the bottom LM317L could work as current limit/analog switch and make something like analog step down current limit from voltages lets say 24V (6x Li-on charged to 3.9Vmax ~24Vin) since I've such battery made of 6 spot welded Li-on's 18650 in seriesIdea behind it is that, LM317 response will be very fast in current limit mode, so maybe such kind of analog switching power supply with constant current could work

author: szan
author_rank: Regular Contributor
timestamp: October 15, 2022, 08:47:30 pm
content: Quote from: DavidAlfa on October 08, 2022, 12:16:43 amSince I'd like to power those LEDs not only in a car, but also use them as daylight front lights in a bike (3x 18650 Li-on cells charged max to 3.9Vmax and minimum 3Vmin each 9Vmin-11.7Vmax ), so it looks like that such simple current limit circuit based on 2x NPN transistors and 2 resistors should do the job, since not too much room for LM317L load regulation (Vin-Vout) when those LEDs will be powered by 9Vmin battery

author: Benta
author_rank: Super Contributor
timestamp: October 15, 2022, 10:20:24 pm
content: That works fine, done that often myself. You do need a third resistor, though, and there's no need for such a high base current.You can place more LEDs in series as long as you keep the driver stage voltage drop higher than 3 V.I attach the schematic I normally use plus the SPICE simulation.

author: szan
author_rank: Regular Contributor
timestamp: October 15, 2022, 11:02:37 pm
content: Quote from: Benta on October 15, 2022, 10:20:24 pmYep, I know that such a high base current not needed since BC547 NPN transistor has hFE minimum 100 and maximum Ib current around 5mAHowever, how do you estimate current limit in the case when third resistor is used in bottom transtor in my case and why do we need it ?

author: Benta
author_rank: Super Contributor
timestamp: October 15, 2022, 11:21:20 pm
content: Quote from: szan on October 15, 2022, 11:02:37 pmThe third resistor does not influence the current through the LED at all. It's there for a completely different reason.Emitter-followers (which this is) are not as harmless and friendly as most think. They will oscillate at several MHz or 10s of MHz in some cases. There are several reasons for this, search for "emitter follower oscillation" yourself.The safe way of killing this behaviour is the base resistor.I've not experienced it with BC847/857 yet, but the high-gain BC849/859 types are prone to it, and if you use a Darlington as the driver it will certainly happen. Try it out yourself in a simulator.

author: szan
author_rank: Regular Contributor
timestamp: October 16, 2022, 11:57:16 am
content: Quote from: Benta on October 15, 2022, 11:21:20 pmI haven't got BC547 for the moment, but I have BC517 NPN darlington which has hFE~30000, so I've decided to use it as standalone driver in slightly different current limit circuit with two diodes in series and in quick simply simulations it looks very good, but I didn't used more sophisticated circuit simulators, so it will be easier solder real circuit and see how it works at different battery voltages starting from 9Vmin to around 14Vmax

author: DavidAlfa
author_rank: Super Contributor
timestamp: October 16, 2022, 02:59:28 pm
content: Why don't use the buck comverters? Will be much more efficient.You can mod these cheap converters from Aliexpress, the circuit is designed for constant voltage but I think they can be easily modded for constant current.As the voltage reference is low, the power drop in the resistor is pretty decent below 500mA.https://www.aliexpress.com/item/1005001579319655.html

author: Benta
author_rank: Super Contributor
timestamp: October 16, 2022, 04:43:12 pm
content: Quote from: szan on October 16, 2022, 11:57:16 amI find that hard to believe. For a basic Darlington stage you'll need three (0.7 V) diodes. Also, at the very low currents you're operating at, diode forward voltage will be around 0.4 V, no more.It won't work, sorry.

author: szan
author_rank: Regular Contributor
timestamp: October 16, 2022, 08:33:15 pm
content: Quote from: DavidAlfa on October 16, 2022, 02:59:28 pmMaybe step up converter will be used to keep battery input voltage at given constant level to minimalize power loses in LEDs driver, so I'd like to keep it simple and have analog linear output without any capacitors in LEDs driver final stages.Quote from: Benta on October 16, 2022, 04:43:12 pmWe'll seeI'm going to use 2x 1N4148 .Nice thing about using diodes is that when temperature rises than its forward voltage goes down, so it will work as automatic additional current limit when more heat will be dissipated in a such thermally coupled circuit, because of idea is keep it very small without any capacitors which could fail at higher temperaturesI will use 2x 22R resistors in parallel -> 11R, since in final design, I'd like to add a switch to have adjustable (two states low/high) current limit just by pressing on/off a buttons connected to this driver, so in this case one of 22R resistors will be disconnected, so default current limit will be around ~25mA, but when additional 22R resistor will be connected by push button in parallel, then we'll have 1/22R+1/22R=1/11R -> 11R resistance and probably around ~50mA at nominal 11.7Vbat (3x 18650 Li-on charged to 3.9V each)

author: Zero999
author_rank: Super Contributor
timestamp: October 16, 2022, 09:45:33 pm
content: Quote from: szan on October 16, 2022, 08:33:15 pmHe's right. The current regulation will be crappy. The total forward voltage drop of the diodes is too close to the base-emitter voltage of the transistor. Try sweeping the voltage and note how widely the current varies. It's not much better than a resistor.None of these circuits are temperature compensated. The current will drop slightly at higher temperatures, because the diode junctions have a negative temperature coefficient.

author: Benta
author_rank: Super Contributor
timestamp: October 16, 2022, 09:54:32 pm
content: Quote from: Zero999 on October 16, 2022, 09:45:33 pmWhich current regulation? The BC517 won't even in the teeniest way be influenced by the 1N4148s. It'll just do... something. Or more likely: nothing.

author: szan
author_rank: Regular Contributor
timestamp: October 17, 2022, 12:05:28 am
content: Quote from: Zero999 on October 16, 2022, 09:45:33 pmI didn't say that this circuit it is temperature compensated, but only mentioned those diode junctions effects at higher temperatures.However, I have quite bulky copper heatsink to hide inside those LEDsFinal count down before testsNOTE: BC517 darlington can be easy changed to another NPN transitor, so no problem what so ever

author: Zero999
author_rank: Super Contributor
timestamp: October 17, 2022, 05:16:22 pm
content: Quote from: Benta on October 16, 2022, 09:54:32 pmIt ought to pass some current. A small Darlington pair, such as the BC517 will have a total base-emitter voltage roughly equal to two 1N4148 diode drops. It will act like a crude current mirror, with the transistor passing roughly the same current as the diodes.

author: Benta
author_rank: Super Contributor
timestamp: October 17, 2022, 06:55:07 pm
content: Quote from: Zero999 on October 17, 2022, 05:16:22 pmI doubt it. 1N4148 has a VF of around 0.4...0.45 V at these currents. The BC517 base is practically shorted to ground.But let's see what impressive results the OP returns with.

author: szan
author_rank: Regular Contributor
timestamp: October 17, 2022, 09:33:37 pm
content: Quote from: Zero999 on October 17, 2022, 05:16:22 pmYep, I forgot about this and BC517 datasheet shows ~1.4VBEQuote from: Benta on October 17, 2022, 06:55:07 pmNope, in my simple simulation we have in NPN transistor BE currents 773uA, so it is ~1mA range and in this case 1N4148 datasheet by Vishay says 0.6Vf which is fine when we use two such diodes in series with 11R current sensing resistoir we get by using regular NPN transistor which has ~0.7Vbe:770.0*uA~0.77mA~1mA(0.6Vf*2-0.7Vf)~0.5Vf / 11R ~45mA current limited by 11R sensing resistorAnyway, by adding third 1N4148 diode in series it looks like this circuit should limit current to around ~40mA with NPN darlington ~1.4Vfd instead of ~0.7Vf in the case of regular NPN transitsor.So, I'm going to add additional 1N4148 diode (3rd) in the case of PC817 darlington, while when we use BC547 it should be fine to have only two 1N4148 diodes in series

author: szan
author_rank: Regular Contributor
timestamp: October 19, 2022, 10:30:00 pm
content: Quote from: Benta on October 17, 2022, 06:55:07 pmBrand new VARTA 610A 12V9 ready for testingWe have also BC547C NPN transistors, so no need to play with BC517 NPN darlington VBE 1.4VfHowever, it looks like that idea of using LM317L in current limiting mode with 2x47R in parallel, should give nice ~53mAmax currents, while we'll still be able to output ~27mAmin, when we disconnect one of 47R resistors:LM317 1.25Vref/47R ~27mA

author: szan
author_rank: Regular Contributor
timestamp: October 22, 2022, 12:34:15 am
content: Quote from: DavidAlfa on October 16, 2022, 02:59:28 pmAs simply as this circuit belowCustom PCB allows me easy add switch to increase two times LEDs current from 25mA to around 50mA when button connects to ground second 22RI've successfully tested those LEDs by using current limiter based on 2x BC547C NPN transistors (hFE>400) and 10k main base resistor with 2x 22R current sensing resistors, where on test PCB I have connector to switch, so without second 22R resistor we have 7.94Vf@23mA, while when switch connects second R22 to ground there is around 8.21Vf@51mA when powered from 12.3Vbat

author: Zero999
author_rank: Super Contributor
timestamp: October 22, 2022, 09:11:47 am
content: Quote from: szan on October 22, 2022, 12:34:15 amUse an IC. I's much simpler. The PAM2861 is a switched mode LED regulator IC. It only requires four additional components, other than the LEDs and is over 90% efficient.

author: szan
author_rank: Regular Contributor
timestamp: October 22, 2022, 11:17:09 am
content: Quote from: Zero999 on October 22, 2022, 09:11:47 amLooks good, but efficiency is not a problem, since 1W-2W can be easy recharged with car alternator or bike electric motor generator during breakingMaybe, I could be more interested in step-up/step-down IC capable to provide given voltage, but I'd like to keep analog output stage while driving LEDs by using LM317 or shown simply two BC547C transistors current limit which is fine, since I can easy add 3 current sensing resistors eg. 22R 47R 47R and just by adding two more BC547C transistors in series with last two resistors 47R's and tiny MPU ( Attiny ) drive them to have nice analog LEDs output at currents around 27mA/40mA/54mA simply by set/clear two MPU pins output without need to study PAM2821 datasheetKeep things simple

author: Zero999
author_rank: Super Contributor
timestamp: October 22, 2022, 12:56:08 pm
content: Quote from: szan on October 22, 2022, 11:17:09 amThe advantage with high efficiency is it heats up less. The LEDs will probably last longer if they're not being cooked by a warm linear regulator underneath them.

author: Benta
author_rank: Super Contributor
timestamp: October 22, 2022, 07:10:09 pm
content: Quote from: szan on October 22, 2022, 12:34:15 amThe second 100 ohm resistor is unnecessary. And your 8.3 V VF is unrealistic. The circuit will only start regulating correctly at around 1.8...2.0 V drop. See my earlier post with simulation.

author: szan
author_rank: Regular Contributor
timestamp: October 22, 2022, 09:01:16 pm
content: Quote from: Benta on October 22, 2022, 07:10:09 pmNOPE, I have real circuit with real electrons and when powered from 12.3Vbat LEDs had ~8.2Vf@50mA, so very close to shown value in my simulationNow, I've added 3rd BC547C transistor to drive second 22R from MPU (Attiny85) powered by... 3.05Vcc made of... yes.... 3V9 Zener diode (BZX85C3V9) and ~1.5k resistors (1k+470) protected by 1N4148 diodeSo far so good, MPU pin 3V drives via 10k resistor BC547C resistor R22 to ground at voltage level ~0.13Vt, so in real circuit now when driven from MPU pins, now I have LEDs current:0.61Vr/22R ~0.028mA0.48Vr/22R ~0.022mA (~0.13Vt ground transistor)so total LEDs limited current is... 50mA and this is not a simulation but real circuit shown belowNow it is time to write some MPU code running at 8MHz since it is powered from ~3Vcc

author: Benta
author_rank: Super Contributor
timestamp: October 22, 2022, 10:02:44 pm
content: Quote from: szan on October 22, 2022, 09:01:16 pmPlease read again.You show a supply voltage of 9 V.I'm sure the circuit works at 12 V and 8.3 V LED drop. But that's not what's in your schematic, sorry. Perhaps a bit of proof-reading before posting? Just an idea.

author: szan
author_rank: Regular Contributor
timestamp: October 22, 2022, 11:40:23 pm
content: Quote from: Benta on October 22, 2022, 10:02:44 pmNo need to draw schematics for 9V/12V/14V since it works while LEDs forward voltage can be estimated with this MAXIMA formula based on real tests:Vf(i):= 7.7 +(8.13-7.7)/(41-10)*(i-10);Vf(10) ~7.70VfVf(41) ~8.13VfVf(30) ~7.98VfVf(50) ~8.25VfI've already connected it to 9Vbat and it works, however at this point 3x 18650 Li-on batteries in series will have around 3V each, so are already discharged and it is fine and expected that this limited current will drop probably to around ~30mA, but still those LEDs are usable as daylight position lights etc.(9Vbat-7.98Vf-0.7Vt)/11R ~30mAI will make more experiments later when MPU software is ready, since I'd like to blink them in random pattern between lower/higher limited currents just by connecting to ground/disconnecting second 22R resistor using MPU and pseudo random numbers generator XORed with real randomness from ADC readings, so that is why I used very unstable zener diode based ~3Vcc MPU power supply

author: szan
author_rank: Regular Contributor
timestamp: October 24, 2022, 03:41:58 pm
content: Quote from: Zero999 on October 22, 2022, 12:56:08 pmNow those LEDs will for sure last longer, since its current is limited to ~25mA and ~50mA maxMPU (Attiny85) 1MHz@3Vcc does the job and now times of notmal and higher brightness are chosen randomlyhttps://player.vimeo.com/video/763425837I need to add even more randomness, since I'd like to have two such front lights and avoid the situation that they blink in the same (random fashion) since for the moment simple pseudo random byte generator is used.Idea is write the same program code to those MPUs, but XOR it from time to time with shifted bits obtained from ADC system voltage (~3Vcc) measurements thanks to 3V9 Zener diode avalanche noise used as power supply ~3Vcc with MPU BOD 2.7V to ensure reset in the case Vcc voltage drops too low

author: szan
author_rank: Regular Contributor
timestamp: October 24, 2022, 08:50:25 pm
content: Quote from: Zero999 on October 11, 2022, 04:42:55 pmI've used linear regulator since without any capacitors we have nice smooth light strong enougth that it easy affects at night green lights powered from mains and turns them off when flash of higher current comes from those LEDsI've increased MPU speed to 4MHz@3.2Vcc and implemented in Attiny85 MPU true randomness source based on ADC bits from measurements of MPU Vcc by setting it as reference voltage for ADC while converting internal 1.1Vref to ADL and something like noise byte is updated each time ADC completes conversion, than this byte is XOR'ed with pseudorandom bytes obtained from software generator, so now there is no chance that when we make a few PCBs and install there MPUs with the same code, front lights will blink in similar (pseudorandom ) patternI could also use internal Attiny85 temperature sensor (ADC4) since those readings are device dependent and uncalibrated readings vary many *C between devices, but Vcc measurements by using MPUs internal 1.1Vrefs are good too, since 1.1V is rarely the correct value. The value is between 1.0 and 1.2. It is specific to each processor.https://player.vimeo.com/video/763535003

author: szan
author_rank: Regular Contributor
timestamp: October 25, 2022, 02:47:13 am
content: Quote from: tooki on October 12, 2022, 04:48:20 pmThe idea was not to use simple regulator equivalent to a new resistor value, but create circuit which will output adjustable unpredictable light and it looks like that idea of using avalanche diode in MPU section is not so bad to provide true randomness to LEDs driverRobust, low-cost, auditable random number generation for embedded system securityhttps://eprint.iacr.org/2016/884.pdf"Under avalanche breakdown conditions, these diodes exhibitrandom behavior called avalanche noise....The resulting avalanche current is probabilistic dueto the randomness of electron collisions; the variability ofavalanche current is avalanche noise."Lets add second zener diode, connect it to another MPU ADC input pin and change software to take bits from ADC conversion on this pin, while keep noisy Vcc as ADC voltage reference, so instead of reading 1.1Vref now lets read noisy ADC pin, by using noisy VCC as referenceOf course, in this design we do not need strong cryptographic properties of those bits and huge bit rates, however it is interesting source of true randomness based on electrons collisions.

author: szan
author_rank: Regular Contributor
timestamp: October 25, 2022, 06:11:50 pm
content: Quote from: DavidAlfa on October 08, 2022, 12:16:43 amResistor will not be able to detect battery voltage and turn those LEDs ON automatically when a car is running and battery voltage goes up to something around above 13.5V, while integrated MPU can do this easy, since I have more than 8MHz capable Attiny85 MPU also available in automotive version as I knowFor the moment I'm running this Attiny85 at speed ~4MHz@3.2V.I've added avalanche random bits sourcing code to this MPU by connecting circuit shown below to one of its ADC inputs and added post processing of read ADC bits and now software PRNG bytes are XOR'ed with TRNG bytes to output unpredictable bursts of higher current pulsesNOTE: This video was recorded at 30fps and thanks to linear analog LEDs regulator those quick light flashes looks nice - no PWM disturbances since it is not bloody cheap switching LEDs driverearth_hit_by_probikeleds_arng_pulses.mp4https://files.fm/f/7daf99eqyIt will be fun to write some test code and output those electron based avalanche bits to computer for its randomness analysis by using NIST Test Suite Random Bit Generation RBGhttps://csrc.nist.gov/projects/random-bit-generation/documentation-and-software

author: tooki
author_rank: Super Contributor
timestamp: October 26, 2022, 03:32:20 pm
content: Quote from: szan on October 25, 2022, 02:47:13 amWhich you didn’t mention until long into the thread. And you never did the basic investigation of seeing how much current the LED bulb actually drew with its original resistor.

author: szan
author_rank: Regular Contributor
timestamp: October 26, 2022, 08:57:33 pm
content: Quote from: tooki on October 26, 2022, 03:32:20 pmWhen I smellI follow the rule - DO NOT turn on ... take it apartCustomized LEDs with maxium 50mA current limit performs as expected