Robotics & Arduino
Lesson 2 · Refinement

The servo · From code to a switch

What if we could control the switches?

What we know — Arduino

Arduino runs code.
We configure the pins.
We control their outputs.

What we know — LDR

An LDR is a light-dependent resistor.
It uses a material whose resistance changes with light.

A little light changes how easily current can pass.
The power supply provides the electrical energy.

Now combine the ideas.

What if we use that same idea of control to switch the motor’s larger current?

Instead of light, use an electrical control signal.
With suitable circuitry, our Arduino’s 5V output can provide that signal.

Now we can control the switch with our code.

That electronic switch is a MOSFET.

Metal–Oxide–Semiconductor
Field-Effect Transistor

Gate → the control connection.
Drain and source → the main current path.

A suitable voltage between gate and source turns the switch ON.
Bring that voltage back to zero → OFF.

For the usual enhancement-type MOSFET. The LDR connection is an analogy for control; a MOSFET uses an electric field. A suitable driver handles the H-bridge gate voltages.

The pin gives the command.
The switches carry the motor current.