This circuit is designed to control a mobile robot with the capability to move, detect obstacles, communicate via Bluetooth, and display information on an LCD screen. The core of the circuit is an Arduino UNO microcontroller, which interfaces with various components such as motors, LEDs, an ultrasonic sensor, a Bluetooth module, and an LCD display. The circuit is powered by a 9V battery, regulated by an LM340T5 7805 voltage regulator. The robot's movement is controlled by two gearmotors, managed by an L293D motor driver. The HC-SR04 ultrasonic sensor is used for obstacle detection, and the Bluetooth HC-06 module allows for wireless control. The LEDs serve as indicators, and the LCD I2C display provides a user interface.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#define TRIGPIN 5
#define ECHOPIN 7
// Initialization
int m1a = 9; // Motor 1, Arduino pin 10 to L293B pin 15.
int m1b = 10; // Motor 1, Arduino pin 9 to L293B pin 10.
int m2a = 11; // Motor 2, Arduino pin 12 to L293B pin 2.
int m2b = 12; // Motor 2, Arduino pin 11 to L293B pin 7.
char val;
bool ready = false;
int VerdDreta = 3;
int VerdEsquerra = 4;
int VermellDreta = 6;
int VermellEsquerra = 2;
LiquidCrystal_I2C lcd(0X27,16,2);
// Custom characters for eyes
byte ulls1_1[8] = {
// ... (custom characters defined here)
};
// ... (more custom characters and functions)
// Setup method
void setup() {
// ... (setup code)
}
// Main loop
void loop() {
// ... (main loop code)
}
// ... (additional functions)
Material List
Base:
+ Arduino UNO
+ Medium Breadboard
+ 9V Battery
+ Switch
+ Wires
Mobility:
+ 2 DC Motors with wheels
+ L293D Motor Driver
+ LM340T5
Distance Sensor:
+ HC-SR04 Ultrasonic Sensor
Control:
+ HC-05 Bluetooth Controller
Display:
+ LCD-I2C Screen
Lights:
+ 4 resistors
+ 2 Green LEDs
+ 2 Red LEDs
Chassis:
+ Lower Chassis
+ Central Chassis
+ Front Upper Chassis
+ Rear Upper Chassis
+ Front Wheel
+ Screws
This documentation provides an overview of the circuit, including the purpose and wiring of each component, as well as the embedded code for the Arduino UNO microcontroller. The additional documentation lists the materials used in the construction of the robot.