Build a line-following robot
Build the drive train of a line-following robot from library parts, connect power and motor control, organize the canvas and get a clean DRC
Goal
Build the Main controller board of the Line-Following Robot demo project by hand: an Arduino Nano, an L298N motor driver, two gearmotors and a 12 V battery. You'll connect power and control, group the motors, leave a note for your team and finish with a clean DRC. Every other tutorial uses this project.
What you're building
Arduino Nano
Controller: reads the line sensor and drives the motors
L298N motor driver
Switches battery power to the motors under the Nano's control
2 × N20 gearmotors
Left and right wheels
12 V battery
Powers the motor driver
The line sensor comes later: in Design with ProtoBot, ProtoBot adds an IR sensor array to this board.


Steps
Add the parts
Open Parts Bin in the left rail and add each part with its Add button:
Search
arduino nanoand add the Arduino Nano.Search
L298Nand add the L298N motor driver.Search
N20 gearmotorand add it. Right-click the motor and choose Duplicate to make the second one.Search
12V batteryand add a battery.
Parts land in free space near the middle of the canvas. Drag them into a rough left-to-right layout: battery, driver, motors on one side, Nano on the other.
Connect the driver to each motor
Drag from the L298N to the left motor and choose the motor output pair.
Rename it
Left motor drive.Repeat for the right motor and name it
Right motor drive.
The L298N has two motor channels. If you connect a third motor, the DRC reports that the interface is over capacity.
Connect the Nano to the driver
Drag from the Arduino Nano to the L298N and choose the control pair for one channel. Name it
Left motor control.Create a second harness for the other channel and name it
Right motor control.If a harness stays amber, open Function Links in the Inspector and click Auto Assign, or pick pins in each row. See Resource allocation.
Group the motors
Animated GIF · Steps:
Drag a box around both motors (with nothing selected, dragging the canvas box-selects).
Click Add group in the canvas toolbar. The group wraps the selection.
In the Inspector, name the group
Drive motorsand pick a colour.
Leave a note for the team
Animated GIF · Steps:
Click Add note in the canvas toolbar. The note lands in free space.
Type
Check the L298N heat sink at stall current.With the note selected, use Connect annotation in the Inspector and choose the L298N, then click Create.
Check the DRC
Open Board Review. Fix anything under BLOCKED first, then PARTIAL.
Expand an issue and click the target icon to jump to it.
When // DRC Issues reads "No DRC issues found", every harness is configured.
See Fixing DRC failures if an issue doesn't clear.
Describe the board
Open Board Identity in the left rail.
Add a description, the tags
roboticsandline-follower, and a requirement such asRuns 30 minutes on one charge.
ProtoBot and your teammates read this when they work on the board. See Board Identity, requirements and kits.
Result
You have a validated drive train with named harnesses, a group and a note. Next, let ProtoBot add the line sensor, or price the BOM.
Common failures
Related pages
Design with ProtoBot: add the IR sensor array with ProtoBot
Harnesses and function links: what each harness holds
Groups and notes: organize larger boards
Share a project with your team: bring a teammate into the project
Last updated

