How a Line-Following Robot Works
The sensors, logic and code behind a line follower, from a simple two-sensor bang-bang robot to smoother proportional steering.
→ wobbling? lower the gain
section 6, the blue band
Chassis, control loops and robots that follow lines.
The sensors, logic and code behind a line follower, from a simple two-sensor bang-bang robot to smoother proportional steering.
→ wobbling? lower the gain
What the P, I and D terms actually do, shown with a robot that follows a line, plus Arduino code and a step-by-step tuning method.
→ tune P first, then D, I last
Two-wheel, four-wheel, tracked or DIY? Compare robot chassis types by steering, terrain and difficulty, and learn how to check motor and battery fit.
→ pick the battery before the chassis
How optical and magnetic encoders count wheel rotation, how to read them with interrupts, and how to measure distance and drive straight.
→ count in an interrupt, not in loop()
Read tilt and rotation from the MPU6050, convert raw values to g and degrees per second, and combine them with a complementary filter.
→ gyro drifts, accel is noisy, blend both
The simple math behind differential drive robots: how wheel speeds set the turning radius, spin and pivot turns, smooth arcs in code, and basic odometry.
→ speed difference = turn
Plan a small servo robot arm the right way: calculate the torque each joint needs, pick servos, power them properly and write Arduino code for smooth, controllable movement.
→ the shoulder servo does the hard work
A simple, step-by-step method to size the drive motors of a wheeled robot from its weight, wheel size, top speed and the slopes it must climb, with a fully worked example.
→ Size for the operating point, not the stall torque
Make a two-link robot arm reach an X,Y point instead of guessing servo angles. The geometry explained step by step, a worked example you can check, and Arduino code with straight-line moves.
→ Tell it where to go, not how to bend
Stop fighting tangled if-statements and delays. Learn the state machine pattern with enum and switch, timed states with millis(), and a complete obstacle-avoiding robot program that stays responsive.
→ One state at a time, clear rules to change
A two-wheel robot that follows a wall at a set distance using two ultrasonic sensors and simple PD control. Sensor placement, wiring, full Arduino code with corner handling, and a step-by-step tuning method.
→ Tune Kp first, then add Kd to stop the wobble
How to add front bumpers to a small robot with lever microswitches, wire them with the Arduino's internal pull-ups, and write non-blocking code that backs up and turns away from whatever the robot hits.
→ COM to GND, NO to the pin
How a two-wheeled robot can estimate its x, y position and heading from wheel encoder ticks. The odometry equations step by step, Arduino code that updates the pose, how to calibrate wheel size and track width, and why the error grows.
→ calibrate the track width with ten spins