Skip to content
RobotVisual

Stage 3 of 6, weeks 5 and 6

Motors, drivers and sensors

Your goal: Understand how a robot moves and how it knows what is in front of it.

A microcontroller can’t drive a motor directly: it needs a driver. This is where it is easiest to burn your first board, which is why the simulator saves you the most here.

Loading the 3D scene

What to learn

  1. 1DC motors and why they need a driver (TB6612FNG, L298N)
  2. 2Servos: moving to an exact angle
  3. 3Distance (HC-SR04) and motion (MPU-6050) sensors
  4. 4Optical sensors: detecting something without contact and deciding when to trigger
  5. 5Actuators in real objects: geared motors, worm gears and counterweights
  6. 6When to use a microcontroller and when a Raspberry Pi 5

A word doesn’t ring a bell? Look it up in the glossary.

Resources

Review: Learn Arduino has motor and servo lessons (10 and 12), and closes with 16, where you build a project. See Learn Arduino.

Common mistake

Picking the L298N for your first project. It shows up in almost every tutorial, but according to @DeRonin_’s robotics guide it is an old driver: it loses about 2 V and runs hot. Learn it because you will see it everywhere, and for your real project pick a TB6612FNG or a DRV8833.

Did you get it?

Question 1 of 3

Why does a motor need a driver?

Practice

In Wokwi, wire an HC-SR04 and a servo to an Arduino. When something comes closer than 20 cm, the servo turns to 90°. Write down what failed on the first try. If you have time left, add an MPU-6050 and print its readings over serial.