Interfacing Ultrasonic Distance Sensor : ASCII Output with PIC Microcontroller

In some of our projects, we may want to measure the distance of an object from a point. Ultrasonic Distance Sensors are the best sensor which provides stable, accurate, precise, non-contact distance measurements from 2cm to 4m. Ultrasonic Sensors can be used to measure distance between moving or stationary objects. Being very accurate and stable, these devices find large number of applications in robotics fields. For example it can be used as an excellent replacement for IR sensors in  a Micromouse. In this tutorial we will lean to interface an Ultrasonic Distance Sensor with PIC Microcontroller.

Interfacing Ultrasonic Distance Sensor  ASCII Output with PIC MicrocontrollerHere for demonstration we are using Rhydolabz Ultrasonic Distance Sensor with ASCII Output. It can be easily interfaced with a PIC Microcontroller using USART by just connecting the output pin of the sensor to RX pin of the microcontroller. In every 500ms this sensor transmits an ultrasonic burst and listens for its echo. The sensor sends out ASCII value corresponds to the time required for the ultrasonic burst to return to the sensor. The UART of the sensor is operates at a baud rate 9600 and the sensor can be powered by  a 5V DC Supply. The ASCII output of the sensor will be equal to the distance to the obstacle in centimeter (cm).

Interfacing Ultrasonic Distance Sensor  ASCII Output with PIC Microcontroller SchematicThe sensor has three pins…

  • Vcc  – +5V DC Supply to the Sensor
  • GND –  Ground Level of the Power Supply
  • SIG – Signal, Serial Data Out’


For more detail: Interfacing Ultrasonic Distance Sensor  ASCII Output with PIC Microcontroller

READ  Interfacing16X2 LCD with PIC Microcontroller

Current Project / Post can also be found using:

  • How interface ultrasonic sensor with lpc2138 in proteus pdf
  • using max3100

Leave a Comment

= 5 + 6

Read previous post:
j. ICSP Programmer for PIC32 microcontroller family

PIC32 ICSP Programmer v1.0 is based on a simple PIC32MX270F256B microcontroller basic circuit. It connects to a PC via USB...

Scroll to top