Go Down

Topic: HC-SR04 Ultrasonic Sensor Questions (Read 220 times) previous topic - next topic

dqrx

Hi everyone,

I've been testing out the HC-SR04 and have noticed some issues with its sensing ability. I am using the NewPing library (http://playground.arduino.cc/Code/NewPing) and an Arduino Uno.

Some issues include:

1. When the sensor is aligned in parallel with a wall it gives very accurate results, but at an angle 30 degrees or more gives back largely varying distances. See attached pic for a visualization.

2. When I point the sensor at my chest I also get varying results ( although this might just be because the fabric of my clothing is absorbing the sound wave...)

I'd like to know if these issues are common occurrences with almost all affordable ultrasonic sensors or if there is something wrong with mine? If there is something wrong with mine, or if there is another sensor that can work with angles much better can anyone suggest some?

Thanks for the help!


Note: I bought it off of ebay for pretty cheap so that may be another reason...

raschemmel

This is a common complaint and the reason for the servo mounted sensor that allows you to rotate the sensor CW on a left turn and CCW on a right turn of the robot..The routine scans left and right (range varies) while checking return and correcting position (reversing servo scan direction) if the signal drops off. You should be able to find some posts with code.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,
DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

andygrove

Yes, this is usual. I actually went through a lot of effort this past week comparing various HC-SR04 sensors with the more expensive Parallax Ping and the RadioShack model. I posted my results on my blog:

http://theotherandygrove.com/ultrasonic-sensor-comparison-part-2/

I also found this very short but useful tutorial, which is where I started:

http://superawesomerobots.com/tutorials/hc-sr04-tutorial-for-arduino/

The issue is that sound waves will not necessarily be reflected from some surfaces, especially depending on the angles involved.

I hope that helps.

Andy.

Cactusface

Hi All,
            I think that like light sound bounces off of the wall at the angle it hits it, so at say 45 Degs most of it 45 Degs in the opposite direction, so you only get a bit coming back. The angle between them being 90 Degs.  Same for IR etc. But I find all the devices I have including cheap Chinese one's work fine.

Regards

Mel.
Open your mind! But not too far, your brains might fall out.
Also like Photography, model building and my 300+ Cacti and Succs.

Go Up