Measure Distance

Intermediate

Read the onboard time-of-flight distance sensor and display the live distance on the OLED. Watch the number change as you move your hand closer and farther from the board.

20 min5 steps
DistanceToFSensorOLEDIntermediate
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 time-of-flight distance sensor is built into the board and wired to the external I2C bus — no extra connections needed.

The sensor fires a short pulse of infrared laser light and times how long it takes to bounce back — light travels so fast that the sensor's chip does the timing itself. The board converts that time-of-flight into centimetres for you automatically.