Arduino-Controlled Robotic Vehicle with Dual Servos and Joystick Input
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is designed to control two DC motors and two servos using an Arduino UNO as the central microcontroller. A 12v battery provides power to the system, with a L298N DC motor driver interfacing between the Arduino and the motors. A KY-023 Dual Axis Joystick Module is used for user input to control the motors and servos. The servos are powered by the 5V output from the Arduino, and the motors are powered by the 12V from the battery through the motor driver.
Component List
Arduino UNO
- Microcontroller board based on the ATmega328P
- Provides I/O pins and power outputs for the circuit
12v Battery
- Power source for the motors and the Arduino UNO (through Vin)
L298N DC Motor Driver
- Interfaces between the Arduino and the motors
- Controls the direction and speed of the motors
DC Motor (x2)
- Converts electrical energy into mechanical motion
KY-023 Dual Axis Joystick Module
- Provides analog input to control the motors and servos
Tower Pro SG90 Servo (x2)
- Small and lightweight servo motor
- Used for precise control of mechanical movement
Wiring Details
Arduino UNO
5Vconnected to servos, motor driver, and joystick module for powerGNDconnected to the negative terminal of the battery, servos, motor driver, and joystick module for common groundVinconnected to the positive terminal of the 12v battery for power inputA4connected to theVRxpin of the joystick moduleA5connected to theVRypin of the joystick moduleD11connected toENAandENBpins of the motor driver for enabling motor controlD9connected toIN1andIN3pins of the motor driver for motor direction controlD8connected toIN2andIN4pins of the motor driver for motor direction controlD7connected to theSignalpin of one servoD6connected to theSignalpin of the other servoD2connected to theSWpin of the joystick module
12v Battery
+connected to the12Vpin of the motor driver andVinof the Arduino-connected to theGNDpin of the motor driver and common ground
L298N DC Motor Driver
5Vconnected to the5Voutput of the Arduino for logic powerGNDconnected to common ground12Vconnected to the positive terminal of the battery for motor powerENAandENBconnected toD11on the Arduino for motor enableIN1andIN3connected toD9on the Arduino for motor directionIN2andIN4connected toD8on the Arduino for motor directionOUT1andOUT2connected to one DC motorOUT3andOUT4connected to the other DC motor
DC Motors
- One motor connected to
OUT1andOUT2of the motor driver - The other motor connected to
OUT3andOUT4of the motor driver
KY-023 Dual Axis Joystick Module
GNDconnected to common ground+5Vconnected to the5Voutput of the ArduinoVRxconnected toA4on the ArduinoVRyconnected toA5on the ArduinoSWconnected toD2on the Arduino
Tower Pro SG90 Servos
Signalof one servo connected toD7on the ArduinoSignalof the other servo connected toD6on the Arduino+5VandGNDconnected to the5Voutput and common ground of the Arduino, respectively
Documented Code
Arduino UNO - sketch.ino
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Arduino UNO - documentation.txt
(No additional documentation provided for the code)
This concludes the documentation for the given circuit. The code provided is a template and needs to be filled in with the logic for reading the joystick inputs, controlling the motor driver, and operating the servos based on the joystick's position.