Jump to main content
Your email has not been verified. Verify email now ›

Build an Arduino Mini-Drone

Summary

Grade Range
8th-12th
Group Size
2-4 students
Active Time
8 hours
Total Time
8 hours
Area of Science
Robotics
Computer Science
Key Concepts
Forces, algorithms, feedback control
Credits
Vanessa Begat, Associate Director of the Gordon A. Cain Center for STEM Literacy, Louisiana State University
Science Buddies is committed to creating content authored by scientists and educators. Learn more about our process and how we use AI.

Overview

Learning Objectives

NGSS Alignment

This lesson helps students prepare for these Next Generation Science Standards Performance Expectations:

Materials

Each group of students will need the following materials to do this lesson:

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.
Additional Computer Science Lessons

More high-quality computer science lessons can be found at Infosys' Pathfinders Online Institute.

Additional Background Links

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:

Assess

You can use this quiz to assess student learning after the activity:

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.

Career Profile
Robotics engineers work at the interface of mechanical and electrical engineering and computer science. Their work can involve designing machines and electrical circuits, along with programs to control them, which are all required to build a working drone. Read more
Career Profile
Electrical engineers design electronic circuits, but also do a lot of programming. Many of the circuits they design may need to interface directly with mechanical systems, especially in devices like drones. Read more
Career Profile
Mechanical engineers design the physical and moving parts of many machines and vehicles. However, most modern machines (like drones) have electronics inside them, so mechanical engineers frequently work closely with electrical engineers and also do some programming. Read more
Career Profile
Software engineers typically focus more on programming and software than designing physical systems. For example, they might design an app that lets you control a drone with a smartphone. They can work closely with engineers to design the software that controls physical systems like drones. Read more

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:

Top
Free science fair projects.