Arduino UNO-Based Battery-Powered Robotic Car with Ultrasonic Sensor and Motor Control
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes an Arduino UNO, an HC-SR04 Ultrasonic Sensor, a DRIVER SHIELD L293D, multiple motors and wheels, a micro servo, a DC motor, a fan, a rocker switch, a toggle switch, and a battery mount. The circuit is designed to control various motors and sensors using the Arduino UNO as the central microcontroller.
Component List
4 x AAA Battery Mount
- Pins: -, +
- Description: Holds four AAA batteries to provide power to the circuit.
- Purpose: Power supply for the circuit.
Arduino UNO
- 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
- Description: A microcontroller board based on the ATmega328P.
- Purpose: Central control unit for the circuit.
HC-SR04 Ultrasonic Sensor
- Pins: VCC, TRIG, ECHO, GND
- Description: Ultrasonic distance sensor.
- Purpose: Measures distance by using ultrasonic waves.
DRIVER SHIELD L293D
- 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)
- Description: Motor driver shield for Arduino.
- Purpose: Controls the motors and provides power to other components.
Micro servo 9G
- Pins: GND, +5V, PWM
- Description: Small servo motor.
- Purpose: Provides precise control of angular position.
Motor and Wheels
- Pins: vcc, GND
- Description: DC motor with attached wheels.
- Purpose: Provides movement for the circuit.
1.5v Battery
- Pins: +, minus
- Description: Single 1.5V battery.
- Purpose: Provides power to specific components.
DC Motor
- Pins: pin 1, pin 2
- Description: Standard DC motor.
- Purpose: Provides rotational movement.
Fan
- Pins: GND, 5V
- Description: Small fan.
- Purpose: Provides airflow.
Rocker Switch
- Pins: 1, 2
- Description: On/Off switch.
- Purpose: Controls power to the circuit.
Toggle Switch SPST
- Pins: L1, COM
- Description: Single-pole single-throw switch.
- Purpose: Controls power to specific components.
Wiring Details
4 x AAA Battery Mount
- + connected to DRIVER SHIELD L293D VCC (External Power Supply)
- - connected to 1.5v battery +
Arduino UNO
- 5V connected to Micro servo 9G +5V
HC-SR04 Ultrasonic Sensor
- VCC connected to DRIVER SHIELD L293D 5V
- TRIG connected to DRIVER SHIELD L293D A0
- ECHO connected to DRIVER SHIELD L293D A1
- GND connected to DRIVER SHIELD L293D GND
DRIVER SHIELD L293D
- 5V connected to HC-SR04 Ultrasonic Sensor VCC
- A0 connected to HC-SR04 Ultrasonic Sensor TRIG
- A1 connected to HC-SR04 Ultrasonic Sensor ECHO
- GND connected to HC-SR04 Ultrasonic Sensor GND
- GND connected to Micro servo 9G GND
- M2 (+) connected to motor and wheels vcc
- M2 GND (-) connected to motor and wheels GND
- M1 (+) connected to motor and wheels GND
- M1 GND (-) connected to motor and wheels vcc
- M3 (+) connected to motor and wheels GND
- M3 GND (-) connected to motor and wheels vcc
- M4 GND (-) connected to motor and wheels GND
- M4 (+) connected to motor and wheels vcc
- SERVO_1 connected to Micro servo 9G PWM
- VCC (External Power Supply) connected to 4 x AAA Battery Mount +
- GND (External Power Supply) connected to Rocker Switch 2
Micro servo 9G
- +5V connected to Arduino UNO 5V
- GND connected to DRIVER SHIELD L293D GND
- PWM connected to DRIVER SHIELD L293D SERVO_1
Motor and Wheels
- vcc connected to DRIVER SHIELD L293D M2 (+)
- GND connected to DRIVER SHIELD L293D M2 GND (-)
- GND connected to DRIVER SHIELD L293D M1 (+)
- vcc connected to DRIVER SHIELD L293D M1 GND (-)
- GND connected to DRIVER SHIELD L293D M3 (+)
- vcc connected to DRIVER SHIELD L293D M3 GND (-)
- GND connected to DRIVER SHIELD L293D M4 GND (-)
- vcc connected to DRIVER SHIELD L293D M4 (+)
1.5v Battery
- + connected to 4 x AAA Battery Mount -
- minus connected to Rocker Switch 1
- + connected to DC Motor pin 2
- + connected to 1.5v battery minus
- minus connected to 1.5v battery +
- + connected to 1.5v battery minus
- minus connected to Toggle Switch SPST L1
DC Motor
- pin 2 connected to 1.5v battery +
- pin 1 connected to Toggle Switch SPST COM
Fan
- GND not connected
- 5V not connected
Rocker Switch
- 2 connected to DRIVER SHIELD L293D GND (External Power Supply)
- 1 connected to 1.5v battery minus
Toggle Switch SPST
- L1 connected to 1.5v battery minus
- COM connected to DC Motor pin 1
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, and the loop() function contains the main code that runs repeatedly. Currently, the code does not perform any specific actions and serves as a starting point for further development.