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

Arduino Uno R3 Controlled Bluetooth Robot with L298N Motor Driver and LED Indicator

View and Edit Project In Cirkit DesignerImage of Arduino Uno R3 Controlled Bluetooth Robot with L298N Motor Driver and LED Indicator

Circuit Documentation

Summary

This circuit is designed to control a set of DC motors using an Arduino Uno R3 microcontroller and an L298N DC motor driver. The circuit also includes an HC-05 Bluetooth module for wireless communication and a red LED as an indicator. Power is supplied by a 4 x AAA battery mount. The Arduino Uno R3 is programmed to interpret serial commands to control the motion of the motors (forward, reverse, left, right, stop) and to toggle the LED on or off.

Component List

Arduino Uno R3

L298N DC Motor Driver

DC Motor (4 units)

HC-05 Bluetooth Module

LED: Two Pin (red)

4 x AAA Battery Mount

Wiring Details

Arduino Uno R3

L298N DC Motor Driver

DC Motors

HC-05 Bluetooth Module

LED: Two Pin (red)

4 x AAA Battery Mount

Documented Code

char t;

void setup() {
  pinMode(13, OUTPUT);   // Left motors forward
  pinMode(12, OUTPUT);   // Left motors reverse
  pinMode(11, OUTPUT);   // Right motors forward
  pinMode(10, OUTPUT);   // Right motors reverse
  pinMode(9, OUTPUT);    // LED
  Serial.begin(9600);
}

void loop() {
  if (Serial.available()) {
    t = Serial.read();
    Serial.println(t);
  }

  if (t == 'F') {            // Move forward (all motors rotate in forward direction)
    digitalWrite(13, HIGH);
    digitalWrite(11, HIGH);
  } else if (t == 'B') {     // Move reverse (all motors rotate in reverse direction)
    digitalWrite(12, HIGH);
    digitalWrite(10, HIGH);
  } else if (t == 'L') {     // Turn right (left side motors rotate in forward direction, right side motors don't rotate)
    digitalWrite(11, HIGH);
  } else if (t == 'R') {     // Turn left (right side motors rotate in forward direction, left side motors don't rotate)
    digitalWrite(13, HIGH);
  } else if (t == 'W') {     // Turn LED on
    digitalWrite(9, HIGH);
  } else if (t == 'w') {     // Turn LED off
    digitalWrite(9, LOW);
  } else if (t == 'S') {     // STOP (all motors stop)
    digitalWrite(13, LOW);
    digitalWrite(12, LOW);
    digitalWrite(11, LOW);
    digitalWrite(10, LOW);
  }
  delay(100);
}

This code is designed to run on the Arduino Uno R3. It sets up the digital pins connected to the motor driver and LED as outputs and initializes serial communication. The loop function reads a character from the serial port and controls the motors and LED based on the received command.