The project is a combination of a heart rate sensor, a temperature and humidity sensor, and an LCD screen. The GY-MAX30102 heart rate sensor uses photoplethysmography - shining light on the skin to measure the perfusion of the blood in an artery - to measure a person's heart rate in beats per minute (BMP) and the level of Oxygen in blood SPO2 in percentage (%). The BMP 280 sensor measures temperature and humidity in the room. The data generated from both sensors are displayed on an LCD 2.8" screen for the person using the device to see them.
My college life inspired me to create this project. As someone who's not used to Houston's weather and high level of humidity, I always wanted a way to measure temperature and humidity inside my room so that I can see if my AC is displaying the right temperature or not. Moreover, given the level of academic stress that college students go through, I thought it would be useful to have an accessible heart rate sensor to monitor how stress is affecting my heart beats.
Building the Project:To build this project, we have two main components: wiring and code.
1. wiring:
First we need to connect the sensors and the screen to the pocket beagle as shown in the image below
You may find this photo of the pocketbeagle pins useful:
We can start wiring the SPI screen. First you need to solder bridge IM1, IM2, and IM3 on the back of the screen as indicated in the photo below. Then to connect the screen to the pocket beagle follow this matching:
For both sensors, they are I2C devices, so you can connect them this way:- GND: connect it to the minus of the breadboard that's connected to GND (P2_21)
- VIN: connect it to the plus of the breadboard that's connected to GND (P2_23)
- SCL: I2C1. SCL (P2_9)
- SDA: I2C1. SDA (P2_11)
Don't forget to connect a 10k Ohm pull-up resistor to each of the SCL and SDA connections.
2. Coding Overview:
Several libraries need to be installed for this project to function. All of the instructions assume a sufficiently updated Debian image is being used on your PocketBeagle. For guides on connecting to the internet and similar, refer to beagleboard.com.
Run the following commands on your Cloud9 workspace to install all the required libraries:
sudo apt-get update
For SPI Screen:
sudo apt install libjpeg-dev zlib1g-dev
sudo pip3 install --upgrade Pillow
sudo pip3 install adafruit-circuitpython-busdevice
sudo pip3 install adafruit-circuitpython-rgb-display
sudo apt-get install ttf-dejavu -y
sudo apt-get install libopenjp2-7
For I2C sensors:
sudo apt-get install i2c-tools
For BMP280:
sudo pip3 install adafruit-circuitpython-bmp280
For GY-MAX30102:
sudo apt install python-numpy
Note: To check if your IC2 devices are connected to the pocketbeagle you can run the command line i2cdetect -r -y 1
Throughout the project I had hard time finding a working python library for the MAX30102 sensor. I have tried more than 5 libraries, but in vain. However, I recently found one that is the closest to the sensor I have. Therefore, my next step would be to try to use this library to populate the function max30102_read()
and be able to read heart rate and oxygen level from the sensor. This is the link to the GitHub repository where the library is:
https://github.com/doug-burrell/max30102
Moreover, I have recently created a custom PCB for this project which contains all the needed components:
https://github.com/HamzaShili65/ENGI301/tree/main/Project2
I would like to extend my sincere thanks to Dr. Welsh for being very supportive and understanding, for helping me throughout the project, and for giving me the opportunity to learn valuable skills in the field of electrical engineering.
Comments