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 HC-SR04 Ultrasonic Sensor and a 16x2 I2C LCD display. The Arduino UNO serves as the central processing unit, controlling the ultrasonic sensor to measure distances and displaying the results on the LCD. The sensor's trigger and echo pins are connected to the Arduino to send out ultrasonic pulses and receive the echo. The LCD is interfaced with the Arduino via the I2C communication protocol, using the SDA and SCL lines for data transfer.
Component List
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- Pins Used: IOREF, 5V, GND, SCL, SDA, D3, D2.
HC-SR04 Ultrasonic Sensor
- Description: An ultrasonic distance sensor capable of measuring distances from 2cm to 400cm.
- Pins Used: VCC, TRIG, ECHO, GND.
16x2 I2C LCD
- Description: A liquid crystal display capable of displaying 16 characters per 2 lines with an I2C interface.
- Pins Used: GND, VCC, SDA, SCL.
Wiring Details
Arduino UNO
- IOREF connected to 16x2 I2C LCD VCC
- 5V connected to HC-SR04 Ultrasonic Sensor VCC
- GND connected to 16x2 I2C LCD GND and HC-SR04 Ultrasonic Sensor GND
- SCL connected to 16x2 I2C LCD SCL
- SDA connected to 16x2 I2C LCD SDA
- D3 connected to HC-SR04 Ultrasonic Sensor TRIG
- D2 connected to HC-SR04 Ultrasonic Sensor ECHO
HC-SR04 Ultrasonic Sensor
- VCC connected to Arduino UNO 5V
- TRIG connected to Arduino UNO D3
- ECHO connected to Arduino UNO D2
- GND connected to Arduino UNO GND
16x2 I2C LCD
- GND connected to Arduino UNO GND
- VCC connected to Arduino UNO IOREF
- SDA connected to Arduino UNO SDA
- SCL connected to Arduino UNO SCL
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 include specific functionality. It should be populated with the setup and loop routines required to initialize the components and implement the desired behavior of the circuit.