Arduino UNO and L293D-Based Battery-Powered Robotic Vehicle with Ultrasonic Sensor
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes an Arduino UNO microcontroller, an L293D motor driver, two hobby gearmotors, a micro servo, an ultrasonic sensor, and a 2x 18650 battery pack. The circuit is designed to control the motors and servo, and to read data from the ultrasonic sensor.
Component List
L293D Motor Driver
- Description: Motor driver IC used to control the direction and speed of motors.
- Pins: 5V, GND, +, Servo1, Servo2, RX/DO, TX/D1, 9V, A0, A1, A2, A3, A4/SDA, A5/SCL, VIN, 3.3V, RESET, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13
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
Hobby Gearmotor with 48:1 gearbox (Motor 1)
- Description: DC motor with a 48:1 gearbox for increased torque.
- Pins: pin 1, pin 2
Hobby Gearmotor with 48:1 gearbox (Motor 2)
- Description: DC motor with a 48:1 gearbox for increased torque.
- Pins: pin 1, pin 2
Micro Servo 9G
- Description: Small servo motor used for precise control of angular position.
- Pins: GND, +5V, PWM
Ultrasonic Sensor
- Description: Sensor used to measure distance by using ultrasonic waves.
- Pins: +VCC, Trigger, Echo, GND
2x 18650 Battery Pack
- Description: Battery pack consisting of two 18650 lithium-ion batteries.
- Pins: vcc, gnd
Wiring Details
L293D Motor Driver
- 5V: Connected to 5V of the Arduino UNO and +VCC of the Ultrasonic Sensor.
- GND: Connected to GND of the Arduino UNO, GND of the Ultrasonic Sensor, GND of the 2x 18650 Battery Pack, pin 1 of Motor 1, pin 1 of Motor 2, and GND of the Micro Servo 9G.
- +: Connected to vcc of the 2x 18650 Battery Pack, pin 2 of Motor 1, and pin 2 of Motor 2.
- Servo1: Connected to PWM of the Micro Servo 9G.
- RX/DO: Connected to D0 of the Arduino UNO.
- TX/D1: Connected to D1 of the Arduino UNO.
- A0: Connected to A0 of the Arduino UNO.
- A1: Connected to A1 of the Arduino UNO.
- A2: Connected to A2 of the Arduino UNO and Trigger of the Ultrasonic Sensor.
- A3: Connected to A3 of the Arduino UNO and Echo of the Ultrasonic Sensor.
- A4/SDA: Connected to A4 of the Arduino UNO.
- A5/SCL: Connected to A5 of the Arduino UNO.
- VIN: Connected to Vin of the Arduino UNO.
- 3.3V: Connected to 3.3V of the Arduino UNO.
- RESET: Connected to Reset of the Arduino UNO.
- D2: Connected to D2 of the Arduino UNO.
- D3: Connected to D3 of the Arduino UNO.
- D4: Connected to D4 of the Arduino UNO.
- D5: Connected to D5 of the Arduino UNO.
- D6: Connected to D6 of the Arduino UNO.
- D7: Connected to D7 of the Arduino UNO.
- D8: Connected to D8 of the Arduino UNO.
- D9: Connected to D9 of the Arduino UNO.
- D10: Connected to D10 of the Arduino UNO.
- D11: Connected to D11 of the Arduino UNO.
- D12: Connected to D12 of the Arduino UNO.
- D13: Connected to D13 of the Arduino UNO.
Arduino UNO
- 5V: Connected to 5V of the L293D Motor Driver.
- GND: Connected to GND of the L293D Motor Driver.
- Vin: Connected to VIN of the L293D Motor Driver.
- A0: Connected to A0 of the L293D Motor Driver.
- A1: Connected to A1 of the L293D Motor Driver.
- A2: Connected to A2 of the L293D Motor Driver.
- A3: Connected to A3 of the L293D Motor Driver.
- A4: Connected to A4/SDA of the L293D Motor Driver.
- A5: Connected to A5/SCL of the L293D Motor Driver.
- D0: Connected to RX/DO of the L293D Motor Driver.
- D1: Connected to TX/D1 of the L293D Motor Driver.
- D2: Connected to D2 of the L293D Motor Driver.
- D3: Connected to D3 of the L293D Motor Driver.
- D4: Connected to D4 of the L293D Motor Driver.
- D5: Connected to D5 of the L293D Motor Driver.
- D6: Connected to D6 of the L293D Motor Driver.
- D7: Connected to D7 of the L293D Motor Driver.
- D8: Connected to D8 of the L293D Motor Driver.
- D9: Connected to D9 of the L293D Motor Driver.
- D10: Connected to D10 of the L293D Motor Driver.
- D11: Connected to D11 of the L293D Motor Driver.
- D12: Connected to D12 of the L293D Motor Driver.
- D13: Connected to D13 of the L293D Motor Driver.
- 3.3V: Connected to 3.3V of the L293D Motor Driver.
- Reset: Connected to RESET of the L293D Motor Driver.
Hobby Gearmotor with 48:1 gearbox (Motor 1)
- pin 1: Connected to GND of the L293D Motor Driver.
- pin 2: Connected to + of the L293D Motor Driver.
Hobby Gearmotor with 48:1 gearbox (Motor 2)
- pin 1: Connected to GND of the L293D Motor Driver.
- pin 2: Connected to + of the L293D Motor Driver.
Micro Servo 9G
- GND: Connected to GND of the L293D Motor Driver.
- +5V: Connected to 5V of the L293D Motor Driver.
- PWM: Connected to Servo1 of the L293D Motor Driver.
Ultrasonic Sensor
- +VCC: Connected to 5V of the L293D Motor Driver.
- Trigger: Connected to A2 of the L293D Motor Driver.
- Echo: Connected to A3 of the L293D Motor Driver.
- GND: Connected to GND of the L293D Motor Driver.
2x 18650 Battery Pack
- vcc: Connected to + of the L293D Motor Driver.
- gnd: Connected to GND of the L293D Motor Driver.
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:
}
This code is a basic template for the Arduino UNO. The setup() function is used to initialize any settings or configurations, and the loop() function contains the main code that runs repeatedly. You can add your specific logic to control the motors, servo, and read data from the ultrasonic sensor within these functions.