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 componentsRC car and boat motors are sold by KV (RPM per volt with no load). This tester checks it: the Nano drives a brushless ESC with a servo signal, a TCRT5000 reflective sensor counts a white mark on a flag on the motor shaft, and the OLED shows RPM and KV. Measure the battery voltage with a multimeter and enter it, or add a divider to read it.
Clamp the motor firmly and wear safety glasses: a loose flag can fly off.
LiPo packs are not sold here; use a pack from a hobby shop with an XT60 lead, charge it on a balance charger on a non-flammable surface, and never leave it charging unattended.
Tick anything you already have and the total updates.
Surpass 2845 waterproof sensorless motor
TCRT5000 reflective sensor module
Follow the colours: red is power, dark grey is ground, blue is a signal.
2S LiPo for the motor (within the ESC rating). LiPo packs are not sold here; use a pack from a hobby shop with an XT60 lead, charge it on a balance charger on a non-flammable surface, and never leave it charging unattended.
rpm_tester.inoVerify & upload in Electrolark#include <Servo.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 oled(128, 64, &Wire, -1);
Servo esc;
volatile unsigned long pulses = 0;
const float VBAT = 7.6; // measured battery voltage
void count() { pulses++; }
void setup() {
esc.attach(9, 1000, 2000);
esc.writeMicroseconds(1000);
attachInterrupt(digitalPinToInterrupt(2), count, FALLING);
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);
delay(3000);
}
void loop() {
esc.writeMicroseconds(map(analogRead(A0), 0, 1023, 1000, 2000));
noInterrupts(); pulses = 0; interrupts();
delay(500);
noInterrupts(); unsigned long n = pulses; interrupts();
long rpm = n * 120; // one mark per turn, 0.5 s window
oled.clearDisplay(); oled.setTextColor(WHITE); oled.setTextSize(2);
oled.setCursor(0, 0); oled.print(rpm); oled.print(" rpm");
oled.setCursor(0, 30); oled.print(rpm / VBAT, 0); oled.print(" KV");
oled.display();
}
Adjust the TCRT5000's pot until its LED blinks cleanly, and shield it from sunlight.
The sensor misses pulses at high speed; use a smaller white mark and keep the gap 2-3 mm.
Turn the knob fully down before connecting the battery.
Briefly, yes, for brushless motors. Do not run it at full speed for long, and keep the flag well balanced.
Yes; put the white mark on the bell and point the sensor at it.
Labels are nominal; real KV varies a few per cent and the ESC's timing changes it.
8 parts: Surpass Hobby 2845 ROCKET Sensorless Waterproof Motor – 3.175mm Shaft 4.0 Gold Plated 2600KV, MAD Components Components AMPX 30A 2-6S Drone ESC, TCRT5000 Single Channel Line Tracking Sensor Module, Generic Nano CH340 Development Board (Soldered), 0.96" OLED Display 128x64, 16mm Rotary Potentiometer (Linear), Solderless Breadboard and Dupont Jumper Wires (40 pcs). 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 3 hours. The build on this page has 7 steps.
No. This page has the complete, tested code (rpm_tester.ino).
About ₹5,064 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
What motor KV means; Counting RPM with an optical sensor and interrupts; Driving an ESC from a Nano.
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.