HC-SR04

Hi,

I'm trying to use a HC-SR04 sensor in a project where a car needs to avoid obstacles encountered in the path, but when it encounters a narrow obstacle (which does not cover the sensor) continue to go forward. Can you help me with some tips? Thank's

Based on what information exactly do you expect any useful comments?

Iirc the minimal range starts at 2 or 3 cm for this sensor. Can't remember what was returned with closer objects.

Post some code (use the code tags), Ctrl T in Arduino IDE before. And maybe some circuitry wouldn't be too bad either.

But my best guess would be that you get false readings for a too close distance (you can check that with a minimal setup and serial print).

Edit: Shouldn't the car register the objects before they get that close?

(which does not cover the sensor)

what do you mean by that?

continue to moving

some dc motors do not have a mechanic brakes so it will keep going for the determined direction for some time!
I was working on a project that uses more than two ultrasonic ( 4 ) all of them were returning false distance ( greater than 6 ) for 2-3cm front obstacle!

Are you firing all 4 ultrasonics at the same time? If not, how much time are you allowing between each ultrasonic shot? The point here being that you have to allow enough time for each ultrasonic "chirp" to decay sufficiently so that it cannot be received by another activated ultrasonic. I think the delay should be somewhere around 30-40 milliseconds.

How narrow is narrow?

If it's like the leg of a chair there's a reasonable chance it doesn't produce much if any echo (sound waves will just go around it if it's about the size of the wavelength or less, barely noticing the object's presence).

Hello

Yes (wvmarie), it's a chair leg. Can you maybe recommend another sensor?
Thanks to others for answers and tips I will keep in mind the next time.

How about whiskers as a fail safe for those very thin obstacles?

what do you mean

Mechanical feelers/whiskers, for when the ulltrasonics fail