Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to interface Ultarsonic sensor to Arduino using TTL to RS485 module ?

Status
Not open for further replies.

milan.rajik

Banned
Joined
Apr 1, 2013
Messages
2,524
Helped
540
Reputation
1,078
Reaction score
524
Trophy points
1,393
Activity points
0
How to interface Ultarsonic sensor to Arduino using TTL to RS485 module ?

I have seen some projects where two Arduino boards are used and TTL sensor will be connected to one Arduino and the two Arduino's are connected through TTL to RS485 module. What I want to know is can I interface just the Sr 04 sensor to TTL to RS485 module pair and to Arduino. I have to send trigger pulse to SR 04 and it will echo back. How will the TTL to RS485 module switch and the sensor side ?
 

Hi Milan.

If I understood what you're after, do this:

1. wire DE and /RE together on both RS485 pairs. Let's call this new signal DIR.
2. at the sensor side, connect sensor's Trig to module's RO, then module's DI and DIR *together* to the sensor's Echo.
3. on Arduino you'll need 2 TTL outputs (for the module's DIR and DI) and an input (for module's RO).

Of course, I've never tried this, but the theory is like this: at the sensor side, the module is normally enabled for receiving a trig pulse. As soon as an echo is detected, the module will switch direction and transmit the pulse on the bus (of course, the Arduino would've switched its side to reception immediately after sending the trig pulse).
I hope this works for you and you know how to work the signals.

Arthur
 
Thank you. I will try that. See attached image. I have done the connections as you mentioned. Is it correct ?
 

Attachments

  • rs485.png
    rs485.png
    12.2 KB · Views: 81

Well, I've never tried this so I can't say for sure if it'll work, but yes, this is how I envisioned it (except maybe for the power and grounding that can be localized sources if the modules are [very] far apart).
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top