Arduino Mega 2560 Battery-Powered Dual Servo Joystick Controller
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit involves an Arduino Mega 2560 microcontroller, two servos, a 9V battery, two 4 x AAA battery mounts, a power jack, and a KY-023 Dual Axis Joystick Module. The circuit is designed to control the servos using the joystick, with power supplied by the batteries.
Component List
Arduino Mega 2560
- Description: A microcontroller board based on the ATmega2560.
- Pins: IOREF, RESET, 3V3, 5V, GND, VIN, A0-A15, D0-D53, AREF, SDA, SCL
Servo (2 units)
- Description: A standard servo motor.
- Pins: gnd, vcc, pulse
9V Battery
- Description: A standard 9V battery.
- Pins: -, +
4 x AAA Battery Mount (2 units)
- Description: A battery holder for four AAA batteries.
- Pins: -, +
Power Jack
- Description: A standard power jack.
- Pins: POSITIF, NEGATIF
KY-023 Dual Axis Joystick Module
- Description: A joystick module with dual-axis control.
- Pins: GND, +5V, VRx, VRy, SW
Wiring Details
Arduino Mega 2560
GND is connected to:
- GND of Servo 1
- GND of Servo 2
- GND of KY-023 Dual Axis Joystick Module
5V is connected to:
- +5V of KY-023 Dual Axis Joystick Module
A0 is connected to:
- VRx of KY-023 Dual Axis Joystick Module
A1 is connected to:
- VRy of KY-023 Dual Axis Joystick Module
D2 PWM is connected to:
- pulse of Servo 1
D4 PWM is connected to:
- pulse of Servo 2
Servo 1
gnd is connected to:
- GND of Arduino Mega 2560
-
- of 4 x AAA Battery Mount 1
vcc is connected to:
-
- of 4 x AAA Battery Mount 1
-
pulse is connected to:
- D2 PWM of Arduino Mega 2560
Servo 2
gnd is connected to:
- GND of Arduino Mega 2560
-
- of 4 x AAA Battery Mount 2
vcc is connected to:
-
- of 4 x AAA Battery Mount 2
-
pulse is connected to:
- D4 PWM of Arduino Mega 2560
9V Battery
- is connected to:
- NEGATIF of Power Jack
+ is connected to:
- POSITIF of Power Jack
4 x AAA Battery Mount 1
- is connected to:
- GND of Servo 1
+ is connected to:
- vcc of Servo 1
4 x AAA Battery Mount 2
- is connected to:
- GND of Servo 2
+ is connected to:
- vcc of Servo 2
Power Jack
NEGATIF is connected to:
-
- of 9V Battery
-
POSITIF is connected to:
-
- of 9V Battery
-
KY-023 Dual Axis Joystick Module
GND is connected to:
- GND of Arduino Mega 2560
+5V is connected to:
- 5V of Arduino Mega 2560
VRx is connected to:
- A0 of Arduino Mega 2560
VRy is connected to:
- A1 of Arduino Mega 2560
Documented Code
Arduino Mega 2560 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 Mega 2560. The setup() function is where you initialize your components, and the loop() function is where you place the code that needs to run continuously.