Robots often need a small control signal from a microcontroller to switch a much larger current through a motor, pump, lamp, or solenoid. Two common switching devices are mechanical relays and MOSFETs. A relay uses moving metal contacts, while a MOSFET uses an electric field inside a semiconductor.
Choosing the right switch affects speed, efficiency, noise, lifetime, and how well the robot can control motor power.
Key Facts
- Relay contacts are controlled by an energized coil, so the input and output can be electrically isolated.
- A MOSFET acts like a voltage-controlled switch, with gate voltage controlling current from drain to source.
- MOSFET conduction loss is approximately P = I^2 RDS(on), where RDS(on) is the on-resistance.
- A relay coil needs a flyback diode because an inductor produces a voltage spike when current is interrupted.
- PWM motor speed control requires fast switching, so MOSFETs are usually preferred over relays.
- For a low-side N-channel MOSFET switch, the motor connects to +V and the MOSFET switches the path to ground.
Vocabulary
- Relay
- A relay is an electromechanical switch that uses a coil-generated magnetic field to open or close metal contacts.
- MOSFET
- A MOSFET is a transistor that uses gate voltage to control current through a semiconductor channel.
- Flyback diode
- A flyback diode is a protective diode placed across an inductive load to safely carry current when the switch turns off.
- PWM
- PWM, or pulse width modulation, controls average power by rapidly switching a load on and off with a chosen duty cycle.
- RDS(on)
- RDS(on) is the small resistance between drain and source when a MOSFET is fully turned on.
Common Mistakes to Avoid
- Using a relay for high-frequency PWM motor control is wrong because relay contacts are mechanical and will chatter, heat, wear, and fail quickly.
- Connecting a MOSFET gate directly to an unknown control voltage is risky because the device may not fully turn on unless the gate-source voltage is high enough for the chosen current.
- Forgetting the flyback diode on a motor, relay coil, or solenoid is wrong because inductive voltage spikes can damage the transistor, microcontroller, or switch contacts.
- Ignoring current and power ratings is wrong because both relay contacts and MOSFETs can overheat or fail if the motor stall current exceeds their safe limits.
Practice Questions
- 1 A MOSFET switches a 4.0 A motor and has RDS(on) = 0.050 ohm. Calculate the MOSFET conduction power loss using P = I^2 RDS(on).
- 2 A 12 V relay coil has resistance 240 ohm. Find the coil current using I = V/R, and calculate the coil power using P = VI.
- 3 A robot motor must be speed-controlled using PWM at 20 kHz. Explain whether a relay or a MOSFET is the better switch, and give two reasons based on switching speed, wear, or efficiency.