Line follower robot with L298N and TCRT5000
The classic robotics starter: a two-wheeled car that tracks a black line on its own.
Shop by category
Shop all componentsSerial bus servos are daisy-chained on one half-duplex data line, each with its own ID, and they report position, load and temperature back. The Waveshare Serial Bus Servo Driver Board joins the ESP32's UART to that bus and feeds the servos 12 V. The sketch sets the second servo's ID once, then runs a slow pan and tilt pattern using the SCServo library's position, speed and acceleration commands.
Motors can start suddenly: keep fingers, hair and loose clothes clear, and lift wheels off the bench while testing.
Tick anything you already have and the total updates.
Follow the colours: red is power, dark grey is ground, blue is a signal.
12 V 2 A for two ST3215 servos.
bus_pan_tilt.inoVerify & upload in Electrolark#include <SCServo.h>
SMS_STS st;
const bool SET_ID = false; // true once, with only one servo connected
void setup() {
Serial.begin(115200);
Serial2.begin(1000000, SERIAL_8N1, 16, 17);
st.pSerial = &Serial2;
delay(500);
if (SET_ID) {
st.unLockEprom(1);
st.writeByte(1, SMS_STS_ID, 2);
st.LockEprom(2);
Serial.println("Servo is now ID 2");
while (true) delay(1000);
}
}
void loop() {
// position 0-4095 = 0-360 degrees, speed in steps/s, acceleration 0-254
st.WritePosEx(1, 1024, 800, 30); // pan left
st.WritePosEx(2, 1800, 800, 30); // tilt up
delay(2500);
st.WritePosEx(1, 3072, 800, 30); // pan right
st.WritePosEx(2, 2300, 800, 30); // tilt down
delay(2500);
Serial.printf("pan at %d, tilt at %d\n", st.ReadPos(1), st.ReadPos(2));
}
Both still have ID 1; set one to ID 2 with only that servo connected.
Check the jumper position on the driver board and that TX and RX are not swapped.
ST3215 servos need 12 V; a 5 V supply gives little torque.
One wire for many servos, position feedback, and smoother motion control.
Two 30 kg·cm servos hold a small camera; balance it over the pan axis.
Yes, add a web page on the ESP32 that sends target positions.
4 parts: ESP32-WROOM-32 38-Pin Development Board, Waveshare Serial Bus Servo Driver Board, 2 × Waveshare ST3215 Serial Bus Servo (30kg·cm) and DC Power Adapter (5.5x2.1mm). On this page you can tick the parts you already have and add only the rest to your cart.
It is a intermediate project and takes about 2 hours. The build on this page has 6 steps.
No. This page has the complete, tested code (bus_pan_tilt.ino).
About ₹5,867 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
How bus servos use IDs on one wire; Position, speed and acceleration commands; Reading feedback from a servo.
Motors can start suddenly: keep fingers, hair and loose clothes clear, and lift wheels off the bench while testing.
The classic robotics starter: a two-wheeled car that tracks a black line on its own.
A robot that looks left and right with its ultrasonic "head" and picks the clearest way.
Roams a tabletop without ever driving off the edge.
Drive a 4WD car from your Android phone over Bluetooth.
Lessons are free to read. Maker (₹499/month) and Pro add quizzes, worked problems and certificates, paid with your Geekobot account. See plans
Learning project. Check every circuit and the datasheet of each part before you power it up.