May 6

Calculating an LED resistor: a technical test

Setting up this website, I have certain requirements.  Superscript, subscript, equation display, logical picture display, charts, formatting that I like and presents information in a manner I think works1.  This is the useful test post to evaluate all of these capabilities.  The subject below is covered in several other places on the wide wide webz.

Calculating current-limiting resistor for an LED

LED circuit
Basic LED circuit

An LED is a great thing.  It makes a great deal of light with relatively little heat and over a long life.  However, LEDs are also a bit more sensitive to power requirements and more easily damaged than other indicators and/or illuminators6.  LEDs require a minimum amount of voltage before they will turn on, producing any illumination, and have a maximum amount of current they can tolerate before their lifespan is degraded (or they fry; I consider this a notable degradation of the expected life of the product).

Refer to the diagram to the right.  An LED is a diode; as such there is a voltage threshold below which no current will flow and above which current will.  This forward voltage drop of the diode, defined as Vf, varies depending on the type of LED used2.  Once voltage exceeding the forward voltage is applied across the LED, current will flow.  The LED has a maximum  forward current (and/or typical, and minimum, too) given by If, where the LED will emit light of the specified intensity and frequency for the given lifetime.  If the datasheet or part spec does not indicate if this is a typical or maximum value, assume it is maximum.

Note: exceeding the maximum current level of an LED will not necessarily fry it immediately.  Too, it will be brighter.  However, exceeding it will decrease the lifespan and luminous efficiency3.

A current limiting device must be used to protect the LED.  The simplest way to limit current is to add a resistor, R, in series with the LED.

Continue reading

February 4

Class X/Class Y (Safety) Capacitor Parameters

“There are more capacitors in a distributor catalog, Horatio, than are dreamt of in your philosophy. “ – Shakespeare  (I think? Close enough)

Safety caps-Appliance Class ISpecifically, I am talking about Safety capacitors, aka X-capacitors, Y-capacitors, XY-capacitors, RFI/EMI suppression capacitors, line filtering capacitors, and no doubt other modes of reference.

When you have the occasion to mix hazardous household voltage with capacitors (perhaps to keep noise from leaking out of your circuit, or for surge protection), special care needs to be taken in selecting the capacitors used.

Normal ceramic capacitors have the distressing tenancy of failing short.  In the case of diagram to the right, such a capacitor in the “Cx” position would cause the mains to short through the capacitor, creating a risk of fire, (small) explosion, and a Bad Day.  Should the failing capacitor be in the “Cy” position, the mains could be shorted to earth ground (risking fire, etc) or, if the case is not connected to earth, could just directly connect the case to mains, creating the risk of arcing, electrocution, and a Bad (hair?) Day for someone. Continue reading

October 20

Voltage triggered switch

Minimum Voltage Indicator

This is a simple analog circuit that can be used to indicate if a minimum voltage is present at Vcc.  Minimum voltage is primarily determined by the zener voltage Dz.

Overview of how it works:

When Vcc < the zener breakdown voltage of Dz, the voltage drop across R1 and R2 are close to zero.  This means the voltage at base of the PNP transistor Q1,B is ~Vcc.  When VEB < VEB,on, the transistor does not conduct.  Therefore, current through R3 = 0, and the voltage drop across R3, defined as EN, is 0V.

Once Vcc > VZ, current starts to flow through R1.  Once there is sufficient current through R1 such that VR1 > VEB,on, Q1 begins to conduct.  This causes a voltage drop across R3, and EN to measure a >0 voltage (up to Vcc – VCE,sat).  R2 is in place to limit the current from the base of the transistor (as part of Q1’s conducted current will flow through the base from the emitter). The sensitivity of this circuit to the specific turn-on point and the Vcc/EN curve are strongly dependent on the values of R1 and R3, and somewhat dependent on the current knee of the zener diode.

Further notes and comments:

This circuit as presented optimizes cost and provide a high signal when Vcc is above the minimum.  Variations on this circuit include

  • a low signal at EN when Vcc is above minimum, using an NPN and flipping the circuit’s topology
  • Using a P-channel MOSFET for Q1 would eliminate the need for R2

As a note, a single LM431 (available from many manufacturers) can also perform a function similar to the “low EN” variation of this circuit with only a pair of external setpoint resistors and a pull-up resistor.  Which approach you choose depends on your application and need; the above could be advantageous for reason of cost, polarity (high EN when over Vcc,min using LM431 requires an inverting component), or voltage range (Maximum operating voltage of a LM431 is 37 volts, discrete bipolar transistors can operate in the hundreds of volts).