This circuit integrates various components with an Arduino UNO microcontroller to create a multifunctional system. The system includes an LCD display for user interface, a potentiometer for adjustable input, a servomotor for mechanical control, an LED for visual indication, resistors for current limiting, a piezo buzzer for audio output, and multiple HC-SR04 ultrasonic sensors for distance measurement.
5V
and GND
are used to power the circuitA0
, A1
, A2
are connected to the TRIG
pins of the HC-SR04 sensorsD13
is connected to the SIG
pin of the Servomotor SG90D12
is connected to the pin 1
of the Piezo BuzzerD9
is connected to the anode
of the LEDD7
, D6
, D5
, D4
, D3
, D2
are connected to the RS
, E
, DB4
, DB5
, DB6
, DB7
pins of the LCD Display respectivelyVDD
connected to 5V
powerVSS
and R_W
connected to GND
VO
connected to the Output
of the PotentiometerRS
, E
, DB4
, DB5
, DB6
, DB7
connected to Arduino UNO pins D7
, D6
, D5
, D4
, D3
, D2
respectivelyK
connected to GND
through a 200 Ohm resistorGND
connected to GND
Output
connected to VO
of the LCD DisplayVCC
connected to 5V
powerSIG
connected to D13
on the Arduino UNOVCC
connected to 5V
powerGND
connected to GND
anode
connected to D9
on the Arduino UNOcathode
connected to GND
through a 200 Ohm resistorcathode
of the LED and GND
K
of the LCD Display and GND
pin 2
of the Piezo Buzzer and GND
pin 1
connected to D12
on the Arduino UNOpin 2
connected to GND
through a 200 Ohm resistorVCC
pins connected to 5V
powerGND
pins connected to GND
TRIG
pins connected to A0
, A1
, A2
on the Arduino UNO respectively#include <LiquidCrystal.h>
// Initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
void setup() {
// Set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello");
}
void loop() {
// put your main code here, to run repeatedly:
}
This code initializes the LCD display and prints the message "hello" on it. The LiquidCrystal
library is used to manage the LCD's interface pins and to set up the display's dimensions. The setup()
function runs once when the program starts and sets up the LCD, while the loop()
function runs continuously, allowing for repeated operations.