Help me write code for distance measurement using ultrasonic transducer & PIC16F877A
Sir,
I am working on a distance measurement device using PING ultrasonic transducer and PIC16f877A,
but i cant able write the suitable code for this sensor in C, please help me.
Thanks
i want to measure the distance to an object up to 3m, i am using PIC16f877A as the controller, pls check the attachment which is the data sheet of my sensor.
thank you.
Re: Help me write code for distance measurement using ultrasonic transducer & PIC16F8
i'm just working on a one ...
my idea based on using pwm .. as i emit pwm with freq. 40khz from the pic for 0.5 sec..then through the transiver . that's meaning 20khz has been transmitted at the same time i open the pwm i
use the pic in capture mode to count the number of returned pulses through the receiver ...
then i calculate the number of missed pulses ... 20k - recevied = missed .... then by knowing the frequency we can calculate the distance
The following is a document with a detailed discussion of using several of the available interfaces of the MaxBotix LV-MaxSonar series with a PIC with code snippets.