Ultrasonic Rangefinder using 89c2051


SKU: IQ-49 Category:

Available Options:



The report details the implementation of distance measurement system using the ultrasonic waves. As the human ear’s audible perception range is 20 Hz to 40 kHz, it is insensitive to ultrasonic waves, and hence the ultrasound waves can be used for applications in industries/vehicles without hindering human activity. They are widely used as range meters and proximity detectors in industries also it can be used in parking assistance system. The distance can be measured using pulse echo and phase measurement method. Here the pulse echo methods used. The measurement unit uses a continuous signal in the transmission frequency range of ultrasonic transducers. The signal is transmitted by an ultrasonic transducer, reflected by an obstacle and received by another transducer where the signal is detected. The time delay of the transmitted and the received signal corresponds to the distance between the system and the obstacle.


There are several ways to measure distance without contact. One way is to use ultrasonic waves at 40 kHz for distance measurement. Ultrasonic transducers measure the amount of time taken for a pulse of sound to travel to a particular surface and return as the reflected echo. This circuit calculates the distance based on the speed of sound at 25°C ambient temperature and shows it on a 7-segment display. Using it, you can measure distance up to 2.5 meters. For this particular application, the required components  are  AT89C2051 microcontroller, two 40kHz ultrasonic transducers  (one  each  for  transmitter and receiver), current buffer ULN2003, operational amplifier iM324I inverter Ca4M4VI four T-segment displays I five transistors and some discreet components. The ultrasonic transmitter- receiver pair is shown in  Ultrasonic generators use piezoelectric materials such as zinc or lead zirconium tartrates or quartz crystal. The material thickness decides the resonant frequency when mounted and excited by electrodes attached on either side of it. The medical scanners used for abdomen or heart ultrasound are designed at 2.R Mez. fn this circuit, a 40kHz transducer is used for measurement in the air medium. The velocity of sound in the air is around 330 m/s at 0°C and varies with temperature.

In  this  project,  you  excite  the  ultrasonic transmitter unit with a 40kHz pulse  burst  and  expect  an  echo  from the object whose distance you want to measure. Fig. 2 shows the transmitted burst, which lasts  for  a  period  of  approximately  0.5  ms.  It  travels  to  the object  in  the  air  and  the  echo  signal is picked up by another ultrasonic transducer unit (receiver), also a 40 kHz pre-tuned unit. The received signal, which is very weak is amplified several times in the receiver circuit and appears somewhat as shown in Fig. 2 when seen on a CRO. Weak echoes also occur due to the signals being directly received through the side lobes. These are ignored as the real echo received alone would give the correct distance. That is why we should have a level control. Of course, the signal gets weaker if the target is farther than 2.5 and will need a higher pulse excitation voltage or a better transducer. Here the microcontroller is used to generate 40 kHz sound pulses. It reads when the echo arrives; it finds the time taken in microseconds  for  to-and-fro travel of sound waves. Using velocity of 333 m/s, it does the calculations and shows on the four 7-segment displays the distance in centimeters and millimeters (three digits for centimeters and one for millimeters).

Additional information

Weight N/A
Project kit

Professional, Assembled, Combo, Learning

7 reviews for Ultrasonic Rangefinder using 89c2051

  1. livelybrowsers

    Thanks for good stuff

  2. Shankar Karol

    Kya Baat hai Iqbal Bhai…
    Great Projects…..
    About Iqbal Bhai: He is really a very helpful person and really a mastermind.
    Whatever your project is he will definitely done that…
    Truly Great Guys….
    All the Best Boss…
    Love you guys….

  3. Author


  4. aparadekto

    Hey, I can’t view your site properly within Opera, I actually hope you look into fixing this.

    • Author

      i check within 2 days

    • admin

      Please update Opera to latest version. Also note that since opera using a different rendering technology to render web pages, initially the first post and top navigation would appear and then it will load the right sidebar and rest page subsequently.

      I triple checked the site loading in opera and did not get any issues.

      Please send the version of opera browser you are using and note that the site is not optimized for mobile version of opera.

  5. xenium pokhrel

    can you please mail me the codes in c or c++ programming language. i will be thankful.

  6. Avishek

    I am interested in your project that deals with speedometer and odometer using atmega32.Can you please give me a code pertaining to c as the program that you have uploaded is in assembly language. you can contact me on the above email id….
    Thank you…

    • Author

      You should check it correctly as that code is in c language not in assembly.

  7. Bhavan

    can you please mail me the codes in c
    thank you


      you can download Ultrasonic rangefinder codes from download option

Add a review

Your email address will not be published. Required fields are marked *