Jump to main content

Make a Medical Alert Fall Detector

1
2
3
4
5
62 reviews

Abstract

Have you ever wondered what someone would do if they fell, got hurt, and could not get up on their own? What if they were home alone and could not reach a phone to call for help? Or, what if they lost consciousness - is there any way to automatically detect that they fell and needed help? In this project, you will program your own fall detector, a device that can automatically detect when someone has fallen over, then sound an alarm or even send a message to someone else. Devices like these are used by many people with a variety of medical conditions - in this project, you will get to make your own and learn about how they work!

Summary

Areas of Science
Difficulty
Method
Time Required
Short (2-5 days)
Prerequisites

None

Material Availability

This project requires a micro:bit and a computer with an internet connection and a USB port. See materials list for details.

Cost
Low ($20 - $50)
Safety

No issues

Credits
Science Buddies is committed to creating content authored by scientists and educators. Learn more about our process and how we use AI.

Objective

Program a medical alert fall detector device to automatically detect a fall and sound an alarm to alert others.

Introduction

Have you ever wondered how motion controls in video game controllers work? Or how a phone knows to automatically rotate the screen if you turn it sideways? These devices use an electronic sensor called an accelerometer. There are many different types of sensors that can measure all sorts of things, like sound, temperature, and light. Accelerometers measure acceleration, which is a change in speed. That is how a video game controller can detect when you shake it. Accelerometers can also detect which direction gravity is pointing, which helps devices tell which way is up and which way is down. That is how your phone knows to rotate the screen if you turn it sideways!

Accelerometers have other uses too. Think again about the question in the abstract. How could you automatically detect if someone has fallen over? By using an accelerometer! Accelerometers can detect both sudden changes in motion (like the impact of hitting the floor) and orientation (the difference between standing up and lying down). Devices that can automatically detect when someone falls are called fall detectors or fall monitors. More generally, a medical alert device or medical alarm can monitor other things, like whether a person's heart rate or breathing rate has dropped too low, if they have not moved for a certain period of time, or their location (using GPS). Many devices also have a button the person can push to summon help (for example, by calling a family member or 911) and voice communication abilities. These wearable devices can take different forms, like necklaces or bracelets (Figure 1).

Figure 1. Left: a medical alert necklace. Right: a medical alert bracelet.

In this project, you will use a pocket-sized programmable computer called a micro:bit to make a medical alert fall detector (note that technically it is "micro:bit" with a colon in the middle, not "microbit"). The micro:bit has many built-in sensors, including an accelerometer. It uses the accelerometer to measure pitch and roll angles (Figure 2). This lets you write code that does something when the micro:bit tips past a certain angle. 

Figure 2. Definitions of micro:bit pitch and roll angles.

The micro:bit has other features like buttons, a grid of LEDs (tiny lights), a speaker, and it can even send messages to another micro:bit. The project's procedure will show you how to build a very basic fall detector that detects when the micro:bit tips over, but you can decide what other features you want to use!

Terms and Concepts

Questions

Bibliography

Materials and Equipment

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.
  1. If this is your first time using a micro:bit, follow the Getting Started instructions on the micro:bit website to learn how to use your micro:bit and connect it to your computer. 
  2. Decide what programming language you will use for your micro:bit:
    1. If you are new to coding, we recommend using Microsoft MakeCode to program your micro:bit. MakeCode is a graphical programming language where you make computer programs using colored blocks of code instead of a text editor. The example code in this procedure uses MakeCode. We recommend following a few of the MakeCode tutorials before you proceed.
    2. You can also program your micro:bit in Python, JavaScript, and Scratch. You may prefer this approach if you already have programming experience in one of these languages. See the Let's Code page for more details.
  3. Start a new MakeCode program and make the code shown in Figure 3. You can also access the program on the MakeCode website here. This program will make the micro:bit display a smiley face when it is standing upright and a frowning face when lying flat (Figure 4).
  4. Download the program to your micro:bit and test it yourself:
    1. Stand the micro:bit upright on its front edge as shown in the left side of Figure 4. In this position, the pitch angle is 90 degrees. What does the micro:bit display?
    2. Lay the micro:bit flat with the LEDs facing up. In this position, the pitch angle is zero degrees. What does the micro:bit display?
    3. Tilt the micro:bit forward so the LEDs are facing down (hold it up in the air so you can see the LEDs). In this position, the pitch angle is 180 degrees. What does the micro:bit display?
