Need info about HC-SR04 Sonar sensor.

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am Working on a project thats can measure distance by Sonar sensor.

I am read HC-SR04 datasheet.
In datasheet writer not define whats happen with echo pin,if there is no object at the max range.

I have badly need the info.
whats happen with echo pin,if there is no object at the max range?

শূন্য  - The ZeRo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You don't get an echo - so you time out. There is so much code written for these modules on the internet - have you not found any?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

eRony wrote:
But itz not enough for me

So what, exactly, do you feel is missing?

 

As already noted, many people have used these devices - and have published their work on the interwebs...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No,   I have not looked up the documentation.

 

The HC-SR04 will detect objects from 1cm to about 100 cm quite reliably.   A nice flat wall at 200 cm will probably work ok.

Anything further will not be very reliable.

 

I suggest that you make your program display 1 cm to 100 cm.   If the echo takes longer,   just call it a failure.   i.e. no object detected.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Look what I found in my 30 minute search of the HC -S204 Ultrasonic Ranging module.

 

Here's one document:

http://www.micropik.com/PDF/HCSR04.pdf

 

Another:

https://docs.google.com/document/d/1Y-yZnNhMYy7rwhAgyL_pfa39RsB-x2qR4vP8saG73rE/edit?pli=1

 

Actually, here is the first page of a Google search that popped up a bunch of stuff:

https://www.google.com/search?q=HC-SR04&sourceid=ie7&rls=com.microsoft:en-US:IE-Address&ie=&oe=&gws_rd=ssl

 

An example using an Arduino.

http://www.instructables.com/id/Simple-Arduino-and-HC-SR04-Example/

 

Schematics of the HC-SR04:

https://www.google.com/search?q=hc-sr04+schematic&sa=X&biw=1093&bih=534&tbm=isch&tbo=u&source=univ&ei=TFJ_VOzRI5WuyATfwoK4BA&ved=0CB0QsAQ

 

Google is your friend, unless they are collecting YOUR personal information...

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

Last Edited: Wed. Dec 3, 2014 - 06:14 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here is a driver:

 

https://github.com/mkschreder/ma...

 

(I have currently not completely ported this driver to make it fully compatible with the rest of the codebase, but it works fine by itself as long as you don't use TIMER1 elsewhere)

LibK - device driver support for flash based microcontrollers: GitHub project

http://oskit.se - join me on my quest to become a better programmer