Arduino Mega 2560-Based Robotic System with Ultrasonic Sensors and Motor Drivers
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, ultrasonic sensors, DC motors, micro servos, and an Arduino Mega 2560 microcontroller. The circuit is designed to control motors and sensors, with the Arduino Mega 2560 serving as the central control unit. The document includes a component list, wiring details, and the embedded code used in the microcontroller.
Component List
Micro Servo 9G
- Description: A small servo motor used for precise control of angular position.
- Pins: GND, +5V, PWM
BTS7960 Motor Driver
- Description: A high-power motor driver module used to control DC 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
Ultrasonic Sensor
- Description: A sensor used to measure distance by using ultrasonic waves.
- Pins: +VCC, Trigger, Echo, GND
250W 12V Electric Motor Brush Motor DC
- Description: A high-power DC motor used for various applications.
- Pins: POSITIF, NEGATIF
DC Motor
- Description: A standard DC motor used for various applications.
- Pins: pin 1, pin 2
Driver Shield L293D
- Description: A motor driver shield used to control multiple DC motors and servos.
- Pins: RESET, 3.3V, 5V, GND, VIN, 9V, A0, A1, A2, A3, A4, A5, M2 (+), M2 GND (-), M1 (+), M1 GND (-), M3 (+), M3 GND (-), M4 GND (-), M4 (+), SERVO_2, SERVO_1, RX/D0, TX/D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, ARef, D13, D12, VCC (External Power Supply), GND (External Power Supply)
12V 7Ah Battery
- Description: A rechargeable battery used to power the circuit.
- Pins: 12v +, 12v -
Battery 12V
- Description: A standard 12V battery used to power the circuit.
- Pins: +, -
Arduino Mega 2560
- Description: A microcontroller board based on the ATmega2560, used for controlling the circuit.
- Pins: IOREF, RESET, 3V3, 5V, GND, VIN, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, D21/SCL, D20/SDA, D19/RX1, D18/TX1, D17 PWM/RX2, D16 PWM/TX2, D15/RX3, D14/TX3, D0 RX0, D1 TX0, D2 PWM, D3 PWM, D4 PWM, D5 PWM, D6 PWM, D7 PWM, D8 PWM, D9 PWM, D10 PWM, D11 PWM, D12 PWM, D13 PWM, AREF, SDA, SCL, D52, D50, D48, D46, D44, D42, D40, D38, D36, D34, D32, D30, D28, D26, D24, D22, D53, D51, D49, D47, D45, D43, D41, D39, D37, D35, D33, D31, D29, D27, D25, D23, 6swdw
Wiring Details
Micro Servo 9G
- GND connected to Driver Shield L293D GND
- +5V connected to Driver Shield L293D 5V
- PWM connected to Driver Shield L293D SERVO_2
Micro Servo 9G
- GND connected to Driver Shield L293D GND
- +5V connected to Driver Shield L293D 5V
- PWM connected to Driver Shield L293D SERVO_1
BTS7960 Motor Driver
- Pin 3 connected to Pin 7 and Arduino Mega 2560 D44
- Pin 5 connected to Arduino Mega 2560 5V
- Pin 1 connected to Arduino Mega 2560 GND
- Pin 4 connected to Arduino Mega 2560 D42
- Pin 8 connected to Arduino Mega 2560 D40
- Pin 9 connected to 12V 7Ah Battery 12v -
- Pin 10 connected to 12V 7Ah Battery 12v +
- Pin 11 connected to 250W 12V Electric Motor Brush Motor DC POSITIF
- Pin 12 connected to 250W 12V Electric Motor Brush Motor DC NEGATIF
BTS7960 Motor Driver
- Pin 3 connected to Pin 7 and Arduino Mega 2560 D45
- Pin 5 connected to Arduino Mega 2560 5V
- Pin 1 connected to Arduino Mega 2560 GND
- Pin 4 connected to Arduino Mega 2560 D43
- Pin 8 connected to Arduino Mega 2560 D41
- Pin 9 connected to 12V 7Ah Battery 12v -
- Pin 10 connected to 12V 7Ah Battery 12v +
- Pin 11 connected to 250W 12V Electric Motor Brush Motor DC POSITIF
- Pin 12 connected to 250W 12V Electric Motor Brush Motor DC NEGATIF
Ultrasonic Sensor
- Echo connected to Arduino Mega 2560 A8
- Trigger connected to Arduino Mega 2560 A9
- GND connected to Driver Shield L293D GND
- +VCC connected to Driver Shield L293D 5V
Ultrasonic Sensor
- Echo connected to Arduino Mega 2560 A11
- Trigger connected to Arduino Mega 2560 A10
- GND connected to Driver Shield L293D GND
- +VCC connected to Driver Shield L293D 5V
250W 12V Electric Motor Brush Motor DC
- POSITIF connected to BTS7960 Motor Driver Pin 11
- NEGATIF connected to BTS7960 Motor Driver Pin 12
250W 12V Electric Motor Brush Motor DC
- POSITIF connected to BTS7960 Motor Driver Pin 11
- NEGATIF connected to BTS7960 Motor Driver Pin 12
DC Motor
- pin 1 connected to Driver Shield L293D M2 (+)
- pin 2 connected to Driver Shield L293D M2 GND (-)
DC Motor
- pin 1 connected to Driver Shield L293D M1 GND (-)
- pin 2 connected to Driver Shield L293D M1 (+)
Driver Shield L293D
- RESET connected to Arduino Mega 2560 RESET
- 3.3V connected to Arduino Mega 2560 3V3
- 5V connected to Arduino Mega 2560 5V
- GND connected to Arduino Mega 2560 GND
- VIN connected to Arduino Mega 2560 VIN
- A0 connected to Arduino Mega 2560 A0
- A1 connected to Arduino Mega 2560 A1
- A2 connected to Arduino Mega 2560 A2
- A3 connected to Arduino Mega 2560 A3
- A4 connected to Arduino Mega 2560 A4
- A5 connected to Arduino Mega 2560 A5
- RX/D0 connected to Arduino Mega 2560 D0 RX0
- TX/D1 connected to Arduino Mega 2560 D1 TX0
- D2 connected to Arduino Mega 2560 D2 PWM
- D3 connected to Arduino Mega 2560 D3 PWM
- D4 connected to Arduino Mega 2560 D4 PWM
- D5 connected to Arduino Mega 2560 D5 PWM
- D6 connected to Arduino Mega 2560 D6 PWM
- D7 connected to **Arduino Mega