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.

[SOLVED] PIC18f4550, How to send and receive signal using Ultrasonic ranging module hc-sr04

Status
Not open for further replies.

McFly123

Newbie level 6
Joined
Jan 21, 2012
Messages
14
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,283
Activity points
1,393
We Just bought this HC-Sr04 ultrasonic ranging module, and we would like to use it as an obstacle sensor, but we have a hard time on the program part of it. we thought it would be as easy as sending LOGIC 1 to the trigger pin ang receiving LOGIC 1 to the echo pin but it's not. do anyone have an experience on this sensor using it with PIC?
 
Last edited:

In looking to the timing diagram ( **broken link removed**) it demands a 10us input pulse to start operation. An output port needs to be connected to this Trig-input of the sensor and the Echo-output needs to go to a micro input port. The 10us start pulse you need to create by a timing loop or a timer. The length of the pulse returned is equivatent to the distance (formula in the paper). Again the pulse length can be measured using a timer which starts on the raise of the echo output.

Enjoy your design work.
 
In looking to the timing diagram ( **broken link removed**) it demands a 10us input pulse to start operation. An output port needs to be connected to this Trig-input of the sensor and the Echo-output needs to go to a micro input port. The 10us start pulse you need to create by a timing loop or a timer. The length of the pulse returned is equivatent to the distance (formula in the paper). Again the pulse length can be measured using a timer which starts on the raise of the echo output.

Enjoy your design work.

does it mean that we still have to use a timer like a 555 to generate a 10us pulse or we could just implement it by programming using delay of 10us? and we also just wanted to use it just to sense an object or an obstacle not as a ranger. Basically we just wanted to send this 10us pulses to generate a sonicburst and receive an echo so the echopin will send HIGH to our PIC18f4550. oh sorry, for I am being redundant, whew! where near from finishing our project but this part frustrates me today.
 

To generate a 10us pulse on the output port on the PIC you could execute a timing loop. First set the output to high and exceute a timing loop (e.g. count down from a value calculated by the time one loop take) and then set the output to low. Or you have to write an timer routine (insteadt of the timing loop). So you don't need a 555 for the 10us!

Enjoy our design work!
 

To generate a 10us pulse on the output port on the PIC you could execute a timing loop. First set the output to high and exceute a timing loop (e.g. count down from a value calculated by the time one loop take) and then set the output to low. Or you have to write an timer routine (insteadt of the timing loop). So you don't need a 555 for the 10us!

Enjoy our design work!

I think we just did that, and it didn't work as we like it to turn out. but we'll try again... we've might missed on something. thanks :)
 

Does any one can explain how ADCON really works? becoz we tried to use ADCON and the sensor worked, but we really don't know how.
 

hi, how u simulate the PIC18f4550 with the ultrasonic ranging module hc-sr0 in protues??? Anyone help... :-:)-:)-(.. Urgent!!!!!!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top