Using DYP-ME007Y-PWM Ultrasonic sensor
<p>I actually want to use this waterproof ultrasonic sensor DYP-ME007Y-PWM (<a href="http://hanjindata.lgnas.com:10000/myweb/P0400/P0400.pdf" rel="nofollow">http://hanjindata.lgnas.com:10000/myweb/P0400/P0400.pdf</a>) on my raspberry PI Compute Module on a classic Raspbian OS. It has 4 pin's (gnd,Trig,Echo and 5V).
Here is my schematic:</p>

<pre><code>Raspberry Pi |  Sensor
GND          | GND
5V           | 5V
22           | Trig
23           | Echo
</code></pre>

<p>I've found some tutorials that explain how ultrasonic sensors works and mannage to have good results with other kind of ultrasonic sensors like this one for exemple (<a href="http://www.micropik.com/PDF/HCSR04.pdf" rel="nofollow">http://www.micropik.com/PDF/HCSR04.pdf</a>)</p>

<p>Here is my code :</p>

<pre><code># Import required Python libraries
import time
import RPi.GPIO as GPIO

# Use BCM GPIO references
# instead of physical pin numbers
GPIO.setmode(GPIO.BCM)

# Define GPIO to use on Pi
GPIO_TRIGGER = 22
GPIO_ECHO = 23

print "Ultrasonic Measurement"

# Set pins as output and input
GPIO.setup(GPIO_TRIGGER,GPIO.OUT)  # Trigger
GPIO.setup(GPIO_ECHO,GPIO.IN)      # Echo

# Set trigger to False (Low)
GPIO.output(GPIO_TRIGGER, False)

# Allow module to settle
time.sleep(0.5)

# Send 10us pulse to trigger
while True:
    GPIO.output(GPIO_TRIGGER, True)
    time.sleep(0.00001)
    GPIO.output(GPIO_TRIGGER, False)

    start = time.time()
    while GPIO.input(GPIO_ECHO)==0:
      start = time.time()

    while GPIO.input(GPIO_ECHO)==1:
      stop = time.time()

    # Calculate pulse length
    elapsed = stop-start
    # Distance pulse travelled in that time is time
    # multiplied by the speed of sound (cm/s)
    # That was the distance there and back so halve the value
    distance = (elapsed * 34000)/2

    print "Distance : %.1f" % distance
    time.sleep(0.05)
# Reset GPIO settings
GPIO.cleanup()
</code></pre>

<p>I doesn't work, i obtain always the same output whatever i do with my sensor
Does anybody has alreeady play with this sensor ? As you can see, the datasheet is pretty ligth, so maybe you will see something my poor electronics skills have missed</p>

<p>Greetings !</p>