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

Bluetooth-Controlled Robotic Vehicle with Servo Actuation and Water Pump

View and Edit Project In Cirkit DesignerImage of Bluetooth-Controlled Robotic Vehicle with Servo Actuation and Water Pump

Circuit Documentation

Summary

The circuit in question is designed to control multiple DC motors, servos, and a water pump, with communication capabilities via a Bluetooth module. It includes motor drivers for controlling the speed and direction of the motors, a microcontroller for logic operations and interfacing with the Bluetooth module, and power regulation components to ensure stable operation. The circuit is powered by a 12V battery and includes a step-down converter to provide appropriate voltage levels to the servos and logic components.

Component List

L298N DC Motor Driver

DC Motor

12V Battery (mini)

Servo

HC-05 Bluetooth Module

Water Pump

KF-301 Relay

XL4015 5A DC Buck Step-down

Arduino UNO

Wiring Details

L298N DC Motor Driver

DC Motors

12V Battery (mini)

Servos

HC-05 Bluetooth Module

Water Pump

KF-301 Relay

XL4015 5A DC Buck Step-down

Arduino UNO

Documented Code

Arduino UNO (Instance ID: 94b79694-ef5b-40cb-a43b-24013add43bd)

#include <Servo.h>;

Servo servo1;
Servo servo2;
char d;
int c;
int S2;
bool a = false;

void setup() {
  // Initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
  
  // Attach the servos to digital pins D5 and D6:
  servo1.attach(5);
  servo2.attach(6);
  
  // Set servos to mid-position:
  servo1.write(90);
  servo2.write(90);
}

void loop() {
  // Check if data is available to read:
  if (Serial.available()) {
    d = Serial.read();
  }
  Serial.println(d);
  
  // If 'U' is received, enter a loop to move servos:
  if (d == 'U') {
    while (1) {
      int z = 20;
      int y = 160;
      
      // Move servos in one direction:
      for (int S1 = z; S1 < y; S1 += 2) {
        if (Serial.available()) {
          d = Serial.read();
        }
        if (d == 'u') {
          goto b;
        }
        S2 = map(S1, z, y, y, z);
        servo1.write(S1);
        servo2.write(S2);
        delay(7);
      }
      
      // Move servos in the opposite direction:
      for (int S1 = y; S1 > z; S1 -= 2) {
        if (Serial.available()) {
          d = Serial.read();
        }
        if (d == 'u') {
          goto b;
        }
        S2 = map(S1, y, z, 180 - y, 180 - z);
        servo1.write(S1);
        servo2.write(S2);
        delay(7);
      }
      
      // If 'a' is true, reset servos to predefined positions:
      if (a == true) {
b:
        c++;
        delay(100);
        if (c == 1) {
          servo1.write(90);
          servo2.write(90);
        }
        if (c == 2) {
          servo1.write(160);
          servo2.write(20);
        }
        if (c == 3) {
          servo1.write(20);
          servo2.write(160);
          c = 0;
        }
        d = '0';
        break;
      }
    }
  }
}

Arduino UNO (Instance ID: 73d09187-cbb5-46d2-a8e0-80d1ad184464)

void setup() {
  // Setup code here
}

void loop() {
  // Main code here
}

This concludes the documentation for the given circuit. The code provided controls the servos based on serial input and interfaces with the Bluetooth module for potential wireless control. The circuit is designed to manage power distribution and control the motors, servos, and water pump effectively.