Arduino-Based Health Monitoring System with OLED Display and MAX30102 Sensor
View and Edit Project In Cirkit Designer
Health Monitoring System (Wearable) Documentation
Summary
This document provides a detailed overview of a health monitoring system designed to measure heart rate and display the data on an OLED screen. The system uses an Arduino UNO microcontroller, a MAX30102 heart rate and oxygen sensor, and a 0.96" OLED display. The components are interconnected to facilitate data acquisition and display.
Component List
0.96" OLED
- Description: OLED display used to show real-time health data.
- Pins: GND, VDD, SCK, SDA
MAX30102 Heart Rate and Oxygen Sensor
- Description: Sensor used to measure heart rate and oxygen levels.
- Pins: VIN, SCL, SDA, INT, IRQ, RD, GND
Arduino UNO
- Description: Microcontroller used to control the system and process data.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
Wiring Details
0.96" OLED
- GND: Connected to Arduino UNO GND
- VDD: Connected to Arduino UNO 3.3V
- SCK: Connected to Arduino UNO D1
- SDA: Connected to Arduino UNO D2
MAX30102 Heart Rate and Oxygen Sensor
- VIN: Connected to Arduino UNO 3.3V
- SCL: Connected to Arduino UNO D1
- SDA: Connected to Arduino UNO D2
- INT: Connected to Arduino UNO D0
- GND: Connected to Arduino UNO GND
Arduino UNO
- GND: Connected to 0.96" OLED GND and MAX30102 GND
- 3.3V: Connected to 0.96" OLED VDD and MAX30102 VIN
- D1: Connected to 0.96" OLED SCK and MAX30102 SCL
- D2: Connected to 0.96" OLED SDA and MAX30102 SDA
- D0: Connected to MAX30102 INT
Code Documentation
/*
* Health Monitoring System (Wearable)
* Objective: Create a basic health monitoring system that measures heart rate
* and temperature.
* Components: Arduino, heart rate sensor, temperature sensor, OLED display.
* Description:
* Use the heart rate sensor to measure the user's pulse and the temperature
* sensor to record body temperature.
* Display real-time health data on the OLED screen.
*/
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <SparkFun_MAX3010x.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
MAX30105 particleSensor;
void setup() {
Serial.begin(115200);
Wire.begin();
if (!display.begin(SSD1306_I2C_ADDRESS, OLED_RESET)) {
Serial.println(F("SSD1306 allocation failed"));
for (;;);
}
display.display();
delay(2000);
display.clearDisplay();
if (!particleSensor.begin(Wire, I2C_SPEED_FAST)) {
Serial.println(F("MAX30105 was not found. Please check wiring/power."));
for (;;);
}
particleSensor.setup();
particleSensor.setPulseAmplitudeRed(0x0A);
particleSensor.setPulseAmplitudeGreen(0);
}
void loop() {
long irValue = particleSensor.getIR();
if (irValue > 50000) {
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.setCursor(0, 0);
display.print(F("Heart Rate: "));
display.print(irValue);
display.display();
}
delay(1000);
}
This code initializes the OLED display and the MAX30102 sensor, then continuously reads the heart rate data and displays it on the OLED screen. The system is designed to provide real-time health monitoring in a wearable format.