A simple projects demonstrating use of Ultrasonic sensor to measure distance. This project make use of PIC microcontroller and 40Khz ultrasonic transducers pair for measuring distance from obstacle and displaying it on 7-Segment LED display.

The working of project is based on the simple phenomenon of sound traveling. The time from transmission of the pulse to reception of the echo is the time taken for the sound energy to travel through the air to the object and back again.

Since the speed of sound is constant through air measuring the echo reflection time lets you calculate the distance to the object using the DST equation :

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

You need to divide by 2 as the distance is the round trip distance i.e. from transmitter to object and back again.

The 40Khz signal is generated form controller itself and given to ultrasonic transmitter via amplifier circuit. Receiver part includes preamplifier, peak detector and threshold circuit.

Block Diagram of PIC Sonar

Circuit Diagram:

for complete theory and code visit PIC Sonar project page
Tags ultrasonic distance measurementPIC projectsPIC sonarpic interfacing ultrasonic sensor
printer friendly create pdf of this news item

Submit comment

(Required; Min length 5)
(Required; will not be displayed)


Sun Sep 27 2020, 07:06 AM
Edgar Sharrow
Want no charge advertising for your website? Check out: http://bit.ly/post-free-ads-here
Sat Sep 26 2020, 07:27 PM
Ronald Withrow
This software will help to increase traffic to website to hundreds, thousands times.
Thu Jun 11 2020, 06:27 AM
sir could please send the code for I2C and wifi interfacing with 8051
Tue May 19 2020, 10:29 PM
Does anyone have microcontroller programming software for STC15F104W (core 8051, 4 k, 128 byte, 6 I/O pin, UART ... DIL8), that works?
Sat May 02 2020, 07:38 PM
Tamu Gurung
Hi I am looking for a assembly language program for a digital decimal counter. Time counts max limit of 2 mins starting from 2.00 mins and ending at 0.00. time is to be displayed on 4 7-segment LED displays. Edsim51 simulator to be used. Thanks
Wed Mar 25 2020, 01:39 PM
Sir kindly send the code file i2c for 8051
Fri Mar 13 2020, 10:36 PM
@ Rohitnani,ABEBE..which project ?
Fri Mar 13 2020, 12:55 PM
how can get hadwere of this project
Sat Mar 07 2020, 05:11 PM
Sir, Could you please send me the zip file input password....
Wed Feb 26 2020, 04:58 PM
Peter Parker
Is it possible to send multiple messages using only 1 GSM module?



Thu Jun 25 2020, 03:46 PM
Mon Jun 22 2020, 03:03 PM
Tue Jun 16 2020, 05:10 PM
Sat Jun 13 2020, 09:43 PM
Thu May 21 2020, 12:44 PM
Thu May 21 2020, 01:28 AM
Wed May 20 2020, 07:05 PM
Wed May 20 2020, 11:52 AM


Guests: 94, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 38215
Newest member: Mirza123