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

Arduino Uno Bluetooth Controlled Car with LCD Display

View and Edit Project In Cirkit DesignerImage of Arduino Uno Bluetooth Controlled Car with LCD Display

Circuit Documentation

Summary

This project is an Arduino-based Bluetooth-controlled car. The car is equipped with four DC motors controlled by an L298N motor driver. It also features an HC-05 Bluetooth module for receiving commands, an LCD display for status messages, and several LEDs for visual indicators. The car's movement is controlled via Bluetooth commands received from a paired device.

Component List

  1. Arduino Uno R3

    • Description: Microcontroller board based on the ATmega328P.
    • Pins: D8, D9, D10, D11, D12, D13, GND, AREF, SDA, SCL, D0/RX, D1/Tx, D2, D3, D4, D5, 6, D7, A5/SCL, A4/SDA, A3, A2, A1, A0, Vin, 5V, 3.3V, RESET, IOREF, NONE, USB Jack, Power Jack.
  2. LCD 16x2 (Wokwi Compatible)

    • Description: 16x2 character LCD display.
    • Pins: VSS, VDD, V0, RS, RW, E, D0, D1, D2, D3, D4, D5, D6, D7, A, K.
  3. HC-05 Bluetooth Module

    • Description: Bluetooth module for wireless communication.
    • Pins: Key, VCC, TXD, RXD, State, GND.
  4. DC Motor

    • Description: Standard DC motor.
    • Pins: pin 1, pin 2.
  5. 9V Battery

    • Description: Power source for the circuit.
    • Pins: +, -.
  6. Toggle Switch SPST

    • Description: Single-pole single-throw toggle switch.
    • Pins: L1, COM.
  7. L298N DC Motor Driver

    • Description: Dual H-Bridge motor driver.
    • 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.
  8. LED: Two Pin (Red)

    • Description: Red LED.
    • Pins: cathode, anode.
  9. LED: Two Pin (White)

    • Description: White LED.
    • Pins: cathode, anode.

Wiring Details

Arduino Uno R3

LCD 16x2 (Wokwi Compatible)

HC-05 Bluetooth Module

L298N DC Motor Driver

DC Motor

9V Battery

Toggle Switch SPST

LED: Two Pin (Red)

LED: Two Pin (White)

Code Documentation

/*
 * Arduino Based Bluetooth Car
 * This code controls a car using an Arduino Uno and an HC-05 Bluetooth module.
 * The car has four DC motors controlled by an L298N motor driver.
 * The car's movement is controlled via Bluetooth commands received from a
 * paired device. The car also has an LCD display to show status messages.
 */

#include <LiquidCrystal.h>

// Pin definitions
const int motor1Pin1 = 6;
const int motor1Pin2 = 5;
const int motor2Pin1 = 9;
const int motor2Pin2 = 3;
const int ledRedPin = 8;
const int ledWhitePin1 = 12;
const int ledWhitePin2 = 13;
const int rxPin = 11;
const int txPin = 10;

// LCD pin definitions
const int rs = A5;
const int en = A4;
const int d4 = A3;
const int d5 = A2;
const int d6 = A1;
const int d7 = A0;

LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
  // Initialize motor pins
  pinMode(motor1Pin1, OUTPUT);
  pinMode(motor1Pin2, OUTPUT);
  pinMode(motor2Pin1, OUTPUT);
  pinMode(motor2Pin2, OUTPUT);
  
  // Initialize LED pins
  pinMode(ledRedPin, OUTPUT);
  pinMode(ledWhitePin1, OUTPUT);
  pinMode(ledWhitePin2, OUTPUT);
  
  // Initialize serial communication
  Serial.begin(9600);
  
  // Initialize LCD
  lcd.begin(16, 2);
  lcd.print("Bluetooth Car");
}

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

void executeCommand(char command) {
  switch (command) {
    case 'F':
      moveForward();
      break;
    case 'B':
      moveBackward();
      break;
    case 'L':
      turnLeft();
      break;
    case