HW Interview
EM-03 · Chapter 8 · Low-Speed Interfaces & Embedded Hardware

Drive a solenoid valve from a GPIO

A microcontroller GPIO must switch a 12 V, 200 mA solenoid valve. Then a 24 V, 2 A valve. Then make the valve drop to a lower "hold" current after it pulls in.

Level● screening
TrackEmbedded & wearables
Really testingA simple question that goes deep.
Full worked answer: in the book, page 206 — what to say first, how to explain it, the numbers worth quoting and the follow-ups. About the book →

Going deeper

Extra explanation that is not in the book: worked numbers, where people go wrong, and how to say it in the room.

Worked example — release time. Example coil: 12 V, 200 mA (60 Ω), assume 50 mH.

Energy per turn-off. ½·L·I² = ½ × 50 mH × (0.2 A)² = 1 mJ — easy for a small diode or Zener.

Hold mode. With a PWM period much shorter than L/R, the coil current follows the average voltage: about 30% duty for 30% hold current.

Where people go wrong

Errata

No corrections known for this question. All errata

Ask about this question

Stuck on a step, or think something is wrong? Send it with EM-03 in the subject. Good questions get answered on this page, and corrections go into the next printing.

Ask about EM-03

Related

← EM-02 Sizing I²C pull-upsEM-04 Power-on to main(): what takes time? →