Arduino UNO-Based Distance Measurement System with HC-SR04 and I2C LCD Display
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit consists of an Arduino UNO microcontroller, an HC-SR04 Ultrasonic Sensor, and a 16x2 I2C LCD display. The Arduino UNO serves as the central controller, interfacing with the ultrasonic sensor to measure distance and displaying the results on the LCD screen.
Component List
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
HC-SR04 Ultrasonic Sensor
- Description: A sensor used to measure distance by using ultrasonic waves.
- Pins: VCC, TRIG, ECHO, GND
16x2 I2C LCD
- Description: A 16x2 character LCD display with I2C interface.
- Pins: GND, VCC, SDA, SCL
Comment
- Description: Placeholder for comments in the circuit design.
- Pins: None
Wiring Details
Arduino UNO
- 5V: Connected to VCC of the 16x2 I2C LCD and VCC of the HC-SR04 Ultrasonic Sensor.
- GND: Connected to GND of the 16x2 I2C LCD and GND of the HC-SR04 Ultrasonic Sensor.
- SCL: Connected to SCL of the 16x2 I2C LCD.
- SDA: Connected to SDA of the 16x2 I2C LCD.
- D3: Connected to TRIG of the HC-SR04 Ultrasonic Sensor.
- D2: Connected to ECHO of the HC-SR04 Ultrasonic Sensor.
HC-SR04 Ultrasonic Sensor
- VCC: Connected to 5V of the Arduino UNO.
- GND: Connected to GND of the Arduino UNO.
- TRIG: Connected to D3 of the Arduino UNO.
- ECHO: Connected to D2 of the Arduino UNO.
16x2 I2C LCD
- VCC: Connected to 5V of the Arduino UNO.
- GND: Connected to GND of the Arduino UNO.
- SCL: Connected to SCL of the Arduino UNO.
- SDA: Connected to SDA of the Arduino UNO.
Code Documentation
Arduino UNO Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
This code is a basic template for the Arduino UNO. The setup() function is where you initialize your components and settings, and the loop() function is where the main logic of your program runs repeatedly.
Additional Documentation
This section is reserved for any additional documentation or comments related to the code or circuit design.