Inaccurate readings with multiple HC-SR05

Hello, first up, sorry for posting in this wrong section, I wasn't able to post in the "sensors" topic, as the post button was missing there.
in the setup below are 4 Hc-sr05 to measure distance. They are all wired to the same trigger pin, while the echo pin goes to a separate interrupt pin on the arduino (18, 19, 20, 21). The main issue is with the readings, they fluctuate quite a bit, +-2cm up to sometimes +-5cm. The sensors are between 60 and 110cm away from the target, well within the measuring range.
What could be causing these issues with the inaccurate readings?

The project:
A standing desk with 4 actuators, unfortunately no stepper motors.
4 x Hc-sr05 are attached to the underside of the desk, one in each corner, to measure the distance to ground
2 x L298 H-bridge are used to control 2 actuators each (direction & PWM)
2 x buttons to press for raising or lowering the desk
1 x Arduino Mega 2560

attached is a sketch of the wiring.

You may suffer inference between sensors or odd reflections from the surfaces .
I would operate them in pairs sequentially from different pins to avoid any interference . There may also be issues in the power supply /connections to components creating interference - hard to say , sorry your wiring diagram is impossible to read .

That variation sounds perfectly normal to me, albeit on the high end of normal.

Make sure you don’t ping two sensors too soon after one another, give echoes time to die out (20-100 ms typically) and that the sound waves have a good surface to bounce off from as poor echoes make the accuracy worse.

Must have been some interference from the table legs. By moving the hc-sr05 sensors to different positions until they gave stable readings, the distance measurements only fluctuate by ~ 0.5cm now at a distance of 70cm.

and yes, the diagram is confusing. Still learning how to draw them properly.

try Libre Office drawing program, free open source software. a side benefit - you can draw an outline of your modules, get the screw holes exactly right, put a + in the center of those screw holes,tape that to the surface you mount your project on, and drill all the holes in exactly the right place.

Possibly the oddest suggestion for drawing circuit diagrams ever...

Not only are there better drawing programs out there, there's also KiCAD (and if you're not too bothered by your software not being FOSS, there's EagleCAD and EasyEDA, just to name two). Use the correct tool for the job!

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.