SUMMER STEM-HEALTH CAMP
  • Home
  • 2025 RCC Camp
    • Day 1: Basic Coding >
      • Button Control
      • Multicolor LED
      • Fading multicolor led
      • Melody (sound)
    • Day 2: Servos and Potentiometers >
      • DC Motor
      • Ultrasound
      • Potentiometer and Motors
      • 2 servo control >
        • Analog Stick Control
      • PIR Motion Sensor
      • IR Light Proximity Sensor
    • Day 3 Making an ECG/EKG! >
      • ECG/EKG health lesson
      • OLED Screen Basics
      • Pictures to OLED
      • BPM on OLED
    • Day 4: Measuring Pulse >
      • Scrolling Screen Graph
      • How the body absorbs light
      • Screen Pictures
      • IR Temp Sensor And Screen
    • Day 5: Finishing up/Show >
      • IR Light Proximity Sensor
      • PIR Motion Sensor
      • CO2 Sensor
      • Ultrasound distance sensor
  • The Teachers
  • Our Partners
  • Archive
    • 2024 Health-STEM Coding Camp >
      • Home (2024)
      • The Teachers
      • Day 1: Basics and Lights
    • 2024 Coding/Robotics Camp >
      • Day 1: Basic Coding >
        • Saving your codes
        • Engineering design
      • Day 2 Servos >
        • 2 Servos, one potentiometer
        • Multicolor LED >
          • Fading multicolor led
    • Pictures from prior years
    • 2023 3D Design Camp >
      • Day 1: 2D design
      • Day 2: 3D design basics
      • Day 3: Constraints
    • 2023 Health-STEM Coding Camp >
      • PreAcademy prep
      • Day 1: Basics and Lights >
        • Multicolor LED
        • Button Control
      • Day 2: Ultrasound >
        • Ultrasound Health Lesson
        • Supplement Melody
        • Supplement: Servo >
          • Potentiometer and Motors
          • 2 servo control
      • Day 3: Measuring Pulse >
        • How the body absorbs light
        • OLED Screen Basics >
          • Scrolling Screen Graph
      • Day 4 Making an ECG/EKG! >
        • ECG Health Lesson
        • Pictures to OLED
        • BPM on OLED
      • Day 5: Finishing up/Show
    • 2021 STEM Camp (HS) >
      • The Teachers (2021)
      • PreAcademy prep
      • Day 1: Basics, Lights, and Temperature Sensor >
        • Day 1 Supplement: Measure Temperature
        • Day 1 Supplement: IR Temp Sensor
        • Day 1 Supplement: Identifying Resistors
        • Supplement: Controlling A Servo
      • Day 2: Measuring Pulse >
        • How the body absorbs light
        • IR Light Proximity Sensor
        • PIR Motion Sensor
      • Day 3 Supplement: OLED Screen Basics >
        • Display Screen Temperature
        • Scrolling Screen Graph
      • Day 4: Finishing up/Show
    • 2021 STEM Camp (MS) >
      • PreAcademy prep
      • Day 1: Basics, Lights, and Temperature Sensor >
        • Day 1 Supplement: Identifying Resistors
        • Day 1 Supplement: Measure Temperature
        • Day 1 Supplement: IR Light Proximity Sensor
      • Day 2: Ultrasound >
        • Day 2 Supplement: IR Temp Sensor
        • Day 2 Supplement: Controlling A Servo
      • Day 3: Measuring Pulse
    • 2020 STEM Camp
    • 2018 Lessons
    • 2017 Camp
  • Contact Us!

Day 3:        
Measure Pulse


Disclaimer: The Pulse Sensor you make for this activity should not be used for diagnostic purposes. If at any point you are concerned about your heart rhythm, you should consult your physician.


Materials for this activity:


The Arduino and USB cord
Picture
Several Different LEDs
Picture
All the Resistor Strips
Picture

The Pulse Sensor​
Picture
Wires
Picture
Breadboard
Picture

Buzzer

Picture

What is the Pulse Oximeter Sensor? 

The pulse sensor is just a Red light, an IR light, and a photodetector. The sensor is measuring how much of the light is penetrating your finger. 
Picture
Picture
Picture

Measuring the Heart Beat

Here is a video that shows a similar sensor to what you will build. This way, you know what to expect. We will use a sensor to get a plot of our heartbeat. Specifically, the sensor measures the IR light going through/off your skin. As blood pumps, this value changes. 

Measuring Pulse

Pulse is one of the simplest and main resources healthcare professionals can use to know if something is wrong with you. This activity will help you learn basic Arduino wiring, how to read data from a sensor, and how to get information to display on your computer monitor. ​
​
Before we write the code, we need to get the library that runs the SpO2 sensor. 
In Arduino IDE:
  1. Go to Sketch -> Include Library -> Manage Libraries
  2. Type in “max3010x” into the search box
  3. Install/Download the “Sparkfun MAX3010x Pulse and Proximity Sensor Library”
Picture
Now we are ready to wire and code the sensor. ​

What is the Pulse Sensor? 

How to Wire the MAX Pulse Sensor

The pulse sensor is just a Red light, an IR light, and a photodetector. 

Flip over your sensor and find the 4 prong labels (Vin, SDA, SCL, GND). You will also need 4 wires to connect the sensor to the Arduino. Use the picture here to help. 
Vin (volts in) to the 5V Arduino pin 
GND (ground) to the GND Arduino pin
​SDA to the Arduino A4 pin
SCL to the Arduino A5 pin​
Picture
Picture

Coding for the Pulse Sensor

Picture

Here is Mr. Dorsey explaining the sensor and code


