Relays

What is a relay?

A relay is an electrically operated switch. When you turn it on, it switches on way. When it is off, it switches the other way.You can use a relay to switch on and off a high current device, like a coffemaker.

How does a relay work?

A relay has an electromagnet, called a coil, and a lightweight switch inside it. When you energize the coil, a piece of the switch is attracted by the coil's magnetic field, which switches the switch on or off.

How do I attach a relay to the board?

The following schematic shows the basic circuit.

E-mail ara@mit.edu if you need a copy of this schematic.

Attach the circuit to one of the HC11's port pins. Use the switch terminals of the relay to switch the device on and off.

WARNING: Never touch a circuit that is plugged into the wall! Make sure any wires attached to the AC line are well insulated and all connections involving the AC line are covered with tape. Line power has killed before and will kill again!

The transistor allows the HC11 to control the relay's medium-sized coil current. The diode prevents the relay from arcing by providing a return path for the energy stored in the coil's magnetic field, extending the relay's life.

How do I identify the relay's pins?

Get an ohmmeter, and measure the resistance between all the relay's pins. The pair of pins with a low but not zero resistance (300 ohms or so) are the coil pins. Then, use the ohmmeter as a continuity checker, and see which pins connect to which other pins both when the relay is energized and not energized. This procedure will allow you to determine the relay's switching configuration.

Some relays have more complicated switching configurations than the one in the picture, for example, some have several switches in parallel. Other relays, called latching relays, have two or more coils and a mechanical latching mechanism inside. A momentary pulse on one of the coils switches the switch. The switch stays switched until you put a momentary pulse on the other coil.

Troubleshooting

If the relay dosen't seem to do anything, it may have the wrong coil voltage. Most relays have a 12 volt coil, but some have a five volt coil. Five volt coil relays are easier to use, since you don't need a high voltage power supply. If you have a twelve volt relay and want to put it on your board, you might try putting nine volts (which is avaliable on the board) on the coil instead of five volts, as shown in the schematic.


Ara Knaian <ara@mit.edu>