Help interfacing with this ultrasonic sensor - DYP-ME007Y

That's what I imagined and, I thought that's what I was doing since I set the pin High for a specified time and bring it back down again, and afterwards, I'm measuring how long the echo pin stays high to derive the distance from the pulse width.

siva2402: That's what I imagined and, I thought that's what I was doing since I set the pin High for a specified time and bring it back down again, and afterwards, I'm measuring how long the echo pin stays high to derive the distance from the pulse width.

Nothing to do with pulse width.

Tim

googled it. I see now. thanks for your replies

reviving this thread. does this version of the sensor (Y) work with NewPing? this reply seems to suggest yes - http://forum.arduino.cc/index.php?topic=106043.msg1638131#msg1638131

but just confirming before ordering a bunch of the sensors…

thx!

Hi, I am working with this modul DYP ME007Y on an university project, but our result is always out of range, and if I use the code with the ping library 1.5 I get a very strange result on the serial screen (it looks like the PC doesn't know the signs, I always get something like this: +ä#'$%!,´^°)

I dont know what to do!

Check your speed in Serial.begin( ) is the same as speed in Serial Monitor, you can change either as long as they match

Thanks, the problem with the serial monitor is over. :stuck_out_tongue_closed_eyes:

But now I only get 0 cm, its always out of range, no idea why.

Ok now everything is working correctly :)

I only changed the ultrasonic sensor of my DYP-ME007Y-X.

Hi Joff, I'm also in need of a waterproofed ultrasonic sensor for a University project. Can I just confirm that you were able to get your DYP ME007Y sensor working and what do you mean when you say you only changed the ultrasonic sensor to fix it? Also where is the best place to get them from?

Thanks

@teckel - did you ever confirm this sensor works with NewPing?

eforman: @teckel - did you ever confirm this sensor works with NewPing?

Would need the sensor to confirm myself. Others have got it working.

Tim

hi all, it took me a while to make it work but finally I was successful.

below is my working code, but the main point is in the wiring:

for me the sensor was not working properly when the 5V was connected to 5V of Arduino UNO. It seems the DYP-ME007Y has lack of current when drawing it directly from Arduino (though I was able to hear the pulse sound).

DYP-ME007Y started working properly when I connected its 5V pin to external source of power.

The code below is not using the NewPing lib but raw pulseIn, which I believe is better approach for initial debugging. Once you are sure the device is working properly, rather use the NewPing library, it has some nice enhancements compared to raw pulseIn.

#define echoPin 10
#define trigPin 11

long duration, distance;

void setup() {
 Serial.begin (9600);
 pinMode(trigPin, OUTPUT);
 pinMode(echoPin, INPUT);
}

void loop() {
 digitalWrite(trigPin, LOW); 
 delayMicroseconds(2); 

 digitalWrite(trigPin, HIGH);
 delayMicroseconds(10); 

 digitalWrite(trigPin, LOW);
 duration = pulseIn(echoPin, HIGH);
 Serial.println(duration);
 distance = duration/58.2;
 Serial.println(distance);
 Serial.println();
 delay(500);
}

While searching for a solution to make the sensor work, I contacted the vendor of DYP-ME007Y (http://en.dypsensor.com/products_detail/&productId=25.html) and they told me there are two versions of the sensor, they call them PWM-output and TX-output. We have the PWM output one. These two differ at least in the way how they respond. the PWM responds with pulse, while TX responds "digitally" with four bytes (0XFF + H_DATA + L_DATA + SUM). More info on DYP-ME007Y-TX: http://www.szxkc.net/uploadfile/201110/20111031172454972.pdf TX surely wont work with NewPing library.

petervojtek: TX surely wont work with NewPing library.

Correct. Also, using NewPing is typically much easier to get the sensor working than doing all the pin high/low/pulsein stuff. NewPing takes care of that for you, and does so in a more direct way.

Tim

just for completeness, one more notice from the vendor (their support is very friendly and responsive):

in fact there exist three versions of the sensor: "PWM, TX (series) and switching output"

Hi Tim, I have a problem interfacing my DYP-ME007*Y*. When I tried the petervojtek's success code, it just show the same distance all of the time (that is 16 cm). Can anyone help me?

Btw, I don't know what type of my DYP-ME007Y, which is PWM or RX-TX or switching. But I also have tried to connect it with RX-TX in my arduino uno. I confused how to use it via RX-TX mode, so I just set up the baudrate according to datasheet and then read the RX. And I got a constant byte 152 in ASCII. So, I frustated now. Need help very soon, friends!

Thanks a lot!

bebebeis: Hi Tim, I have a problem interfacing my DYP-ME007*Y*. When I tried the petervojtek's success code, it just show the same distance all of the time (that is 16 cm). Can anyone help me?

Btw, I don't know what type of my DYP-ME007Y, which is PWM or RX-TX or switching. But I also have tried to connect it with RX-TX in my arduino uno. I confused how to use it via RX-TX mode, so I just set up the baudrate according to datasheet and then read the RX. And I got a constant byte 152 in ASCII. So, I frustated now. Need help very soon, friends!

Thanks a lot!

It sounds like you have the serial version, which means it won't work with newPing.

Tim

teckel:

bebebeis: Hi Tim, I have a problem interfacing my DYP-ME007*Y*. When I tried the petervojtek's success code, it just show the same distance all of the time (that is 16 cm). Can anyone help me?

Btw, I don't know what type of my DYP-ME007Y, which is PWM or RX-TX or switching. But I also have tried to connect it with RX-TX in my arduino uno. I confused how to use it via RX-TX mode, so I just set up the baudrate according to datasheet and then read the RX. And I got a constant byte 152 in ASCII. So, I frustrated now. Need help very soon, friends!

Thanks a lot!

It sounds like you have the serial version, which means it won't work with newPing.

Tim

Yeah, I also guess that it is the serial verion. But How to interface it? The datasheet doesn't provide enough information. Should I transmit something to TX or just read the packet in RX? Like I stated before, I just get a constant byte 152 in ASCII.

Thanks,

Beryl

I have a circuit that was using a HC-SR04 and worked well using the newping library but when I plugged in the ME007Y all I got was 0 most of the time with the odd random number. After reading what petervojtek said above I checked the 5v line on my circuit and found it was only sitting at around 3.9v. I connected an external 5v supply and the ME007y immediately started to perform as expected. For those with problems I would check the supply voltage first and also be aware that the breadboard jumper wires can also be a source of intermittent connection. Also the pin-out of the ME007Y is different to the SR04.
This is the ME007Ythat i am using.

http://www.ebay.com.au/itm/DC-5V-DYP-ME007Y-Ultrasonic-Sensor-Module-Board-Measuring-Range-30cm-3-5-M-40kHz-/121325612004?pt=AU_B_I_Electrical_Test_Equipment&hash=item1c3f91ebe4

@teckel - Is there any way to check which version did I have? An how can I manage to get it working?

Hi Guys,

I also spent lots of time to get the correct values from the sensor, but all we were on a wrong road. Sensor uses RX-TX Serial communication, and transmits data using serially sent values, including start digit, raw value and a crc check value. I found this code on a russian arduino forum.

Click on the link and translate it in English. I tried it and it works.

http://arduino.ru/forum/apparatnye-voprosy/ultrazvukovoi-vlagozashchishchennyi-sensor-dyp-me007y

I hope this helps.

Regards,

Tezel

DYP-ME007.txt (1.8 KB)