Using UltraSonic & Lcd Display

This is a simple Park Sensor System. With this tutorial you will be able to found your distance from another car up to 4m. and print the distance to Lcd Display HD44780. When the distance is “secure” a Green Led light, also when your distance is less that 30cm (You can adjust this) a Red Led light.
arduino-ultrasonic-ranging-with-hc-sr04_1

Wiring

To wire your SR-04 Ranging Detector to your Arduino, connect the following pins:

  • Sensor Pin 1 (Gnd) –> Arduino Ground
  • Sensor Pin 2 (Echo) –> Arduino Pin 11
  • Sensor Pin 3 (Trig) –> Arduino Pin 12
  • Sensor Pin 4 (Vcc) –> Arduino +5V
  • Don’t forget to connect and the other 2 pins of potentiometer to Ground and +5V.

To wire your Lcd Display to your Arduino, connect the following pins:

  • Lcd Pin 1 (Vss) –> Arduino Ground
  • Lcd Pin 2 (Vdd) –> Arduino +5V
  • Lcd Pin 3 (Vo) –> Middle Pin of Potentiometer 10K
  • Lcd Pin 4 (Rs) –> Arduino Pin 8
  • Lcd Pin 5 (Rw) –> Arduino Ground
  • Lcd Pin 6 (E) –> Arduino Pin 7
  • Lcd Pin 7-10 –> N/C
  • Lcd Pin 11 (D4) –> Arduino Pin 5
  • Lcd Pin 12 (D5) –> Arduino Pin 4
  • Lcd Pin 13 (D6) –> Arduino Pin 3
  • Lcd Pin 14 (D7) –>Arduino Pin 2
  • Lcd Pin 15 (A) –> Arduino +3.3V
  • Lcd Pin 16 (K) –> Arduino Ground

To wire your Leds to your Arduino, connect the following pins:

  • First Led Pin (5V) –> Arduino Pin 9
  • Second Led Pin (5V) –> Arduino Pin 10
  • The Ground Pins of Led –> Arduino Ground via 220ohm Resistor

 

Recommended Software

  • none

Instructions and Code

Posted in Arduino Tutorials Tagged with: , , ,
One comment on “Using UltraSonic & Lcd Display
  1. dayahbayang says:

    may i know is this code can be write in micro-c pro for pic? it is bcause my project is using pic microcontroller and not use the arduino.

Leave a Reply

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

*