Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - Sonar Application PIC16F877

(you are viewing a thread; or go back to list of threads)

Sonar Application PIC16F877 (by Douglas)
Hello Jonathan,

Sorry for my english.

I am starting with ldmicro and PIC and i need to build a project to measure the distance of objects with a Ultrasonic Sensor (Sonar) and to determinate the distance i will need to measure the pulse lenght of the sensor to know the distance.

Example: Distance = (s * t)/2 (in metres)

where:

s [m/s] the speed of sound in air
t [s] the round trip echo time.

Some delay times:

Round trip echo time Distance
t = 588us 10cm
t = 5.8ms 1m

Is it possilbe to build with ldmicro?

I am looking forward on your feedback.

Douglas (Brazil)
Sat Sep 11 2010, 10:37:10
(no subject) (by Jonathan Westhues)
It's possible, though the time resolution will be limited by the cycle time. (Some micros have hardware that would let you measure with better resolution, but LDmicro doesn't support that.)

See the attachment, which measures the positive width of a pulse on Xin. The width is in units of cycle times; so with an 0.2 ms cycle time, for example, the 10 cm distance corresponds to a count of ~3, and the 1 m distance to a count of ~29.
Sat Sep 11 2010, 15:22:31, download attachment count-pulse.ld
(no subject) (by Douglas)
Thank you very much.
Sat Sep 11 2010, 16:37:37
sonar (by maximus)
Here I'm make LD sonar detection...
Can any body correction this LD...
Thank's......
Wed Sep 21 2011, 23:25:08, download attachment sonar edit.ld
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):