
Summary
Students use real data from the Perseverance Mars rover to create a system that monitors and tests the functioning of the Mars Oxygen In-Situ Resource Utilization Experiment (MOXIE) instrument, which converts carbon dioxide in the Martian atmosphere into breathable oxygen. Students analyze temperature, pressure, and gas flow data to determine whether MOXIE is operating properly. To do this, they apply chemistry concepts such as balanced chemical equations and gas laws alongside coding and data analysis techniques. Working in small teams, students break the problem into manageable parts, test their code using subsets of real mission data, and refine their solutions. The activity emphasizes engineering design, systems thinking, and the critical role computer science plays in enabling advanced technologies for space exploration.Engineering Connection
Aerospace, mechanical, and robotics engineers work together to make technologies such as MOXIE function on Mars. Aerospace engineers design the rover and ensure instruments can survive launch, space travel, and the harsh Martian environment. Mechanical engineers focus on the physical design of MOXIE, including gas flow systems, thermal control, and structural components that must operate reliably under extreme temperatures and low pressure. Robotics engineers integrate MOXIE into the rover’s automated systems, enabling it to operate remotely and autonomously based on commands sent from Earth. Together, these engineers ensure that MOXIE can safely convert carbon dioxide into oxygen while operating as part of a complex robotic system millions of miles away.
Learning Objectives
After this activity, students should be able to:
- Analyze real-world scientific data from the Perseverance rover to evaluate the performance of an engineering system.
- Apply chemistry principles, including balanced chemical equations and gas laws, to model the conversion of carbon dioxide into oxygen.
- Develop and test computer code to monitor system behavior and trigger alerts based on defined performance criteria.
- Use the engineering design process to plan, build, test, and refine a data-driven monitoring solution.
Educational Standards
Each Teach Engineering lesson or activity is correlated to one or more K-12 science,
technology, engineering or math (STEM) educational standards.
All 100,000+ K-12 STEM standards covered in Teach Engineering are collected, maintained and packaged by the Achievement Standards Network (ASN),
a project of D2L (www.achievementstandards.org).
In the ASN, standards are hierarchically structured: first by source; e.g., by state; within source by type; e.g., science or mathematics;
within type by subtype, then by grade, etc.
Each Teach Engineering lesson or activity is correlated to one or more K-12 science, technology, engineering or math (STEM) educational standards.
All 100,000+ K-12 STEM standards covered in Teach Engineering are collected, maintained and packaged by the Achievement Standards Network (ASN), a project of D2L (www.achievementstandards.org).
In the ASN, standards are hierarchically structured: first by source; e.g., by state; within source by type; e.g., science or mathematics; within type by subtype, then by grade, etc.
NGSS: Next Generation Science Standards - Science
| NGSS Performance Expectation | ||
|---|---|---|
|
HS-ETS1-4. Use a computer simulation to model the impact of proposed solutions to a complex real-world problem with numerous criteria and constraints on interactions within and between systems relevant to the problem. (Grades 9 - 12) Do you agree with this alignment? |
||
| Click to view other curriculum aligned to this Performance Expectation | ||
| This activity focuses on the following Three Dimensional Learning aspects of NGSS: | ||
| Science & Engineering Practices | Disciplinary Core Ideas | Crosscutting Concepts |
| Use mathematical models and/or computer simulations to predict the effects of a design solution on systems and/or the interactions between systems. Alignment agreement: | Both physical models and computers can be used in various ways to aid in the engineering design process. Computers are useful for a variety of purposes, such as running simulations to test different ways of solving a problem or to see which one is most efficient or economical; and in making a persuasive presentation to a client about how a given design will meet his or her needs. Alignment agreement: | Models (e.g., physical, mathematical, computer models) can be used to simulate systems and interactions—including energy, matter, and information flows—within and between systems at different scales. Alignment agreement: |
| NGSS Performance Expectation | ||
|---|---|---|
|
HS-PS1-7. Use mathematical representations to support the claim that atoms, and therefore mass, are conserved during a chemical reaction. (Grades 9 - 12) Do you agree with this alignment? |
||
| Click to view other curriculum aligned to this Performance Expectation | ||
| This activity focuses on the following Three Dimensional Learning aspects of NGSS: | ||
| Science & Engineering Practices | Disciplinary Core Ideas | Crosscutting Concepts |
| Use mathematical representations of phenomena to support claims. Alignment agreement: | The fact that atoms are conserved, together with knowledge of the chemical properties of the elements involved, can be used to describe and predict chemical reactions. Alignment agreement: | The total amount of energy and matter in closed systems is conserved. Alignment agreement: Science assumes the universe is a vast single system in which basic laws are consistent.Alignment agreement: |
| NGSS Performance Expectation | ||
|---|---|---|
|
HS-PS3-3. Design, build, and refine a device that works within given constraints to convert one form of energy into another form of energy. (Grades 9 - 12) Do you agree with this alignment? |
||
| Click to view other curriculum aligned to this Performance Expectation | ||
| This activity focuses on the following Three Dimensional Learning aspects of NGSS: | ||
| Science & Engineering Practices | Disciplinary Core Ideas | Crosscutting Concepts |
| Design, evaluate, and/or refine a solution to a complex real-world problem, based on scientific knowledge, student-generated sources of evidence, prioritized criteria, and tradeoff considerations. Alignment agreement: | At the macroscopic scale, energy manifests itself in multiple ways, such as in motion, sound, light, and thermal energy. Alignment agreement: Although energy cannot be destroyed, it can be converted to less useful forms—for example, to thermal energy in the surrounding environment.Alignment agreement: Criteria and constraints also include satisfying any requirements set by society, such as taking issues of risk mitigation into account, and they should be quantified to the extent possible and stated in such a way that one can tell if a given design meets them.Alignment agreement: | Energy cannot be created or destroyed—it only moves between one place and another place, between objects and/or fields, or between systems. Alignment agreement: Modern civilization depends on major technological systems. Engineers continuously modify these technological systems by applying scientific knowledge and engineering design practices to increase benefits while decreasing costs and risks.Alignment agreement: |
International Technology and Engineering Educators Association - Technology
-
Optimize a design by addressing desired qualities within criteria and constraints.
(Grades
9 -
12)
More Details
Do you agree with this alignment?
-
Apply a broad range of design skills to their design process.
(Grades
9 -
12)
More Details
Do you agree with this alignment?
-
Evaluate ways that technology can impact individuals, society, and the environment.
(Grades
9 -
12)
More Details
Do you agree with this alignment?
Materials List
Each group needs:
- 1 laptop or tablet capable of running Python or a similar programming language and Excel
- access to MOXIE Data Sheet
- 1 Engineering Rubric
Worksheets and Attachments
Visit [www.teachengineering.org/activities/view/jpl-3042-mars-chemistry-coding-challenge-activity] to print or download.Pre-Req Knowledge
Students should have:
- Knowledge of how to balance chemical equations and/or charges.
- Experience coding in Python.
- Familiarity with Microsoft Excel.
Introduction/Motivation
Today we have a design challenge that is related to a real mission that’s happening on Mars.
The Perseverance Mars rover landed on the Red Planet in 2021 and is NASA’s most advanced rover to date. The rover, which operates using programmed instructions it receives from engineers on Earth, carries a suite of advanced science tools to search for signs of ancient life while studying the geology and subsurface of the Red Planet.
Why do you think NASA uses programmed instructions instead of controlling the rover in real time? What challenges might Mars’ distance create? (Let students offer answers. Answer: NASA uses programmed instructions because Mars is so far away that communication signals can take several minutes to travel between Earth and the rover. This delay makes real-time control impossible and requires the rover to operate autonomously to avoid hazards and complete tasks safely.)
Like other missions, Perseverance also brought new technologies to Mars to test them on the Red Planet and push the frontiers of what future missions could do.
Why would NASA test new technologies on Mars instead of waiting until humans go there? What might engineers learn from these tests? (Let students offer answers. Answer: NASA tests new technologies on Mars so they can reduce risks and solve problems before human lives are involved. These tests help engineers learn how the technology performs in real Martian conditions and what improvements are needed for future missions.)
One of those new technologies was Ingenuity, the first helicopter to fly on Mars. Performing more than 70 powered flights, Ingenuity showed how helicopters could be a useful tool for future robotic and human explorers on Mars.
Another new technology that traveled to Mars with Perseverance resides within the chassis of the rover: an instrument called MOXIE, which stands for Mars Oxygen In-Situ Resource Utilization Experiment. This electrochemical device can create breathable oxygen by using a catalyst to split carbon dioxide in the Martian atmosphere.

