Arduino and ESP32 Controlled Motor and Stepper Motor System with Battery Power
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit involves multiple motor drivers, a stepper motor driver, a stepper motor, an Arduino UNO, an ESP32, resistors, a relay module, and a 12V battery. The circuit is designed to control motors and a stepper motor using the Arduino UNO and ESP32 microcontrollers. The relay module is used for switching purposes, and resistors are used for current limiting and signal conditioning.
Component List
BTS7960 Motor Driver
- Description: Motor driver 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 for controlling the circuit.
- 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: Driver for controlling a stepper motor.
- 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: Microcontroller with Wi-Fi and Bluetooth capabilities.
- 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: 200 Ohms resistor.
- Pins: pin1, pin2
Relay module 5v-30v
- Description: Relay module for switching.
- Pins: common contact, normally open, normally closed, trigger, V-, V+
Wiring Details
BTS7960 Motor Driver
- Pin 3 connected to Resistor pin1
- Pin 7 connected to Resistor pin1
- Pin 5 connected to Resistor pin1
- Pin 5 connected to ESP32 VIN
- Pin 3 connected to ESP32 VIN
- Pin 7 connected to Relay module V+
- Pin 1 connected to Relay module V-
- Pin 1 connected to Arduino UNO 3.3V
- Pin 4 connected to Arduino UNO D7
- Pin 8 connected to Arduino UNO D6
- Pin 11 connected to BTS7960 Motor Driver Pin 11
- Pin 10 connected to 12V 200Ah Battery GND
- Pin 4 connected to Arduino UNO D3
- Pin 8 connected to Arduino UNO D4
12V 200Ah Battery
- 12V connected to BTS7960 Motor Driver Pin 11
- GND connected to BTS7960 Motor Driver Pin 10
Arduino UNO
- D1 connected to Resistor pin1
- D0 connected to Resistor pin2
- 5V connected to ESP32 VIN
- 3.3V connected to Relay module V-
- D7 connected to BTS7960 Motor Driver Pin 4
- D6 connected to BTS7960 Motor Driver Pin 8
- D3 connected to BTS7960 Motor Driver Pin 4
- D4 connected to BTS7960 Motor Driver Pin 8
- D13 connected to TB660 Stepper Motor Driver PUL - (PUL)
- D12 connected to TB660 Stepper Motor Driver DIR - (DIR)
- D11 connected to Relay module trigger
TB660 Stepper Motor Driver
- PUL+ (+5V) connected to ESP32 VIN
- DIR+ (+5V) connected to ESP32 VIN
- VCC connected to ESP32 VIN
- GND connected to Relay module V-
- 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 Resistor pin1
- GND connected to Relay module V-
- EN connected to Resistor pin2
Resistor
- pin1 connected to Arduino UNO D1
- pin2 connected to Arduino UNO D0
- pin2 connected to ESP32 RX0
- pin1 connected to ESP32 TX0
- pin1 connected to BTS7960 Motor Driver Pin 3
- pin2 connected to ESP32 EN
Relay module 5v-30v
- V+ connected to ESP32 VIN
- V- connected to Relay module V-
- trigger connected to Arduino UNO D11
Documented Code
Arduino UNO Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
ESP32 Code
No code provided for the ESP32.
This documentation provides a comprehensive overview of the circuit, including a summary, component list, wiring details, and documented code.