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

Arduino Nano Controlled Robotic Cleaner with Ultrasonic Sensors and I2C LCD Interface

View and Edit Project In Cirkit DesignerImage of Arduino Nano Controlled Robotic Cleaner with Ultrasonic Sensors and I2C LCD Interface

Circuit Documentation

Summary

This circuit is designed to control a robotic cleaning system equipped with multiple sensors and actuators. The system is powered by a 12V battery and is controlled by an Arduino Nano microcontroller. The circuit includes motor and wheel assemblies for movement, a 5V mini water pump for wet cleaning, water level and dust sensors for environmental monitoring, and multiple HC-SR04 ultrasonic sensors for obstacle detection and navigation. A L293D motor driver is used to control the motors, and an I2C LCD screen provides a user interface for mode selection and status display.

Component List

Battery 12V

Motor and Wheels (4 instances)

5V Mini Water Pump

Water Level Sensor

Dust Sensor

HC-SR04 Ultrasonic Sensor (4 instances)

L293D Motor Driver

Arduino Nano

LCD Screen 16x2 I2C

Wiring Details

Battery 12V

Motor and Wheels

5V Mini Water Pump

Water Level Sensor

Dust Sensor

HC-SR04 Ultrasonic Sensor

L293D Motor Driver

Arduino Nano

LCD Screen 16x2 I2C

Documented Code

#include <NewPing.h>    // Import libraries for ultrasonic sensors
#include <LiquidCrystal_I2C.h>     // I2C LCD library
#include <Wire.h>                 // I2C library

// Initialize pin numbers for ultrasonic sensors and motor control
const int echo_L = 2; const int trig_L = 3;
const int echo_M = 4; const int trig_M = 5;
const int echo_R = 7; const int trig_R = 8;
const int echo_Crack = A0; const int trig_Crack = A1;
const int dustSensorPin = A2; // Dust sensor
const int waterLevelPin = A3;
const int L1 = 6; const int L2 = 9;
const int R1 = 10; const int R2 = 11;
const int pump = 13; // Pump control for wet cleaning

// Additional variables and constants
int motor_speed = 255;
int max_distance = 200;
int distance_L = 0; int distance_M = 0;
int distance_R = 0; int distance_Crack = 0;
bool isWetCleaning = false;
bool isWaterLow = false;
unsigned long lastPumpTime = 0;

// Initialize ultrasonic sensors and LCD
NewPing sonar_L(trig_L, echo_L, max_distance);
NewPing sonar_M(trig_M, echo_M, max_distance);
NewPing sonar_R(trig_R, echo_R, max_distance);
NewPing sonar_Crack(trig_Crack, echo_Crack, max_distance);
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
  // Setup pin modes and initial states
  pinMode(L1, OUTPUT); pinMode(L2, OUTPUT);
  pinMode(R1, OUTPUT); pinMode(R2, OUTPUT);
  pinMode(pump, OUTPUT);
  digitalWrite(L1, LOW); digitalWrite(L2, LOW);
  digitalWrite(R1, LOW); digitalWrite(R2, LOW);
  digitalWrite(pump, LOW);
  lcd.begin(16, 2); lcd.print("Choose Mode");
  Serial.begin(9600);
  delay(2000);
}

void loop() {
  // Mode selection and sensor reading logic
  // Movement control and wet cleaning logic
  // Dust detection and water level checking
  // Functions for moving the robot and controlling the pump
}

// Functions for reading sensors and controlling actuators
// Detailed function implementations are omitted for brevity

The code provided is a high-level overview of the embedded software running on the Arduino Nano. It includes initialization of sensors and actuators, setup of pin modes, and the main loop with logic for mode selection, movement control, sensor reading, and actuator control. Functions for reading sensors, moving the robot, and controlling the pump are declared and used within the loop.