Figure 3. Example program.
Figure 4. Example code running on the micro:bit.
  1. Look at the code so you can understand how it works. The key to this program is an if/else statement. The code tells the micro:bit "IF the pitch angle is outside of a certain range, show a frowny face. ELSE, show a happy face." The condition for the if statement will be true if the pitch variable is less than the angle1 variable OR if the pitch variable is greater than the angle2 variable. That way, when the micro:bit is "vertical," it will show a smiley face. When it "falls over" (either forward or backward), it will show a frowny face. 
  2. Try changing the angle1 and angle2 variables and re-downloading the code. What happens if you make the angles bigger? Smaller? What values do you think will work the best for a fall detector if a person is wearing the micro:bit, for example, in their pocket or clipped to a belt?
  3. Now it is time to use the engineering design process to design your own fall detector. There is no "right" or "wrong" way to do this, but here are some suggestions for features you could add:
    1. Program a "help" button using the on button A pressed block under Input in the MakeCode menu.
    2. Make the micro:bit play a sound in addition to displaying something with the LEDs.
    3. Experiment with the on shake block under Input. This block lets you detect a variety of motions using the accelerometer (you can change them using the drop-down menu). Do any of these make sense to use as part of a fall detector?
    4. Try using the on loud sound block. Does this block work to detect loud sounds like a person falling or yelling for help?
    5. See the Variations section for some more advanced suggestions.
  4. Try some real-world testing of your fall detector.
    1. Use the battery pack that came with your micro:bit so it does not need to be plugged into a USB cable.
    2. Try wearing your micro:bit yourself or asking a volunteer. You will need to figure out how to attach it to a person's clothing or have them put it in a pocket. 
    3. Try some (gentle!) practice falls onto something soft like a couch or pile of pillows. Does your fall detector detect the falls? If not, are there things you can change in your code, like the values of the angle1 and angle2 variables, or other conditions you have set?
  5. Try iteratively testing and improving your fall detector based on the results of your tests. 

    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 Good Health and Well-Being: Ensure healthy lives and promote well-being for all at all ages.

    Variations

    • You can use your micro:bit to send messages to another micro:bit. Can you program your micro:bit to automatically send a "help" message when a fall is detected? See the secure messaging and Micro Chat tutorials on the micro:bit website.
    • The example code in this project only uses the pitch angle. What if someone falls sideways? Can you incorporate the roll angle into your code? What combination of pitch and roll angles indicates that someone is standing upright and not fallen over? It can be helpful to monitor the pitch and roll angles using the serial write numbers block under Advanced/Serial.
    • One problem with the example code in this project is that it will immediately detect a "fall" if the micro:bit tips over. This can result in "false positives" — for example, what if someone is wearing the micro:bit, bends over to pick something up, then immediately stands back up? Can you write a program to wait and detect if a person is standing again before sounding an alarm?
    • Can you write a program that will sound an alarm if a person has not moved for a certain amount of time? 

    Careers

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

    Career Profile
    If you are injured in an accident, suffer a stroke, heart attack, or loss of a limb, or are born with conditions that make it difficult to move your body, then you will often be cared for by a physical therapist. Physical therapists review a patient's medical history, test and measure his or her physical condition (things like range of motion, strength, flexibility, balance, coordination, muscle function), and then develop a treatment plan to meet some physical goals. They coach, motivate, and… 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
    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
    Think of all the things you do as you go about your day, like putting on your shoes, buttoning your shirt, turning on a faucet, typing on a keyboard, going grocery shopping, picking up laundry, making a sandwich, or using a spoon. Now imagine trying to maintain your independence if an injury or illness made it difficult for you to use your hands, move your arms, or even walk. Occupational therapists are the healthcare providers who help people regain independence by developing or restoring… Read more

    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

    Finio, Ben. "Make a Medical Alert Fall Detector." Science Buddies, 2 Oct. 2024, https://www.sciencebuddies.org/science-fair-projects/project-ideas/CompSci_p074/computer-science/medical-alert-fall-detector. Accessed 10 June 2026.

    APA Style

    Finio, B. (2024, October 2). Make a Medical Alert Fall Detector. Retrieved from https://www.sciencebuddies.org/science-fair-projects/project-ideas/CompSci_p074/computer-science/medical-alert-fall-detector


    Last edit date: 2024-10-02
    Top
    Free science fair projects.