Embedded Systems/High-Voltage Circuits
From Wikibooks, the open-content textbooks collection
Often we use embedded systems to control high-power devices. For example, maybe we want to program a microcontroller to turn on and off standard light bulbs.
As we discussed earlier, typical microcontroller output pins switch between 0 V and 5 V, and can drive a maximum of 0.025 A. But a typical light bulb requires 120 VAC at 0.5 A to turn on. We can't connect the microcontroller up to the 120 VAC directly. [1] What do we do?
Contents |
[edit] Transistors and Relays
Some transistors, known as "Power Transistors", can control a high voltage source using a lower voltage control signal. There is also a type of electromechanical device known as a relay that can also be used to control a high voltage source with a relatively small control current. Both of these tools can be used to control the flow of a high-power electrical flow with an embedded computer.
Occasionally we need to use multiple stages of amplification. To turn on a large motor, we need a large relay -- but to turn on the large relay, we need a power transistor -- but to turn on the large transistor, we need at least a small transistor -- finally, we turn on the small transistor with the microcontroller output pin.
[edit] Isolation
When working with embedded systems, or any expensive piece of equipment, we often find that it is a good idea to isolate the expensive components from the high power components. We do this through a technique called isolation. Isolation, in essence, is how we keep the high current and/or high voltages out of low-current, low-voltage devices. There are several types of isolators.
The "isolation barrier" is an imaginary line between the high-current or high-voltage device on one side, and low-current, low-voltage devices on the other side.
- Transformers are used to transfer power from one side of the isolation barrier to the other
- optoisolators are used to transfer signals across an isolation barrier from one low-power device to another low-power device
- relays allow a microcontroller on one side of the isolation barrier to switch on and off high-power devices on the other side.
[edit] Transformers
Transformers use magnetic fields to move a voltage from one coil to another (over simplification). There is no direct wire connection between the input and the output terminals, and therefore transformers can help to prevent spikes on one side from damaging expensive equipment on the other.
[edit] Opto-Isolators
Opto-Isolators are the ultimate in isolation[citation needed]. One half of the Opto-Isolator (OI) is an LED. The circuit connected to that side turns the light on and off. The other half of the optoisolator is a phototransistor. When the light is on, the phototransistor absorbs the light, and acts like a closed switch. When the light is off, the phototransistor acts like an open switch. Because light is used instead of electricity, and because the light can only go in one direction (from LED to phototransistor), they provide a very high level of reliable isolation.
The hardware MIDI interface is an example of a good opto-isolator interface.
[edit] Relays
Relays can also be used to isolate, because they act very similarly to transformers. The current flow in one wire is controlled by a magnetic field, generated by a second wire.
A relay controls whether electrons flow or not, by allowing a small current to the input coil producing a magnetic field in which operates the switch.
[edit] references
- ↑ (1) Occasionally someone does accidentally connect an integrated circuit to 120 V. The integrated circuit immediately self-destructs. If you're lucky, it cracks in half and lets off a small puff of smoke. If you're unlucky, it will still look like a good chip, leading to hours of frustration trying to figure out why the system isn't working.
[edit] For further reading
- SCRs and triacs include several power transistors in a convenient package, and often cost less than buying equivalent transistors seperately.
- So-called "solid-state relays" (Wikipedia:SSR) are a convenient combination of an opto-isolator and some power transistors. Some SSRs include a Wikipedia:Zero cross circuit.

