This activity is part of a one-day “STEAM Day” curriculum hosted by our organization. At the Center for Innovation in STEM Education, we strive to create exposure and access to hands-on STEM experiences with real-world connections. Throughout this lesson, students imagine themselves as NASA engineers tasked with programming the Mars Ingenuity helicopter. Students begin by exploring the history of Mars exploration and relevant STEM careers. Students then practice using Swift playgrounds to build foundational coding skills before block-coding with MacBooks to control their drones in a simulated mission.
Pre-Lesson Preparation
This lesson was designed to take 2-3 hours with middle or high-school students. However, it could easily be broken into smaller segments, and it will depend heavily on the amount of technology and space available. To safely fly drones in our classrooms, we rotate four groups of four students through drone-flying stations at a time.
The following supplies are required for this lesson:
- Projector and device for presenting slides and a coding demonstration
- iPads or MacBooks with Swift Playgrounds installed
- iPads or MacBooks with drone blockcoding software
- Classroom drone set (we use CoDrones)
- Mars “course,” where students will navigate their drones. This could be a printed mat, a butcher-paper drawing of Mars landmarks (ex. Olympus Mons), or a simple obstacle course with cones.
Lesson Introduction (Engage)
Students begin by discussing how scientists might study other planets like Mars. Ask students to consider how they might explore areas inaccessible to rovers, like the Mars Curiosity, which they may have already heard of. Allow students to think-pair-share to support verbal processing and peer-to-peer learning before sharing with the whole group.
Example Thinking Question: Imagine you are a scientist for NASA! You want to study the polar ice caps of Mars, but your rover can’t drive on the ice. What could you do?
Next, the instructor can share information about Mars research and historical milestones. While we present the information to students with slides and videos, students could also conduct their own guided research. Highlight for students that Ingenuity was the first powered flight on another planet.
Introduce Coding Fundamentals with Swift Playgrounds (Investigate)
Begin the coding lesson segment by asking students to discuss why scientists can’t pilot the Ingenuity with a joystick or controller. Emphasize to students that, because Mars is so far away, flight commands for the Ingenuity must be pre-programmed in advance.
Swift Playgrounds, specifically Learn to Code 1, is a great way to introduce students to basic coding concepts before they fly their drones. The instructor can use this time to define commands, functions, and loops before demonstrating a few challenges in Learn to Code 1. After the demonstration, release students to practice coding independently.
Introducing a visual anchor chart can support students in distinguishing between commands, functions, and loops. While defining each term, pair the vocabulary with simple visuals and a real-world example to make the concepts more concrete. For example, relate coding to a familiar routine like getting ready for school. A command is a single action, such as brushing your teeth. A function is a group of related commands, like “get ready for school,” which might include brushing your teeth, making your bed, and packing your backpack. A loop occurs when the command or function is repeated each day of the week!
Extend Programming Skills with a Simulated Mars Mission (Act)
Once students feel comfortable coding with Swift, they are ready to test their skills flying “Ingenuity” drones! Demonstrate for students how to connect and program their drones. This could depend heavily on the drone and software you select. Make sure to review classroom expectations and basic drone safety!
Present a challenge for their simulated mission before giving students time to practice writing their code. If working in groups, ask students to compare their code with each other to provide peer feedback.
Example Mission: To collect important data on Mars, you need to program the Ingenuity Helicopter to navigate from “base camp” to take a photo (flash blue light) of the Happy Face Crater.
Taking turns, allow students to test their code on your Mars course. If time permits, and students do not successfully complete their mission, they can engage with the Engineering Design Process to adjust their code. Finally, lead a class discussion to stamp key learning and foster community.
- How did this activity help you understand how NASA explores places like Mars?
- How did you fix errors or improve your code during the mission?
- What other challenges might engineers face when working on a real Mars mission?



Attach up to 5 files which will be available for other members to download.