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

Arduino UNO Bluetooth-Controlled Robotic Car with LCD Display and RGB LED

View and Edit Project In Cirkit DesignerImage of Arduino UNO Bluetooth-Controlled Robotic Car with LCD Display and RGB LED

Circuit Documentation

Summary

This circuit is designed to control a robotic vehicle with motorized wheels, an RGB LED, a laser diode, a servo motor, an LCD display, and Bluetooth communication. The control is managed by an Arduino UNO microcontroller, which interfaces with various components to perform actions based on received commands.

Component List

  1. Motor and Wheels

    • Description: Motorized wheels for movement.
    • Pins: VCC, GND
  2. Arduino UNO

    • Description: Microcontroller for controlling the circuit.
    • 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
  3. L298N DC Motor Driver

    • Description: Motor driver for controlling the motors.
    • Pins: OUT1, OUT2, 12V, GND, 5V, OUT3, OUT4, 5V-ENA-JMP-I, 5V-ENA-JMP-O, +5V-J1, +5V-J2, ENA, IN1, IN2, IN3, IN4, ENB
  4. Bluetooth HC-06

    • Description: Bluetooth module for wireless communication.
    • Pins: VCC, GND, TXD, RXD
  5. Servo

    • Description: Servo motor for precise control.
    • Pins: GND, VCC, PWM
  6. RGB LED (Wokwi compatible)

    • Description: RGB LED for visual indications.
    • Pins: R, COM, G, B
  7. 16x2 I2C LCD

    • Description: LCD display for visual output.
    • Pins: GND, VCC, SDA, SCL
  8. Battery 12V

    • Description: Power source for the circuit.
    • Pins: +, -
  9. Resistor (150 Ohms)

    • Description: Resistor for current limiting.
    • Pins: pin1, pin2
  10. Resistor (95 Ohms)

    • Description: Resistor for current limiting.
    • Pins: pin1, pin2
  11. Laser Diode

    • Description: Laser diode for emitting laser light.
    • Pins: negative, positive

Wiring Details

Motor and Wheels

Arduino UNO

L298N DC Motor Driver

Bluetooth HC-06

Servo

RGB LED (Wokwi compatible)

16x2 I2C LCD

Battery 12V

Resistor (150 Ohms)

Resistor (95 Ohms)

Laser Diode

Code Documentation

#include <Servo.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// Pin configuration
const int motorRightForward = 2;
const int motorRightBackward = 3;
const int motorLeftForward = 4;
const int motorLeftBackward = 5;
const int ledRed = 6;
const int ledGreen = 7;
const int ledBlue = 8;
const int laserPin = 10;
const int servoPin = 9;

Servo servo;
LiquidCrystal_I2C lcd(0x27, 16, 2);
int servoAngle = 90;
char command;

void setup() {
  Serial.begin(9600); // Set the baud rate to your Bluetooth module

  // Motor pins
  pinMode(motorRightForward, OUTPUT);
  pinMode(motorRightBackward, OUTPUT);
  pinMode(motorLeftForward, OUTPUT);
  pinMode(motorLeftBackward, OUTPUT);

  // LED pins
  pinMode(ledRed, OUTPUT);
  pinMode(ledGreen, OUTPUT);
  pinMode(ledBlue, OUTPUT);

  // Laser pin
  pinMode(laserPin, OUTPUT);

  // Servo setup
  servo.attach(servoPin);
  servo.write(servoAngle);

  // LCD setup
  lcd.init();
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print("Ready");
}

void loop() {
  if (Serial.available() > 0) {
    command = Serial.read();

    if (isalpha(command)) {
      switch (command) {
        case 'F':
          forward();
          break;
        case 'B':
          backward();
          break;
        case 'L':
          turnLeft();
          break;
        case 'R':
          turnRight();
          break;
        case 'S':
          stopMotors();
          break;
        case 'V':
          Red();
          break;
        case 'G':
          Green();
          break;
        case 'v':
          Blue();
          break;
        case 'q':
          offRGB();
          break;
        case 'l ':
          laserOn();
          break;
        case 'K':
          laserOff();
          break;
        case 'W':
          servoUp();
          break;
        case 'w':
          servoUp();
          break;
        case 'U':
          servoDown();
          break;