Actuators & Control · Study deck
Relays and Solenoids: Drivers and Protection
A coil stores energy and sends it back when switched off.
Motor Max is your guide for this deck.

After studying this chapter
Learning objectives
You will be able to:
- 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: The software command is small, but the coil current, contact rating, flyback path, and default state decide whether the physical action is safe.
- Explain: Once the relay pattern is clear, a solenoid is the same electrical problem with motion instead of contacts.
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.
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.
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.

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.

Major section
Solid-State Relays (SSR)
With coil protection handled, the next choice is which switching technology best matches the load and cycle pattern.
- For silent, high-speed, and maintenance-free switching, use solid-state relays.
- No moving contact means quiet, fast cycling, but leakage, on-state voltage drop, load type, and heatsinking remain part of the switching decision.

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.
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.
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.
- With coil protection handled, the next choice is which switching technology best matches the load and cycle pattern.
Retrieval practice
Recall check

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?
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.
Print reference
Answers
Answer key.
- A · Relay and solenoid coils are inductive loads, so microcontrollers should drive them through a transistor or MOSFET stage with flyback protection.