Why is producing oxygen on Mars such a big deal? What problems does it help solve for future missions? (Let students offer answers.) The oxygen produced by MOXIE, or instruments like it, could be used in the future to create breathable air for astronauts, or it could even be combusted and used as fuel for launches from the Martian surface—for example, to send samples from Mars back to Earth.
Which do you think is more important for a Mars mission—oxygen for breathing or oxygen for fuel? Can you make an argument for both? (Let students offer answers. Answer: Both are essential: oxygen for breathing is critical for keeping astronauts alive, while oxygen for fuel is necessary to power rockets for returning to orbit or back to Earth. Without breathable oxygen, the mission can’t continue, and without fuel, the crew could be stranded on Mars, so successful missions require both.)
Because Mars is so far away, testing and evaluating instruments like MOXIE from here on Earth relies heavily on computer science and coding. Scientists and engineers send command codes to the rover to operate MOXIE and to receive data from the instrument. This includes commands that tell MOXIE when to run and for how long, and how to measure the success of each test of the instrument.
What kinds of things could go wrong if an instrument like MOXIE doesn’t work properly—and no one is there to fix it? (Answer: If MOXIE doesn’t work properly, it could produce little or no oxygen, send incorrect data, or shut down completely without warning. Because no one can repair it on Mars, these failures could delay missions, limit future astronaut support, or prevent critical plans like producing oxygen for breathing or fuel.)
What types of data do you think engineers would look at to decide whether MOXIE is working correctly? (Answer: Engineers would look at data such as how much oxygen MOXIE produces, the purity of that oxygen, how long it runs, and how much power it uses. They would also monitor temperature, pressure, and error messages to make sure the instrument is operating safely and as expected.)
In today’s challenge, you’re going to work with real data collected by MOXIE on Mars. Your task is to design a system that can test, monitor, and evaluate whether the instrument is operating correctly—just like NASA engineers do.
How is analyzing data and writing code just as important as building the hardware in modern space missions? (Answer: Analyzing data and writing code is just as important as building the hardware because software controls how instruments operate and tells engineers whether they are working correctly. Without reliable code and data analysis, even the best-built hardware cannot be tested, monitored, or used effectively in space.)
Let’s get started!
Procedure
Background (Teacher's Guide)

Perseverance Mars Rover Background
The Perseverance Mars rover landed on Mars in 2021 and is NASA’s most advanced rover to date. It operates using carefully programmed instructions sent by engineers on Earth and carries a suite of scientific instruments designed to search for signs of ancient life while studying Mars’ geology and subsurface. Perseverance represents a major step forward in robotic exploration, combining advanced sensing, automation, and data collection technologies to operate in an extremely remote and challenging environment.
Testing New Technologies on Mars
In addition to its scientific mission, Perseverance was designed to test new technologies that could support future exploration. One of the most notable examples is Ingenuity, the first helicopter to fly on another planet. With more than 70 successful powered flights, Ingenuity demonstrated that aerial exploration is possible on Mars, opening new possibilities for scouting terrain, supporting rover missions, and assisting future human explorers.
MOXIE and In-Situ Resource Utilization
Another groundbreaking technology carried by Perseverance is the Mars Oxygen In-Situ Resource Utilization Experiment, or MOXIE. Housed within the rover’s chassis, MOXIE is an electrochemical device that produces oxygen by splitting carbon dioxide from the Martian atmosphere using a catalyst. This process demonstrates in-situ resource utilization (ISRU), the concept of using local materials on another planet rather than transporting everything from Earth.
Why MOXIE Matters for Future Missions
The oxygen produced by MOXIE, or by larger versions of similar systems in the future, could serve multiple purposes. It could provide breathable air for astronauts living on Mars and could also be used as an oxidizer in rocket fuel to launch spacecraft from the Martian surface. This capability is critical for long-term human exploration, as producing oxygen locally would significantly reduce mission cost, complexity, and risk.
The Role of Computer Science and Data Analysis
Because Mars is millions of miles away, instruments such as MOXIE must be monitored and evaluated remotely. Scientists and engineers rely heavily on computer science and coding to send commands to the rover, control when instruments run and collect performance data. This data is analyzed on Earth to determine whether systems are functioning as expected and to guide future operations.
In this challenge, students work with real MOXIE data collected on Mars to design a system to monitor and test the instrument’s performance. By analyzing temperature, pressure, and gas data, students experience how engineers use coding, data analysis, and scientific principles to evaluate complex systems operating in space. This activity provides an authentic context for understanding how engineering, chemistry, and computer science come together in modern space exploration.
Before the Activity (Preparation)
- Gather activity materials.
- Make sure Python is accessible on all laptops.
- Make sure Excel data is accessible to all groups.
During the Activity
- Provide an overview of the MOXIE instrument aboard the Perseverance Mars rover, explaining that it's designed to convert carbon dioxide in the Martian air to oxygen. (Suggested explanation: MOXIE is a special instrument on the Perseverance Mars rover that is designed to produce oxygen from the Martian atmosphere. Mars’ air is mostly carbon dioxide, which humans can’t breathe. MOXIE works by taking in carbon dioxide and using a process called electrolysis to separate the oxygen from the carbon. This experiment is important because it tests a technology that could help future astronauts breathe on Mars and even create rocket fuel for the trip back to Earth.)
- (Optional) Define electrolysis: Electrolysis is a process that uses electricity to break a substance into its basic parts. For example, if you pass an electric current through water, it splits the water into hydrogen and oxygen gases. In MOXIE’s case, electrolysis is used to split carbon dioxide (CO₂) from the Martian air into oxygen (O₂) and carbon monoxide (CO). Basically, electricity does the work of breaking chemical bonds so we can get useful oxygen.

- Divide students into pairs or small groups.
- Hand out activity materials.
- Explain the design challenge: Using real data from MOXIE, each group will program a system that can monitor and test whether the instrument is running properly.
- Instruct students to access and open the MOXIE Data Sheet on their laptops.
- Display the MOXIE Gas Flow Schematic for the entire class to see.

- Review the data set in the Excel file with the class while showing students the MOXIE Gas Flow Schematic.
- Point out that temperature and pressure are monitored at multiple locations.
- Emphasize that gas laws can be a valuable starting point to track how these details change over time.
- Note that carbon dioxide enters at the bottom left as a reactant.
- Note that the carbon monoxide and oxygen then leave as products at the top left and right, respectively.
- Give students time to plan and map out how they will use the provided data to track whether MOXIE is operating properly.
- As students discuss their plans, walk around the room and listen to their thinking. If needed, offer the following as hints:
- Students should consider what data columns they need to successfully complete the task.
- Students should consider how the task can be broken down into smaller parts for each group member.
- Students should consider gas laws.
- Optional: Review the gas laws from their chemistry course, if necessary.
- Be aware of the following:
- Students will most likely try to develop a solution using the gas laws from their chemistry course, relating pressure and temperature (Gay-Lussac’s law), like so:
(P/T)carbon dioxide = (P/T)carbon monoxide + (P/T)oxygen
- The most common mistake students make when using gas laws is forgetting to correct for the number of moles. In this case, encourage students to balance the equation first:
2CO2 → 2CO + O2
And add a multiplier in their code for the number of moles using the equation:
(P/nT)carbon dioxide = (P/nT)carbon monoxide + (P/nT)oxygen
Or
(P/2T)carbon dioxide = (P/2T)carbon monoxide + (P/1T)oxygen
- Once each group has a plan, have students begin writing their code. Suggest that each group assign specific tasks to each team member.
- Provide these hints and tips as needed:
- The simplest place to begin is with the alarm that indicates whether conditions are met. If students are just using Python, a team member can be in charge of the parameters for success and the readout:
if a >= 0.80:
print("Conditions Met")
elif a <= 0.80:
print("Warning: Low Oxygen Levels")
- Suggest students create subsets of the data instead of operating off the entire (very large!) spreadsheet. Some questions to ponder:
- Which columns do they need for their plan?
- Can they test on a small set of lines first before running through every line?
- As team members work through their tasks, they may see opportunities to tie code together into more effective solutions. This will likely include having the code do the calculations line by line and then be fed to the alarm:
if p3 >= 200 and p4 >= 250:
(p3.iloc[x] / (t8.iloc[x]*2) + p3.iloc[x] / (t9.iloc[x]*2)) / (p4.iloc[x] / (t14.iloc[x]*3) + p5.iloc[x] / (t15.iloc[x]*3)) = a
if a >= 0.80:
print("Conditions Met")
elif a <= 0.80:
print("Warning: Low Oxygen Levels")
- If students are familiar with libraries, this presents a much faster and more effective way to go through the thousands of lines of code:
p3 = mtx.loc[: , [6]]
p4 = mtx.loc[: , [7]]
t8 = mtx.loc[: , [2]]
tb = mtx.loc[: , [1]]
t9 = mtx.loc[: , [3]]
t14 = mtx.loc[: , [4]]
t15 = mtx.loc[: , [5]]
p5 = mtx.loc[: , [8]]
#print(p3)
a = [ ]
b = [ ]
- As students test their code, have them examine separate sections of the data as subsets before looking at everything at once. Does the data trigger more when the device is on or off, or when it's hot or cold? This may help students navigate any limitations to their code. Remind students to save small subsets of the original data file and label them clearly.
- Have student groups share their code and strategies with one another midway through the challenge to generate new ideas and solutions.
- Once they have finished creating their programs, have students share their final solutions, including considerations, with the class using these discussion prompts:
- Where did you set your alarm levels for the mass balance of oxygen produced?
- Why was this level selected?
- What could be done to improve it?
- What are the strengths and weaknesses of your solution?
- Did the code take a long time because it was running line by line?
- How could it be made to run faster?
- Thinking about the engineering of MOXIE, what assumptions were made about the process, and how did they affect our outcome? For example, if students used the gas laws to determine pressure, volume, and temperature, do those equations apply to open systems like MOXIE, or only to closed systems?
- Use the Engineering Rubric to evaluate each group’s code.
- Assign students a writing assignment to evaluate the strengths and weaknesses of their model and those of other student groups. Encourage students to articulate these pros and cons to help them communicate the advantages of different solutions to the same problem. (Optionally, this can be assigned as homework.)
Vocabulary/Definitions
carbon dioxide (CO₂): A gas made of one carbon atom and two oxygen atoms; it is the main component of Mars’ atmosphere and the gas MOXIE uses to make oxygen.
electrochemical conversion: A chemical process that uses electricity to transform one substance into another, such as converting CO₂ into oxygen in MOXIE.
Jet Propulsion Laboratory (JPL): A NASA research and development center in California that designs and operates robotic spacecraft, including Mars rovers.
Mars Oxygen In-Situ Resource Utilization Experiment (MOXIE): An instrument on the Perseverance rover that produces oxygen from carbon dioxide in the Martian atmosphere.
National Aeronautics and Space Administration (NASA): The U.S. government agency responsible for space exploration, scientific research, and developing space technologies.
oxygen production: The process of creating oxygen, which can be used for breathing or as fuel for rockets.
system monitoring: Observing and tracking how an instrument or system operates to detect problems, measure performance, and ensure proper function.
Assessment
Pre-Activity Assessment
Class Discussion Questions: Ask students to answer the following questions in the Introduction and Motivation section:
- Why do you think NASA uses programmed instructions instead of controlling the rover in real time? What challenges might Mars’ distance create? (Answer: NASA uses programmed instructions because Mars is so far away that communication signals can take several minutes to travel between Earth and the rover. This delay makes real-time control impossible and requires the rover to operate autonomously to avoid hazards and complete tasks safely.)
- Why would NASA test new technologies on Mars instead of waiting until humans go there? What might engineers learn from these tests? (Answer: NASA tests new technologies on Mars so they can reduce risks and solve problems before human lives are involved. These tests help engineers learn how the technology performs in real Martian conditions and what improvements are needed for future missions.)
- Why is producing oxygen on Mars such a big deal? What problems does it help solve for future missions? (Answer: Producing oxygen on Mars is a big deal because it allows astronauts to use local resources instead of bringing everything from Earth. It helps solve major challenges such as providing breathable air and creating rocket fuel, making long-term human missions safer, lighter, and more realistic.)
- Which do you think is more important for a Mars mission—oxygen for breathing or oxygen for fuel? Can you make an argument for both? (Answer: Both are essential: Oxygen for breathing is critical for keeping astronauts alive, while oxygen for fuel is necessary to power rockets for returning to orbit or back to Earth. Without breathable oxygen, the mission can’t continue, and without fuel, the crew could be stranded on Mars, so successful missions require both.)
- What kinds of things could go wrong if an instrument like MOXIE doesn’t work properly—and no one is there to fix it? (Answer: If MOXIE doesn’t work properly, it could produce little or no oxygen, send incorrect data, or shut down completely without warning. Because no one can repair it on Mars, these failures could delay missions, limit future astronaut support, or prevent critical plans like producing oxygen for breathing or fuel.)
- What types of data do you think engineers would look at to decide whether MOXIE is working correctly? (Answer: Engineers would look at data such as how much oxygen MOXIE produces, the purity of that oxygen, how long it runs, and how much power it uses. They would also monitor temperature, pressure, and error messages to make sure the instrument is operating safely and as expected.)
- How is analyzing data and writing code just as important as building the hardware in modern space missions? (Answer: Analyzing data and writing code is just as important as building the hardware because software controls how instruments operate and tells engineers whether they are functioning correctly. Without reliable code and data analysis, even the best-built hardware cannot be tested, monitored, or used effectively in space.)
Activity Embedded (Formative) Assessment
Imagine and Plan: As students imagine and plan their code, walk around the room and listen to their thought process. You can offer the following as hints:
- Students should consider what data columns they need to successfully complete the task.
- Students should consider how the task can be broken down into smaller parts for each group member.
- Students should consider gas laws.
Mid-Challenge Group Share-Out: Midway through the challenge, student groups share their code and strategies with one another to generate new ideas and solutions.
Post-Activity (Summative) Assessment
Final Classroom Share-Out: Student groups share their final solutions with the class using these discussion prompts:
- Where did you set your alarm levels for the mass balance of oxygen produced?
- Why was this level selected?
- What could be done to improve it?
- What are the strengths and weaknesses of your solution?
- Did the code take a long time because it was running line by line?
- How could it be made to run faster?
- Thinking about the engineering of MOXIE, what assumptions were made about the process, and how did they affect our outcome? For example, if students used gas laws to get pressure, volume, and temperature, do those equations work in open systems like MOXIE or only in closed systems?
Engineering Rubric: Use the Engineering Rubric to evaluate each group’s code.
Activity Extensions
If students haven't already tried it, task them with using physics to create a charge balance instead of using chemistry to generate a mass balance. Note that columns in the data should include volts and current. Because electrons have a known charge, it is possible (and more representative of the real MOXIE) to use Ohm’s Law, V = IR, to track how much oxygen is being produced.
Activity Scaling
More advanced students can use external devices or microcontrollers in their monitoring system.
Subscribe
Get the inside scoop on all things Teach Engineering such as new site features, curriculum updates, video releases, and more by signing up for our newsletter!More Curriculum Like This
Students are introduced to the planet Mars. They begin by discussing the location and size of Mars relative to Earth, as well many interesting facts about this "red planet." Next, the history of Martian exploration is reviewed and students discover why researchers are so interested in studying this ...
During this lesson, students discover the journey that a Mars rover embarks upon after being designed by engineers and before being prepared for launch. Students investigate the fabrication techniques, tolerance concepts, assembly and field-testing associated with a Mars exploratory rover.
Students gain experience with the software/system design process, closely related to the engineering design process, to solve a problem. The lesson culminates in a hands-on experience with the design process as students simulate the remote control of a rover.
Students learn about the human safety risks that are evaluated and addressed to minimize danger to astronauts. They examine a specialized launch schedule and the varied backgrounds and professions of the crew. Students find out about the crew's activities and living conditions once on the Martian su...
Other Related Information
For more information about the mission, go to https://mars.nasa.gov/mars2020.
Copyright
© 2026 by Regents of the University of Colorado; original © 2025 Jet Propulsion LaboratoryContributors
NASA Jet Propulsion LaboratorySupporting Program
NASA Jet Propulsion LaboratoryLast modified: March 28, 2026
User Comments & Tips