Arduino UNO Based Ultrasonic Distance Measurement with I2C LCD Display
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit integrates an Arduino UNO microcontroller with an LCD Display (16x4 I2C) and an HC-SR04 Ultrasonic Sensor. The Arduino UNO serves as the central processing unit, controlling the LCD Display for output and interfacing with the HC-SR04 Ultrasonic Sensor for distance measurement. The LCD Display communicates with the Arduino via the I2C protocol, while the HC-SR04 sensor is connected to digital pins for trigger and echo signals. The circuit is powered through the Arduino's 5V pin, which also supplies power to the other components.
Component List
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0-A5, SCL, SDA, AREF, D0-D13.
LCD Display 16x4 I2C
- Description: A 16x4 character LCD display with an I2C interface.
- Pins: SCL, SDA, VCC, GND.
HC-SR04 Ultrasonic Sensor
- Description: An ultrasonic distance sensor capable of measuring distances from 2cm to 400cm.
- Pins: VCC, TRIG, ECHO, GND.
Wiring Details
Arduino UNO
- GND: Connected to the GND pins of the LCD Display and HC-SR04 Ultrasonic Sensor.
- 5V: Supplies power to the VCC pins of the LCD Display and HC-SR04 Ultrasonic Sensor.
- A4 (SDA): Connected to the SDA pin of the LCD Display for I2C communication.
- A5 (SCL): Connected to the SCL pin of the LCD Display for I2C communication.
- D8: Connected to the ECHO pin of the HC-SR04 Ultrasonic Sensor.
- D9: Connected to the TRIG pin of the HC-SR04 Ultrasonic Sensor.
LCD Display 16x4 I2C
- SCL: Connected to the A5 (SCL) pin of the Arduino UNO.
- SDA: Connected to the A4 (SDA) pin of the Arduino UNO.
- VCC: Powered by the 5V pin of the Arduino UNO.
- GND: Connected to the GND pin of the Arduino UNO.
HC-SR04 Ultrasonic Sensor
- VCC: Powered by the 5V pin of the Arduino UNO.
- TRIG: Connected to the D9 pin of the Arduino UNO.
- ECHO: Connected to the D8 pin of the Arduino UNO.
- GND: Connected to the GND pin of the Arduino UNO.
Documented Code
Arduino UNO Code (sketch.ino)
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Note: The provided code is a template and does not contain any functional code specific to the operation of the components. It will need to be populated with the necessary initialization and operational routines for the LCD Display and HC-SR04 Ultrasonic Sensor.