Arduino and ESP32 Controlled Motor and Stepper Motor System with Battery Power
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes various components such as motor drivers, a battery, an Arduino UNO, a stepper motor driver, a stepper motor, an ESP32, resistors, and a relay module. The circuit is designed to control motors and other peripherals using microcontrollers.
Component List
BTS7960 Motor Driver
- Description: Motor driver module for high-power motors.
- 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
12V 200Ah Battery
- Description: Power source for the circuit.
- Pins: GND, 12V
Arduino UNO
- Description: 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
TB660 Stepper Motor Driver
- Description: Stepper motor driver module.
- Pins: ENA - (ENA), ENA+ (+5V), DIR - (DIR), DIR+ (+5V), PUL - (PUL), VCC, GND, A+, A-, B+, B-, PUL+ (+5V)
Stepper Motor (Bipolar)
- Description: Bipolar stepper motor.
- Pins: D, B, C, A
ESP32
- Description: Wi-Fi and Bluetooth microcontroller.
- Pins: EN, VP, VN, D34, D35, D32, D33, D25, D26, D27, D14, D12, D13, GND, VIN, 3V3, D15, D2, D4, RX2, TX2, D5, D18, D19, D21, RX0, TX0, D22, D23, BOOT
Resistor
- Description: Resistor with a resistance of 200 Ohms.
- Pins: pin1, pin2
Relay module 5v-30v
- Description: Relay module for switching high-power devices.
- Pins: common contact, normally open, normally closed, trigger, V-, V+
Wiring Details
BTS7960 Motor Driver
- Pin 1: Connected to Relay module (V-), TB660 Stepper Motor Driver (GND), Arduino UNO (3.3V), ESP32 (GND)
- Pin 3: Connected to Resistor (pin1), BTS7960 Motor Driver (Pin 5), ESP32 (VIN), Relay module (V+), TB660 Stepper Motor Driver (PUL+ (+5V)), TB660 Stepper Motor Driver (DIR+ (+5V)), TB660 Stepper Motor Driver (VCC), Arduino UNO (5V), BTS7960 Motor Driver (Pin 7)
- Pin 4: Connected to Arduino UNO (D3)
- Pin 5: Connected to BTS7960 Motor Driver (Pin 3)
- Pin 7: Connected to BTS7960 Motor Driver (Pin 3)
- Pin 8: Connected to Arduino UNO (D4)
- Pin 10: Connected to BTS7960 Motor Driver (Pin 10), 12V 200Ah Battery (GND)
- Pin 11: Connected to BTS7960 Motor Driver (Pin 11), 12V 200Ah Battery (12V)
12V 200Ah Battery
- GND: Connected to BTS7960 Motor Driver (Pin 10)
- 12V: Connected to BTS7960 Motor Driver (Pin 11)
Arduino UNO
- D0: Connected to Resistor (pin2)
- D1: Connected to Resistor (pin1)
- D3: Connected to BTS7960 Motor Driver (Pin 4)
- D4: Connected to BTS7960 Motor Driver (Pin 8)
- D6: Connected to BTS7960 Motor Driver (Pin 8)
- D7: Connected to BTS7960 Motor Driver (Pin 4)
- D11: Connected to Relay module (trigger)
- D12: Connected to TB660 Stepper Motor Driver (DIR - (DIR))
- D13: Connected to TB660 Stepper Motor Driver (PUL - (PUL))
- 3.3V: Connected to BTS7960 Motor Driver (Pin 1)
- 5V: Connected to BTS7960 Motor Driver (Pin 3)
TB660 Stepper Motor Driver
- PUL+ (+5V): Connected to BTS7960 Motor Driver (Pin 3)
- DIR+ (+5V): Connected to BTS7960 Motor Driver (Pin 3)
- VCC: Connected to BTS7960 Motor Driver (Pin 3)
- GND: Connected to BTS7960 Motor Driver (Pin 1)
- PUL - (PUL): Connected to Arduino UNO (D13)
- DIR - (DIR): Connected to Arduino UNO (D12)
- A+: Connected to Stepper Motor (A)
- A-: Connected to Stepper Motor (C)
- B+: Connected to Stepper Motor (B)
- B-: Connected to Stepper Motor (D)
Stepper Motor (Bipolar)
- A: Connected to TB660 Stepper Motor Driver (A+)
- C: Connected to TB660 Stepper Motor Driver (A-)
- B: Connected to TB660 Stepper Motor Driver (B+)
- D: Connected to TB660 Stepper Motor Driver (B-)
ESP32
- RX0: Connected to Resistor (pin2)
- TX0: Connected to Resistor (pin1)
- VIN: Connected to BTS7960 Motor Driver (Pin 3)
- EN: Connected to Resistor (pin2)
- GND: Connected to BTS7960 Motor Driver (Pin 1)
Resistor
- pin1: Connected to Arduino UNO (D1), ESP32 (TX0), BTS7960 Motor Driver (Pin 3)
- pin2: Connected to Arduino UNO (D0), ESP32 (RX0), ESP32 (EN)
Relay module 5v-30v
- V+: Connected to BTS7960 Motor Driver (Pin 3)
- V-: Connected to BTS7960 Motor Driver (Pin 1)
- trigger: Connected to Arduino UNO (D11)
Documented Code
Arduino UNO Code (sketch.ino)
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Documentation (documentation.txt)
This document provides a comprehensive overview of the circuit, including the components used, their connections, and the code for the microcontroller.