Actuators & Control · Study deck

Relays and Solenoids: Drivers and Protection

A coil stores energy and sends a voltage pulse back when switched off.

Motor Max is your guide for this deck.

relayssolenoids
Motor Max, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Explain: The photographs below make solid-state relay (ssr) a physical comparison: look for changes in package, exposed interfaces, mounting, scale, and service access before treating the forms as interchangeable.
  • Explain: Different bodies can provide the same electrically controlled switching capability, but the isolation technology, current path, terminals, protection parts, and mounting method determine where each relay form belongs.
  • Explain: Step 4: Verify mechanical life against application: Both relays exceed the required lifespan, but contact degradation from inrush current will shorten this significantly if undersized.
  • Explain: For silent, high-speed, and maintenance-free switching, use solid-state relays.
An industrial butterfly valve with a pneumatic actuator and electrically controlled solenoid valve mounted on top
An industrial butterfly valve with a pneumatic actuator and electrically controlled solenoid valve mounted on top
iotclass.org

Major section

Start With the Story

The coil stored energy that had nowhere safe to go.

  • An actuator means a part that turns an electrical command into physical action.
  • GPIO means general purpose input/output.
  • A GPIO pin is a small digital connection on a controller; it must not power a heavy coil directly.

Key terms

Relays and solenoids
Relays and solenoids are useful because they make clean on/off actions.
iotclass.org

Major section

Start With the Story (continued)

This runway does not prove that every relay or solenoid suits the load.

  • The deeper sections explain ratings, drivers, isolation, flyback protection, heating, switching life, and mechanical limits.
  • Think of a water valve that opens only when the controller energizes a coil, then snaps shut when power is removed.
  • The software command is small, but the coil current, contact rating, flyback path, and default state decide whether the physical action is safe.
Panel-mount 40 amp solid-state relay with low-voltage control terminals and high-current load terminals
Panel-mount 40 amp solid-state relay with low-voltage control terminals and high-current load terminals
iotclass.org

Major section

Never Connect Relay Coil Directly to GPIO!

Most relay coils draw 50-100mA, far exceeding the 20-40mA GPIO limit.

  • Different bodies can provide the same electrically controlled switching capability, but the isolation technology, current path, terminals, protection parts, and mounting method determine where each relay form belongs.
One-channel electromechanical relay breakout with logic header, indicator, relay can, and screw terminals
One-channel electromechanical relay breakout with logic header, indicator, relay can, and screw terminals
iotclass.org

Major section

Solenoid Control

Once the relay pattern is clear, a solenoid is the same electrical problem with motion instead of contacts.

  • Solenoids provide linear push/pull motion for locks, valves, and latches.
  • The visible valve motion is evidence from a chain of energy conversions, not proof that coil current alone guarantees movement.
Real photograph of solenoid (valve/lock actuator)
Real photograph of solenoid (valve/lock actuator)
iotclass.org

Major section

Solid-State Relays (SSR)

The photographs below make solid-state relay (ssr) a physical comparison: look for changes in package, exposed interfaces, mounting, scale, and service access before treating the forms as interchangeable.

  • They share a capability name, but packaging and installation change the electrical, mechanical, environmental, and maintenance constraints.
  • For silent, high-speed, and maintenance-free switching, use solid-state relays.

Key terms

No moving contact
No moving contact means quiet, fast cycling, but leakage, on-state voltage drop, load type, and heatsinking remain part of the switching decision.
A small black solid-state relay with four metal pins, shown next to a ruler for scale.
A small black solid-state relay with four metal pins, shown next to a ruler for scale.
iotclass.org

Major section

Design Example: Smart Sprinkler Controller

The exact component choices vary by product, but the engineering tradeoffs are stable.

  • The engineering challenge: Each irrigation zone uses a 24V AC solenoid valve drawing 250-500 mA inrush current.
  • The controller must switch up to 16 zones, survive outdoor temperature extremes (-20C to +50C), and last 10+ years with daily cycling.
  • Lesson for IoT designers: solid-state switching is not always chosen for raw electrical superiority.

Why it matters

A Wi-Fi-connected irrigation controller is a useful relay and solenoid design example because it must switch many outdoor valve coils, survive wiring faults, and avoid nuisance noise in a home installation.

iotclass.org

Major section

12V Motor Relay Sizing

Scenario: You are designing an IoT greenhouse controller that switches a 12V DC ventilation fan on and off based on temperature readings.

  • The fan motor is rated for 5A continuous operation.
  • Relay B: 15A assumed inrush / 28A measured = 0.54× margin (undersized -- contacts will arc and weld!).
  • Step 4: Verify mechanical life against application: Both relays exceed the required lifespan, but contact degradation from inrush current will shorten this significantly if undersized.
Relay controller kit with circuit board, relay, terminals, driver components, and protection parts laid out for assembly
Relay controller kit with circuit board, relay, terminals, driver components, and protection parts laid out for assembly
iotclass.org

Deck summary

Key takeaways

The coil stored energy that had nowhere safe to go.

  • This runway does not prove that every relay or solenoid suits the load.
  • Most relay coils draw 50-100mA, far exceeding the 20-40mA GPIO limit.
  • Once the relay pattern is clear, a solenoid is the same electrical problem with motion instead of contacts.
  • The photographs below make solid-state relay (ssr) a physical comparison: look for changes in package, exposed interfaces, mounting, scale, and service access before treating the forms as interchangeable.
iotclass.org

Retrieval practice

Recall check 1 of 3

Motor Max says: answer from memory, then check your reasoning.

Q1An ESP32 must switch a 5 V relay coil rated at 80 mA. What is the safest interface design?

AUse a transistor or MOSFET driver with a flyback diode across the relay coil
BConnect the relay coil directly to a GPIO pin because both use 5 V logic
CPut the flyback diode in series with the relay contact terminals
DUse a pull-up resistor only, because relays provide electrical isolation
Show answer

Answer: A Relay and solenoid coils are inductive loads, so microcontrollers should drive them through a transistor or MOSFET stage with flyback protection.

iotclass.org

Retrieval practice

Recall check 2 of 3

Motor Max says: answer from memory, then check your reasoning.

Q2A switch cycles often in a quiet room. When is an SSR a sound first candidate?

AWhen quiet, frequent switching fits the SSR's load and thermal limits.
BUse an SSR when zero leakage is essential, because its off state fully isolates the load.
CUse an SSR when there is no room for a heat sink, because its switching loss needs no thermal path.
DUse an SSR with any AC or DC load, because the same output stage switches both load types.
Show answer

Answer: A An SSR avoids contact wear, but its heat and leakage still need review.

iotclass.org

Retrieval practice

Recall check 3 of 3

Motor Max says: answer from memory, then check your reasoning.

Q3An AC valve coil needs switch-off suppression. Which path fits?

AAn AC-rated varistor or snubber sized for the valve coil.
BUse a plain DC diode across the AC coil, because it clamps the coil on both half-cycles.
CUse a software delay alone, because it dissipates the coil's switch-off energy before the next command.
DUse a larger relay contact alone, because contact capacity suppresses the coil voltage spike.
Show answer

Answer: A An AC coil needs protection that works on both polarities.

iotclass.org

Print reference

Answers

Answer key.

  1. A · Relay and solenoid coils are inductive loads, so microcontrollers should drive them through a transistor or MOSFET stage with flyback protection.
  2. A · An SSR avoids contact wear, but its heat and leakage still need review.
  3. A · An AC coil needs protection that works on both polarities.
iotclass.org