Arduino and ESP32-Powered Ocean Cleaning Robot with BTS7960 Motor Drivers
View and Edit Project In Cirkit Designer
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
5V Relay
- Description: A relay that operates at 5V.
- Pins: Normally Open, Common terminal, Normally Closed, In, GND, VCC
Battery 12V
- Description: A 12V battery used to power the circuit.
- Pins: +, -
DC Motor
- Description: A DC motor used for movement.
- Pins: pin 1, pin 2
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
5V Battery
- Description: A 5V battery used to power the circuit.
- Pins: +, -
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
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
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
- VCC: Connected to 5V Battery (+)
- GND: Connected to 5V Battery (-)
- In: Not connected in this circuit
- Common terminal: Not connected in this circuit
- Normally Open: Not connected in this circuit
- Normally Closed: Not connected in this circuit
Battery 12V
- + (Positive): Connected to:
- BTS7960 Motor Driver (Pin 3, Pin 5, Pin 7)
- tb6600 Micro Stepping Motor Driver (VCC)
- - (Negative): Not connected in this circuit
DC Motor
- pin 1: Connected to BTS7960 Motor Driver (Pin 10)
- pin 2: Connected to BTS7960 Motor Driver (Pin 9)
Arduino UNO
- 5V: Connected to 5V Battery (+)
- GND: Connected to 5V Battery (-)
- D5: Connected to BTS7960 Motor Driver (Pin 8)
- D6: Connected to BTS7960 Motor Driver (Pin 4)
5V Battery
- + (Positive): Connected to:
- ESP32 (Vin)
- 5V Relay (VCC)
- Arduino UNO (5V)
- BTS7960 Motor Driver (Pin 7, Pin 3, Pin 5)
- - (Negative): Connected to:
- ESP32 (GND)
- 5V Relay (GND)
- Arduino UNO (GND)
- BTS7960 Motor Driver (Pin 1)
ESP32 (30 pin)
- Vin: Connected to 5V Battery (+)
- GND: Connected to 5V Battery (-)
BTS7960 Motor Driver
- Pin 1: Connected to 5V Battery (-)
- Pin 3: Connected to 5V Battery (+)
- Pin 4: Connected to Arduino UNO (D6)
- Pin 5: Connected to 5V Battery (+)
- Pin 7: Connected to 5V Battery (+)
- Pin 8: Connected to Arduino UNO (D5)
- Pin 9: Connected to DC Motor (pin 2)
- Pin 10: Connected to DC Motor (pin 1)
tb6600 Micro Stepping Motor Driver
- VCC: Connected to 12V Battery (+)
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.