Jump to main content

Build a Wearable Device Using an Arduino to Keep Astronauts Safe on Mars

Abstract

Astronauts on Mars missions must be protected from hazardous environments, like steep cliffs, rocky terrain, and extreme temperature variations. How can geofencing help? In this project, you will design a system that uses geofencing technology coupled with biosensors to ensure astronaut safety. The system will create a virtual boundary around astronauts, providing alerts if they approach dangerous areas or leave designated safe zones, or if their vital signs fall below a certain threshold. Can you build a reliable safety net for astronauts on Mars?

Summary

Areas of Science
Difficulty
Method
Time Required
Average (6-10 days)
Prerequisites

Previous Arduino experience is recommended. See our How to Use an Arduino page for tutorials.

Material Availability

A kit is available from our partner Home Science Tools®. See the Materials section for details.

Cost
High ($100 - $150)
Safety

No issues

Credits
Hannah James, Cornell University
This publication was supported by an agreement with Cornell University, under Prime Agreement MCS2107‑23‑01 from the Department of Defense, Office of Local Defense Community Cooperation. Any opinions, findings, and conclusions or recommendations expressed in this publication are those of the author(s) and do not necessarily reflect the views of Cornell University nor those of Sponsor.
Science Buddies is committed to creating content authored by scientists and educators. Learn more about our process and how we use AI.

Objective

Design and build a wearable astronaut safety device. 

Introduction

Exploring Mars has been on the minds of space agencies for generations; however, it is no easy feat. While space agencies, such as NASA, have sent rovers and orbiters to Mars, no human has stepped foot on Mars. Why is that? Well, one of the reasons is due to how unsafe Mars is for humans, from lack of breathable oxygen to high levels of radiation and extreme temperatures. If we want to be able to explore Mars we need to do it in a way that keeps astronauts safe. One approach to achieving this is by establishing safe zones—areas that are less hazardous, such as those free from steep cliffs. Information required to be able to define these “safe zones” can be gathered through data collected by Mars rovers and spacecraft in orbit. Figure 1 shows an image of the surface of Mars taken by NASA's Perseverance rover.

Figure 1. NASA’s Perseverance Mars rover used its dual-camera Mastcam-Z imager to capture this image of a hill called "Santa Cruz" on April 29, 2021. (Image credit: NASA/JPL-Caltech/ASU/MSSS)

Geofencing is a method of creating these virtual boundaries or safe zones on Mars, where astronauts can safely roam and work without fear of encountering dangerous terrain or high-risk areas. "Geo" comes from "geography" as the fencing is defined by location i.e. GPS coordinates. Using sensors and real-time location tracking, we can define these boundaries and alert astronauts when they are approaching hazardous areas, such as steep cliffs or high-radiation zones. To put yourself in the shoes of the astronaut, watch this video, which is a visual exploration of Mars:

In this project, you will create a device that uses sensing and geofencing to keep astronauts safe while exploring Mars. Geofencing uses GPS technology to create virtual geographic boundaries that enable code to trigger some sort of response when a device leaves a particular location. By using sensors to track location and monitor environmental conditions, your device will warn astronauts if they are about to leave a safe zone and enter a restricted or dangerous area. To do this, you'll need to understand how to use GPS technology for tracking, as well as how to work with sensors that can detect environmental factors like air quality and temperature. You will also need to program your device to send warnings, either through flashing lights or audio cues, when an astronaut approaches a danger zone. This approach will make use of basic geofencing concepts, allowing you to create a real-time safety system for astronauts. To learn more about geofencing and how it works, watch the following video:

Your project will involve designing a prototype wearable device that integrates GPS, sensors, and geofencing software. As you build and test your device, you will learn how these technologies work together to create a system that can protect astronauts during their missions on Mars. Can you design a system that will keep astronauts safe as they explore the Martian surface?

Terms and Concepts

Questions

Bibliography

Materials and Equipment Buy Kit

Recommended Project Supplies

Get the right supplies — selected and tested to work with this project.

View Kit

Note: this is an engineering design project. The circuit diagram and example code in the project's procedure will show you how to use the components listed below. However, you may choose to remove, substitute, or add other sensors or outputs to your project.

