Obstacle-avoiding robot
The car gets an HC-SR04 ultrasonic sensor. It drives ahead, and when something is closer than 25 cm, it drives backwards, turns right and drives forward again.
Start buildingIn the simulator
Complete robots, step by step: parts, wiring, code and fixes. Build each one in the simulator first.
The car gets an HC-SR04 ultrasonic sensor. It drives ahead, and when something is closer than 25 cm, it drives backwards, turns right and drives forward again.
The car stays 20 cm away from whatever is in front of it and follows it when it moves. Your first proportional (P) controller, tuned while you watch the Serial Monitor.
Two IR line sensors under the front let the car follow a black line on a white floor. Learn how the sensors tell black from white and how four cases steer.