Arduino UNO-Based Ultrasonic Sensor and LCD Display Controlled DC Motor System
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit involves an Arduino UNO microcontroller interfacing with an HC-SR04 Ultrasonic Sensor, a 16x2 I2C LCD, a DC Motor, and an L298N 2A Dual Motor Driver Module. The circuit is powered by a 12V battery. The Arduino UNO controls the motor driver and reads data from the ultrasonic sensor, displaying the information on the LCD.
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 for measuring distance 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
DC Motor
- Description: A simple DC motor.
- Pins: pin 1, pin 2
Battery 12V
- Description: A 12V battery used to power the circuit.
- Pins: +, -
L298N 2A Dual Motor Driver Module with PWM Control
- Description: A motor driver module capable of controlling two DC motors with PWM control.
- Pins: OUT1, OUT2, 12V, GND, 5V, OUT4, OUT3, ENA, IN1, IN2, IN3, ENB, IN4
Wiring Details
Arduino UNO
GND connected to:
- Battery 12V (-)
- 16x2 I2C LCD (GND)
- L298N Motor Driver (GND)
- HC-SR04 Ultrasonic Sensor (GND)
5V connected to:
- 16x2 I2C LCD (VCC)
- L298N Motor Driver (5V)
- HC-SR04 Ultrasonic Sensor (VCC)
A4 connected to:
- 16x2 I2C LCD (SDA)
A5 connected to:
- 16x2 I2C LCD (SCL)
D10 connected to:
- L298N Motor Driver (ENA)
D7 connected to:
- L298N Motor Driver (IN1)
D6 connected to:
- L298N Motor Driver (IN2)
D3 connected to:
- HC-SR04 Ultrasonic Sensor (ECHO)
D2 connected to:
- HC-SR04 Ultrasonic Sensor (TRIG)
HC-SR04 Ultrasonic Sensor
GND connected to:
- Arduino UNO (GND)
VCC connected to:
- Arduino UNO (5V)
TRIG connected to:
- Arduino UNO (D2)
ECHO connected to:
- Arduino UNO (D3)
16x2 I2C LCD
GND connected to:
- Arduino UNO (GND)
VCC connected to:
- Arduino UNO (5V)
SDA connected to:
- Arduino UNO (A4)
SCL connected to:
- Arduino UNO (A5)
DC Motor
pin 1 connected to:
- L298N Motor Driver (OUT1)
pin 2 connected to:
- L298N Motor Driver (OUT2)
Battery 12V
- connected to:
- Arduino UNO (GND)
+ connected to:
- L298N Motor Driver (12V)
L298N 2A Dual Motor Driver Module with PWM Control
GND connected to:
- Arduino UNO (GND)
5V connected to:
- Arduino UNO (5V)
12V connected to:
- Battery 12V (+)
ENA connected to:
- Arduino UNO (D10)
IN1 connected to:
- Arduino UNO (D7)
IN2 connected to:
- Arduino UNO (D6)
OUT1 connected to:
- DC Motor (pin 1)
OUT2 connected to:
- DC Motor (pin 2)
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:
}
Additional Documentation (documentation.txt)