Circuit Documentation
Summary
The circuit in question is designed to control multiple DC motors using BTS7960 motor drivers, which are interfaced with an Arduino UNO microcontroller. The circuit also includes ultrasonic sensors for distance measurement and a Lipo battery for power supply. A rocker switch is used to control the power flow from the Lipo battery to the motor drivers. The Arduino UNO is responsible for controlling the motor drivers and reading data from the ultrasonic sensors.
Component List
DC Motor
- Description: A standard DC motor used for converting electrical energy into mechanical rotation.
- Pins: pin 1 (Motor positive), pin 2 (Motor negative)
BTS7960 Motor Driver
- Description: A high-power motor driver capable of driving high current loads.
- Pins: Pin 1 (GND), Pin 2, Pin 3, Pin 4, Pin 5, Pin 6, Pin 7, Pin 8, Pin 9, Pin 10, Pin 11 (Enable), Pin 12 (VCC)
Lipo Battery
- Description: A rechargeable battery that provides power to the circuit.
- Pins: VCC (Positive), GND (Negative)
Arduino UNO
- Description: A microcontroller board based on the ATmega328P, used for controlling the logic of the circuit.
- Pins: IOREF, Reset, 3.3V, 5V, GND, Vin, Analog Pins (A0-A5), SCL, SDA, AREF, Digital Pins (D0-D13)
5v Battery
- Description: A battery that provides a 5V power supply.
- Pins: + (Positive), - (Negative)
Rocker Switch
- Description: A switch used to control the power supply from the battery.
- Pins: 1, 2
Ultrasonic Sensor
- Description: A sensor used for measuring distances by emitting ultrasonic waves.
- Pins: +VCC (Power), Trigger, Echo, GND (Ground)
Wiring Details
DC Motor
- Motor positive (pin 1) connected to BTS7960 Motor Driver (Pin 10)
- Motor negative (pin 2) connected to BTS7960 Motor Driver (Pin 9)
BTS7960 Motor Driver
- GND (Pin 1) connected to Arduino UNO (GND)
- VCC (Pin 12) connected to Lipo Battery (GND) through Rocker Switch
- Enable (Pin 11) and Pin 5 connected to Rocker Switch (Pin 2)
- Control pins (Pin 3, Pin 4, Pin 7, Pin 8) connected to Arduino UNO (D8, D11, D9, D10 for one driver and D4, D6, D5, D7 for the other driver)
Lipo Battery
- VCC connected to Rocker Switch (Pin 1)
- GND connected to BTS7960 Motor Driver (Pin 12)
Arduino UNO
- 5V connected to Ultrasonic Sensors (+VCC)
- GND connected to BTS7960 Motor Driver (Pin 1) and Ultrasonic Sensors (GND)
- Digital Pins (D2-D13) connected to Ultrasonic Sensors (Trigger, Echo) and BTS7960 Motor Driver control pins
Rocker Switch
- Pin 1 connected to Lipo Battery (VCC)
- Pin 2 connected to BTS7960 Motor Driver (Pin 11, Pin 5)
Ultrasonic Sensor
- +VCC connected to Arduino UNO (5V)
- Trigger connected to Arduino UNO (D2, D13 for the two sensors)
- Echo connected to Arduino UNO (D3, D12 for the two sensors)
- GND connected to Arduino UNO (GND)
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:
}
Note: The provided code is a template and does not contain any functional logic. It needs to be populated with the actual control code for the motors and sensors.
