Project tutorial
3D-Printed Air Gate for Drones

3D-Printed Air Gate for Drones © GPL3+

Move your drone racing skills to the next level with these interactive air gates!

  • 31 respects

Components and supplies

Apps and online services

About this project

We admit it - we love playing with drones, and we dream of the day when we’ll be able to make one with But until that day comes, here’s a must-have for all drone lovers.

Just like in real-life drone races, we wanted to make something for mini-drone races.

The idea is simple: The RGB LED changes from red to green whenever the ultrasonic sensor detects the drone getting closer. Whoever finishes the course in the shortest amount of time - wins!

Air Gates in Action

The electronics

The basic circuit goes like this:

HC-SR04 (ultrasonic sensor) > Arduino > RGB LED

Here’s a magic link with these components already selected on

If you’ve never used circuito before, take a short tour of the app: as you can see, on your left hand side, you can select different sensor and actuators that can be added to your circuit. You can also change the controller and the power source.

Give it a try and click Generate once you’re done.

Welcome to your circuito reply!

Here you’ll find 3 sections:

1. The Bill of Materials or BoM is a list of all the parts you need for your project.

Don’t forget that circuito not only guides you how to connect these components, but also adds necessary peripheral parts that your circuit can’t do without.

2. Next you’ll find the Step-by-Step wiring guide, that shows you exactly how to connect all the components of your circuit.

Notice that this circuit uses an Arduino Pro Mini, in order to connect it to the computer you need a FTDI cable or a Sparkfun breakout board. This will provide power and communication to the board via USB.

3. And at last the code section.

Follow these steps:

  • Download the code zip file from the circuito reply and extract all files to your computer.
  • Open the firmware.ino file with Arduino IDE.
  • Make sure that the port and board are set properly
  • Upload the code to your Arduino

Was the upload successful?

If not >> go back and check that you connected everything properly. If you’re still having trouble, comment below and we’ll come to the rescue!

If yes (yay!) >> copy the void loop () function from this tutorial and replace it with the original void loop () you got in the sample code. Don't forget to upload the new code to your Arduino.

The code generated by is a sample code. It includes different libraries and takes care of all the settings that make the interaction between the components of your circuit and your microcontroller. The code in this tutorial was written specifically for this project by our awesome team.

A bit more about the code:

The hcsr4.ping_cm from the new ping library is set to return -1, meaning the sensor did not discover any obstacle in the max distance defined. To prevent false detections, we edited the condition - if (hcsr04Dist < 30 && hcsr04Dist > 2) so that the -1 won’t trigger the air gate.

The plastics

The air gates are 3D printed, and you can download their .STL files from the bottom of this page.

There are two parts: the base and the body and you can easily screw them together.

Some technical printing details:

We used the MakerBot Replicator 2X Resolution: 0.2 Infill: 15

And that’s basically it. We’d love to hear your thoughts and ideas for improvement. Feel free to comment or contact us on our facebook page.


Air gate void loopArduino
Replace the void loop () function in the sample code from with the code below
void loop() {
  // Read distance measurment from UltraSonic sensor
  int hcsr04Dist = hcsr04.ping_cm();

  rgbLed.setRGB(255, 0 , 0 );  //Change the values in the brackets to (255,0,0) for pure RED, (0,255,0) for pure GREEN and (0,0,255) for pure BLUE.

  if (hcsr04Dist < 30 && hcsr04Dist > 2)
    rgbLed.setRGB(0, 255, 0);    //Change the values in the brackets to (255,0,0) for pure RED, (0,255,0) for pure GREEN and (0,0,255) for pure BLUE.

Custom parts and enclosures

Air Gate Body
Air Gate Base
Air Gate for drones


Similar projects you might like

Valentine's Sunflower

Project tutorial by team

  • 38 respects

Tito - Arduino UNO 3D-printed robot

Project tutorial by Camilo Parra Palacio

  • 52 respects

Weather Station for Drones

Project tutorial by Giuseppe Caccavale

  • 48 respects

Fun Cases For Electronic Components

Project in progress by team

  • 65 respects

SpacedOut - IRL space invaders with drones

Project showcase by zvizvi

  • 1 comment
  • 27 respects

Otto DIY+ Arduino Bluetooth robot easy to 3D Print

Project tutorial by Team Otto builders

  • 219 respects
Add projectSign up / Login