Tiny Whoop Drone Gate With Timer
Introduction: Tiny Whoop Drone Gate With Timer
I got my son a tiny whoop indoor FPV drone for Christmas, specifically an EMAX Tinyhawk II. We’ve had fun creating small obstacle courses in our basement, but one thing was missing – a timer so we could compare flight times.
This instructable (my first) is for a drone gate with an automatic timer that can be used at the start and end of the course. When the drone passes through the gate at the start of the course, a timer starts and continues until the drone passes through the gate again at the end of the course.
Since we’re using an Arduino as the brains of this project, we decided to add an RGB LED strip in a circle that the drone flies through. The LEDs change colors every ten seconds during the race that the pilot can see in their peripheral vision. If the race ends with a new record time, the LEDs show a chaser pattern. A long press of the reset button saves the current race time as the new record to beat.
Before going any further, let’s see this drone gate in action…
Step 1: Electrical Components
Below are the electrical components we used:
* Arduino Nano
* HC-SR04 ultrasonic distance sensor
* Adafruit 4-digit 7-segment display w/I2C backpack
* WS2812B individually addressable RGB LED strip (2M, 120 LEDs, 5V)
* Push button
* 1000µF capacitor
* 470-ohm resistor
* 10K-ohm resistor
* 5V power supply
* DC power adapter
* Micro USB cable
Step 2: Other Supplies
Below are additional supplies we used to construct the circuit and actual gate:
* Soldering iron
* Jumper wires
* Heat-shrink tubing
* Black plexiglass
* Drill press with paddle bits
* Jigsaw with plexiglass blade
* Hot glue gun
* ½” OD plastic tubing
* 1x2 poplar painted black
* Wood glue and nails
Step 3: Hardware
When setting out to build this drone gate, we weren't sure what to use to detect the drone as it passes through the gate. We ended up using an HC-SR04 ultrasonic distance sensor – a common sensor often used in robotics to measure distance. This sensor has two pins that need connected to the Arduino – trigger and echo. We decided to connect these to digital input pins D4 and D3, respectively.
For displaying the race time and to keep things simple, we decided to use an Adafruit 4-digit 7-segment display w/I2C backpack. This display uses serial communications to update the display and is only connected to the two I2C pins on the Arduino Nano – A4 (data) and A5 (clock).
We used a narrow (5mm) 2-meter RGB LED strip that we folded in half onto itself so that the LEDs point both up and down. This LED strip is passed inside plastic tubing to hold its shape as a circle to fly the drone through. 769
We connected the RGB LED strip to pin D5 on the Arduino using a 470-ohm resistor. We also added a 1000µF capacitor to the input power. The resistor and capacitor are recommended best practices for connecting RGB LED strips.
A simple push button is used to reset the timer back to zero. It can also be long pressed to store the displayed time as the record time to beat. We connected the reset button to pin D2 on the Arduino with a 10K ohm pull-down resistor to ground.
To power this project, we used a 5V power supply and female DC power adapter with terminal screws. The RGB LED strip has too many LEDs to be powered from the Arduino directly, so it’s wired directly to the power adapter. To power the Arduino, we decided to use an old micro-USB cable we had laying around. We soldered the 5V and GND wires of all the components together with the power and micro-USB cable and protected the connections with heat shrink tubing.
Step 4: Wiring Diagram
Step 5: Software
The software for this project is relatively straight-forward. The main program loop checks for the presence of the drone within the gate and starts or stops the race timer. The elapsed time is updated on the 4-digit display with a max time of “999.9” seconds. The most complicated portion of the code is updating the RGB LED strip to indicate race progress. Because we used a 2-meter LED strip folded back on itself, the LEDs need to be mirrored so the LEDs facing up match those that are facing down.
The Arduino Nano’s built-in EEPROM is used to save the record flight time, triggered by a long press of the reset button. 939