---
title: Heart Rate Monitor
description: Students design and build a heart rate monitor using the gator:particle sensor, micro:bit, and gator:bit.
---

[STEAM Activities](https://activities.sparkfuneducation.com)

# [Heart Rate Monitor](https://activities.sparkfuneducation.com/heart-rate-monitor)

 Written by [Alexandra Gendreau Chakarov](https://activities.sparkfuneducation.com/author/alexandra-gendreau-chakarov) | Oct 10, 2019 7:25:16 PM

 

**Activity Name:**

Heart Rate Monitor

**Grade Level:**

The activity is targeted for grade 7, but could work for grades 5 to 8.

**Time Required:**

120 minutes (approximately 2 class periods)

**Expendable Cost:**

None

**Group Size:**

Work in pairs

**Subject area:**

science, technology

 

**Summary:**

Students design and build a heart rate monitor using the gator:particle sensor, micro:bit, and gator:bit. Students explore how they can raise and lower their heart rate through different activities and what that means for how hard their heart is working. Students augment their heart rate monitor with additional signals such as when their heart rate reaches different thresholds. This can work in a life science unit looking at anatomy and physiology, a physical education class looking to integration computation, or in a STEM class where students build wearable technology.

 

**Keywords**:

micro:bit, heart rate, physical activity, sensors, middle school, coding

 

**Educational Standards:**

*ISTE*

- Computational Thinker 5b 
    - Students collect data or identify relevant data sets, use digital tools to analyze them, and represent data in various ways to facilitate problem-solving and decision-making.

*NGSS*

- MS-LS1-3: Use argument supported by evidence for how the body is a system of interacting subsystems composed of groups of cells.
- SEP 3: Planning and Carrying Out Investigations 
    - MS-PS2-2: Plan an investigation to provide evidence that the change in an object’s motion depends on the sum of the forces on the object and the mass of the object.

**Prerequisite Knowledge:**

Students should have some experience programming the micro:bit. Provided they have worked through some of the tutorials on the [MakeCode website](https://makecode.microbit.org/) they should be able to complete the activity.

 

**Learning Objectives:**

1. Students make the connection through an investigation that their heart works harder when their body is working through physical activity and their emotions (i.e. being anxious for a test causes their heart rate to rise).
2. During the investigation students collect and display the relevant heart rate information using numbers, sounds, and lights.

**Materials List:**

- micro:bit
- USB cord
- Power supply (micro:bit battery pack should be sufficient)
- SparkFun gator:bit
- gator:particle
- 4 alligator clips
- Computer or tablet capable of flashing code to micro:bit

 

**Introduction / Motivation:**

*\[Download an app on your smartphone and/or use your fitness watch, really anything that can track your heart rate\]*. How many of you have ever checked your pulse in gym class? Have you ever wondered why sometimes it feels like your heart is racing? Why do you think it was happening? *\[Hopefully at least a few students will be in agreement, offer up some anecdotes\].* Well that’s one of the things I use my smart watch for. It lets me monitor my heart rate (how many times my heart beats per minute) and see how it changes throughout the day. What do you think happens to your heart rate throughout the day? *\[some possible students responses… stays the same, goes up if I have a test, goes up when I walk home, goes down I sleep at night\].* We can actually build our own heart rate monitor and figure out what is happening.

 

**Procedure:**

*Background*

Make sure you are familiar with the different capabilities of the gator:bit and micro:bit. The main ones to focus on here are the different ways to represent information using the 5 LEDS on the gator:bit controlled by pin P12, the speaker controlled by pin P0, and the 25 LEDs on the micro:bit itself (see *Figure 1*). In addition, make sure you are familiar with the [gator:particle](https://learn.sparkfun.com/tutorials/sparkfun-gatorparticle-hookup-guide/all) sensor and how to wire it (see *Figure 2*). There are three blocks for controlling the gator:particle (see *Figure 3*). The main thing to remember is to ***connect the ground wire first to prevent any incomplete circuits***. Incomplete circuits can cause parts of the system to heat up.

*Figure 1: Ways to use the gator:bit/micro:bit to represent information.*

 

|   |  |
| --- | --- |

*Figure 2: Wiring diagram for the gator:particle and an actual picture of the wiring.*

 

*Before the Activity*

- Separate all the materials so that each group has all the parts they need.  
  (I recommend printing out the wiring guidelines in this)
- Write up the URLs for the tutorial on big stickies, whiteboard, share them on Google Classroom, etc.
- Print the [gator:particle sensor activity sheet](https://activities.sparkfuneducation.com/hubfs/EDU/Activities/2019/Heart%20Rate%20Monitor/Heart%20Rate%20Monitor%20Activity%20Sheet.pdf) that guides students through the activity

 

*With the Students*

1. Divide the class into pairs and make sure each pair has a set of the materials
2. The first step is to wire the sensor so students can start taking measurements. Have students wire their gator:particle using the wiring diagram in *Figure 2.*
3. Confirm that students have wired the sensor correctly by having them share their wiring configuration with another pair of students.
4. The first project that students will code gets them familiar with the heart rate sensor. They display the heart rate on the micro:bit and have the 5 LEDS on the gator:bit blink according to their heart rate. Students can achieve this by pausing for the length of time equal to the heart rate (i.e. if my heart rate is 70 then I pause for 70 milliseconds for each blink).
5. For more experienced coders, they can create a new project on [MakeCode](https://makecode.microbit.org/) and import the sensor library by going to Extensions and searching for [this repository](https://github.com/sparkfun/pxt-gator-particle) (see *Figure 4*). For students who are less experienced, they can start with [this tutorial](https://makecode.microbit.org/#editor) that imports the libraries and the blocks they need for them.

 

|   |  |   |   |
| --- | --- | --- | --- |

*Figure 4: Sequence of moves in MakeCode to add the gator:particle.*

1. Once students have their initial program coded, they should test it out to see what they can do to make their heart rate change. Encourage them to sit still and take some deep breaths, run up and down the hallway and then check, etc. To test, it is important that you place the sensor against your skin with the highlighted portion in *Figure 5* touching your skin. It works the best when you place your finger tip over this part. See [this video](https://youtu.be/9aav-tfChUc) for a working example. This is the [MakeCode project](https://makecode.microbit.org/52589-82487-45783-30052) for the example.

*Figure 5: The actual sensing part of the sensor. Place your finger tip over this for the most accurate readings.*

1. Bring the class together and have them list the different activities they did and how that affected their heart rate. Do you think it would be useful to get alerts if your heart rate gets low or high?
2. Students get to design their own heart rate monitoring system. If students are familiar with the different options for display on the gator:bit and micro:bit, they can proceed to making a design plan.
3. Show students the different options they have for creating their heart rate alert system. This can be done by showing one you created yourself or just illustrate the different features on the gator:bit/micro:bit as shown in *Figure 1*.
4. Before students start to code their heart rate monitoring system, they need to make a design plan. Use the activity sheet for students to plan their design.
5. Now students code their design. Again experienced students can create a new project on [MakeCode](https://makecode.microbit.org/) and import the gator:particle library by going to Extensions and searching for [this repository](https://github.com/sparkfun/pxt-gator-particle) (see *Figure 4*). If students want to use the LEDs on the gator:bit they should import the neopixel library (see *Figure 6*). For less experienced students and students who need extra help, they can use [this tutorial](https://makecode.microbit.org/#) which imports the necessary libraries and gives them a set of blocks to work with. This is the [MakeCode Project](https://makecode.microbit.org/11446-55486-73424-50236) for an example solution.

 

|  |  |   |
| --- | --- | --- |

*Figure 6: Sequence of moves in MakeCode to add the neopixel library*

1. Once students complete their programs, have them test it out.
2. Students conduct design share outs where they explain their design choices. It is important here for students to actually interact with each other’s designs and see if they work on other people. Some suggested strategies for doing this are:
3. After seeing each other’s designs, have students answer the last question on the activity sheet. These questions help them think about how their design changes depending on the context.
4. Finish with a brief, whole class discussion on struggles the students had completing the tasks and how they overcame them.

**Troubleshooting Tips:**

- Coding
- gator:particle
- Wiring
- Displays

**Going Further:**

- Since individual data points can be incorrect, have students take three consecutive measurements and compute the average.
- Have the students send their heart rate over the radio to a partner. Have the partner guess the activity they are doing.

[View full post](https://activities.sparkfuneducation.com/heart-rate-monitor)

```json
{
  "@context" : "http://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Alexandra Gendreau Chakarov"
  },
  "dateModified" : "2019-10-14T16:22:47.314Z",
  "datePublished" : "2019-10-10T19:25:16Z",
  "headline" : "Heart Rate Monitor",
  "image" : {
    "@type" : "ImageObject",
    "height" : 600,
    "url" : "https://cdn2.hubspot.net/hubfs/2224003/EDU/Activities/2019/Lights%20and%20Music/Figure%202.b.jpg",
    "width" : 800
  },
  "mainEntityOfPage" : "https://activities.sparkfuneducation.com/heart-rate-monitor",
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "height" : 60,
      "url" : "/hs/hsstatic/content_shared_assets/static-1.4092/img/default-amp-logo.png",
      "width" : 60
    },
    "name" : "Activities for the STEAM Classroom"
  }
}
```