Arduino Bomber Plane Mechanism + Missile Detector System
by 1069943 in Circuits > Arduino
56 Views, 0 Favorites, 0 Comments
Arduino Bomber Plane Mechanism + Missile Detector System
VIDEO
https://drive.google.com/file/d/15euywVaja5sbQi7I2ZQ0DMl9ZEgVMzN-/view?usp=drive_link
https://drive.google.com/file/d/1mqW6BSMHi0Ori00R9sXjh5ZdiuMAI8E4/view?usp=drive_link
MY INVENTION
My invention is an Arduino Bomber Plane Mechanism + Missile Detector System. It uses a microcontroller to manage real-time data from sensors and execute physical tasks through servos.
Key Project Features
1. Proximity Radar (Input System)The system uses an HC-SR04 Ultrasonic Sensor to measure distance. It works by sending a sound pulse and timing how long it takes to return.
- Safe Zone: If no object is detected within 40cm, the Green LED is powered.
- Warning Zone: Between 15cm and 40cm, the Yellow LED is powered and the Piezo Buzzer starts a pulsing signal.
- Danger Zone: Under 15cm, the Red LED is powered and the buzzer makes a solid alarm sound.
2. Dynamic Audio Scaling Instead of a basic on/off sound, I used a command called map() to create a reactive alarm.
- Frequency (Pitch): As the distance decreases from 40cm to 15cm, the code automatically increases the pitch of the buzzer.
- Timing (Speed): The algorithm also scales the pause time between beeps. The beeps get faster as the object gets closer to the sensor, providing better feedback to the user.
3. Dual-Servo Actuation (Mechanical Output)The project uses two Micro Servos to perform physical movements.
- Automated Flare System: If the sensor detects an object in the "Danger Zone" (<15cm), the code automatically moves this motor. You can see this in my video when my hand triggers the alarm and the white cardboard arm moves.
- Manual Hatch: I have a second button on Pin A1 that allows me to open a "bomb hatch" whenever I press it.
How the Mechanism Works
In my video, you can see how the hardware and software work together.
- Input Data: The Ultrasonic Sensor on the breadboard constantly sends data to the Arduino. I also used Analog Pins (A0 and A1) as digital inputs for my buttons.
- Processing Logic: To make sure the system doesn't lag, I used non-blocking code called millis(). This is a Level 4 skill because it lets the Arduino multitask. As shown in the video, the sensor keeps scanning even while the motors are moving.
- Output Action: I used PWM (Pulse Width Modulation) to control the Servo Motors. I also used an RGB LED that turns Red when the flares are active to show the system status.
HOW THE CODE WORKS:
1. Data Acquisition (Inputs)
- Ultrasonic Sensor (HC-SR04): This component uses Time-of-Flight (ToF) sensing. The code triggers a sonic pulse and measures the duration until the return signal is received, calculating distance based on the speed of sound.
- Digital Input Interfacing: I utilized Analog Pins (A0 and A1) as digital inputs for my tactile switches. By enabling Internal Pull-Up Resistors in the software, I ensured a stable "High" logic state when the buttons are open, preventing floating signals.
2. Data Processing & Algorithms (Logic)
- Dynamic Variable Mapping: The code uses the map() function to translate raw distance integers into a proportional Duty Cycle for the buzzer. This creates an algorithm where the output frequency is a direct function of the input distance.
- Conditional Logic Gates: The flare deployment system operates on a Boolean OR logic gate. The system triggers if (ManualSwitch == LOW || SensorDistance < 15).
- Concurrency (Non-blocking code): To ensure the system remains responsive, I implemented Asynchronous Timing using the millis() function. This avoids the "processor blocking" caused by delay(), allowing the CPU to handle radar scanning and audio-visual output simultaneously.
3. Output Control (Actuators & Feedback)
- Pulse Width Modulation (PWM): I used PWM signals on pins 6 and 8 to control the Micro-Servo motors. The code sends specific pulse widths to position the motors at 0 or 180 degrees.
- Status Telemetry (RGB LED): A Common Cathode RGB LED provides a visual system-status interface. The code manages the intensity of the Red, Green, and Blue channels to indicate whether the system is in "Standby" or "Active Deployment" mode.
HOW IT MEETS LEVEL 4 CRITERIA
1. Knowledge (Circuitry and Software)
- Advanced Components: "I didn’t just use basic LEDs. I integrated Level 4 components like the HC-SR04 Ultrasonic Sensor for detection and two Micro Servo Motors for movement. You can see in my circuit that I used 330 Ohm resistors to protect my LEDs and used both digital and analog pins for my inputs."
- Software Mastery: "My code is Level 4 because I used new functions I defined myself to keep the logic clean. I also used the Servo library to control my motors and the map() function to scale my sensor data into different audio pitches."
2. Application (Functionality and Purpose)
- Clear Purpose: "This isn’t just a circuit; it’s a security device. It uses all the 'MUST' parts like buttons and resistors, and 'SHOULD' parts like motors and distance sensors."
- Reliable Execution: "As you saw in my video, the code compiles and the components work exactly as they should. When an object enters the danger zone, the system reacts instantly by firing the flares."
3. Communication (Organization)
- Professional Coding: "My code follows all the conventions. I declared every variable at the top, organized the code into chunks, and used indentation so it’s easy to read."
- Neat Build: "I built the physical project neatly. The wiring is organized so you can see all the peripheral parts, and my Instructable includes original photos and videos of every step."
4. Thinking (Efficiency and Complexity)
- Multitasking (Non-blocking Code): "The most complex part of my project is that I used non-blocking timers (millis()) instead of delays. This is a Level 4 program structure that makes the system efficient because it can scan for intruders while it’s beeping and moving the motors at the same time."
- Powerful Interactions: "By combining the distance sensor with motors and sound, the project becomes much more powerful than a simple alarm. It accounts for variations in distance by changing the beep speed and pitch automatically."
Supplies
Materials List
The document attached has a link and cost to buy each item and a picture of how it looks. Here is a generic list of items needed
- Arduino Uno
- Ultrasonic Distance Sensor HC-SR04
- Servo Motors x2
- RGB LED Common Cathode
- Standard LEDs x2 Red, x2 Yellow, x2 Green
- Piezo Buzzer
- Push Buttons
- Resistors 330 Ohms x3
- Breadboard
- Jumper Wires
- USB Cable
- Wires
- Breadboard
- Cardboard
Downloads
The Circuit
- Place the Sensor exactly at the Center of the board
The Circuit
- Connect the positive and negative ends of the sensor to power rails
- Place the LEDs in parallel and connect their negative ends to a single column
- connect the column the negative power rail using a resistor
- Place the buzzer and connect its negative end to power rail
The Circuit
- Place a button and ground it
The Circuit
- Place another button and ground it
Creating the Prop
- Cut a piece of Cardboard and cut it into trapezoidal shape similar to the rudder on the back of a Bomber plane
The Circuit
- Place the RGB LED and connect its negative ends to corresponding pins (11,12 and 13)
- Use a resistor to connect the LED to positive power rail
The Circuit
- Connect the LEDs to their corresponding Pins
Flare Hatch
- Create a hollow box using cardboard that looks like a magazine of a Glock
- Make sure that it is 2 inches wide and 0.5 inches thick
- Use only 4 panels for the structure
- Then use glue gun to paste the servo and the lid onto the magazine for flare like in the picture
Bomb Hatch
- Create this simple mechanism using cardboard and servo for the bomb hatch
- cut a piece of cardboard and cut a rectangle from it
- us that piece and that rectangular cut to create this mechanism
- Use Matchsticks or skewers for the shafts
The Final Circuit
- Now connect the Servo control pins to their corresponding pins (6 and 8) for control and power them using wires to connect them to power rails on the breadboard
- And connect pushbuttons to control the bomb hatch and the flare control
The Code
- Connect your Arduino UNO to your computer using USB to B converter
- Plug in this code in Arduino IDE and you're done
Downloads
Common Mistakes
People can make a lot of mistakes while making this project I have made them and wrote them down so you don't have to:
- Confusing between 330 Ohm and 10k Ohm resistors as they look the same if they are not noticed properly and can decrease the current you are getting to LEDs if you are not noticing.
- Getting confused between pins as I have used almost all pins in the circuit and I have made a lot of mistakes and wasted a lot of time figuring them out.
- Miscalculating RGB pins if they are common cathode or common anode as it can result in doing opposite of what you want.
- Changing positive and negative pins of Servos as they are the most dangerous mistake you can make because if they are miscalculated, your Arduino will heat up and stop working, if untreated Arduino can fry