reading ultrasonic receve


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    Feb 2013
    Posts
    11


    Did you find this post helpful? Yes | No

    Default Re: reading ultrasonic receve

    I do I have two analogs and one digital I prefer the analogs , but don't have probes for them I will try to hook it up later and see what the timing is

  2. #2
    Join Date
    Jul 2003
    Location
    USA - Arizona
    Posts
    156


    Did you find this post helpful? Yes | No

    Default Re: reading ultrasonic receve

    In the code that LinkMTech provided there should be no issue with the PAUSEUS or PAUSE commands.
    distance:
    PULSOUT trig,1 ' each count = 10us
    PAUSEUS 120 ' Wait for transmit pulse to complete
    PULSIN sens,1,dist ' will time out in 655ms if nothing received
    dist= dist/15 'convert to inches
    PAUSE 100
    RETURN

    END
    There is a minimum delay between the time the device reacts to the input (PULSOUT) and the time it provides an output (to be read by PULSIN). This time is defined by the 8 40kHz bursts it sends. The device does not raise its output high before the burst is sent (that is in the datasheet), so that means that you could use an approximate delay no longer than 200us between PULSOUT and PULSIN commands and still be ok. LinkMTech suggested 120us to allow for margin; that should be no problem. The other delay, the one which occurs after the PULSIN, represents how much to delay before the next time it tries the measurement again. This again should not be an issue.

    You certainly need a scope, but not to test your code (since your code looks fine, and it matches BASIC STAMP code and many others which work with modules like the PING, and Devantech's SRF04 modules. You need the scope to see if the module you have is doing what its datasheet claims it does. Also. maybe a pulldown (say 10-20k on the GPIO4 may help - perhaps the SR module does not pull to ground too well).

Similar Threads

  1. Ultrasonic range meter
    By Crista in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 16th June 2008, 18:01
  2. the ultrasonic SRF04 with pic16f88
    By tur_bot in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 20th March 2008, 17:24
  3. sensor ultrasonic 8051&PIC
    By hd_uni_pro in forum Schematics
    Replies: 1
    Last Post: - 13th September 2006, 12:58
  4. ultrasonic sensor
    By PoTeToJB in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 9th May 2006, 20:26
  5. SRF08 Ultrasonic Rangefinder
    By rad in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 25th July 2003, 21:01

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts