Challenge

Project 2 - Measuring distance of an object using ultrasonic sensor (HC-SR04)

PROJECT OVERVIEW:

  • We are going to implementation of code for “Measuring distance of an object" using ultrasonic distance sensor (HC-SR04) and Atmega32 Microcontroller in which real time distance is sensed by an ultrasonic sensor and displays measured distance on an LCD display by using the SimulIDE.

GOALS:

Measuring the distance of an object using Ultrasonic Distance Sensor (HC-SR04):

  • The ultrasonic distance sensor has 4 Pins: Vcc, GND, Trigger and Echo. The Vcc and GND are used to power up the sensor and are connected to power and ground rails on breadboard. Trigger is connected to PIN 40 (ADC0/PA0) and Echo is connected to PIN 0 (T0/PB0) of the microcontroller.

PROJECT KEY HIGHLIGHTS:

Measuring the distance travelled by the wave to the object and gets bounced back from the object to sensor:

  • Controller has to trigger the sensor to start transmitting the ultrasonic waves. To trigger the ultrasonic sensor,controller has to send a high signal to the Trig pin.Trig pin - connected to PA0, Echo pin - connected to PBO(ICSPI)
    In pin - That pin is for simulating the object distance.The input voltage in this pin is directly proportional to the
    object distance.
  • Now the ultrasonic transmitter on the sensor will emit a short burst automatically.If there is an object in the range of ultrasonic sensor, then the transmitted wave will bounce back towards the sensor and the ultrasonic receiver will receive that echo.
  • When the ultrasonic wave transmission starts,the Echo pin is held high by the sensor until the ultrasonic sensoy, receives the echo pulse.
  • After it receives the echo, Echo pin is pulled down. The pulse width of that HIGH pulse at Echo pin is the time
    taken by the wave to travel to the object and gets bounced back from the object to the sensor.
  • we have to capture the pulse width in order to measure the distance of the object.

PROJECT DELIVERABLES:

  • By this project we used to monitor the distance between ultrasonic sensor and object and it will display that monitored distance value on LCD display.
  • Microcontroller ATmega32 is used to control the whole process.
  • Ultrasonic sensor will be having transmitter and receiver in it. Transmitter continuously transmits the signal and whenever obstacle approaches the sensor then that transmitted signal hits the object, bounce back and received by ultrasonic receiver.
  • That sensor sensed signal with respect to distance is then send to microcontroller, microcontroller in turn displays the measured distance value on LCD.
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.