author

caisson

Inbox View Profile
4Comments

Tell us about yourself!

  • Simple Led Driver/Constant-current Source 20 MA

    A tutorial on this current source driver for LED (2018 09 14)--------------------------------------------------------------------------------I'll try to invoke as little math as possible. More math will be separately appended at the end for details. Some assumptions are made. They have very minor influence. They, however, make explanation clearer, much easier to understand.[IMO, Vd, the diode Voltage, at 0.68V, is a better fit.But I'll use the Vd=0.78V here. To set to desired LED current,R2 needs to be trimmed anyway.]..........................Let Power supply be Vc (5V-15V, 10V is nominal), Diode Voltage be Vd, diode current of D3,D4 be Id,Voltage across R2 be Vr, current of R2 be Ir. We assume Q1 collector current=emitter current=Ir=ILED,all diode Voltages are about the same = 0.78V, ...

    see more »

    A tutorial on this current source driver for LED (2018 09 14)--------------------------------------------------------------------------------I'll try to invoke as little math as possible. More math will be separately appended at the end for details. Some assumptions are made. They have very minor influence. They, however, make explanation clearer, much easier to understand.[IMO, Vd, the diode Voltage, at 0.68V, is a better fit.But I'll use the Vd=0.78V here. To set to desired LED current,R2 needs to be trimmed anyway.]..........................Let Power supply be Vc (5V-15V, 10V is nominal), Diode Voltage be Vd, diode current of D3,D4 be Id,Voltage across R2 be Vr, current of R2 be Ir. We assume Q1 collector current=emitter current=Ir=ILED,all diode Voltages are about the same = 0.78V, as does Vbe of Q1.Because Ir=ILED=20mA, Vr = IrxR2 = 20mAx39Ω = 0.78V (That's why I choose Diode Voltage be 0.78V, so to fitthe article result.)First, calculate the quiescent state of the circuit, so that we have some numbers to visualize:Choose Vc=10V (will explain why choose 10V), on the R1,D3,D4 circuit:Id = (Vc-Vd-Vd)/R1 = (10V-2x0.78V)/10k = 0.844mA (0)On the circuit of D3,D4,Q1Vbe:Vd3+Vd4-Vbe=VrTherefore,Vr = Vd+Vd-Vd = Vd |Vbe=VdILED = Ir = Vr/R2 ILED = Vd/R2 = 0.78V/39Ω = 20mA From above equation, ILED only depends on Vd,R2; has no dependency on Vc!Explanation:Vbe of Q1, Base-Emitter Voltage (a diode), is about the same as Vd. Vr = Vd3+Vd4-Vbe = Vd+Vd-Vd = Vd.That is,Vr=Vd (a single diode Voltage), about 0.78V here. This is the reference Voltage across R2, to develop the current Ir, which is also ILED.The current source for the LED is then simply:============================ILED = Vd/R2 |Vd=Diode Voltage (1)============================For this article, ILED = 0.78V/39Ω = 20mA.Now,find variation of ILED based on Vd variation which, in turn, is induced by power supply variation:i.e. find ILED to be a function of Vc.We can now ignore the Q1 side of the circuit, as all we need to find is Vd variation, which is from the D3,D4,R1 side of the circuit. Diode (D3, or D4) current is:Id = (Vc-2Vd) / R1 (2)Vd is relatively constant, about 0.78V here, soId variation is defined by R1 only.Or, Delta Id (i.e. change of Id) = 1/R1 x Delta Vc [See below appended why this is so.]Delta Id = 1/10k x Delta Vc, or--------------------------------Delta Id = 0.1mA per V (3)--------------------------------Assume the supply, Vc, centers at 10V, and changes +/-5V, from 5V to 15V as in the article.Hence,for a 5-V supply Voltage change, based on the above equation (3),Total delta Id = 0.1mA per Volt x 5V, orId varies +/-0.5mA for Vc varying +/-5V. From Equation (0), we have Id,nom=0.844mA.We now calculate Vd change:Id,hi = 0.5mA+0.844mA,nomVd change = 26mV x Ln [(Id,hi/Id,nom)] =12mV [See appendix below on this]If Vd goes higher by 12mV from the norm ...From equation (1): ILED = Vd / R2:ILED,hi = (Vd,nom+12mV) / R2 = Vd,nom / R2 + 12mV / R2The part, 12mV/R2, is the variation term.That is, the change from 20mA norm, induced by +/-5V, is ILED change = +/-12mV/R2 = +/-12mV/39Ω------------------------------------------------------------ILED change = +/-0.308mA for +/-5V change (4)------------------------------------------------------------That is, total change of +/-0.3mA from 20mA for a +/-5V supply change.Or,+/- (0.3mA/20mA) x100% = +/- 1.54% i.e. Total ILED varies <= +/-1.54% from the nominal 20mA,very constant!Conclusion:Equations (3) and (4) show constant current sourceas LED current driver, with minimum changeover a wide supply Voltage range (+/-5V, or 10-V span).--------------------------------Check the effect of Vd in the simplified equation (2):For a diode, Vd varies very slowly with Id current.For a 2X change of diode current, Vd changes 18mV.For a 10X change of diode current, Vd changes 60mV.Compare them to typical 0.7V diode Voltage magnitude,the Vd varies only(DeltaVd x100%)/0.7V -->2.57% at 2X diode current change.8.57% at 10X diode current change.Therefore,Vd can be a Voltage reference, just like Zener diodes.The equation for above Id1/Id2 ratio is: ------------------------------0.026V x Ln (Id1/Id2)) (5)------------------------------ [where 0.026V is Thermal Voltage, Vt, at 25C.]i.e.Take the natural log (log-base-2, not base-10) of the current ratio, then multiply by 26mV.With (5) we can calculate ANY Vd change when knowingthe Id ratio. Example.:5X Id change --> Vd changes 41.8mV...........For Vc change from 5V-15V, the Id current change is, from equation (3), with +/-5V supply change,Delta Id = 0.1mA/V x 5V = 0.5mA totalRecall, from equation (0)Id (or Id,nom) at quiescent is 0.844mA, Id,hi = 0.844mA + 0.5mA = 1.344mARatio of Id = Id,hi / Id,nom = 1.344mA / 0.844mA = 1.59Using (5), 0.026V x Ln(1.59) = 26mV x 0.465 = 12.1mVHave two diodes, D3,D4, so total Vdiode variation = 2x 12mV = 24mV = 0.024VHere,the nominal two-diode Voltage is 0.78Vx2 = 1.56VWith a 5-V change on Vc, the change on the 2-diode Voltage is:from 1.56V to (1.56V+0.024V), --> Vd is practically constant!Hence, the earlier assumption that D3,D4 diode Voltage is relatively constant is valid, having little effect on the simplified equation (3) which is derived from equation (2).Conclusion:Equation (1), ILED = Vd/R2 is valid, [Vd is Vdiode, and stable and flat, at about 0.7V.]and 'seems' independent of the power supply Voltage.---------------------------------------As real world would have it, ILED is slightly dependent on Vc,the supply Voltage. A percentage here, a percentage there, it adds up. Also the NPN (Q1) output impedance (collector impedance) is not ideally infinite. It depends on the supply Voltage.There would be small induced error by the collector impedance.But the simplified way for quick calculation and visualizingthe dependency are a valuable tool.A circuit good to 5%, 2%, tighter accuracy, is something else.At accuracy of 1% and below you'd have to account for a lot more. More understanding of the circuit and the device are needed. You can always trim R2 to get the precise current you want.Then it stays nearly constant over the supply range.======================================================================================Appendix:LetId=diode current, Vd=diode Voltage, Is=diode saturation current (a diode parameter)For a diode, the Current-Voltage relationship isId = Is x [e^(Vd/Vt) - 1] (6)whereVt=0.026V approx. at 25C, is called Thermal Voltage Is is a parameter of the diode.Because (Is) is very very small (10^-15, 10^-17 Amp), when compared to Id, the equation can be simplified to------------------------Id = Is x e^(Vd/Vt) (7) ------------------------Equation (7) is the simplified diode equation.Take the Ln of (6):Vd = Vt x Ln [1 + (Id/Is)] (8) Example:Vd = 0.026 x Ln [1 + (0.228mA/10^-15)] = 0.68VDiode has internal resistance, the complete equation isVd = IdRd + Vt x Ln [1 + (Id/Is)] (9)Because Rd is small, and mostly Id is small (in mA),IdRd is small compared to Vd, equation (7) is mostly usedfor low power, battery powered, circuits.At high Id, say, 0.1A, even if Rd is as low as 1 Ohm (maybe 5 Ohms), IdRd would be 0.1V (maybe 0.5V). Now it is not small when compared to nominal 0.7V. Then (9) must be used.For the circuit, assumption is made thatVd of 1N4007 = Vbe of Q1.Vbe of an NPN may not be the same as power supply typerectifier diodes such as 1N4007.For example, Vbe of 2N3904 is about 0.68V, and 1N4004 is about 0.56V. The key is: Vd is relatively constant over wide Id range, only the magnitude (0.56V vs 0.68V) is different. For the magnitude difference, you can trim it out. [Again, 10X Id change induces only 60mV Vd change. Examples: 0.56V to 0.62V, 0.68V to 0.74V.]1N4007 is a high Voltage diode (1000V break-down, 1A).As a high Voltage application diode, its Rd is generally high.It affects the Vd flatness over Id variations.The diode current here is small, about 1mA. Supply Voltage is low (less than 20V). For flatter/more constant diode Voltage as a reference, recommend use diode types 1N4001-1N4004 instead (lower Rd). 1N914 works fine too.Q1 can be any 400mW to 1W NPN, such as 2N3904, 2N2222A.-----------------------Derivation of Id variation (of D3, D4):As mentioned, from (2), Id = (Vc-2Vd) / R1 orId = Vc/R1 - 2Vd/R1Assume Vd is relatively constant, differentiating with respect to Vc∂Id/∂Vc = 1/R1 - 0 = 1/R1 --> ΔId/ΔVd = 1/R1 = 1/10k--> ΔId = 0.1mA per V To avoid differentiation, optionally do this:Calculate Id using (2), say, at Vc=10V:Id,nom = (10-1.56V)/10k |2Vd=1.56VId,nom = 0.844mANow increase Vc by 1V, to 11V:Id,hi = (11-1.56)/10k = 0.944mAChange of Id for a 1-V change:ΔId = Id,hi - Id,nom = 0.944mA - 0.844mA = 0.1mATherefore, Id change is 0.1mA per V.------------------------The other factors:Current gain, beta (β), of bipolar transistor isβ = Ic/Ib, deriving toIc = (β/β+1) x Ie [Ic is always one Ib less than Ie]If beta is nominally 100, the error induced by beta is 1% on Ic magnitude (which is ILED).If β is 100, and Ic=ILED=20mA, Ib= 20mA/β = 0.2mAThis Ib takes away the current from diodes D3,D4,Recall that at 10V supply, Id,nom is 0.844mA,error induced by Ib (or β for that matter) = 23.7% of Id (!!)This Id variation causesVd error = 0.026 x Ln (23.7%) = 0.026 x Ln (23.7/100) = 37.4mVIr error = Vd error / R2 = 37.4mV/39 = 0.96mA, or 1mA approx.Hence,Ib, or β, alone causes 1mA/20mA x100% = 5% magnitude error,(the delta variation over supply change, though, remains small).The comfortable factor here is that the 'large' errors are all magnitude errors, affecting only the accuracy of deriving the nominal current value using the simplified equations. All the while, the LED current variations induced by supply Voltage change is still small and valid, forming a tight current source. And, the magnitude errors can be trimmed out by varying R2.-------------------------Collector output impedance is finite. It is a functionof the applied Collector Voltage (at Collector-to-Emitter pins). In this circuit it is (Vsupply-VLED).The related transistor parameter is called Early Voltage, Va.Collector impedance is then roughlyRc = Va/IcVa generally ranges from 30V to 100V. For 2N2222A Va=74V.Assume Va=74V in this circuit. The Collector impedance, at ILED=Ic=20mA, is Rc = 74V/20mA = 37k Ohms.1/Rc = 1/37k gives ΔIc = 0.027mA per V change on Collector Volt.Or, 0.027mAx100%/20mA, it is 0.135% change per Volt. Practically can ignore. Also note that there is a resistor (R2=39Ω) at the emittor.Its presence greatly ehances Collector output impedance to even higher still. Meaning? Can ignore Collector impedance influence.----------------With all that, do not forget resistors. They could be 1%, 2%, 5%, even 20% tolerance.A 20% error on R2 (39Ω) is a direct percentage error on ILED!We use R2 to trim out all other magnitude variables anyway!And it is designed that way for trimming and setting the correct LED current.----------------Transistor saturation:If supply Voltage is too low, there may not be enough for the NPN and it will saturate. Current gain may then go down to 10 or even 1, 0.1, etc. Base current increasewill drastically rob current from diodes D3,D4. Vcollector = Vc-Vled. Vemitter=Vd=0.7V approx.Vce = Vcollector - Vemitter = Vc - Vled - Vdor Vc = Vled+0.7+Vce.Vce needs about >=0.2V to be above saturation at 20mA.So Vc >= Vled+0.7V+0.2V or-----------------------------------------Vsupply >= Vled+0.9V approx. (10)-----------------------------------------A single white/blue LED is about 3.3V at 20mA; green LED about 1.9V; red LED about 1.6V,Arriving at, for a single LED:Vsupply >= 4.2V|wht, 2.8V|grn, 2.5V|red ------------------The maximum supply Voltage is dependent on Q1 break down Voltage. Because Voltage transient could apply to the collector pin via capacitive coupling of the LED capacitance, the safety application is:Vsupply,max <= BVceo where BVceo is Collecter-Emitter Breakdown Voltage, when Base is open; no connection on the Base pin.-----------------------------------------------------------------------Circuit wiring errors:If D3/D4 is wired in reverse, they no longer conduct current. Q1 will saturate. Then LED current is roughly dependent on R2 only:ILED = (Vc-Vled-0.1)/R2 |0.1V is saturation VoltageAs you can see, ILED varies directly with supply Vc. Always first check D3,D4 Voltage (or at Q1 Base).It should be 2Vd, or about 1.4V - 1.6V.The safety net is R2 (39Ω). It limits damage:There is no short-circuit current path from supply to ground; can only via R2 (or R1). If the LED is reversely connected, there will not be LED lightand LED current (Icollector=0), and the NPN will saturate to about Vcollector=0.8V, even if plenty headroom of 15V supply. At high enough supply Voltage, and if LED is wired in reverse ... Note that LED reversed breakdown Voltage can be as low as 3.6V to 5V. It is still higher than the forward LED Voltage. If its Voltage is that high, the LED is wired in reverse.

    View Instructable »
  • How to Get Emergency Power From a Phone Line

    I know this is old post. I read almost all the comments. Funny indeed. This is a DIY project. Some DIY is not logical, just for the hell of it. The designer is experimenting. Help him. If you have a better mouser trap, publish it and show us how. LOL, Maxim (an IC maker) actually, in Application Note 1923, does just that (150mW output from phone line, off-hook, using ICs Max253 and Max667).Back to 7805. Per spec, the designer needs input capacitor and output cap. on 7805 for proper operation. When drawing more than 20mA, it will be 'off-hook' and the phone line DC Voltage will drop to 7.5V-6.2V. At 6.2V the low side, 7805 is unable to output 5V. 7805 needs about 2.5V drop-out (Vin-Vout). Recommend to use a low drop-out (<=1.2V) linear regulator, or build a discrete regulator.Since it...

    see more »

    I know this is old post. I read almost all the comments. Funny indeed. This is a DIY project. Some DIY is not logical, just for the hell of it. The designer is experimenting. Help him. If you have a better mouser trap, publish it and show us how. LOL, Maxim (an IC maker) actually, in Application Note 1923, does just that (150mW output from phone line, off-hook, using ICs Max253 and Max667).Back to 7805. Per spec, the designer needs input capacitor and output cap. on 7805 for proper operation. When drawing more than 20mA, it will be 'off-hook' and the phone line DC Voltage will drop to 7.5V-6.2V. At 6.2V the low side, 7805 is unable to output 5V. 7805 needs about 2.5V drop-out (Vin-Vout). Recommend to use a low drop-out (<=1.2V) linear regulator, or build a discrete regulator.Since it is off-hook, there will be no high Voltage ring signal (90Vrms AC). Surely he has to be careful at the moment hooking his kit to the phone line. Maybe just happen to be a call coming in, and the 90Vac will fry the 7805 and possibly the device connected to it.There are ways to fix this. Let's make it work rather than criticize.You can connect up to 5 old type phones to phone line (5xREN). If you have Fiber Optics from the street side, like me, then the DC is from a battery backup panel (UPS + maintainer/charger), at your house! You can then even connect more load! If you later cancel phone line service, you can use it any which way! You own the battery backup panel. I'm told battery replacement is my cost+labor. IMO, I would do on-hook DIY though. That is, drawing less than 20mA. Then protection circuit ahead of it to prevent high ring Voltage intrusion. A low power 5V-out buck converter will do (Step-down switching regulator: from high to low Voltage). 48Vx18mA=0.86W, 80% efficiency to 0.86Wx0.8=0.69W, 0.69W/5V=138mA. Not bad!And it can connect to phone line 24/7 without affecting phone operation (call out, receive calls). Not just for charging, 138mA is plenty for lighting LEDs. 0.69W can power LEDs to 55 Lumens. Suitable as bedside light or bedside book light.Compared to this DIY, 5Vx75mA=0.375W. Nearly double the power!DIY project for fun! Help to improve it!

    View Instructable »