Main Content

Mapping a Room with Ultrasonic Distance Sensors

Ultrasonic distance sensors like the HC-SR04 work by emitting a tiny pulse of ultrasonic sound and then measuring the time taken to return. These are typically used to detect the presence of obstacles around things like a quadcopter, robotic car or robotic arm. I wanted to experiment with using them for mapping the walls of my room. The way it would work is that I would rotate the sensor and at each point while measuring the ultrasonic sensor reading, I would also read the value from my magnetic compass, hence I would know exactly what direction I am facing in. With that thought, I collected all the parts and connected them on a breadboard.”

Link to article