Arduino-Controlled Rocket Launcher with Relay and Geared Motor
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is designed to control a 12V geared motor using an Arduino UNO microcontroller and a 5V relay. The motor is part of a rocket launcher system, where the activation of the relay causes the rocket to ascend, and deactivation causes it to descend. The system is powered by two 18650 Li-ion batteries connected in series. The Arduino UNO controls the relay through one of its digital pins, and the relay switches the power to the motor from the batteries.
Component List
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- Purpose: Acts as the control unit for the rocket launcher, driving the relay to power the motor.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0-A5, SCL, SDA, AREF, D0-D13.
12V Geared Motor
- Description: A motor with a gearbox to increase torque.
- Purpose: Provides the mechanical action for the rocket launcher.
- Pins: Terminal 1, Terminal 2.
5V Relay
- Description: An electromechanical switch that can be controlled with a low voltage signal.
- Purpose: Switches the high-power circuit for the motor on and off.
- Pins: Normally Open, Common terminal, Normally Closed, In, GND, VCC.
18650 Li-ion Battery x 2
- Description: Rechargeable batteries providing the power source for the motor.
- Purpose: Supplies power to the motor through the relay.
- Pins: +, -.
Wiring Details
Arduino UNO
- 5V connected to 5V relay VCC.
- GND connected to 5V relay GND and 12V geared motor Terminal 1.
- Vin connected to 18650 Li-ion Battery x 2 (+).
- D13 connected to 5V relay In.
12V Geared Motor
- Terminal 1 connected to Arduino UNO GND.
- Terminal 2 connected to 5V relay Common terminal.
5V Relay
- VCC connected to Arduino UNO 5V.
- GND connected to Arduino UNO GND.
- Normally Open connected to Arduino UNO Vin.
- Common terminal connected to 12V geared motor Terminal 2.
- In connected to Arduino UNO D13.
18650 Li-ion Battery x 2
- + connected to Arduino UNO Vin.
- - connected to 12V geared motor Terminal 1.
Documented Code
/*
* Rocket Launcher Control
* This code controls a relay to manage a 12V geared motor for a rocket launcher.
* The rocket will ascend when the relay is activated and descend when deactivated.
* The speed of ascent and descent is controlled by delays.
*/
const int relayPin = 13; // Pin connected to the relay input
void setup() {
pinMode(relayPin, OUTPUT); // Set relay pin as output
digitalWrite(relayPin, LOW); // Ensure relay is off initially
}
void loop() {
// Launch the rocket (activate relay)
digitalWrite(relayPin, HIGH);
delay(5000); // Adjust delay for ascent speed
// Stop the rocket (deactivate relay)
digitalWrite(relayPin, LOW);
delay(5000); // Adjust delay for descent speed
}
The code is written for the Arduino UNO and is responsible for controlling the relay that powers the 12V geared motor. The relayPin is set to pin 13, which corresponds to the digital pin D13 on the Arduino UNO. The setup() function initializes this pin as an output and ensures the relay starts in the off position. The loop() function then alternates between turning the relay on and off, with a 5-second delay between each state change, simulating the ascent and descent of the rocket.