Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino Nano Controlled LCD Display with Dual IR Sensor Inputs and Servo Output

View and Edit Project In Cirkit DesignerImage of Arduino Nano Controlled LCD Display with Dual IR Sensor Inputs and Servo Output

Circuit Documentation

Summary of the Circuit

This circuit integrates an Arduino Nano microcontroller with an LCD screen (16x2 characters) using I2C communication, two IR sensors, and a servo motor. The Arduino Nano serves as the central processing unit, controlling the LCD screen to display messages, reading signals from the IR sensors, and driving the servo motor based on the program logic. The IR sensors are used to detect objects or motion, and the servo motor is controlled via PWM signal from the Arduino Nano.

Component List

Arduino Nano

LCD screen 16x2 I2C

IR Sensor

Servo

Wiring Details

Arduino Nano

LCD screen 16x2 I2C

IR Sensor

Servo

Documented Code

Arduino Nano Code (sketch.ino)

#include "LCDIC2.h"

LCDIC2 lcd(0x27, 16, 2);

void setup() {
  if (lcd.begin()) lcd.print("Hello, World!");
}

void loop() {
  for (uint8_t i = 0; i < 15; i++) {
    lcd.setCursor(i, 1);
    delay(250);
  }
  for (uint8_t i = 15; i > 0; i--) {
    lcd.setCursor(i, 1);
    delay(250);
  }
}

This code initializes an LCD screen with I2C communication, prints "Hello, World!" on the screen, and then creates a simple animation by moving the cursor back and forth across the second row of the LCD. The LCDIC2 library is used for interfacing with the LCD, and the address 0x27 is specified for the I2C communication. The setup() function initializes the LCD and prints the initial message. The loop() function creates the animation effect by moving the cursor position and introducing a delay between movements.