Circuit Bytes · Episode 28 · Components · Relays
Relays
A relay is a switch flipped by a magnet. A small current through its coil pulls a metal arm and closes the contacts, so a tiny circuit can switch a much bigger one without the two ever touching.
A switch flipped by a magnet
A chip can only push a tiny current, but sometimes it needs to turn on something big, like a pump or a motor. A relay does that job. Inside is a coil of wire wrapped around an iron core, and a springy metal arm (the armature) that carries one of the switch contacts. A small spring holds the arm away from the core.
Coil on, contacts closed
Run current through the coil and it becomes an electromagnet. The magnetic field pulls the arm down toward the core, and the contacts snap shut with a click. Now current can flow through the contacts to the load. Turn the coil off and the spring lifts the arm, opening the contacts again.
Two circuits that never touch
The coil side and the switch side are not wired together. The only link between them is the magnetic pull on the arm. That's why a small control circuit (the chip and the coil) can switch a separate, bigger load circuit (the battery and the pump): the two are electrically isolated.
Normally open, and driving the coil
The contacts in the video are normally open (NO): they are closed only while the coil has power. The coil itself obeys Ohm's law, so its current is coil voltage ÷ coil resistance: 5 V ÷ 100 Ω = 0.05 A = 50 mA. Most chip pins are only rated for about 20 mA, so a transistor switch sits between the pin and the coil and carries the coil current instead. A diode across the coil absorbs the voltage spike when the coil turns off.
Try it yourself
Find a relay's datasheet (search for any common hobby relay) and look for two numbers: the coil voltage and the coil resistance. Divide one by the other to get the coil current. For example, a 24 V coil of 1,200 Ω draws 24 ÷ 1,200 = 0.02 A = 20 mA. Compare your answer to about 20 mA for a chip pin: if it's close or above, use a transistor to drive the coil.
Good to know
- An electromechanical relay is an electromagnet (the coil) that moves an armature carrying switch contacts.
- Many relays also have a normally closed (NC) contact that is connected when the coil is off and opens when it's on. COM is the shared terminal that switches between NO and NC.
- Real 5 V relay coils are often roughly 70-100 Ω, so check the datasheet for your part.
- Microcontroller pins are typically rated around 20 mA continuous (an Arduino Uno's ATmega328P has a 40 mA absolute maximum), so a transistor or driver chip is used for the coil.
- The flyback diode across the coil protects the transistor from the spike when the coil's magnetic field collapses.
- The pump is a generic example. Switching wall-powered loads with a relay is wall-wiring work: leave it to a licensed electrician and keep your experiments at battery voltages.
Answer to the comment question
A 12-volt relay coil has 400 ohms of resistance. How many milliamps does it draw? 30 milliamps. I = V ÷ R = 12 V ÷ 400 Ω = 0.03 A = 30 mA.
Test your knowledge
Quick quiz: Relays
4 multiple-choice questions. Pick one answer for each, then check how you did.
Sources
- All About Circuits, "Relay Construction": coil, armature and contacts; the coil isolates the control circuit from the switched circuit
- SparkFun Learn, "SIK Experiment Guide for Arduino V3.3, Experiment 13: Using Relays": COM, NO and NC; a transistor and diode drive the coil
- All About Circuits, "Electromagnetism": a current-carrying coil makes a magnetic field; relays introduced
- SparkFun Learn, "Transistors: Applications I, Switches": driving a load a chip pin can't power directly
Video transcript
How can a tiny current from a chip switch on something big, like a pump?
With a relay: a switch flipped by a magnet. Inside: a coil and a springy metal arm.
Current through the coil makes an electromagnet. It pulls the arm down and the contacts snap shut. Click!
The coil side and switch side never touch, so the small circuit stays separate from the big one.
These contacts are normally open: closed only while the coil has power.
A 5-volt coil of 100 ohms draws 50 milliamps. That's too much for most chip pins, so a transistor switch drives the coil.
A 12-volt relay coil has 400 ohms of resistance. How many milliamps does it draw? Comment your answer below!
That's your byte.
More from Circuit Bytes
- EP26cThe transistor as a switch
- EP27cThe transistor as an amplifier
- EP29cBatteries in series vs parallel
- EP30cFuses and circuit breakers