Interfacing Ultrasonic Ranger With AVR

Status
Not open for further replies.

alfie.max15

Member level 2
Joined
Jan 3, 2013
Messages
47
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Visit site
Activity points
1,660
I was looking for how to interface the ultrasonic rangefinder with AVR and from a website i found the following steps

Ultrasonic Range Finder Interface.

These modules are designed to be used for microcontroller based applications hence optimized for it. The interface is a single pin called SIG (signal). The MCU is connected to the Ultrasonic Range Finder Module by a single i/o line. The steps required to read distance are :-

1. Microcontroller make the i/o line output. (by using the DDRx Register in AVR or TRISx Register in PIC)
2. The i/o line is made low (this may be the default state of i/o pin)
3. Wait for 10uS
4. Make the i/o line high.
5. Wait for 15uS
6. Make the i/o line low
7. Wait for 20uS
8. Now make it input (by using the DDRx Register in AVR or TRISx Register in PIC)
9. Module will keep it low. Wait till it is low, as soon as it becomes high start the timer.
10. After that wait till it is high, as soon as it becomes low copy the timer value and stop the timer.
11. Finally we have the time required for the wave to go hit the obstacle and come back to the module.

can anyone help me understand this....

why is the i/o lines being toggled between input and output?
why is there change in the wait time?
 

Maybe the microcontroller has to send a pulse to the sensor through SIG pin to start the sensor (wave). So, the mcu pin will be o/p first. Then the sensor outputs data through SIG pin and it should be fed to mcu. So, the mcu pin is made i/p. The wave is sent and it gets reflected back to the sensor. The time between transmission of wave and reception of wave is found and converted to distance.

Can you post the datasheet of your sensor?
 



i dont have a datasheet of the sensor....

https://www.micro-examples.com/public/microex-navig/doc/090-ultrasonic-ranger

i have made my own using the details of this site....

but i am using avr so the programming given in that site of no use to me....
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…