Verify and Upload the Code to the Arduino 

After you upload the code to the board successfully, open up your serial monitor to see if it is giving your readings. 

Seeing your pulse data. Serial Plotter

Now, let's learn how to see a graph of your pulse data! Go to Tools and select Serial Plotter.

You will have to wait about 10 seconds for the graph to zoom in on the data. 

Picture
Here is a screenshot of Mr. Dorsey's data from the serial plotter.
​
Here are some tips to get a good reading. 
1) Use your thumb, it is bigger and has more blood flow
2) Do not push down too hard on the sensor (that would restrict blood flow) 
Picture
Hopefully, you got the sensor to give a reading! If you didn't, ask for help.

For this graph, the reading is how much IR light it is getting reflected back into the sensor. The value increases as blood loses oxygen and decreases when it has more oxygen. Darker blood is less oxygenated blood. 


Light blinks when your heart beats

In this activity, we will turn on a light every time your heart beats. In order to do this, you need to set a "threshold value". That means a limit. The light is kept on whenever your sensor gets a reading below that point and the graph goes below that point. If it is outside that value, the light will be off. For my above graph, you can see that the graph goes between 104,100 and 103,500. It quickly drops down to the 103,500 value when my heart beats. Your value will be different, so you need to look at your graph to pick this number. 
Picture
Picture

Calculating BPM

We can use this sensor's data to calculate your heart's beats per minute (BPM). That code has a lot of math and uses arrays(matrices), so we are not going to have you type this one out yourself. Here is a link to that Arduino file. Open this file on your computer and compile it. Open your serial monitor and see if it works. 
heartrate_serial.ino
File Size: 2 kb
File Type: ino
Download File

If your sensor is powered correctly, you should see a little red light on it. If you do, put your thumb over the sensor and keep it there. After several seconds, it should level out your BMP reading. 
Picture

This lesson is inspired by
https://how2electronics.com/blood-oxygen-heart-rate-monitor-max30100-arduino/​
https://lastminuteengineers.com/max30102-pulse-oximeter-heart-rate-sensor-arduino-tutorial/​
Proudly powered by Weebly
  • Home
  • 2025 RCC Camp
    • Day 1: Basic Coding >
      • Button Control
      • Multicolor LED
      • Fading multicolor led
      • Melody (sound)
    • Day 2: Servos and Potentiometers >
      • DC Motor
      • Ultrasound
      • Potentiometer and Motors
      • 2 servo control >
        • Analog Stick Control
      • PIR Motion Sensor
      • IR Light Proximity Sensor
    • Day 3 Making an ECG/EKG! >
      • ECG/EKG health lesson
      • OLED Screen Basics
      • Pictures to OLED
      • BPM on OLED
    • Day 4: Measuring Pulse >
      • Scrolling Screen Graph
      • How the body absorbs light
      • Screen Pictures
      • IR Temp Sensor And Screen
    • Day 5: Finishing up/Show >
      • IR Light Proximity Sensor
      • PIR Motion Sensor
      • CO2 Sensor
      • Ultrasound distance sensor
  • The Teachers
  • Our Partners
  • Archive
    • 2024 Health-STEM Coding Camp >
      • Home (2024)
      • The Teachers
      • Day 1: Basics and Lights
    • 2024 Coding/Robotics Camp >
      • Day 1: Basic Coding >
        • Saving your codes
        • Engineering design
      • Day 2 Servos >
        • 2 Servos, one potentiometer
        • Multicolor LED >
          • Fading multicolor led
    • Pictures from prior years
    • 2023 3D Design Camp >
      • Day 1: 2D design
      • Day 2: 3D design basics
      • Day 3: Constraints
    • 2023 Health-STEM Coding Camp >
      • PreAcademy prep
      • Day 1: Basics and Lights >
        • Multicolor LED
        • Button Control
      • Day 2: Ultrasound >
        • Ultrasound Health Lesson
        • Supplement Melody
        • Supplement: Servo >
          • Potentiometer and Motors
          • 2 servo control
      • Day 3: Measuring Pulse >
        • How the body absorbs light
        • OLED Screen Basics >
          • Scrolling Screen Graph
      • Day 4 Making an ECG/EKG! >
        • ECG Health Lesson
        • Pictures to OLED
        • BPM on OLED
      • Day 5: Finishing up/Show
    • 2021 STEM Camp (HS) >
      • The Teachers (2021)
      • PreAcademy prep
      • Day 1: Basics, Lights, and Temperature Sensor >
        • Day 1 Supplement: Measure Temperature
        • Day 1 Supplement: IR Temp Sensor
        • Day 1 Supplement: Identifying Resistors
        • Supplement: Controlling A Servo
      • Day 2: Measuring Pulse >
        • How the body absorbs light
        • IR Light Proximity Sensor
        • PIR Motion Sensor
      • Day 3 Supplement: OLED Screen Basics >
        • Display Screen Temperature
        • Scrolling Screen Graph
      • Day 4: Finishing up/Show
    • 2021 STEM Camp (MS) >
      • PreAcademy prep
      • Day 1: Basics, Lights, and Temperature Sensor >
        • Day 1 Supplement: Identifying Resistors
        • Day 1 Supplement: Measure Temperature
        • Day 1 Supplement: IR Light Proximity Sensor
      • Day 2: Ultrasound >
        • Day 2 Supplement: IR Temp Sensor
        • Day 2 Supplement: Controlling A Servo
      • Day 3: Measuring Pulse
    • 2020 STEM Camp
    • 2018 Lessons
    • 2017 Camp
  • Contact Us!