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

Arduino and ESP32-Powered Ocean Cleaning Robot with BTS7960 Motor Drivers

View and Edit Project In Cirkit DesignerImage of Arduino and ESP32-Powered Ocean Cleaning Robot with BTS7960 Motor Drivers

Circuit Documentation

Summary

This circuit is designed for a boat robot that cleans oceans by collecting plastic waste. The system includes various components such as relays, batteries, motor drivers, and microcontrollers to control the movement of the boat and the operation of a conveyor belt.

Component List

  1. 5V Relay

    • Description: A relay that operates at 5V.
    • Pins: Normally Open, Common terminal, Normally Closed, In, GND, VCC
  2. Battery 12V

    • Description: A 12V battery used to power the circuit.
    • Pins: +, -
  3. DC Motor

    • Description: A DC motor used for movement.
    • Pins: pin 1, pin 2
  4. Arduino UNO

    • Description: A microcontroller used to control the boat and conveyor belt.
    • 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
  5. 5V Battery

    • Description: A 5V battery used to power the circuit.
    • Pins: +, -
  6. ESP32 (30 pin)

    • Description: A microcontroller with Wi-Fi and Bluetooth capabilities.
    • Pins: EN, VP, VN, D34, D35, D32, D33, D25, D26, D27, D14, D12, D13, GND, Vin, D23, D22, TX0, RX0, D21, D19, D18, D5, TX2, RX2, D4, D2, D15, 3V3
  7. BTS7960 Motor Driver

    • Description: A motor driver used to control the DC motor.
    • Pins: Pin 1, Pin 2, Pin 3, Pin 4, Pin 5, Pin 6, Pin 7, Pin 8, Pin 9, Pin 10, Pin 11, Pin 12
  8. tb6600 Micro Stepping Motor Driver

    • Description: A motor driver used for micro-stepping control of motors.
    • Pins: ENA-, ENA+, DIR-, DIR+, PUL-, PUL+, B-, B+, A-, A+, GND, VCC

Wiring Details

5V Relay

Battery 12V

DC Motor

Arduino UNO

5V Battery

ESP32 (30 pin)

BTS7960 Motor Driver

tb6600 Micro Stepping Motor Driver

Documented Code

/*
 * Arduino Sketch for Boat Robot Cleaning Oceans
 * This code controls the movement of the boat and the conveyor belt
 * to collect plastic waste from the ocean.
 */

// Pin definitions
const int motorControlPin1 = 5; // Connected to BTS7960 Pin 8
const int motorControlPin2 = 6; // Connected to BTS7960 Pin 4

void setup() {
  // Initialize motor control pins as outputs
  pinMode(motorControlPin1, OUTPUT);
  pinMode(motorControlPin2, OUTPUT);

  // Initial state of motors (stopped)
  digitalWrite(motorControlPin1, LOW);
  digitalWrite(motorControlPin2, LOW);
}

void loop() {
  // Example logic to move the boat and operate the conveyor belt
  // Move forward
  digitalWrite(motorControlPin1, HIGH);
  digitalWrite(motorControlPin2, LOW);
  delay(2000); // Move forward for 2 seconds

  // Stop
  digitalWrite(motorControlPin1, LOW);
  digitalWrite(motorControlPin2, LOW);
  delay(1000); // Stop for 1 second

  // Move backward
  digitalWrite(motorControlPin1, LOW);
  digitalWrite(motorControlPin2, HIGH);
  delay(2000); // Move backward for 2 seconds

  // Stop
  digitalWrite(motorControlPin1, LOW);
  digitalWrite(motorControlPin2, LOW);
  delay(1000); // Stop for 1 second

  // Repeat the cycle
}

This code initializes the motor control pins and sets the initial state of the motors to stopped. The loop function contains logic to move the boat forward and backward with pauses in between.