Disclaimer: Science Buddies participates in affiliate programs with Home Science Tools®, Amazon.com, Carolina Biological, and Jameco Electronics. Proceeds from the affiliate programs help support Science Buddies, a 501(c)(3) public charity, and keep our resources free for everyone. Our top priority is student learning. If you have any comments (positive or negative) related to purchases you've made for science projects from recommendations on our site, please let us know. Write to us at [email protected].

Experimental Procedure

This project follows the Engineering Design Process. Confirm with your teacher if this is acceptable for your project, and review the steps before you begin.
Before you begin: Review How to Use an Arduino Tutorials 1-3.

You will first assemble your circuit and test your code. This makes it easier to identify and fix any issues with your circuit or code. After everything is working, you will house your Arduino and circuit into a box and then test the wearble device. 

Assemble the circuit

See Figure 2 for the circuit diagram and Figure 3 for the final result of what your circuit will look like. Important: this is an advanced project. The instructions assume you know how to use a breadboard and how to build a circuit from a circuit diagram. Review the linked resources if you need help.

Figure 2. Circuit Diagram of the Safety Wearable Device

  1. First, let's wire the 5V and GND pins from the Arduino Uno R4 to the breadboard. This will serve as your power distribution for all components.
    1. 5V from Arduino → Breadboard positive rail (+)
    2. GND from Arduino → Breadboard negative rail (-).
  2. The GPS Neo 7M communicates via serial (TX/RX), so you'll connect the TX and RX to the RX and TX on the Arduino, respectively:
    1. VCC → Breadboard positive rail (+)
    2. GND → Breadboard negative rail (-)
    3. TX → RX (Pin 0) on Arduino
    4. RX → TX (Pin 1) on Arduino 
    5. Note: When using TX/RX for serial communication, you need to be careful not to interfere with the Arduino’s USB serial connection. For proper serial communication, you should disconnect these two wires when connecting to USB to upload code, then reconnect after the code is uploaded.
  3. The MAX30102 Heart Rate and Oxygen Sensor wiring is as follows: 
    1. +ve → Breadboard positive rail (+)
    2. -ve → Breadboard negative rail (-)
    3. S → A1 on Arduino
  4. The DS18B20 uses a 1-Wire communication protocol, and it needs a 10kΩ pull-up resistor between the Data Pin and VCC to work correctly.
    1. VCC → Breadboard positive rail (+)
    2. GND → Breadboard negative rail (-)
    3. Data Pin → A2 on Arduino
    4. 10kΩ Pull-up Resistor between Data Pin (A2) and VCC (5V)
  5. The MQ-135 Gas Sensor uses analog output, so you'll connect the AOUT pin to an analog pin on the Arduino for reading gas concentrations:
    1. VCC → Breadboard positive rail (+)
    2. GND → Breadboard negative rail (-)
    3. AOUT → A0 on Arduino
  6. The OLED Display communicates via I2C, so you'll connect SCL and SDA to the corresponding pins on the Arduino.
    1. VCC → Breadboard positive rail (+)
    2. GND → Breadboard negative rail (-)
    3. SCL → A5 (SCL pin) on Arduino
      1. Pin A5 has SCL functionality, even though this is not labeled on your Arduino
    4. SDA → A4 (SDA pin) on Arduino
      1. Pin A4 has SCL functionality, even though this is not labeled on your Arduino
  7. The buzzer can be connected to any digital pin on the Arduino for feedback alerts:
    1. Buzzer Pin 1 → Pin D9 on the Arduino
    2. Buzzer Pin 2 → Breadboard negative rail (-)
  8. 9V battery clip for portable power:
    1. Connect the battery clip from the Arduino kit to the battery
    2. Connect the other end to the battery jack of the Arduino
Arduino astronaut geofencing and biometrics prototypeImage Credit: Hannah James / Science Buddies

Figure 3. Final result of what your circuit will look like once assembled and placed inside a box.

Test Your Code

