Obstacle detection with moving ultrasonic sensor

This project is very similar to obstacle detection, but has one key difference: the ultrasonic sensor is mounted on a servomotor. This allows the sensor not only to detect obstacles, but also to change its position in order to scan the surroundings.

If the ultrasonic sensor detects an obstacle, it can check in which direction there is more space. The Joy-Car then automatically decides where it should swerve in order to continue its journey safely. This additional flexibility makes the system even more intelligent and adaptable.

Download

Here you can download the code example in your preferred programming language. Simply select the language you want to use and download the corresponding file to get started right away.

micro:bit