SEN0312 ME007YS WATERPROOF ULTRASONIC SENSOR
I am testing this sensor for an embedded solution in a product. I am using your Arduino sketch to test. It appears a though the sensor reports 0 distance when the distance is greater that max range of the sensor. The sensor will only provide a distance if the distance is 28-450cm. Is this correct?
Another issue is that the wiki page does not specify what the output of your transducer is at either end of the range. If it had said this, I would have understood it wouldn't work. My request is uncomplicated. It is a land drone with motors. If it [url=https://techemirate.com/how-to-download-disney-plus-on-hisense-smart-tv/]identifies [/url] an object within two metres or fewer, I want it to stop. If your sensor detects an object inside its range, it is operational. The issue with your sensor is that if the object is farther away than 4.5 metres, it also returns 0 centimetres "below minimum range." How can I tell whether something is extremely near or very far away?
olof.sasHello, what type of connector is on the outlet from the converter? I want to design a printed circuit board with a connector for this sensor.
TomasHelikarIf yes, how can we connect it directly to the raspberry pi? sharan.reddy
If yes, how can we connect it directly to the raspberry pi? sharan.reddy
import RPi.GPIO as GPIO #Import GPIO library
import time #Import time library
GPIO.setmode(GPIO.BCM) #Set GPIO pin numbering
TRIG = 23 #Associate pin 23 to TRIG
ECHO = 24 #Associate pin 24 to ECHO
print "Distance measurement in progress"
GPIO.setup(TRIG,GPIO.OUT) #Set pin as GPIO out
GPIO.setup(ECHO,GPIO.IN) #Set pin as GPIO in
while True:
GPIO.output(TRIG, False) #Set TRIG as LOW
print "Waitng For Sensor To Settle"
time.sleep(2) #Delay of 2 seconds
GPIO.output(TRIG, True) #Set TRIG as HIGH
time.sleep(0.00001) #Delay of 0.00001 seconds
GPIO.output(TRIG, False) #Set TRIG as LOW
while GPIO.input(ECHO)==0: #Check whether the ECHO is LOW
pulse_start = time.time() #Saves the last known time of LOW pulse
while GPIO.input(ECHO)==1: #Check whether the ECHO is HIGH
pulse_end = time.time() #Saves the last known time of HIGH pulse
pulse_duration = pulse_end - pulse_start #Get pulse duration to a variable
distance = pulse_duration * 17150 #Multiply pulse duration by 17150 to get distance
distance = round(distance, 2) #Round to two decimal points
if distance > 28 and distance < 400: #Check whether the distance is within range
print "Distance:",distance - 0.5,"cm" #Print distance with 0.5 cm calibration
else:
print "Out Of Range" #display out of range
Please help how to use it with raspberry pi 3b+.
Thank You sharan.reddy
Did you ever find a solution to this problem?
import RPi.GPIO as GPIO #Import GPIO library
import time #Import time library
GPIO.setmode(GPIO.BCM) #Set GPIO pin numbering
TRIG = 23 #Associate pin 23 to TRIG
ECHO = 24 #Associate pin 24 to ECHO
print "Distance measurement in progress"
GPIO.setup(TRIG,GPIO.OUT) #Set pin as GPIO out
GPIO.setup(ECHO,GPIO.IN) #Set pin as GPIO in
while True:
GPIO.output(TRIG, False) #Set TRIG as LOW
print "Waitng For Sensor To Settle"
time.sleep(2) #Delay of 2 seconds
GPIO.output(TRIG, True) #Set TRIG as HIGH
time.sleep(0.00001) #Delay of 0.00001 seconds
GPIO.output(TRIG, False) #Set TRIG as LOW
while GPIO.input(ECHO)==0: #Check whether the ECHO is LOW
pulse_start = time.time() #Saves the last known time of LOW pulse
while GPIO.input(ECHO)==1: #Check whether the ECHO is HIGH
pulse_end = time.time() #Saves the last known time of HIGH pulse
pulse_duration = pulse_end - pulse_start #Get pulse duration to a variable
distance = pulse_duration * 17150 #Multiply pulse duration by 17150 to get distance
distance = round(distance, 2) #Round to two decimal points
if distance > 28 and distance < 400: #Check whether the distance is within range
print "Distance:",distance - 0.5,"cm" #Print distance with 0.5 cm calibration
else:
print "Out Of Range" #display out of range
Please help how to use it with raspberry pi 3b+.
Thank You sharan.reddy
I am testing this sensor for an embedded solution in a product. I am using your Arduino sketch to test. It appears a though the sensor reports 0 distance when the distance is greater that max range of the sensor. The sensor will only provide a distance if the distance is 28-450cm. Is this correct? rsstansbury