Since this is a complex project with lots of moving parts, first we will test everything individually to confirm it all works, and then integrate everything together.

  1. To start off simple download this code to first just display temperature on the OLED screen.
  2. After that, try this code which allows you to blink the Arduino onboard LED using the heart rate sensor and your heartbeat.
  3. This code contains the rest of the sensor capabilties. So now incoporate it into your script depending on which sensors you chose to use.
  4. Now let's start incorporating the geofence capabilities! this code contains just that.
  5. To obtain the GPS coordinates of your location, follow these steps:
    1. Open Google Maps, click on your location, then right-click to display the coordinates at the top.
    2. Once you have your coordinates, update the code with your location and set a reasonable radius, such as 10 meters.
    3. The geofence radius in the code is set to 0.00005 degrees, which translates to about 5.57 meters (18 feet) in real-world distance. Since one degree of latitude is approximately 111,320 meters, multiplying by 0.00005 gives this small radius.
    4. With such a small geofence, even a minor misclick on Google Maps—like selecting the house next door—could place the user outside the safe zone immediately. Increasing the radius slightly could help avoid these issues.
  6. To test the geofence capabilities, move the GPS module around to simulate movement and observe how the system responds to the geofence. 
    1. Geofence Alert:
      1. If you move outside the geofence area, the buzzer should activate.
      2. If the buzzer doesn’t sound when crossing the geofence boundary, check the geofence_lat, geofence_lon, and geofence_radius values that you entered are correct.
    2. Inside the Geofence:
      1. When within the geofence area, the buzzer should turn off.
  7. The OLED screen should display:
    1. Temperature (°C) – accurately updates in real-time.
    2. If the OLED does not display correctly, check wiring connections for the display.
  8. Now that we've confirmed everything works, here is the full code!
    1. This code integrates all the components you've set up, including MQ135 gas sensor, GPS module, temperature sensor, pulse sensor, and OLED display. It continuously reads data from these sensors and displays relevant information on the OLED screen while also triggering alerts based on certain conditions.
    2. What the code does:
      1. Monitors air quality using the MQ135 gas sensor.
      2. Retrieves GPS coordinates using the GPS module and checks if the location is within a predefined geofence.
      3. Measures temperature with the Dallas Temperature sensor.
      4. Reads heart rate signals from the pulse sensor and flashes the onboard LED.
      5. Displays this information on the OLED screen.
      6. Triggers a buzzer if the device moves outside the geofenced area.
    3. Try modifying these settings:
      1. Adjust sensor thresholds:
        1. Change Threshold = 580; for the pulse sensor to see how sensitive it is to detecting a heartbeat.
        2. Modify geofence_radius = 0.00005; to change how far the device can move before triggering the geofence alert.
        3. Adjust the gas concentration warning level in the display logic (gasConcentration > X) to make it more or less sensitive.
      2. Customize alerts:
        1. Change the buzzer frequency or duration in playTone(int frequency, int duration) to make different alerts for different situations, such as it getting louder the further away the astronaut is or, the longer they are outside the geofence.
        2. Add a warning on the OLED display if temperature exceeds a certain value (e.g., if (tempC > 30) display a "High Temp!" alert).
      3. Add more data to the OLED display. Currently, the OLED screen shows temperature, gas levels, acceleration, and GPS data. You can modify it to:

        1. Display heart rate data if above a threshold.
        2. Add warnings for high gas concentration or extreme acceleration.
        3. Show a countdown timer for when the next GPS update occurs.

Troubleshooting tip: if things aren't working as expected, check your wiring! That is where most issues arise.

Wearability

To make your device wearable, follow these steps:

  1. Place your device in a box or container.
    1. This can be cardboard or plastic. But note that whatever box or container you use you'll want to be able to see the OLED display and have easy access to any switches.
    2. Once the electronics are secured in the container, close it.
  2. Attach the velcro straps around the container.
  3. Attach velcro straps to whichever item you wish to wear the device on, such as a sweatshirt.
  4. Now you're all set to wear your personally made device with pride!
icon scientific method

Ask an Expert

Do you have specific questions about your science project? Our team of volunteer scientists can help. Our Experts won't do the work for you, but they will make suggestions, offer guidance, and help you troubleshoot.

Global Goals

The United Nations Sustainable Development Goals (UNSDGs) are a blueprint to achieve a better and more sustainable future for all.

