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

Arduino UNO Bluetooth-Controlled Robotic Car with Motor Driver and Battery Power

View and Edit Project In Cirkit DesignerImage of Arduino UNO Bluetooth-Controlled Robotic Car with Motor Driver and Battery Power

Circuit Documentation

Summary

This circuit is designed to control two DC motors using an Arduino UNO, a Motor Driver (L298N), and an HC-05 Bluetooth Module. The motors can be controlled via Bluetooth commands sent to the Arduino, which then drives the motors through the motor driver. A rocker switch is used to power the circuit using a LiPo battery.

Component List

  1. Arduino UNO

    • Description: A microcontroller board based on the ATmega328P.
    • 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
  2. Motor Driver (L298N)

    • Description: A dual H-Bridge motor driver that allows control of two DC motors.
    • Pins: OUT 1, OUT 2, OUT 3, OUT 4, +12V INPUT, GND, +5V OUTPUT, ENA, IN 1, IN 2, IN 3, IN 4, ENB
  3. HC-05 Bluetooth Module

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

    • Description: A simple DC motor.
    • Pins: pin 1, pin 2
  5. DC Motor (Motor 2)

    • Description: A simple DC motor.
    • Pins: pin 1, pin 2
  6. Rocker Switch

    • Description: A switch to control the power supply.
    • Pins: 1, 2
  7. LiPo Battery 2200mAH 30c

    • Description: A rechargeable lithium polymer battery.
    • Pins: VCC, GND

Wiring Details

Arduino UNO

Motor Driver (L298N)

HC-05 Bluetooth Module

DC Motor (Motor 1)

DC Motor (Motor 2)

Rocker Switch

LiPo Battery 2200mAH 30c

Code Documentation

// put your main code here, to run repeatedly:
char m=0;

void setup()
{
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(12, OUTPUT);
  Serial.begin(9600);
  Serial.println("Setup-Done");
}

void loop()
{
  if (Serial.available()>0)
  {
    m=Serial.read();
    Serial.println(m);
  }
  if (m=='R')
  {
    digitalWrite(9, HIGH);
    digitalWrite(10, LOW);
    digitalWrite(11, HIGH);
    digitalWrite(12, LOW);
    Serial.println("Move-Right");
  }
  else if (m=='L')
  {
    digitalWrite(9, LOW);
    digitalWrite(10, HIGH);
    digitalWrite(11, LOW);
    digitalWrite(12, HIGH);
    Serial.println("Move-Left");
  }
  else if (m=='F')
  {
    digitalWrite(9, HIGH);
    digitalWrite(10, LOW);
    digitalWrite(11, LOW);
    digitalWrite(12, HIGH);
    Serial.println("Move-Farword");
  }
  else if (m=='B')
  {
    digitalWrite(9, LOW);
    digitalWrite(10, HIGH);
    digitalWrite(11, HIGH);
    digitalWrite(12, LOW);
    Serial.println("Move-Back");
  }
  else if (m=='S')
  {
    digitalWrite(9,  LOW);
    digitalWrite(10, LOW);
    digitalWrite(11, LOW);
    digitalWrite(12, LOW);
    Serial.println("STOP");
  }
}

This code is designed to control the movement of the motors based on commands received via Bluetooth. The commands 'R', 'L', 'F', 'B', and 'S' correspond to moving right, left, forward, backward, and stopping, respectively. The Arduino reads the command from the Bluetooth module and sets the motor driver pins accordingly to control the motors.