Projects with Blocks·Tutorial 5 of 5

Obstacle Avoider

Advanced

Program your robot to navigate a room on its own. It drives forward until the distance sensor detects an obstacle, then reverses and turns to find a clear path.

40 min5 steps
DistanceMotorsAutonomousRobotProjectAdvanced
0 of 5 steps

Step 1 of 5

Connect your board

Power on your Beaver Board — the OLED will show a PIN code. Click Connect in the toolbar, choose Connect via Bluetooth, and select your board. If it's your first time, enter the PIN shown on the screen.

The HC-SR04 distance sensor faces forward on GP16/GP17. Place the robot on the floor in an open area before running.

Clear the floor of obstacles you don't want the robot to hit. The robot will move autonomously — make sure there are no drop-offs nearby.