This project explores topics key to Industry, Innovation and Infrastructure: Build resilient infrastructure, promote sustainable industrialization and foster innovation.

Variations

  • Using the MPU6050, detect either an extreme acceleration, indicating that the astronaut fell or experienced an impact, or a lack of movement for an extended period of time, indicating that they're stuck or hurt
  • Adjust the alert thresholds for heart rate, temperature, and gas sensors
  • Combine LEDs with buzzer alerts for different levels of danger (green for safe, red for emergency)
    • You can connect the LEDs to any digital pins on the Arduino. Each LED needs a 220Ω resistor in series to prevent damage:
      1. LED1 → Pin 3 (with 220Ω resistor)
      2. LED2 → Pin 4 (with 220Ω resistor)
      3. LED3 → Pin 5 (with 220Ω resistor).
  • Use the ESP8266 Wi-Fi module to send data to ThingSpeak and visualize data remotely
    1.  You will also connect its TX and RX pins to the Arduino's RX and TX pins, respectively. The ESP8266 operates at 3.3V, so connecting it directly to 5V can damage it. Here's the wiring:
      1. VCC → 3.3V on Arduino (NOT 5V)
      2. GND → Breadboard negative rail (-)
      3. TX → RX (Pin 0) on Arduino
      4. RX → TX (Pin 1) on Arduino
  • Introduce sleep modes for sensors to save power
  • Use a 7.4V Li-ion batter with a compatible charger and a JST plug connector for rechargeable battery options 

Careers

If you like this project, you might enjoy exploring these related careers:

Career Profile
Just as a potter forms clay, or a steel worker molds molten steel, electrical and electronics engineers gather and shape electricity and use it to make products that transmit power or transmit information. Electrical and electronics engineers may specialize in one of the millions of products that make or use electricity, like cell phones, electric motors, microwaves, medical instruments, airline navigation system, or handheld games. Read more
Career Profile
Shakespeare described humans as a "piece of work," and others have called the body "the most beautiful machine," but like any machine, sometimes body parts need repairs or servicing when the body cannot take care of the problems itself. That's where biomedical engineers come in. They use engineering to solve problems in medicine, such as creating replacement body parts, drug-delivery systems, medical instruments, and test equipment. Their work helps restore health and function, and improves the… Read more
Career Profile
Are you interested in developing cool video game software for computers? Would you like to learn how to make software run faster and more reliably on different kinds of computers and operating systems? Do you like to apply your computer science skills to solve problems? If so, then you might be interested in the career of a computer software engineer. Read more
Home Science Tools®

Contact Us

Our kits are developed in partnership with Home Science Tools®. If you have purchased a kit for this project, Home Science Tools® is pleased to answer any questions.

In your email, please follow these instructions:
  1. Include your Home Science Tools® order number.
  2. Please describe how you need help as thoroughly as possible:

    Examples

    Good Question I'm trying to do Experimental Procedure step #5, "Scrape the insulation from the wire. . ." How do I know when I've scraped enough?
    Good Question I'm at Experimental Procedure step #7, "Move the magnet back and forth . . ." and the LED is not lighting up.
    Bad Question I don't understand the instructions. Help!
    Good Question I am purchasing my materials. Can I substitute a 1N34 diode for the 1N25 diode called for in the material list?
    Bad Question Can I use a different part?

Contact Support

News Feed on This Topic

 
, ,

Cite This Page

General citation information is provided here. Be sure to check the formatting, including capitalization, for the method you are using and update your citation, as needed.

MLA Style

James, Hannah. "Build a Wearable Device Using an Arduino to Keep Astronauts Safe on Mars." Science Buddies, 12 Nov. 2025, https://www.sciencebuddies.org/science-fair-projects/project-ideas/SpaceEx_p053/space-exploration/astronaut-mars-geofencing?from=Blog. Accessed 6 June 2026.

APA Style

James, H. (2025, November 12). Build a Wearable Device Using an Arduino to Keep Astronauts Safe on Mars. Retrieved from https://www.sciencebuddies.org/science-fair-projects/project-ideas/SpaceEx_p053/space-exploration/astronaut-mars-geofencing?from=Blog


Last edit date: 2025-11-12
Top
Free science fair projects.