How it works#
Source codetext
The Arduino steps a servo across the arc. At each angle it fires the ultrasonic sensor, converts echo time to distance, shows the reading on the LCD, and prints an angle,distance line over serial. On the computer, a Python script reads the stream with pyserial and redraws a polar plot in Streamlit.
The sweep range for the sensor was 0-180 degrees, and the maximum usable range for the sensor is about 100 cm. The LCD on the breadboard displays the current distance value for the user to view physically.
Challenges
- Noisy or zero readings from the ultrasonic sensor
- Keeping the plot responsive while serial data keeps arriving