The HC-SR04 ultrasonic sensor uses sonar to determine distance to an object - just like bats or dolphins do.
This module offers excellent range accuracy and stable readings in an easy-to-use package. It operation is not affected by sunlight or black material (although acoustically soft materials like cloth can be difficult to detect). Similar in performance to the SRF005 but with the low-price of a Sharp infrared sensor.
Perfect for collision avoidance on your next robotics or multirotor project!
Spec: Power: 5V DC Quiescent Current : <2mA Effectual Angle: <15° Ranging Distance : 2cm – 500 cm/1" - 16ft Resolution : 0.3 cm LxWxH: 45 x 20 x 15mm Weight: 8.5g
Includes: Ultrasonic Module 1 x Terminated ribbon cable 200mm
I need a wiring diagram on how to wire it to an apm 2.5 and a clearly written or videoed instruction on how to load the code for it. There does not seem to be any instruction on the internet for setting this sensor up with the apm 2.5.
I downloaded arduino HC-SR04 libraries from this product "files" section. I pasted it in libraries folder and when I open first or second example and compile it shows me error:
UltrasonicDemo:17: error: 'Ultrasonic' does not name a type
UltrasonicDemo.pde: In function 'void loop()':
UltrasonicDemo:27: error: 'ultrasonic' was not declared in this scope
UltrasonicDemo:29: error: 'Ultrasonic' has not been declared
UltrasonicDemo:30: error: 'Ultrasonic' has not been declared
Can someone help me?
I am using Arduino UNO R3.
Clen pcb, clean soldering, not expansive at all. However, the value readings i have here ( maybe it is my program, don't know yet)are not enough stable to use it for on-board distance mesures, especially during obstacle avoidance calculations.