Difference between revisions of "Electronics notes/Diodes"

From Helpful
Jump to: navigation, search
m (Bypass diode / (flyback) protection / catch / snubber / freewheeling / suppressor diode (application))
 
m (Avalanche diode (spec/type))
 
(209 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{Electronics notes}}
 
{{Electronics notes}}
  
<!--
+
===Behaviour===
 +
 
 +
====General====
 +
{{stub}}
 +
 
 +
Diodes were developed in vacuum tube days, around the same time semiconductor diodes were.
 +
 
 +
We now mean semiconductor diodes, unless noted otherwise.
 +
 
 +
 
 +
The basic introduction to semiconductor diodes is that they conduct one way, and not the other.
 +
{{comment|(a little more precisely, have very high resistance in one direction and very low resistance in the other)}}.
 +
 
 +
 
 +
That's may be enough knowledge for some applications around power (supplies),
 +
but around signals and in general, there are some subtleties to their behaviour.
 +
 
 +
For starters, look at the {{imagesearch|diode I-V curve}}.
 +
 
 +
 
 +
A diode is largely characterized by:
 +
* Vf  forward voltage drop
 +
* Vbr reverse breakdown voltage
 +
* current limit it will manage
 +
 
 +
 
 +
Common wishes for diodes
 +
* Large current - for power control) (e.g. 1N4000, 1N5400 series)
 +
* low voltage drop - e.g. when doing polarity protection (e.g. ~0.7 for silicon, 0.3 for schottky, 0.2V for germanium)
 +
* fast switching - for signal use. Often implies lower current.
 +
* max reverse bias (commonly in the range of a few dozen to a few hundred)
 +
* reverse recovery (e.g. schottky)
 +
* low leakage (all diodes leak on the order of a few microamps in reverse)
 +
* high breakdown voltage
 +
 
 +
 
 +
 
 +
 
 +
'''In forward bias'''
 +
 
 +
Diodes don't conduct current until forward bias (voltage) is higher than the diode's '''forward voltage drop, Vf'''.
 +
 
 +
This is usually in the 0.2 .. 0.7V range {{comment|(and correlated to specific types, e.g. ~0.7 for silicon, 0.3 for schottky, 0.2V for germanium)}}, but can be engineered higher (and will also be higher for diodes in series).
 +
 
 +
Above that voltage it they are pretty good conductor.
 +
It's still a semiconductor, though, so presents a small resistance.
 +
You can model a real diode as an ideal diode (the basic description of 'conducts one way and not the other') in series with a resistor.
 +
 
 +
That resistance actually varies with ''current'' {{comment|(see the fact that the forward conduction part of the {{imagesearch|diode I-V curve}} so is not quite a straight line)}}, so technically nonlinear, but in most uses this doesn't matter.
 +
 
 +
 
 +
'''That voltage is also the voltage they drop'''
 +
: functionally this is usually is a ignoreable detail, sometimes in your way, and sometimes even useful.
 +
: this voltage is almost independent of current
 +
: that voltage times the current passed is wasted as heat
 +
:: For example, running 3A through a 0.6V-drop diode means ~1.8watt wasted, as heat.
 +
 
 +
 
 +
'''In reverse bias''':
 +
 
 +
No current flows (aside from a tiny leak current).
 +
 
 +
...until the reverse breakdown voltage, and then they start conducting anyway.
 +
