Build an Arduino Mini-Drone
Summary
Overview
Learning Objectives
- Understand the components of a drone.
- Understand how drones are used in precision agriculture.
- Analyze how weight, lift, drag, and thrust are related to flight.
- Use sound waves to determine how far away an object is.
- Develop a model of the circuitry to create an agricultural drone.
- Develop an Arduino program to control a programmable drone.
- Employ pseudocode to program a drone using Arduino.
NGSS Alignment
This lesson helps students prepare for these Next Generation Science Standards Performance Expectations:- HS-PS4-1. Use mathematical representations to support a claim regarding relationships among the frequency, wavelength, and speed of waves traveling in various media.
- HS-PS4-5. Communicate technical information about how some technological devices use the principles of wave behavior and wave interactions with matter to transmit and capture information and energy.
Materials
Each group of students will need the following materials to do this lesson:
- Science Buddies DIY Mini Drone Kit
- Electronics Kit for Arduino
- Piece of paper or cardstock
- Tape
- Scissors
-
Windows or Mac computer. See this page if you have a Chromebook. Your computer will need:
- Access to the Arduino IDE, either installed local version or web-based editor (note that Chromebooks can only use the web version). Watch this video for a comparison of the two options.
- USB port. The Science Buddies kit comes with a USB-A to C cable. The "C" end plugs into the Arduino and the "A" end plugs into your computer. You will need an adapter or different cable if your computer only has USB-C ports. Watch this video to learn about the different types of cables and adapters.
Background Information for Teachers
This section contains a quick review for teachers of the science and concepts covered in this lesson.Note: This lesson assumes that students have worked with Arduino before and are familiar with some of the basics like blinking an LED and using a button. If you are introducing your students to Arduino for the first time, please see the Introduction to Arduino lesson plan at Science Buddies before starting this lesson. That way, your students will be ready to dive right into the more advanced topics in this course, like controlling the sensors and motors that you will need for the drone.
Drones are becoming a part of everyday life, with uses ranging from aerial photography and recreational racing to package delivery and agricultural applications. Some students might have flown their own toy drones or even seen drones flying around in the sky. Simply buying an off-the-shelf drone does not give students much insight into how they work, but building your own fully functioning remote controlled drone is an intimidating task.
This lesson takes a middle road that is more appropriate for students who are just getting started with electronics and programming. Students will build a mini "popsicle stick" drone that can fly up and down on two guide rails. This way, they only need to worry about controlling the drone's motion in a single direction, while its motion in other directions is constrained. This allows you to introduce them to the basics of motor control, using sensors, and writing a program to implement feedback control with an Arduino — all without having to worry about the drone crashing.
The Arduino Drone Course Overview document includes information about standards alignment, learning objectives, and a summary of each part of the lesson with instructions. Each lesson module contains additional supporting materials like videos, circuit diagrams, and example code. The lesson is organized as follows:
- Part 1: Introduction: Provides an introductory overview of drones, particularly their uses in agriculture. Also includes a more detailed introduction to the ultrasonic sensor and some more advanced Arduino concepts like writing your own functions. Includes slides for teacher use.
- Part 2: Motor Control: Move beyond Arduino basics like buttons and LEDs and learn to control motors using a transistor. Includes a detailed step-by-step video.
- Part 3: Ultrasonic Sensor: Learn to use the ultrasonic sensor to measure distance to a target object. Includes a detailed step-by-step video.
- Part 4: Build the Drone: Set up the guide rails, build the frame for your drone, and attach the motors and wires so they are ready to connect to the Arduino. Includes a detailed step-by-step video.
- Part 5: Feedback Control: Put it all together — now your students have all the pieces they need to write a program that will control the drone's altitude using feedback from the ultrasonic sensor. Includes a student assignment with scaffolded code and a grading rubric.
More high-quality computer science lessons can be found at Infosys' Pathfinders Online Institute.
Additional Background Links
- How to Use an Arduino, Science Buddies
- How to Use a Breadboard for Electronics and Circuits, Science Buddies
- Resistor Guide, Science Buddies
Prep Work (time varies)
- Make sure your classroom computers are set up so students can use the Arduino IDE. There are several different options. To install the IDE locally, follow the instructions on the Arduino software page for the correct operating system. Follow these getting started instructions to use the web-based editor (this will require students to create an online account). If your students use Chromebooks, see the Use Arduino with Chromebook page.
Lessons
Part 1: Introduction
This part of the lesson contains a slide deck you can use to introduce several topics to your students:
- Drones and their uses in agriculture (slides 1–7)
- The forces of flight (slides 8–13)
- The ultrasonic sensor (slides 14–26)
- Feedback control (slides 27–32)
- Using Arduino functions (slides 33–38)
Materials for this lesson:
Part 2: Motor Control
By now, your students should be familiar with the basics of using an Arduino, along with parts like buttons, potentiometers, and LEDs. To build their drone, they will need to control motors. These motors require more power than the Arduino's pins can provide directly — they must get their power from an external battery pack. This requires introducing a new circuit part called a transistor, which acts like an electronic "control valve." It lets you use the low-power control signal from an Arduino pin to control the much larger electrical current flowing through the motors.
The following video provides a step-by-step guide to controlling a motor's speed using a potentiometer and Arduino functions that your students will already be familiar with from the introductory lesson (analogRead, analogWrite, and map). Students can follow along with the video, pausing it when prompted. You can also refer to the Motor Control Circuit and Example Code document for the circuit diagram and example code shown in the video.
Optionally, you can show your students the datasheet for the transistor used in this project. The datasheet contains a lot of dense, advanced information that students do not need, but datasheets are very useful for looking up which pin is which on a part.
Materials for this lesson:
Part 3: Ultrasonic Sensor
Many full-sized drones have a downward-facing ultrasonic sensor mounted on the bottom. This lets the drone measure the distance to the ground and automatically hover at a constant altitude. Drones may contain additional sideways-facing sensors to detect obstacles during flight. In this project, your students will build a small popsicle-stick drone that cannot support the weight of an ultrasonic sensor. Instead, you will mount the ultrasonic sensor on the ground directly beneath the drone, facing upward. This allows you to measure the drone's height and implement feedback control.
The following video provides a step-by-step guide to using the HC-SR04 ultrasonic sensor with an Arduino, using some functions they are already familiar with (e.g. digitalWrite) and some new ones (e.g. pulseIn). Students will use the sensor to control an LED. Students can follow along with the video, pausing it when prompted. You can also refer to the Ultrasonic Sensor Circuit and Example Code document for the circuit diagram and example code shown in the video.
Optionally, you can show your students the datasheet for the ultrasonic sensor. Datasheets are useful when you need to understand how a sensor works and how to use it.
Materials for this lesson:
Part 4: Build the Drone
In this part of the lesson your students will build frames for their drones and connect motors. Follow along with the video below to build the drones, but note these important differences:
- You will build a support with two parallel dowels to support the drone. This prevents the drone from spinning and getting tangled in the wires as it flies up and down. The Science Buddies DIY Mini Drone Kit comes with a block of wood with holes pre-drilled for the dowels.
- Your drones will need two guide straws, opposite each other on the center of the frame, so they will fit over the two dowels.
- The wire colors in your kit may vary. You should not need to use separate extension wires to connect the motors (the motor wires should be long enough to reach the middle of the drone).
- The drone kit includes a foam block. Punch the dowels through this block and place it on top of the piece of wood. This provides some extra cushioning for your drone in case of any accidental hard landings.
Note that it is very important for the four motors to be vertical and aligned with each other. If the motors are mounted crooked, this will cause additional friction with the dowels, because part of the lift force will be pointed sideways instead of up. This can cause the drone to get stuck. Make sure students mount the motors very carefully.
Part 5: Feedback Control
Now your students have all the pieces they need: they know how to use an Arduino, how to control the motors' speed, how to measure distance with an ultrasonic sensor, and they have built a small drone that flies up and down on guide rails. They can now implement feedback control to make the drone hover at a desired altitude. This altitude can be adjusted with a potentiometer. If the drone is disturbed (bumped up or down), it should automatically return to the target altitude — just like a real drone!
The Student Feedback Control Assignment document first asks students to write pseudocode showing how they would implement feedback control. Then, it provides scaffolded code where students need to fill in key parts using what they have learned. Finally, students will test their code on their own drones!
Example solution code is provided for teachers to refer to. You can use the grading rubric to assess students' performance on the project. A quiz is also provided in the next section.
Materials for this lesson:
Teacher Tool Box
- Introduction video
- Arduino Drone Course Overview
- Arduino Drone Lesson Slides
- MOSFET datasheet
- Motor control circuit and example code
- Motor control video
- Ultrasonic sensor circuit and example code
- Ultrasonic sensor datasheet
- Ultrasonic sensor video
- Drone assembly video
- Student feedback control assignment
- Final code solution (PDF)
- Final code solution (Arduino file)
- Drone project grading rubric
Assess
You can use this quiz to assess student learning after the activity:
- Online quiz, assignable in any LMS
- Quiz (pdf) and answer key (pdf)
Make Career Connections
Discussing or reading about these careers can help students make important connections between the in-class lesson and STEM job opportunities in the real world.
Lesson Plan Variations
There are many projects on the Science Buddies site that you can use to expand on the drone your students built in this project. See the following pages for parts lists, circuit diagrams, and example code:





















