Electronics notes/Diodes

From Helpful
(Redirected from LED strip)
Jump to: navigation, search
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: 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 · 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