The behaviour is called '''Avalance breakdown''', naming relevant semiconductor behaviour[https://en.wikipedia.org/wiki/Avalanche_breakdown].
 +
 
 +
That voltage is often 50V or more, and can be engineered to be higher.
 +
 
 +
Which means you can ignore this effect in in a lot of low-voltage electronics.
 +
 
 +
 
 +
Most diodes are not made for this, will be easily damaged. (Again, look at the {{imagesearch|diode I-V curve|I-V curve}}: the reverse current curve is much steeper, meaning there is little difference between 'conducts a little' and 'burns itself up unless something else limits current')
 +
 
 +
 
 +
Zener diodes are roughly the only type that ''are'' made for this.
 +
Their reverse breakdown voltage is intentionally lower (see Zener applications), and the I-V curve is often a little less steep, meaning there is more voltage range they are comfortable with, and is easier for you to intentionally use.  See the section on Zeners below.
 +
 
 +
 
 +
 
 +
 
 +
 
 +
'''LEDs''' are somewhat unusual diodes.
 +
: They have higher Vf, most between 1.4V and 4.5V,
 +
: their design focuses on light, means they can deal with very little current,
 +
: they have negative resistance curve (putting current through them heats them up, lowering the resistance and passing more current - [[thermal runaway]] until it burns)
 +
 
 +
The are also more fragile in reverse.
 +
 
 +
You don't want to use LEDs as diodes for power, but they have some uses around signals, where you know current is never high.
 +
 
 +
 
 
See also:
 
See also:
 
http://www.stephenpeek.co.uk/Electronics/diode/diode.htm
 
http://www.stephenpeek.co.uk/Electronics/diode/diode.htm
  
 +
====Zener diode (type/behaviour)====
 +
{{stub}}
  
Forward bias:
+
'''Context:'''
* Diodes don't let current flow until a certain forward bias is applied. Below that voltage they don't move any current, above it they are good conductors (/small resistors; you can model a real diode with an ideal diode (the basic description of 'conducts one way and not the other') in series with a resistor).
+
  
* drop a fixed voltage
+
''Reverse breakdown'' refers to diodes/transistors conducting in reverse.<!-- {{comment|(At some reverse potential, it overcomes the p-n junction tendencies. This happens when the carriers in the transition region are affected by the electric field enough to create mobile or free electron-hole pairs via collisions with bound electrons, which leads to a very short, relatively large current spike)}}
 +
-->
  
That minimum bias and dropped voltage is ~0.7V for Silicon diodes, ~0.2 for Germanium, ~0.3 for Schottky,
+
''All'' diodes have a '''zener voltage''' beyond which they conduct, and a reverse breakdown region where that reverse flow will happen (and then a point at which they burn).
somewhere between 1.4V and 4.5V for different kinds of LEDs.
+
  
 +
On regular diodes, the Zener voltage is far enough away (usually dozens of volts)
 +
to never happen in the circuit it's specced for.
  
Reverse bias:
 
* No current flows until the breakdown voltage (often 50V or more, except for Zeners, for which it is intentionally low, e.g. 6V)
 
  
 +
Even when you want to use it, on regular diodes the region is narrow and hard to use, varies with production{{verify}}, so you would easily damage it.
  
  
A diode is characterized mostly by:
+
A '''Zener diode''', in forward bias, acts like a completely regular diode, with similar voltage drop {{comment|(usually roughly 0.6V .. 0.7V drop, sometimes lower{{verify}})}}
* Vd  forward voltage drop
+
* Vbr reverse voltage breakdown
+
* current limit
+
*
+
  
 +
Their difference is in reverse behaviour:
 +
: Their Zener voltage is engineered to be at a lower level {{comment|(one more usable in typical low-voltage electronics, often between 2.4V and 7V, apparently up to 33V)}}
 +
: they have a wider reverse breakdown region, better-characterized in that region, and more robust within it.
 +
{{comment|(Lower-than-2.4V Zeners are actually ''imitations'' of Zener behaviour and their behaviour is a little different{{verify}})}}
  
  
 +
The better defined reverse breakdown region make it exploitable in its own right, e.g.
 +
* voltage clamping protection (and other purposes where they effectively act as a sort of relief valve)
 +
: e.g. say you have a 5V-powered device, and added a 5.1V zener. A transient spike in the input will be suppressed to a good amount {{comment|(and because it's transient will not cause temperature issues in the zener)}}
  
 +
* simple, shunt-style regulation
 +
: (TODO: simple zener regulation image)
 +
: not efficient, not ''the'' mort stable, so for more than a little current you want other regulation
 +
 +
* fixed voltage references
 +
 +
* clipping signals
 +
: e.g. one for DC, two for an AC waveform
 +
: e.g.
 +
:: in audio for distortion (see [[fuzz boxes]])
 +
:: avoiding [[Electronics_notes/Amplifier_notes#Phase_inversion|op amp phase inversion]]
 +
 +
 +
 +
The current and heat dissipation varies between zeners,
 +
often range of milliwatts for voltage reference,
 +
a few hundred milliwatts for simple regulation,
 +
up to a Watt or so.
 +
 +
Since you rarely want to move a lot of current in reverse bias, circuits will often see some sort of current limitation (a resistor or such).
 +
 +
 +
 +
See also:
 +
* http://en.wikipedia.org/wiki/Zener_diode
 +
 +
 +
<!--
 +
https://www.youtube.com/watch?v=O0ifJ4oVdG4
 
-->
 
-->
 +
 +
====Avalanche diode (spec/type)====
 +
 +
Avalance diodes usually refer to diodes that are made to imitate Zener behaviour,
 +
yet will work for higher voltages (100 ~ 300V) than true Zeners can.
 +
 +
 +
Avalance diodes may be found categorized as (or referred to) as Zener diodes.
 +
 +
 +
See also:
 +
* http://en.wikipedia.org/wiki/Avalanche_diode
 +
 +
 +
====Rectifier diode (spec)====
 +
 +
Rectification is a circuit typically using diodes, not a type of diode.
 +
 +
 +
However, you would prefer specific specs for rectification designs.
 +
 +
As such, diodes manufactured specifically for this use may be in their own section when you're looking to buy them.
 +
 +
 +
Also, since you usually combine two or four of them, there are also single components that contain two or four suitable diodes<!--, reducing component count and possibly simplifying heat sinking-->.
 +
 +
 +
<!--
 +
These properties include:
 +
* high enough reverse breakdown voltage
 +
: to not break immediately
 +
 +
* heat sinking - they will often be in larger packages
 +
: and e.g. in ones you can easily attach heatsinks to
 +
 +
* a chunky enough forward current (IF), given that
 +
: (because all of the power in the device is going through these)
 +
 +
* low Vf, because that means less energy lost as heat
 +
: e.g. schottky
 +
: (again, because all of the power in the device is going through these)
 +
 
===Types and materials===
 
===Types and materials===
 +
 +
 
====Silicon diode====
 
====Silicon diode====
 
Common, cheap.
 
Common, cheap.
Line 42: Line 209:
  
  
====Avalance breakdown (behaviour) / avalanche diode (type)====
+
====Schottky diode (type)====
 +
{{stub}}
  
Avalance diodes usually refer to diodes that are made to imitate Zener-like behaviour, but which will work for higher voltages (100 ~ 300V) than Zeners can.
+
Forward voltage drop on the order of 0.15V .. 0.45V rather than the more typical 0.6V .. 0.7V.
  
Avalance diodes may be found categorized as (or referred to) as Zener diodes.  
+
Also switches faster than some.
  
  
http://en.wikipedia.org/wiki/Avalanche_diode
+
Nice when you want to
 +
avoid wasting power when protecting something capable of a bunch of current,
 +
or want to avoid a voltage drop that is significant to your application,
 +
or for faster switching.
  
 +
It also has some uses filtering higher frequency.
  
  
====Zener diode (type/behaviour)====
+
They have limited reverse voltage ratings (reverse saturation happens more quickly),
 +
so are not as useful for certain protection,
 +
and have more reverse leakage current.
  
A '''Zener diode''' acts like a normal diode in forward bias, and in reverse bias will conduct only if the voltage is over a known breakdown voltage - a behaviour known asthe Zener/avalance effect.
+
See also:
 +
* https://en.wikipedia.org/wiki/Schottky_diode
 +
* https://en.wikipedia.org/wiki/Schottky_diode#Applications
  
Most other diodes show a similar effect, but with different specs that are more finicky to use; Zeners in the other hand are designed to easily use this effect and to work within the reverse breakdown region.
+
====Current regulating diode (type)====
 +
<!--
 +
Also known as constant-current diode, because that's what they do:
 +
limit current flow regardless of input voltage ripple, or change in load resistance.
  
 +
(cf. Zeners, which keep the ''voltage'' constant)
 +
 +
 +
Internally they are actually a FET used in a specific way
 +
 +
They do so only for quite small currents, though.
 +
 +
They are e.g. useful to protect LEDs,
 +
taking a relatively unknown supply and making a constant-current power supply.
 +
 +
-->
 +
 +
====Signal diode, switching diode (spec)====
 
<!--
 
<!--
Zeners's reverse-bias behaviour is similar to forward behaviour - that is, it will not conduct until the voltage approaches the Zener voltage (V<sub>Z</sub>), and after which they conduct.
+
e.g. 1N4148 (or the older 1N914)
 +
 
 +
Low current spec, but react faster (as in reverse recovery time),  
 +
so do better at applications involving higher frequencies, clipping, switching, dealing with pulses,
 +
and freewheel/flyback for smaller devices.
 +
and in some signal processing like ring modulation where the reaction time means less waveform distortion.
 
-->
 
-->
 +
 +
<!--
 +
Also used to protect some IO against transients and ESD (can be less necessary when already buffered).
 +
-->
 +
 +
===Applications===
 +
====Bypass diode / flyback protection diode (application)====
 +
 +
A '''bypass diode''' is a diode used to protect something against reverse biasing - against voltage going the wrong way.
 +
 +
Also known as '''flyback diode''', '''kickback diode''', '''catch diode''', '''snubber diode''', '''freewheeling diode''', '''suppressor diode''', '''commutating diode''', antiparallel diode, and more.
 +
{{comment|(Some names refer more specifically to more transient reverse biasing, or the causes behind that)}}
 +
  
  
 +
Examples:
 +
* inductors in general can store energy (in the magnetic field)
 +
: some because sudden changes (e.g. solenoid disconnecting)
 +
: and larger things that move (solenoids, motors) a little more so (movement that translates back to magnetic field)
 +
: They can often easily deliver a few times the voltage they usually operate at (varying with case). This can seriously stress the circuit components directly around it, depending on design.
 +
: The use of a diode in parallel, reverse-biased to how you drive it, is one easy way to bleed this short-lived current
 +
: yes, you're essentially making a one-way short-circuit, which is why it also affects the braking behaviour of coil-style actuators: the collapse of the magnetic field is usually slowed{{verify}}
 +
: on the spike shape:
 
<!--
 
<!--
 +
:: mostly an RL circuit discharging, so consider how energy works in its time constants (mostly gone within 5), where one is L/R
 +
:: The coil will have an effective series resistance, so it acts like an RL circuit, though with a tiny R
 +
:: the diode will also be working as a resistor (also small)
 +
:: you ''can'' add a (power) resistor in series with the diode to effectively lower the current during discharge, though for various solutions it may be easier to choose a larger diode
 +
-->
 +
: https://electronics.stackexchange.com/questions/110574/how-to-choose-a-flyback-diode-for-a-relay
 +
 +
* In a series of solar cells, shading one cell among multiple leads that one cell it to be reverse biased relative to the others, meaning that panel gets fed current from the others, which would heat it and may eventually damage it.
 +
: A bypass diode in parallel with each cel llets the current-in-the-wrong-direction pass alongside the cell instead.
 +
 +
 +
 +
Notes:
 +
* If the load is bidirectional (e.g. bidirectional motor driver) then the flyback can happen in either direction, and you can't protect it in the way described above
 +
: For example, in the case of a [[H-bridge]] driver, you need four diodes for protection in both directions
 +
 +
* Protection diodes should be able to take a decent load - may well be a few amps for a short while (depends a lot on the load)
 +
: bog-standard diode like 1N4001-1N4007 series can be used - for lower frequencies
 +
: for higher frequencies you need to look around more, probably for [[schottky]] diodes
 +
 +
* Protection diodes should have a voltage rating of ''at least'' the voltage you are applying
 +
: whenever significant energy can get stored (e.g. in case of coils), leeway is a good idea
 +
 +
* Protection diodes should be robust to reverse biasing (themselves)
 +
 +
* You may have preference for a fast-acting diode (e.g. Schottky) to minimize the time the reverse bias is applied (though note they have lower reverse-bias ratings)
 +
 +
* Sometimes you may also care about low voltage drop (which can matter e.g. in solar and battery applications, minimizing loss).
 +
 +
* If reaction time is not so important (or low cost is considered more important), cheaper general-purpose diodes such as the 1N400x series can be used.
 +
  
Within a certain reverse voltage range, the voltage across the zener diode will remain almost constant.
 
 
-->
 
-->
  
Zeners are often used when this property is used as a feature rather than a problem.  
+
See also:
Useful for voltage clamping, as voltage references, simple (shunt) regulation (with low currents).
+
* http://en.wikipedia.org/wiki/Flyback_diode
 +
* http://pvcdrom.pveducation.org/MODULE/Bypass.htm
 +
* [[Electronics notes/snubbers|snubbers]]
  
 +
====Blocking diode (application)====
 
<!--
 
<!--
Simple shunt regulation and voltage reference creation use the Zener as a sort of relief valve.
+
The function diodes are introduced as:
The difference is largely the intent to draw real current or not.
+
 
 +
A blocking diode prevents flow in the wrong direction,
 +
by being in series with one or more components so simply not allowing the
 +
other direction.
  
Zener forward{{verify}} voltage drop is in the 2.4V-7V range, and up to ~33V{{verify}}.
 
Lower Zeners are imitation of Zener behaviour.
 
 
-->
 
-->
  
  
 +
====Clamp diode, protection diode, diode clipping (application)====
 
<!--
 
<!--
  
You pretty much always need current limiting; zeners can't move a lot of current.
+
A '''clamp diode''' / '''clamping diode''' (not to be confused with diode clamps), simular to protection diodes, and similar to clipping diodes.
Zener current/heat dissipation varies, often milliwatts for voltage reference, a few hundred milliwatts for simple regulation, up to a Watt or so.
+
-->
+
  
 +
There are distinct setups, but they're only correlated and not a hard split, so the workings and function are similar enough that these are confusable, near-synonymous terms.
  
  
http://en.wikipedia.org/wiki/Zener_diode
+
(also, unrelated to polarity protection via a diode)
  
  
  
 +
The function they share is taking away voltages above some level.
  
====Schottky diode (type)====
+
This is done for two main reasons:
  
http://en.wikipedia.org/wiki/Schottky_diode
+
* protecting something that would be damaged from higher levels, from short transients that might happen
 +
: then also called protection diodes
 +
: may be specced only for ''very'' short transients only, and less often for anything sustained
  
Forward voltage drop on the order of 0.15V - 0.45V{{verify}}.
+
* limiting/clipping the waveform
 +
: then also called clipping diodes
 +
: e.g. for [[guitar distortion]], though there's variations of that
 +
: often specced for the fact they may be active more of the time
  
  
 +
Broadly, there are two setups:
 +
* use a particular-voltage zener from Gnd to to signal, to burn off anything higher than its zener voltage
  
 +
* use a regular diode from signal to Vcc
 +
: basically meaning that when that signal is over ~Vcc + Vf, you're dumping current into the Vcc rail
  
===Applications===
 
====Bypass diode / (flyback) protection / catch / snubber / freewheeling / suppressor diode  (application)====
 
  
A '''bypass diode''' refers to a diode used to avoid problems that can stem from reverse biasing.
+
In the schottky to Vcc setup,
 +
: small EMI and ESD will be absorbed by the power supply without difficulty,
 +
:: (and if you worry about introducing noise you can add a bypass capacitor)
 +
: small constant currents will be used as power,
 +
: while a larger constant current is more likely to put higher voltage on a circuit that can't necessarily deal with it (mostly the diode, meaning you'll heat and potentially burn it over time)
 +
:: can regularly be relieved with a series resistor (though that can affect the signal of the line it's on)
  
For example, in a series of solar cells, shading one cell among multiple leads to it to be (relatively) reverse biased,
+
: Fast diodes are preferable for transients  (usually schottky)
meaning it gets fed current from the others, which would heat it and may eventually damage it.
+
:: there are a few cases where those are less ideal. Apparently around fast CMOS{{verify}}. (and CMOS protection doesn't use Schottky{{verify}})
A bypass diode in parallel makes the diode-solarcell
+
pair safer as it lets the current-in-the-wrong-direction pass alongside the cell.
+
  
  
You may have preference for a fast-acting diode (e.g. Schottky) to minimize the time the reverse bias is applied.
 
  
Sometimes you may also care about low voltage drop (which can matter e.g. in battery applications). If reaction time is not so important (or low cost is considered more important), cheap general-purpose diodes such as the 1N400x series can be used.
+
-->
 +
=====Protection diodes in ICs=====
 +
<!--
 +
Some ICs (e.g. various op amps, CMOS ICs, ICs in general, microcontroller GPI/O pins) have internal protection diodes on most pins.
  
 +
These are often good for EMI protection, though often ''not'' rated against larger discharges like ESD from a human. Some are likelier to survive a good carpet-shuffling zap than others.
  
 +
So when you expose IC pins to the outside of a device, consider extra protection.
  
A '''flyback/protection diode''' refers specifically to reverse biasing from inductive circuits, particularly electromagnetic components (coils on relays, solenoids, and motors) to kick noticable power into the circuit, which can cause reverse biasing and voltage spikes <!--(often easily a few times the operating voltage for a few microseconds or more)--> where they normally wouldn't be (and high enough to kill various components, including transistors).
 
  
A protection diode is placed in parallel with the inductive component, reverse biased to how you drive it (in the wrong directon in terms of the power supply); once the inductive element tries reverse bias the power, it conducts directly (shorts) to itself via the diode. For magnetic fields, this means that the collapse of the magnetic field is slowerd{{verify}}. You are effectively making a sort of RC circuit, so less resistance makes for less of a spike, but more current on the diode. For general-purpose solutions it is safer to choose a larger diode than to add resistance, partly because you would need power resistors.
 
  
 +
Also, some 3.3V microcontrollers have 3.3V diodes on at least their communication lines, so that a 5V device talking to it won't immediately damage it.
  
Protection diodes should
+
This isn't really any different from protection diodes in general, except that they may be specced to deal with 5V at the low currents used in signals, but ''not'' when more than a few mA are involved.
* have a voltage rating of at least the voltage you are applying (about the same is usually good enough, a little more can't hurt)
+
* and be able to take a decent load - may well be a few amps for a short while (depends a lot on the load)
+
* be robust to reverse biasing (themselves)
+
  
 +
"5V tolerant" seems to refer to this. Note that this is often not very official, and may still shorten life.
 +
Use [[level shifting]] if in any doubt.
 +
 +
 +
[[Electronics_notes_/_Inputs_and_outputs#Protection_diodes_.28inputs_and_output_pins.29]]
 +
 +
 +
 +
 +
You can also use Zener behaviour as '''voltage references'''. (TODO: Image)
 +
This is called a '''shunt reference'''{{verify}} because it shunts all further voltage away (as heat).
 +
 +
Typically in series with a resistor to limit current.
 +
(which then implies this should be sensed with high impedance or it won't be very precise?{{verify}})
 +
 +
 +
In theory this is also '''voltage regulation''', in that it burns off higher voltage as heat.
 +
The amount of heat depends on the current, though, so this is largely just a less-efficient alternative
 +
to a [[linear regulator]].
 +
 +
 +
 +
https://mdesemiconductor.com/clamping-diodes-and-their-application/
  
If the load is bidirectoinal (e.g. bidirectional motor driver) then the flyback can happen in either direction, and you can't protect it in the way described above. For example, in the case of a H-bridge driver, you need four diodes for protection in both directions.
 
  
 
-->
 
-->
 +
 +
====Clamper circuit, diode clamp (application)====
 +
 +
<!--
 +
A diode clamper circuit (not to be confused with a clamp diode) uses a diode, capacitor, and resistor to '''add a DC offset (the diode's voltage drop) to an AC signal'''.
 +
 +
This makes most sense for signals, because large loads affect the performance.
 +
 +
Such offsets aren't unusualy in (common mode) audio circuits
 +
  
 
See also:
 
See also:
* http://en.wikipedia.org/wiki/Flyback_diode
+
* http://en.wikipedia.org/wiki/Clamper_%28electronics%29
* http://pvcdrom.pveducation.org/MODULE/Bypass.htm
+
  
====Clamp diode (application)====
 
  
====Voltage clamping diodes (application)====
+
-->
  
 +
<!--
  
http://en.wikipedia.org/wiki/Clamper_%28electronics%29
+
====Diodes in series====
  
 +
Regular diodes in series can be useful to drop more voltage, when that's useful.
 +
 +
Regular diodes in different directions is not particularly useful.
 +
 +
 +
Zener diodes
 +
 +
 +
 +
-->
 +
<!--
 +
====Diodes in parallel====
 +
 +
 +
Two in the same direction is generally not done, because unless they are very similar, current will not be drawn equally when conducting, and potentially switch at different times.
 +
 +
 +
Antiparallel will generally mean one is switched on,
 +
suggests that for some reason, current can go in either direction.
 +
 +
You might have antiparallel LEDs as a polarity indicator.
 +
They will also protect each other from overvoltage.
 +
 +
 +
 +
 +
Zeners
 +
 +
 +
 +
 +
-->
  
 
====Rectifier bridge (simple design)====
 
====Rectifier bridge (simple design)====
Line 154: Line 480:
  
 
===LEDs===
 
===LEDs===
 +
 +
LEDs convert a higher percentage of energy going through them to light than, say,
 +
classic lightbulbs (where a lot of the energy becomes heat, i.e. IR radiation).
 +
 +
 +
That sounds awesomely efficient, though there's a footnote to that: getting from AC mains voltage
 +
to few-volt DC voltage. 
 +
That conversion is not very efficient to do, particularly not for the quite-low currents involved
 +
when each just powers a few LEDs.
 +
 +
 +
 +
 +
LEDs do act as diodes {{comment|('Light Emitting Diodes', after all)}}, in that they conduct/work only in one direction.
 +
Their ratings as diodes is pretty poor, though. They are slower, and their reverse breakdown is close,
 +
so in many situations you'ld want to add a serious diode. <!-- e.g. LED reverse breakdown is so close that in some cases you want a regular diode as polarity protection.-->
 +
 +
 +
LED of different types usually need something like 2V or 3V forward voltage before they start emitting light. {{comment|(The extremes, including some less usual types, seem to be 1.6V and approx. 4.4V)}}{{verify}}.
 +
 +
 +
 +
====Driving====
 +
 +
LEDs have an {{imagesearch|LED I-V curve|I-V curve}} that is not only nonlinear, but also very steep exactly near the point you woule like to operate them at, particularly if you want to drive them at decent brightness but also have them live long.
 +
 +
: they have a threshold below which they do nothing
 +
: a fairly flat bit of still low current (and they will be relatively dim here)
 +
:: quick-and-dirty uses operate them here, e.g. by using a somewhat large resistor.
 +
: and then shoots up, from little current to too much, over a volt or two
 +
 +
The exact curve varies with
 +
* LED type (that search shows different curves for the different classic LED colors),
 +
* environment temperature - itself largely determined by the current currently going through it
 +
* production line variation
 +
 +
 +
Indicator LEDs tend to be specced for a continuous current of ~10mA.
 +
Superbright for perhaps ~20mA, and low-current LEDs perhaps 2mA.
 +
 +
Keep in mind that these are continuous-use maximums.
 +
Both in that most LEDs already give off some light at 1mA.
 +
(And also that you can often pulse higher currents on a low duty cycle. Check spec sheets)
 +
 +
 +
All that makes it very hard to create a universal LED driver that is entirely plug and play.
 +
 +
This is roughly why the current-limiting resistor approach is such a typical approach,
 +
because it which works fine on things like indicator LEDs where we care more about lifetime
 +
and basic visibility than maximum brightness or maximum efficiency.
 +
 +
When driving powerful LEDs, though, we do care (also because of waste heat),
 +
and will generally use a current-limiting LED driver, for which there are now plenty of ICs,
 +
and supplies centered around them.
 +
 
<!--
 
<!--
 +
(also, once you feed more than ~200mA to a single LED thing, it will be designed to take a heatsink - and you'll want to add it. Not that much higer than that you'll also want to guarantee at least ''some'' airflow.
 +
-->
  
LEDs are diodes, but you could almost consider that a detail - their rating as a diode is too poor to use them as functional diodes.
 
  
LED of different types usually need at least 2V or 3V forward voltage to work at decent brightness.
+
=====LED response time=====
The extremes for different kinds of seem to be 1.6V to approx. 4.4V{{verify}}.
+
<!--
  
 +
A LED takes a little time to start emitting light.
  
LEDs care about the current going through them.
+
''Very'' little, though, think nanoseconds to turn on (more for larger LEDs),
Fairly regular LEDs want at most ~10mA,  
+
tens of nanoseconds to turn off.
bright LEDs at most ~20mA,
+
low current LEDs ~2mA.
+
  
These low current maxima are why LEDs are very usually seen with current limiting resistors.
+
That's short enough that nearby inductances and capacitances will probably
 +
alter that a bit, so this delay ''might'' be dozens of nanoseconds higher.
  
That resistor will also drop most of the voltage the LED doesn't (as a diode, the LED drops a fixed voltage, its V<sub>f</sub>).
 
  
 +
Note that higher-output LED lighting tends to take much longer than that to start up,
 +
because of details of their drivers.
  
Your givens are usually the supply voltage, the LED's voltage drop V<sub>f</sub>, and the LED's maximum continuous current rating.
+
 
You'll often apply:
+
The main thing this matters to is probably optocoupling higher-speed communication,
 +
and note that it's also why faded LEDs sometimes seem to act very strangely on camera (eyes integrate over time, cameras expose a fraction of the time, particularly when they see a lot of light)
 +
 
 +
 
 +
https://electronics.stackexchange.com/questions/86717/what-is-the-latency-of-an-led/86720#86720
 +
 
 +
-->
 +
 
 +
 
 +
=====Current limiting resistor=====
 +
 
 +
A LED has negligible resistance, so will easily pass much more current than it can stand.
 +
 
 +
 
 +
As such, you need something external to it to limit current.
 +
 
 +
The simplest way to do so is to put a resistor in series.
 +
For most LED and typical PCB voltages this works out on the order of 100 ohm to 1kOhm.
 +
 
 +
 
 +
The upside is that it' very simple, the downside is that since the resistor passes the same current as the LED,
 +
it will also waste some power, putting that into heat instead of light.
 +
 
 +
A fairly small to tiny amount in most setups, and it turns out that if you have a few indicator LEDs drawing a few dozen mA total, then it's often not worth it energy-wise ''or'' component-wise to drive them more efficiently, unless maybe you need the absolute most battery life.
 +
 
 +
At the same time, when producing a lot of light, there are certainly better ways.
 +
 
 +
 
 +
 
 +
 
 +
Details:
 +
 
 +
Being a diode, the LED drops a fixed voltage, its V<sub>f</sub>.
 +
 
 +
...but does not limit current so in current terms it might as well not be there. Your calculations aim to have just the resistor drop drops enough of the (leftover) voltage that the current through it and something in series with it is at/below some target current.
 +
 
 +
...in this case the specific LED's rated maximum continuous current - or rather something a bit below it with a slightly higher-valued resistor.
 +
 
 +
 
 +
Often your givens are the supply voltage,
 +
the LED's voltage drop V<sub>f</sub>,
 +
and the LED's maximum continuous current rating you want to stay under.
 +
 
 +
You'll usually use:
 
       V<sub>in</sub> - V<sub>LED</sub>
 
       V<sub>in</sub> - V<sub>LED</sub>
 
  R = -----------
 
  R = -----------
 
         I<sub>LED</sub>
 
         I<sub>LED</sub>
  
For example, to drive a ~2.2V red LED, aiming for at most 20mA, and deciding you want a single standard-value resistor, you might choose:
 
* on 5V:  150&#x2126; for ~18mA
 
* on 12V:  470&#x2126; for ~21mA or 1k&#x2126; for ~9mA
 
* on 9V:  470&#x2126; for ~14mA
 
* on 3.3V: 100&#x2126; for ~11mA
 
  
 +
Chances are you'll grab the next-highest standard-valued resistor. If you want to know the current for it, the following reformulation is useful:
 +
I<sub>LED</sub> = (V<sub>in</sub> - V<sub>LED</sub>) / R
 +
 +
For example, to drive a ~2.2V red LED, aiming to stay under 20mA, and using standard-value (e.g. cheap carbon 5%) resistors, you might choose:
 +
* on 3.3V: 100&#x2126; for 11mA, maybe 220&#x2126; for 5mA
 +
* on 5V:  220&#x2126; for 12mA, maybe 330&#x2126; for 8mA or 150&#x2126; for 19mA,
 +
* on 9V:  470&#x2126; for 14mA
 +
* on 12V:  560&#x2126; for 17mA, or 1k&#x2126; for 10mA, or maybe 470&#x2126; for 21mA.
 +
 +
 +
 +
Side note: A LED's max-current rating is for a good part limited by the ability to sink the generated heat, and assumes ''continuous'' current. When you're only ever pulsing the LED with a lowish duty cycle, you can get away with higher currents.
 +
For example, TV remote IR leds can do this because their pulsed protocols are implicitly low-duty-cycle.
 +
And you might do it for visible LEDs because when using something like PWM, for part of the curve current drops off faster than the human-apparent intensity.
 +
 +
=====LED drivers=====
 +
 +
At some point (often above a few hundred mA, for something that is on a lot), it becomes worth it energy-wise to invest in components to drive the LED more efficiently.
 +
 +
 +
Since this often means a cleverer, more controlled circuit, it usually ''also'' means we can more safely aim for a current that is nearer its maximum brightness, just because there is less risk of burning it.
 +
 +
 +
<!--
 +
The curve of current for a voltage is nonlinear - they are roughly exponential. This means they do very little for the first (varying with specific LED) one or two volts, and once they have lit up, it's only one or two more volts before they burn themselves.
 +
 +
Hitting a specific current means you need ''very'' fine tuning of your voltage - and that's still ignoring the fact that the curve will change a little with temperature - mostly that from itself.
 +
-->
 +
 +
There are two basic approaches:
 +
 +
 +
======Constant-current LED driver======
 +
<!--
 +
 +
Constant-current LED drivers will aim to always let through the rated current - within a few percent, and correcting on the scale of milliseconds.
 +
 +
 +
They typically have some IC monitor the current, and adapt the voltage.
 +
 +
The voltage will depend not only on what sort of load you connect,
 +
but also not be sensitive to what enviroment like temperature might have.
 +
 +
{{comment|(you can {{search|constant current driver filetype:PDF|google some spec sheets}} to get a better impression of what they do, and how they can be tweaked)}}
 +
 +
 +
Pros:
 +
* brightness is pretty constant, even in changing environments
 +
 +
* This lets you safely aim near the LED's maximum possible brightness
 +
 +
* can be fairly energy-efficient
 +
 +
 +
Cons:
 +
* the load has to fit the driver
 +
: not an issue in a fixed device, mind
 +
: but it makes them useless as e.g. a generic power supply, because it increase up the voltage to output their target current, which is not how most other things (want to) work
 +
 +
 +
 +
When choosing a constant current LED driver, you need to know
 +
* its voltage is enough for your LED(s) (look at the voltage drop)
 +
* its target current isn't too much for your chosen LED(s)
 +
* you're not trying to connect more LEDs than the driver current can handle
 +
 +
 +
A LED driver you can buy will often have chosen the target current for you.
 +
 +
And, because of how they work, they will be doing some voltage conversion - many take either 100-250V AC or somewhere in the range of 10-40V DC.
 +
 +
 +
 +
 +
Constant-current make more sense than constant-voltage drivers when controlling a known load, e.g. a single LED.
 +
 +
 +
 +
When coming from a higher voltage, they'll have something like a [[buck converter]].
 +
 +
 +
 +
More complex designs can give more features (like rectification, so polarity doesn't matter),
 +
and/or expose more of the IC's (e.g. a dimming knob, being well behaved around PWM).
 +
 +
 +
 +
Note that higher-powered LEDs are often multiple LEDs in series in an easier-to-cool package.
 +
It can sometimes make sense to under-power one of these so you can get away with less cooling.
 +
-->
 +
 +
======Constant-voltage LED driver======
 +
<!--
 +
 +
Constant-voltage drivers aim for a specific voltage, and the current that gets drawn depends on the load.
 +
 +
 +
Pros:
 +
* more flexible than CC design-wise when you don't know your exact load ahead of time
 +
: e.g. you can use the same driver for designs with varied amount of different amount of LEDs
 +
: also meaning you can add LEDs without adding drivers, as long as the combined current doesn't pass the driver's rated max
 +
 +
* could be used as more generic (well regulated) power supply
 +
 +
 +
Cons:
 +
* Less efficient than CC
 +
: {{verify}} why - electric reasons or typical/pragmatic ones?
 +
 +
* When connecting different LEDs/LED strings, production differences may mean some have lower V<sub>f</sub>, get more current, and burn out faster.
 +
: Can be alleviated (e.g. protection resistors, and one reason why LED strings have these) though it means you avoid using max brightness
 +
 +
 +
 +
http://www.sfeg.com/blog/difference-of-constant-voltage-vs.-constant-current-driver-for-led
 +
 +
http://www.ledsupply.com/blog/constant-current-led-drivers-vs-constant-voltage-led-drivers/
 +
 +
http://btbmarketing.com/staging/phihong/Phihong_CC_vs_CV_LED_Drivers_White_Paper.pdf
 +
 +
-->
 +
 +
=====Multiple LEDs=====
 +
======Common cathode versus common anode======
 +
<!--
 +
 +
Common cathode/anode is a general concept, but LEDs are a nice example case, and perhaps the one you are likeliest.
 +
 +
 +
When you have a bunch of LEDs in a construction close to each other,
 +
but that you want to drive separately (such as a seven-segment display),
 +
all such LEDs will probably either share their cathode, or all share their anode,
 +
to almost halve the amount of wires.
 +
 +
It doesn't matter to the LEDs themselves, but the difference matters to how exactly the controlling circuitry looks.
 +
 +
Common anode
 +
* means the V+ pins are tied together
 +
* and you light individual LEDs by connecting each to ground
 +
 +
* Most R,G,B LED strips are common-anode[http://electronics.stackexchange.com/questions/106810/why-are-most-rgb-led-strips-common-anode-instead-of-common-cathode]
 +
: it's e.g. more convenient when controlling using transistors{{verify}}
 +
 +
 +
 +
Common cathode
 +
* means all Gnd pins are tied together
 +
* you control by putting power on individual LEDs.
 +
 +
 +
-->
 +
 +
=====Series versus parallel=====
 +
<!--
 +
 +
You can do both, but each has its own requirements and pitfalls
 +
 +
Series:
 +
* easier to do with current-limiting resistors
 +
* prefers higher supply voltage (means you can put more on a string)
 +
* if one fails, the entire string stops
 +
 +
 +
Parallel:
 +
* harder to do with current-limiting resistors
 +
: more current through a single resistor, so needs a higher power rating
 +
 +
* Depending on how you limit current, LED failures may imply redistributing the same current to fewer LEDs - which means the rest will fail faster due to thermal runaway
 +
 +
* between batches (and even within the same batch) forward voltage is only within some tolerance. If they're different enough, some may draw much more current than others and there is no way to control that (resistors help here).
 +
 +
 +
 +
 +
You need a means of current limiting either way.
 +
 +
The higher-powered the whole, the more that a CC driver becomes more
 +
sensible.
 +
 +
 +
With current-limiting resistors, the restrictions
 +
above points to a mix.
 +
 +
Most commonly just as many as you can put in series with your
 +
voltage supply, and add such strings in parallel.
 +
 +
In theory you can also put a bunch in parallel after a single resistor,
 +
but choosing its value is a little more finicky,
 +
and note that failures
 +
 +
 +
 +
A mix tends to be most convenient,
 +
as evidenced by CC LED drivers tending to have ratings like 350mA 10-20V.
 +
 +
 +
 +
 +
 +
Driving a bunch of LEDs concurrently from a single voltage source using current limiting resistors, then in terms of heat and practicality, it is easier putting a bunch of them in series (and have a higher-voltage source makes that more practical).
 +
 +
In comparison, putting one resistor in front of a bunch of LEDs in parallel would work, but the current that needs to go through through is quickly high enough that the resistor can't dump that heat.
 +
For basic 0.25W resistors, it's usually just a few.
 +
Series is easier because you can just keep adding sets of resistor-and-LEDS-in-series (power source allowing), whereas neither inparallel or in-series allows adding to a particular group (for different reasons).
 +
 +
(Also, differences between LED in production means different parts of a parallel set might light more than others. This is less of an issue within series because the current is by definition the same through all, and between sets because the resistor is more of a part of determining that current)
 +
 +
 +
Note that much of the above does applies less to a constant-voltage supply, and even less to a constant-current driver.
 +
 +
 +
Downside to chunks in series is that if one breaks one such section stops working.
 +
 +
-->
 +
 +
====Dimming====
 +
 +
'''LEDs can be dimmed''', in two basic ways:
 +
 +
* '''Control the current'''
 +
: The amount of light isn't linear, but when humans adjust a knob, they tend to be practical about it, and if digital you can compensate.
 +
: The simple analog circuit requires little more than a transistor (being a current amplifier) and a voltage divider with a potmeter to control it, plus some fine tuning for the transistor's gain
 +
: ...plus some thought on how to never drive it with too much current
 +
 +
 +
* '''Blink it very fast''', typically using [[PWM]], or possibly a relatively analog oscillating circuit.
 +
: Once the cycle in which it blinks is 100Hz or faster, we humans only really perceive the average amount of light that comes out. When you have a microcontroller this tends to be moderately easy. There are some cheaper ICs that can do much the same.
 +
 +
: note that the current drops off faster than the intensity apparent to humans, meaning you can save a little power
 +
: ...and/or get a little more lifetime out of a LED, as it's heat (more than anything else) that destroys LEDs
 +
 +
 +
 +
It also means that on lower duty cycles you can drive them a slightly higher currents than you would use for continuous driving.
 +
But since LEDs typically heat up faster than they cool down, this is ''not'' "half the duty cycle means twice the power" stuff. Datasheets may spec some of these details, and there are some rules of thumb you can follow if they don't.
 +
 +
Also, it's not really worth it to do this for apparent brightness, because you need to lower the duty cycle.
 +
 +
Still, it's useful for things like an infrared TV remotes. Because the protocols used are quite low duty cycle {{comment|(typically simple bit-trains, where highs are themselves a 38kHz blockwave rather than continuous, and with relatively large intervals between repeated commands, so in this use are ''guaranteed'' to have a pretty low duty cycle)}}, you may be able to drive them at a few times their rated continuous current, which means they carry further.
  
  
 
http://www.ledsmagazine.com/features/4/8/1
 
http://www.ledsmagazine.com/features/4/8/1
 +
 +
 +
LED designed made for room lighting are designed to deal with hundreds of mA or more.
 +
Often because they're a large area or LEDS side by side (and often in part in series, allowing (or forcing) us to use higher voltages).
 +
 +
 +
 +
<!--
 +
You're not the first to think of using a capacitor to smooth PWM output.
 +
 +
It works in a way, but
 +
* until it's charged it looks ''more'' like a short than the LED itself would, which isn't nice to your current source.
 +
* due to charging time also changes the amount of time the voltage stays below the LED's minimum forward voltage - so usually lowers changes the intensity compared to a straight PWM signal (also meaning low duty cycles won't be visible at all).
 +
 +
Apparently inductors work better, but still stuffer similar problems for low duty cycle.
 +
 +
 +
However:
 +
* if you only care about humans (and other slow-sensing sensors), the integration time involved means the same smoothing/averageing
 +
 +
* changing the current changes the color. Perhaps only matters to accurate color reproduction (e.g. LED monitors/TVs), or getting the right sort of white out of your led.
 +
 +
...meaning the smoothing is unnecessary.
 +
 +
 +
 +
http://www.candlepowerforums.com/vb/showthread.php?278129-Electronics-question-why-not-put-a-big-cap-on-a-PWM-light
 +
 +
http://electronics.stackexchange.com/questions/206702/led-should-i-smooth-the-current-with-a-capacitor
 +
 
-->
 
-->
  
 +
====See also====
 +
 +
* Colors and voltages: http://www.oksolar.com/led/led_color_chart.htm
  
===Photodiodes===
+
===Thyristors===
 
<!--
 
<!--
(cf. [[#Photoresistors|photoresistors]])
 
  
Faster response than photoresistors.
+
Functionally, thyristors are electrically controlled [[bistable]] switches:
 +
they conduct in one way, ''or'' the other, and can be switched
 +
: by a gate (three-lead thyristor), or
 +
: by voltage being high enough (two-lead thyristor).
 +
 
 +
They will continue to conduct until the input drops below a threshold.
 +
 
 +
 
 +
Thyristors are semiconductors devices, but deal with higher voltages and/or currents than most semiconductors, so so are often seen controlling moderate power, from a low-voltage circuit.
 +
 
 +
Varying designs are used to switch AC or DC, at mains or lower voltages, e.g.
 +
: for light dimming.
 +
 
 +
: in a power supply that wants to protect its load from overvoltage.
 +
:: e.g. a zener that controls a thyristor across the mains input (this setup is called a crowbar), whenever it is probably a cheaper idea to trip hour house breaker, than to feed high voltages to your own circuit's output.
 +
 
 +
: as [[snubbers]] {{verify}}
  
Avalanche photodiode
 
  
 
See also:
 
See also:
* http://en.wikipedia.org/wiki/Photodiode
+
* http://en.wikipedia.org/wiki/Thyristor
 
-->
 
-->
  
 +
====Silicon-controlled rectifiers (SCR)====
 +
<!--
 +
A specific type of thyristor, one that will pass current only in one direction.
 +
 +
If you want a bidirectional variant, look at TRIACs.
 +
 +
 +
https://en.wikipedia.org/wiki/Silicon_controlled_rectifier
 +
-->
  
===Photoresistors, a.k.a. Light Dependent Resistors (LDR), Cadmium Sulfide cells (CdS)===
+
====GTO====
 
<!--
 
<!--
A (high resistance) semiconductor, not a simple resistor.
+
A gate turn-off (GTO) thyristor is one where the gate can also be used to turn the current both on and off (where a lot of thyristors with gates only allow you to turn it on, not off).
 
-->
 
-->
  
===Phototransistors===
+
====TRIAC====
 
<!--
 
<!--
A transistor where the base is the light diode controls the gain.
+
TRIAC (Triode for Alternating Current) is a generalized trade name, for what more formally is known as a bidirectional triode thyristor, or bilateral triode thyristor.
  
 +
Like a thyristor, it will continue to conduct until the input drops below a threshold.
  
Phototransistors (or opto-transistors) consist of a photodiode with internal gain. A phototransistor is in essence nothing more than a bipolar transistor that is encased in a transparent case so that light can reach the base-collector junction. The electrons that are generated by photons in the base-collector junction are injected into the base, and this photodiode c
+
But it does so in both directions.
 +
(They are not quite symmetric, though, which matters in design and some applications)
 +
 
 +
 
 +
Also exists in optical variant, for circuit-isolated control over an AC signal.
 +
 
 +
 
 +
See also:
 +
* http://en.wikipedia.org/wiki/TRIAC
 
-->
 
-->
  
 +
====DIAC====
 +
<!--
  
 +
A DIode for Alternating Current (DIAC) will conduct in both directions,
 +
but only above a basic breakdown voltage, and only until it drops below a certain voltage.
  
  
===DIAC===
+
They do not have a gate, and has lower breakdown voltage than most other thyristors.
  
 +
This makes them mostly useful as triggers on the gate of a TRIAC,
 +
as that lets them trigger more evenly.
 +
 +
This setup is often seen in classic AC dimmers (AC - light, heaters, etc.) and starters.
 +
 +
 +
See also:
 +
* http://en.wikipedia.org/wiki/Diac
 +
* [[#Triac]]
 +
 +
-->
 +
 +
====Others====
 
<!--
 
<!--
 +
See also:
 +
* http://en.wikipedia.org/wiki/Thyristor#Types_of_thyristor
 +
-->
 +
 +
===See also===
 +
* [[Electronics notes/Light sensing|Light sensing]] (for photodiodes, phototransistors)
 +
 +
 +
===Unsorted===
 +
 +
 +
 +
====LED pixel strings====
 +
{{stub}}
 +
 +
Each is a LED with built in driver chip (often 3 channels, RGB, 18mA-per-channel),
 +
in something like a {{imagesearch|5050 package}}.
 +
 +
There are also variants that separate the driver chip and the LED (and usually control a handful of LEDs each), but work and control much the same.
 +
 +
Sometimes called neopixels (this seems to be an adafruit name[https://www.adafruit.com/category/168])
 +
 +
 +
 +
These LED are not individally addressable as such.
 +
Instead, each chips holds one color, and when it gets a new one it commmunicates the old one on its own output.
 +
 +
So sending one color shifts everything in the string into the next pixel.
 +
 +
And if you want to change one pixel within a string,
 +
you will need to have remembered what's on there in your own buffer, change what you want, then replace the entire string's worth of values again.
 +
 +
...but you can update the entire chain fast enough to not notice it's actually shifting, at least not until you have more than one or two hundred such pixels in a string.
 +
 +
{{comment|(If you want to think big, say, make a hundreds-of-pixels display, you'll run into bandwidth and latency details, and you'll probably want to split it into multiple strings, controlled individually. You can probably use some of the cheapest microcontrollers you can find (but note minimum rate on some, e.g. the WS*) while still keeping update latency lower than your eyes can notice.)}}
 +
 +
 +
Note that a bunch have strict timing, in which case the '''speed''' of replacing the entire string is relatively fixed.
 +
 +
For an idea of speed, the WS2812, at 800kHz, means 1.25µs per bit, *3colors*8bits = 30µs per pixel, so e.g. 100 pixels takes ~3ms. {{comment|(This is roughly the amount of pixels you can update with it still looking pretty smooth to us - so more than that will have to be done in separate strings)}}
 +
 +
 +
 +
 +
There are perhaps a dozen variations of the ICs in relatively common use.
 +
 +
Most of them (noted if it differs)
 +
* Have 256 levels{{verify}} (8-bit) per channel {{comment|(some try to gamma-correct, which does rather matter to color mixing)}}
 +
* control 3 channels (for R,G,B) (sometimes 4, then typically RGBW)
 +
* '''current draw''': specced to draw around 18mA per fully bright color (varies somewhat per type)
 +
:: so around ~50mA max per single pixel
 +
:: ...for mixed near-whites; ''color'' colors will typically to something like 20 to 30mA.
 +
:: So e.g. 50 pixels would be ~2.5A max but typically more like 1A to 1.7A <!-- and 300 pixels ~15A max and 6A..9A-->
 +
:: note that there are variants -- which may be labeled exactly the same -- that draw maybe 60% of that.
 +
 +
 +
* You can often use a lower voltage
 +
: but they'll be dimmer
 +
: at some point no longer show the right color (because the different colors have different minimum voltages)
 +
: and below that fail to light at all.
 +
 +
* 3.3V-level logic won't work with things expecting 5V CMOS logic, but there are several tricks available (see below)
 +
 +
 +
Somewhat common ICs include:
 +
* '''WS2801''' - SOP-14 or DIP-14  (separate driver; controls a few LEDs)
 +
** 3-5V
 +
** shift up to 25MHz {{verify}}
 +
** chains with '''4''' wires {{comment|(Vcc, Gnd, Data, Clock)}}
 +
** More-channel-per-chip variants include '''WS2803''' (SOP-28, DIP-28) for 18 channels (up to 6 RGB LEDs)
 +
** {{search|WS2801 pdf|WS2801 datasheet}}
 +
 +
 +
* '''WS2811''' - PLCC6 (integrated in LED), or separate DIP-8 or SOP-8 chip
 +
** V<sub>cc</sub> is ~6V, V<sub>LED</sub> up to 12V{{verify}}
 +
** chains with '''3''' wires {{comment|(Vcc, Gnd, Data)}} - uses specific timing instead of a clock (...but this puts more constraints on the controller)
 +
** {{search|WS2811 pdf|WS2811 datasheet}}
 +
 +
 +
* '''WS2812''', '''WS2812B''' - PLCC6 (integrated in LED)
 +
** 6-7V
 +
** slight improvement over WS2811 based LEDs, identical to control {{verify}}
 +
** chains with '''3''' wires {{comment|(Vcc, Gnd, Data)}} - uses specific timing instead of a clock (...but this puts more constraints on the controller)
 +
** {{search|WS2812 pdf|WS2812 datasheet}}
 +
 +
 +
* '''LPD6803''' - SOP-16 / QFN-16 (separate driver)
 +
** 5-7V
 +
** shift up to 15MHz {{verify}}
 +
** {{search|LDP6803 pdf|LDP6803 datasheet}}
 +
** chains with '''4''' wires {{comment|(Vcc, Gnd, Data, Clock)}}
 +
** variants include LPD8806, LPD8809
 +
 +
 +
* '''LPD8803''' - SOP-16, others?{{verify}} (separate driver)
 +
** V<sub>cc</sub> is 2.7-5.5V, V<sub>LED</sub> is 3..12V
 +
** shift up to 20MHz {{verify}}
 +
** chains with '''4''' wires {{comment|(Vcc, Gnd, Data, Clock)}}
 +
** variants include LPD8806, LPD8809
 +
 +
 +
* '''HL1606''' - SOP-16, others? (separate driver)
 +
** 3-5V
 +
** SPI - needs 4 data wires (2 more than most of the others), 6 in total
 +
** Some sources note it doesn't do PWM, others say it does. I've not looked up what's going on there<!--
 +
Resembles a 74HC595 shift register
 +
https://learn.adafruit.com/hl1606-led-strip/basic-usage
 +
-->
 +
 +
 +
I've also seen mention of:
 +
* More-channel variants of LDPs, e.g. '''LDP6806''' and '''LDP8806''' (6-channel), apparently LDP8809, and probably more.
 +
* TM1803
 +
* TM1809
 +
* LPD1109
 +
* SM16716
 +
* TLS3001
 +
 +
 +
* SK681 (RGBW, separate white)
 +
 +
 +
 +
* ws2815
 +
: 12V
 +
 +
* GS8208
 +
: 12V
 +
 +
 +
 +
 +
 +
 +
 +
 +
Notes:
 +
* It seems the LPD6803 and WS2801 are decent tradeoffs between speed and price. There's faster, and there's cheaper, but for many purposes these are nice.
 +
 +
* WS28*'s 2-wire communcation {{comment|(in comparison to LDP*, which are more SPI-like)}} means more restrictions on the timing of communication {{comment|(you may need a fastish uC for reliable control)}}, and a little less bandwidth. The distance possible between pixels seems higher, and it seems to work out cheaper.
 +
 +
* most LDP variants are identical to control, most WS variants are similar to control
 +
 +
* On voltage:
 +
** Some chips can work with and put out at most ~5V (and may start working around 3 point something V).
 +
** Some will fry if you give them more than ~6V
 +
** Some can drive up to 12V and are fine with 5-12V.
 +
** Some are intentionally 12V. 12V means less effect from voltage drop over longer strips{{verify}}
 +
 +
<!--
 +
http://forum.arduino.cc/index.php/topic,115853.0.html
 +
-->
 +
 +
 +
 +
 +
<!--
 +
I have [See e.g. dealextreme, SKU [http://dx.com/s/111682 111682]
 +
this dealextreme product], using the LPD6803.
 +
 +
Using one regulated 5V source to power both string and microcontroller is probably easiest.
 +
Assume each pixel takes around 20mA to 35mA when you're doing bright-color stuff (ymmv),
 +
meaning a 50-pixel string will easily take 1A to 1.7A. (I'd use a &ge;2A 5V power supply to be safe)
 +
 +
The colors of these wires varies between products, and apparently over time.
 +
On the dealextreme products, Vcc and ground are identifiable by also being separate wires, Vcc also by not being in the plug.
 +
-->
 +
 +
<!--
 +
If nothing happens:
 +
* try a [[bypass capacitor]]
 +
* check that you're using the right code (try to identify the chip)
 +
* check that you've connected to the right end
 +
* The WS* protocol requires strict timing. You basically can't do anything else while updating the string, and you may need a >8MHz uC to be fast enough.
 +
-->
 +
 +
 +
 +
<!--
 +
 +
'''[http://learn.adafruit.com/adalight-diy-ambient-tv-lighting/ Adalight]''' (and projects like it) imitate the [http://en.wikipedia.org/wiki/Ambilight ambilight], when playing things from your PC via screen captures {{comment|(...which won't work with hardware accelerated decoding, 3D rendering, and some DVD players)}}.
 +
 +
Related projects:
 +
* [http://www.ambilight4pc.com/atmolight.html atmolight]
 +
* [http://code.google.com/p/boblight/ boblight]
 +
* [http://ca.rstenpresser.de/index.php/karate-main.html karatelight]
 +
* [http://www.rgb-styles.com/ibelight/ ibelight]
 +
 +
 +
If you want a pass-through device, so that you can plug in any (say, composite) video, you'll probably need a video capture device on your PC.
 +
 +
To forego a PC, you'll probably need something faster than an Arduino (in theory you might do very low resolution captures) - if you're going for cheapish but flexible, I'm guessing the raspberry pi plus a video capture USB stick may work well enough{{verify}}.
 +
-->
 +
 +
 +
=====3.3V tricks=====
 +
 +
Most of these LEDs are 5V CMOS devices, meaning they are HIGH above 70%*Vcc = ~3.5V, and just won't work when controlled from 5V.
 +
 +
 +
See [[Level shifting]] for your basic options.
 +
: I'd go for the two-diode level shifter, since this is just one line
 +
: {{comment|(note that since ws2812 communicate at 800Kbps, not all optoisolators are fast enough)}}
 +
 +
 +
 +
There's also a trick that runs one pixel at a lower Vcc (4.3V, via one diode) so that its input is high above >3V, and it outputs 4.3V logic (its Vcc) which is fine for the rest.
 +
 +
The one pixel will be a little less bright,
 +
so you either don't use it, or maybe use it for something separate like an indicator.
 +
 +
https://hackaday.com/2017/01/20/cheating-at-5v-ws2812-control-to-use-a-3-3v-data-line/
 +
 +
====zero cross circuit====
 +
<!--
 +
Side note: A '''zero cross circuit''' is one where it waits on the AC input to cross or be near 0V.
 +
 +
This is most relevant when ''switching'' that AC, to avoid changes in currents that are faster than the AC frequency (as would happen when switched e.g. at the wave's peaks), often to protect loads, and/or avoid causing higher-frequency noise.
  
http://en.wikipedia.org/wiki/Diac
 
  
See also: [[#Triac]]
+
It's often seen in circuits that control a larger load, e.g. via triac or thyristor/[https://en.wikipedia.org/wiki/Silicon_controlled_rectifier SCR].
  
TODO: summarize thyristors
+
Note that opto-triacs often come with zero-cross built in,
 +
and various solid-state relays do too.
 
-->
 
-->

Latest revision as of 18:22, 13 August 2021

This is for beginners and very much by a beginner.

It's intended to get an intuitive overview for hobbyist needs. It may get you started, but to be able to do anything remotely clever, follow a proper course or read a good book.


Some basics and reference: Volts, amps, energy, power · Ground · batteries · resistors · changing voltage · transistors · fuses · diodes · varistors · capacitors · inductors · transformers · baluns · amplifier notes · frequency generation · skin effect


And some more applied stuff:

IO: Input and output pins · wired local IO · wired local-ish IO · ·  Various wireless · 802.11 (WiFi) · cell phone

Sensors: General sensor notes, voltage and current sensing · Knobs and dials · Pressure sensing · Temperature sensing · humidity sensing · Light sensing · Movement sensing · Capacitive sensing · Touch screen notes

Actuators: General actuator notes, circuit protection · Motors and servos · Solenoids

Some stuff I've messed with: Avrusb500v2 · GPS · Hilo GPRS · JY-MCU · DMX · Thermal printer ·


Noise stuff: Stray signals and noise · sound-related noise names · electronic non-coupled noise names · electronic coupled noise · ground loop · strategies to avoid coupled noise · Sampling, reproduction, and transmission distortions


Audio notes: See avnotes

Microcontroller and computer platforms Arduino and AVR notes · ESP series notes · STM32 series notes · · · ·


Less sorted: Ground · device voltage and impedance, audio and otherwise · electricity and humans · power supply considerations · Common terms, useful basics, soldering · PLL · pulse modulation · signal reflection · resource metering · SDR · Project boxes · vacuum tubes · Unsorted stuff

See also Category:Electronics.

Behaviour

General

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)

Diodes were developed in vacuum tube days, around the same time semiconductor diodes were.

We now mean semiconductor diodes, unless noted otherwise.


The basic introduction to semiconductor diodes is that they conduct one way, and not the other. (a little more precisely, have very high resistance in one direction and very low resistance in the other).


That's may be enough knowledge for some applications around power (supplies), but around signals and in general, there are some subtleties to their behaviour.

For starters, look at the diode I-V curve.


A diode is largely characterized by:

  • Vf forward voltage drop
  • Vbr reverse breakdown voltage
  • current limit it will manage


Common wishes for diodes

  • Large current - for power control) (e.g. 1N4000, 1N5400 series)
  • low voltage drop - e.g. when doing polarity protection (e.g. ~0.7 for silicon, 0.3 for schottky, 0.2V for germanium)
  • fast switching - for signal use. Often implies lower current.
  • max reverse bias (commonly in the range of a few dozen to a few hundred)
  • reverse recovery (e.g. schottky)
  • low leakage (all diodes leak on the order of a few microamps in reverse)
  • high breakdown voltage



In forward bias

Diodes don't conduct current until forward bias (voltage) is higher than the diode's forward voltage drop, Vf.

This is usually in the 0.2 .. 0.7V range (and correlated to specific types, e.g. ~0.7 for silicon, 0.3 for schottky, 0.2V for germanium), but can be engineered higher (and will also be higher for diodes in series).

Above that voltage it they are pretty good conductor. It's still a semiconductor, though, so presents a small resistance. You can model a real diode as an ideal diode (the basic description of 'conducts one way and not the other') in series with a resistor.

That resistance actually varies with current (see the fact that the forward conduction part of the diode I-V curve so is not quite a straight line), so technically nonlinear, but in most uses this doesn't matter.


That voltage is also the voltage they drop

functionally this is usually is a ignoreable detail, sometimes in your way, and sometimes even useful.
this voltage is almost independent of current
that voltage times the current passed is wasted as heat
For example, running 3A through a 0.6V-drop diode means ~1.8watt wasted, as heat.


In reverse bias:

No current flows (aside from a tiny leak current).

...until the reverse breakdown voltage, and then they start conducting anyway. The behaviour is called Avalance breakdown, naming relevant semiconductor behaviour[1].

That voltage is often 50V or more, and can be engineered to be higher.

Which means you can ignore this effect in in a lot of low-voltage electronics.


Most diodes are not made for this, will be easily damaged. (Again, look at the I-V curve: the reverse current curve is much steeper, meaning there is little difference between 'conducts a little' and 'burns itself up unless something else limits current')


Zener diodes are roughly the only type that are made for this. Their reverse breakdown voltage is intentionally lower (see Zener applications), and the I-V curve is often a little less steep, meaning there is more voltage range they are comfortable with, and is easier for you to intentionally use. See the section on Zeners below.



LEDs are somewhat unusual diodes.

They have higher Vf, most between 1.4V and 4.5V,
their design focuses on light, means they can deal with very little current,
they have negative resistance curve (putting current through them heats them up, lowering the resistance and passing more current - thermal runaway until it burns)

The are also more fragile in reverse.

You don't want to use LEDs as diodes for power, but they have some uses around signals, where you know current is never high.


See also: http://www.stephenpeek.co.uk/Electronics/diode/diode.htm

Zener diode (type/behaviour)

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)

Context:

Reverse breakdown refers to diodes/transistors conducting in reverse.

All diodes have a zener voltage beyond which they conduct, and a reverse breakdown region where that reverse flow will happen (and then a point at which they burn).

On regular diodes, the Zener voltage is far enough away (usually dozens of volts) to never happen in the circuit it's specced for.


Even when you want to use it, on regular diodes the region is narrow and hard to use, varies with production(verify), so you would easily damage it.


A Zener diode, in forward bias, acts like a completely regular diode, with similar voltage drop (usually roughly 0.6V .. 0.7V drop, sometimes lower(verify))

Their difference is in reverse behaviour:

Their Zener voltage is engineered to be at a lower level (one more usable in typical low-voltage electronics, often between 2.4V and 7V, apparently up to 33V)
they have a wider reverse breakdown region, better-characterized in that region, and more robust within it.

(Lower-than-2.4V Zeners are actually imitations of Zener behaviour and their behaviour is a little different(verify))


The better defined reverse breakdown region make it exploitable in its own right, e.g.

  • voltage clamping protection (and other purposes where they effectively act as a sort of relief valve)
e.g. say you have a 5V-powered device, and added a 5.1V zener. A transient spike in the input will be suppressed to a good amount (and because it's transient will not cause temperature issues in the zener)
  • simple, shunt-style regulation
(TODO: simple zener regulation image)
not efficient, not the mort stable, so for more than a little current you want other regulation
  • fixed voltage references
  • clipping signals
e.g. one for DC, two for an AC waveform
e.g.
in audio for distortion (see fuzz boxes)
avoiding op amp phase inversion


The current and heat dissipation varies between zeners, often range of milliwatts for voltage reference, a few hundred milliwatts for simple regulation, up to a Watt or so.

Since you rarely want to move a lot of current in reverse bias, circuits will often see some sort of current limitation (a resistor or such).


See also:


Avalanche diode (spec/type)

Avalance diodes usually refer to diodes that are made to imitate Zener behaviour, yet will work for higher voltages (100 ~ 300V) than true Zeners can.


Avalance diodes may be found categorized as (or referred to) as Zener diodes.


See also:


Rectifier diode (spec)

Rectification is a circuit typically using diodes, not a type of diode.


However, you would prefer specific specs for rectification designs.

As such, diodes manufactured specifically for this use may be in their own section when you're looking to buy them.


Also, since you usually combine two or four of them, there are also single components that contain two or four suitable diodes.


Signal diode, switching diode (spec)

Applications

Bypass diode / flyback protection diode (application)

A bypass diode is a diode used to protect something against reverse biasing - against voltage going the wrong way.

Also known as flyback diode, kickback diode, catch diode, snubber diode, freewheeling diode, suppressor diode, commutating diode, antiparallel diode, and more. (Some names refer more specifically to more transient reverse biasing, or the causes behind that)


Examples:

  • inductors in general can store energy (in the magnetic field)
some because sudden changes (e.g. solenoid disconnecting)
and larger things that move (solenoids, motors) a little more so (movement that translates back to magnetic field)
They can often easily deliver a few times the voltage they usually operate at (varying with case). This can seriously stress the circuit components directly around it, depending on design.
The use of a diode in parallel, reverse-biased to how you drive it, is one easy way to bleed this short-lived current
yes, you're essentially making a one-way short-circuit, which is why it also affects the braking behaviour of coil-style actuators: the collapse of the magnetic field is usually slowed(verify)
on the spike shape:
https://electronics.stackexchange.com/questions/110574/how-to-choose-a-flyback-diode-for-a-relay
  • In a series of solar cells, shading one cell among multiple leads that one cell it to be reverse biased relative to the others, meaning that panel gets fed current from the others, which would heat it and may eventually damage it.
A bypass diode in parallel with each cel llets the current-in-the-wrong-direction pass alongside the cell instead.


Notes:

  • If the load is bidirectional (e.g. bidirectional motor driver) then the flyback can happen in either direction, and you can't protect it in the way described above
For example, in the case of a H-bridge driver, you need four diodes for protection in both directions
  • Protection diodes should be able to take a decent load - may well be a few amps for a short while (depends a lot on the load)
bog-standard diode like 1N4001-1N4007 series can be used - for lower frequencies
for higher frequencies you need to look around more, probably for schottky diodes
  • Protection diodes should have a voltage rating of at least the voltage you are applying
whenever significant energy can get stored (e.g. in case of coils), leeway is a good idea
  • Protection diodes should be robust to reverse biasing (themselves)
  • You may have preference for a fast-acting diode (e.g. Schottky) to minimize the time the reverse bias is applied (though note they have lower reverse-bias ratings)
  • Sometimes you may also care about low voltage drop (which can matter e.g. in solar and battery applications, minimizing loss).
  • If reaction time is not so important (or low cost is considered more important), cheaper general-purpose diodes such as the 1N400x series can be used.


-->

See also:

Blocking diode (application)

Clamp diode, protection diode, diode clipping (application)

Protection diodes in ICs

Clamper circuit, diode clamp (application)

Rectifier bridge (simple design)

LEDs

LEDs convert a higher percentage of energy going through them to light than, say, classic lightbulbs (where a lot of the energy becomes heat, i.e. IR radiation).


That sounds awesomely efficient, though there's a footnote to that: getting from AC mains voltage to few-volt DC voltage. That conversion is not very efficient to do, particularly not for the quite-low currents involved when each just powers a few LEDs.



LEDs do act as diodes ('Light Emitting Diodes', after all), in that they conduct/work only in one direction. Their ratings as diodes is pretty poor, though. They are slower, and their reverse breakdown is close, so in many situations you'ld want to add a serious diode.


LED of different types usually need something like 2V or 3V forward voltage before they start emitting light. (The extremes, including some less usual types, seem to be 1.6V and approx. 4.4V)(verify).


Driving

LEDs have an I-V curve that is not only nonlinear, but also very steep exactly near the point you woule like to operate them at, particularly if you want to drive them at decent brightness but also have them live long.

they have a threshold below which they do nothing
a fairly flat bit of still low current (and they will be relatively dim here)
quick-and-dirty uses operate them here, e.g. by using a somewhat large resistor.
and then shoots up, from little current to too much, over a volt or two

The exact curve varies with

  • LED type (that search shows different curves for the different classic LED colors),
  • environment temperature - itself largely determined by the current currently going through it
  • production line variation


Indicator LEDs tend to be specced for a continuous current of ~10mA. Superbright for perhaps ~20mA, and low-current LEDs perhaps 2mA.

Keep in mind that these are continuous-use maximums. Both in that most LEDs already give off some light at 1mA. (And also that you can often pulse higher currents on a low duty cycle. Check spec sheets)


All that makes it very hard to create a universal LED driver that is entirely plug and play.

This is roughly why the current-limiting resistor approach is such a typical approach, because it which works fine on things like indicator LEDs where we care more about lifetime and basic visibility than maximum brightness or maximum efficiency.

When driving powerful LEDs, though, we do care (also because of waste heat), and will generally use a current-limiting LED driver, for which there are now plenty of ICs, and supplies centered around them.


LED response time
Current limiting resistor

A LED has negligible resistance, so will easily pass much more current than it can stand.


As such, you need something external to it to limit current.

The simplest way to do so is to put a resistor in series. For most LED and typical PCB voltages this works out on the order of 100 ohm to 1kOhm.


The upside is that it' very simple, the downside is that since the resistor passes the same current as the LED, it will also waste some power, putting that into heat instead of light.

A fairly small to tiny amount in most setups, and it turns out that if you have a few indicator LEDs drawing a few dozen mA total, then it's often not worth it energy-wise or component-wise to drive them more efficiently, unless maybe you need the absolute most battery life.

At the same time, when producing a lot of light, there are certainly better ways.



Details:

Being a diode, the LED drops a fixed voltage, its Vf.

...but does not limit current so in current terms it might as well not be there. Your calculations aim to have just the resistor drop drops enough of the (leftover) voltage that the current through it and something in series with it is at/below some target current.

...in this case the specific LED's rated maximum continuous current - or rather something a bit below it with a slightly higher-valued resistor.


Often your givens are the supply voltage, the LED's voltage drop Vf, and the LED's maximum continuous current rating you want to stay under.

You'll usually use:

     Vin - VLED
R = -----------
        ILED


Chances are you'll grab the next-highest standard-valued resistor. If you want to know the current for it, the following reformulation is useful:

ILED = (Vin - VLED) / R

For example, to drive a ~2.2V red LED, aiming to stay under 20mA, and using standard-value (e.g. cheap carbon 5%) resistors, you might choose:

  • on 3.3V: 100Ω for 11mA, maybe 220Ω for 5mA
  • on 5V: 220Ω for 12mA, maybe 330Ω for 8mA or 150Ω for 19mA,
  • on 9V: 470Ω for 14mA
  • on 12V: 560Ω for 17mA, or 1kΩ for 10mA, or maybe 470Ω for 21mA.


Side note: A LED's max-current rating is for a good part limited by the ability to sink the generated heat, and assumes continuous current. When you're only ever pulsing the LED with a lowish duty cycle, you can get away with higher currents. For example, TV remote IR leds can do this because their pulsed protocols are implicitly low-duty-cycle. And you might do it for visible LEDs because when using something like PWM, for part of the curve current drops off faster than the human-apparent intensity.

LED drivers

At some point (often above a few hundred mA, for something that is on a lot), it becomes worth it energy-wise to invest in components to drive the LED more efficiently.


Since this often means a cleverer, more controlled circuit, it usually also means we can more safely aim for a current that is nearer its maximum brightness, just because there is less risk of burning it.


There are two basic approaches:


Constant-current LED driver
Constant-voltage LED driver
Multiple LEDs
Common cathode versus common anode
Series versus parallel

Dimming

LEDs can be dimmed, in two basic ways:

  • Control the current
The amount of light isn't linear, but when humans adjust a knob, they tend to be practical about it, and if digital you can compensate.
The simple analog circuit requires little more than a transistor (being a current amplifier) and a voltage divider with a potmeter to control it, plus some fine tuning for the transistor's gain
...plus some thought on how to never drive it with too much current


  • Blink it very fast, typically using PWM, or possibly a relatively analog oscillating circuit.
Once the cycle in which it blinks is 100Hz or faster, we humans only really perceive the average amount of light that comes out. When you have a microcontroller this tends to be moderately easy. There are some cheaper ICs that can do much the same.
note that the current drops off faster than the intensity apparent to humans, meaning you can save a little power
...and/or get a little more lifetime out of a LED, as it's heat (more than anything else) that destroys LEDs


It also means that on lower duty cycles you can drive them a slightly higher currents than you would use for continuous driving. But since LEDs typically heat up faster than they cool down, this is not "half the duty cycle means twice the power" stuff. Datasheets may spec some of these details, and there are some rules of thumb you can follow if they don't.

Also, it's not really worth it to do this for apparent brightness, because you need to lower the duty cycle.

Still, it's useful for things like an infrared TV remotes. Because the protocols used are quite low duty cycle (typically simple bit-trains, where highs are themselves a 38kHz blockwave rather than continuous, and with relatively large intervals between repeated commands, so in this use are guaranteed to have a pretty low duty cycle), you may be able to drive them at a few times their rated continuous current, which means they carry further.


http://www.ledsmagazine.com/features/4/8/1


LED designed made for room lighting are designed to deal with hundreds of mA or more. Often because they're a large area or LEDS side by side (and often in part in series, allowing (or forcing) us to use higher voltages).



See also

Thyristors

Silicon-controlled rectifiers (SCR)

GTO

TRIAC

DIAC

Others

See also


Unsorted

LED pixel strings

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)

Each is a LED with built in driver chip (often 3 channels, RGB, 18mA-per-channel), in something like a 5050 package.

There are also variants that separate the driver chip and the LED (and usually control a handful of LEDs each), but work and control much the same.

Sometimes called neopixels (this seems to be an adafruit name[2])


These LED are not individally addressable as such. Instead, each chips holds one color, and when it gets a new one it commmunicates the old one on its own output.

So sending one color shifts everything in the string into the next pixel.

And if you want to change one pixel within a string, you will need to have remembered what's on there in your own buffer, change what you want, then replace the entire string's worth of values again.

...but you can update the entire chain fast enough to not notice it's actually shifting, at least not until you have more than one or two hundred such pixels in a string.

(If you want to think big, say, make a hundreds-of-pixels display, you'll run into bandwidth and latency details, and you'll probably want to split it into multiple strings, controlled individually. You can probably use some of the cheapest microcontrollers you can find (but note minimum rate on some, e.g. the WS*) while still keeping update latency lower than your eyes can notice.)


Note that a bunch have strict timing, in which case the speed of replacing the entire string is relatively fixed.

For an idea of speed, the WS2812, at 800kHz, means 1.25µs per bit, *3colors*8bits = 30µs per pixel, so e.g. 100 pixels takes ~3ms. (This is roughly the amount of pixels you can update with it still looking pretty smooth to us - so more than that will have to be done in separate strings)



There are perhaps a dozen variations of the ICs in relatively common use.

Most of them (noted if it differs)

  • Have 256 levels(verify) (8-bit) per channel (some try to gamma-correct, which does rather matter to color mixing)
  • control 3 channels (for R,G,B) (sometimes 4, then typically RGBW)
  • current draw: specced to draw around 18mA per fully bright color (varies somewhat per type)
so around ~50mA max per single pixel
...for mixed near-whites; color colors will typically to something like 20 to 30mA.
So e.g. 50 pixels would be ~2.5A max but typically more like 1A to 1.7A
note that there are variants -- which may be labeled exactly the same -- that draw maybe 60% of that.


  • You can often use a lower voltage
but they'll be dimmer
at some point no longer show the right color (because the different colors have different minimum voltages)
and below that fail to light at all.
  • 3.3V-level logic won't work with things expecting 5V CMOS logic, but there are several tricks available (see below)


Somewhat common ICs include:

  • WS2801 - SOP-14 or DIP-14 (separate driver; controls a few LEDs)
    • 3-5V
    • shift up to 25MHz (verify)
    • chains with 4 wires (Vcc, Gnd, Data, Clock)
    • More-channel-per-chip variants include WS2803 (SOP-28, DIP-28) for 18 channels (up to 6 RGB LEDs)
    • WS2801 datasheet


  • WS2811 - PLCC6 (integrated in LED), or separate DIP-8 or SOP-8 chip
    • Vcc is ~6V, VLED up to 12V(verify)
    • chains with 3 wires (Vcc, Gnd, Data) - uses specific timing instead of a clock (...but this puts more constraints on the controller)
    • WS2811 datasheet


  • WS2812, WS2812B - PLCC6 (integrated in LED)
    • 6-7V
    • slight improvement over WS2811 based LEDs, identical to control (verify)
    • chains with 3 wires (Vcc, Gnd, Data) - uses specific timing instead of a clock (...but this puts more constraints on the controller)
    • WS2812 datasheet


  • LPD6803 - SOP-16 / QFN-16 (separate driver)
    • 5-7V
    • shift up to 15MHz (verify)
    • LDP6803 datasheet
    • chains with 4 wires (Vcc, Gnd, Data, Clock)
    • variants include LPD8806, LPD8809


  • LPD8803 - SOP-16, others?(verify) (separate driver)
    • Vcc is 2.7-5.5V, VLED is 3..12V
    • shift up to 20MHz (verify)
    • chains with 4 wires (Vcc, Gnd, Data, Clock)
    • variants include LPD8806, LPD8809


  • HL1606 - SOP-16, others? (separate driver)
    • 3-5V
    • SPI - needs 4 data wires (2 more than most of the others), 6 in total
    • Some sources note it doesn't do PWM, others say it does. I've not looked up what's going on there


I've also seen mention of:

  • More-channel variants of LDPs, e.g. LDP6806 and LDP8806 (6-channel), apparently LDP8809, and probably more.
  • TM1803
  • TM1809
  • LPD1109
  • SM16716
  • TLS3001


  • SK681 (RGBW, separate white)


  • ws2815
12V
  • GS8208
12V





Notes:

  • It seems the LPD6803 and WS2801 are decent tradeoffs between speed and price. There's faster, and there's cheaper, but for many purposes these are nice.
  • WS28*'s 2-wire communcation (in comparison to LDP*, which are more SPI-like) means more restrictions on the timing of communication (you may need a fastish uC for reliable control), and a little less bandwidth. The distance possible between pixels seems higher, and it seems to work out cheaper.
  • most LDP variants are identical to control, most WS variants are similar to control
  • On voltage:
    • Some chips can work with and put out at most ~5V (and may start working around 3 point something V).
    • Some will fry if you give them more than ~6V
    • Some can drive up to 12V and are fine with 5-12V.
    • Some are intentionally 12V. 12V means less effect from voltage drop over longer strips(verify)






3.3V tricks

Most of these LEDs are 5V CMOS devices, meaning they are HIGH above 70%*Vcc = ~3.5V, and just won't work when controlled from 5V.


See Level shifting for your basic options.

I'd go for the two-diode level shifter, since this is just one line
(note that since ws2812 communicate at 800Kbps, not all optoisolators are fast enough)


There's also a trick that runs one pixel at a lower Vcc (4.3V, via one diode) so that its input is high above >3V, and it outputs 4.3V logic (its Vcc) which is fine for the rest.

The one pixel will be a little less bright, so you either don't use it, or maybe use it for something separate like an indicator.

https://hackaday.com/2017/01/20/cheating-at-5v-ws2812-control-to-use-a-3-3v-data-line/

zero cross circuit