Ultrasonic readings jump about
- HC-SR04
Why it happens
- Echoes from nearby things.
- Readings too close together.
- Noise from a motor or servo on the same 5 V.
How to fix it
- Leave 60 ms between readings.
- Take five readings and use the middle one.
- Lift the sensor off the table and keep its front clear.
- Power motors and servos separately, with the grounds joined.
It worked if: With a still wall the number changes by about a centimetre or less.
Related errors
Tutorials where it can happen
- Colour Picker RGB LED with Arduino
- Distance Measurement and Stepper Motor Control with LCD Output
- HC-SR04 Ultrasonic Sensor with Arduino Uno
- Liquid Level Detection and Pump Control
- Object Tracking and Following System with LCD Feedback
- Obstacle Avoiding Robot Car with Arduino and LCD
10 more
- Obstacle-Avoiding Robot Arm with Arduino and LCD
- Smart Mailbox with Arduino, Ultrasonic Sensor and Servo
- Smart Pet Door with Arduino, Ultrasonic Sensor and Servo
- Smart Trash Can with Arduino: Lid Opens by Itself
- Ultrasonic Parking Sensor with LCD Display using Arduino
- Ultrasonic Sensor and Servo Motor with Arduino Uno
- Vehicle Parking Space Occupancy Detection with LCD Feedback
- Vehicle Speed Measurement and LCD Output Using Arduino
- Water Level Monitoring and Fish Tank Pump Control with Arduino
- Water Level Monitoring and Solar Water Heater Control
From how the part works. Explained from how the part works; not tried on a real circuit for this page.
Didn't help? Search another error or ask us.

