I'm doing a project involving an ultrasonic sensor for object detection. Originally I used a HC-SR04 ultrasonic sensor but then I decided to change it to a URM07 sensor because it had a longer range. I can't figure out how to get the URM07 sensor to work, since it uses TX and RX pins where the HC-SR04 sensor would use Trig and Echo pins.
I've provided a picture of my circuit. Basically, I want to replace the HC-SR04 sensor in my circuit with a URM07 and get it to do the exact same thing except with longer range. Any help would be appreciated.
hewa_hx:
I'm doing a project involving an ultrasonic sensor for object detection. Originally I used a HC-SR04 ultrasonic sensor but then I decided to change it to a URM07 sensor because it had a longer range. I can't figure out how to get the URM07 sensor to work, since it uses TX and RX pins where the HC-SR04 sensor would use Trig and Echo pins.
I've provided a picture of my circuit. Basically, I want to replace the HC-SR04 sensor in my circuit with a URM07 and get it to do the exact same thing except with longer range. Any help would be appreciated.
Is there a data sheet on your URM07 that give you more of a clue about how to use it?
hewa_hx:
Nope. No information was given about how to use it. There are some online tutorials but they are very very limited.
I don't think you even tried!!!! The VERY FIRST Google return for "URM07" gave a link to a very clear specification on how to use the thing and communicate with it.
I've looked at every single result on the first and second page. They are all very basic and provide no help with my problem. Have you actually read the results? Just because you saw them doesn't prove anything.
I'm in the process of switching between two ultrasonic sensors for my circuit. The original one was a HC-SR04 but I switched to a URM07 for better range.
The HC-SR04 uses Trig and Echo pins which I understand how to code, but the URM07 (the one im switching with) uses Rx and Tx pins instead for sending input and output. What does Rx and Tx mean and how do I put it in my code? Can I just plug in the Rx and Tx pins in place of where the Trig and Echo pins once were or do I have to use different code?
Rx stands for "receive". Tx stands for "transmit".
hewa_hx:
how do I put it in my code?
This sensor has a UART interface. That means you will need to use the appropriate serial commands to configure and read the sensor. Probably the easiest way to work with it is via a library. A quick Google search provided this one:
I can't say whether that is the best library available. You might find some other alternatives with a bit of searching.
hewa_hx:
Can I just plug in the Rx and Tx pins in place of where the Trig and Echo pins once were
You will need to connect the pins to a serial port on your Arduino board. If you don't have a spare serial port then you can create one using the SoftwareSerial library.
hewa_hx:
or do I have to use different code?
Yes you need to use different code. This sensor has a completely different interface from the other sensor you were using previously.
Nope. The code doesn't even work, nor does the connection diagram because it doesn't even connect to power! I've looked at that page already and none of the code or diagrams actually work. They provided datasheets, but I have no idea what any of those mean.
Cross posting is against the rules of the forum. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend 15 minutes writing a detailed answer on this thread, without knowing that someone else already did the same in the other thread.
Repeated cross posting will result in a suspension from the forum.
In the future, please take some time to pick the forum section that best suits the topic of your question and then only post once to that forum section. This is basic forum etiquette, as explained in the sticky "How to use this forum - please read." post you will find at the top of every forum section. It contains a lot of other useful information. Please read it.