Tuesday, 19 August 2025

Pulse Oximeter Using Arduino project

                Pulse Oximeter Using Arduino project
                                    by sugantharajan  |18th  august                                                                   

    
       



πŸ“Œ Introduction

Health monitoring devices are becoming more important in daily life, and the pulse oximeter is one of the most widely used. It measures:

  • SpO₂ (Blood Oxygen Saturation)

  • Pulse Rate (Heart Beats per Minute)

In this project, we will build a pulse oximeter using Arduino Uno, MAX30100 sensor, and a 16x2 LED display.

The MAX30100 sensor is specially designed for pulse oximetry. It has two LEDs (red and infrared) and a photodetector to measure how much oxygen is in your blood and your heartbeat rate. However, many MAX30100 modules available online have PCB design errors that cause overheating, unstable readings, or no output. I faced this too — but after fixing the PCB issue, my sensor worked perfectly.

Let’s see how you can build it step by step.


πŸ›  Components Required

To make this project, you need:

  • Arduino Uno

  • MAX30100 Pulse Oximeter Sensor Module

  • 16x2 LED Display (with I2C interface)

  • Jumper Wires

  • Breadboard (optional)

  • USB Cable for Arduino


⚙️ Working Principle

The MAX30100 sensor works on the principle of Photoplethysmography (PPG).

  1. The sensor has Red (660nm) and Infrared (940nm) LEDs.

  2. These lights pass through your fingertip.

  3. Oxygenated blood absorbs more infrared light, while deoxygenated blood absorbs more red light.

  4. A photodiode detects the remaining transmitted/reflected light.

  5. As your heart pumps blood, the light absorption changes with each beat.

  6. The Arduino processes this data to calculate:

    • Pulse Rate (BPM) → from periodic changes in IR absorption.

    • SpO₂ (%) → from the ratio of red to IR absorption.

  7. The results are displayed on the 16x2 LED screen.


πŸ”§ How I Fixed the PCB ErrorπŸ‘‰ To fix it:

  1. Find the small resistor near SDA/SCL lines.

  2. That resistor is connected wrongly to a transistor.

  3. Cut the line (trace) going from the resistor to the transistor.

  4. Then connect the resistor with a small wire to the last pin of the voltage regulator (3.3V output).

  5. After this, the sensor will get the correct voltage and start working properly.


⚠️ In short: Cut wrong line → Join resistor to 3.3V regulator pin → Sensor fixed ✅


πŸ”Œ Circuit Connections

MAX30100 → Arduino Uno

  • VIN → 3.3V

  • GND → GND

  • SDA → A4

  • SCL → A5

16x2 LCD Display (I2C) → Arduino Uno

  • VCC → 5V

  • GND → GND

  • SDA → A4

  • SCL → A5

(Both the sensor and display use the same I2C bus.)


πŸ’» Arduino Code

#include <Wire.h> #include "MAX30100_PulseOximeter.h" #include <LiquidCrystal_I2C.h> #define REPORTING_PERIOD_MS 1000 PulseOximeter pox; LiquidCrystal_I2C lcd(0x27, 16, 2); // Change 0x27 if your LCD uses a different I2C address uint32_t tsLastReport = 0; void onBeatDetected() { Serial.println("Beat detected!"); } void setup() { Serial.begin(9600); // Initialize LCD lcd.init(); lcd.backlight(); lcd.setCursor(0, 0); lcd.print("Pulse Oximeter"); // Initialize MAX30100 if (!pox.begin()) { Serial.println("FAILED to initialize MAX30100"); lcd.setCursor(0, 1); lcd.print("Sensor Error!"); for (;;); } else { Serial.println("MAX30100 Ready"); lcd.setCursor(0, 1); lcd.print("Place Finger"); } pox.setOnBeatDetectedCallback(onBeatDetected); } void loop() { pox.update(); if (millis() - tsLastReport > REPORTING_PERIOD_MS) { float hr = pox.getHeartRate(); float spo2 = pox.getSpO2(); Serial.print("Heart rate: "); Serial.print(hr); Serial.print(" bpm / SpO2: "); Serial.print(spo2); Serial.println(" %"); lcd.clear(); lcd.setCursor(0, 0); lcd.print("HR: "); lcd.print(hr); lcd.print(" BPM"); lcd.setCursor(0, 1); lcd.print("SpO2: "); lcd.print(spo2); lcd.print(" %"); tsLastReport = millis(); } }

πŸ“Š Output

  • The display shows Heart Rate (BPM) and SpO₂ (%).

  • Readings update in real-time.

  • The sensor works accurately once the PCB issue is fixed.


πŸ“‚ Applications

This project can be used for:

  • Personal health monitoring

  • DIY medical devices

  • Student electronics projects

  • IoT-based health systems


✅ Conclusion

In this project, we successfully built a pulse oximeter using Arduino Uno, MAX30100, and a 16x2 LED display.

The biggest challenge was the faulty PCB design in the MAX30100 module, but after fixing it, the sensor worked perfectly. This project is a great way to learn about biomedical sensors, I2C communication, and real-time data display.


πŸ“ž Contact : sugantharajan17@gmail.com

Thursday, 14 August 2025

Automatic Railway Gate System – IoT Based project

       Automatic Railway Gate System – IoT                                Based  Safety Project

                                       by:Sugantharajan | iot project | project no:1

                                                                                                                                                                                                          

                                                                PROJECT IMAGE



                                                                                                                                                                                                             

πŸš€Introduction

Railway crossings are one of the most accident-prone areas, especially in unmanned locations. Manual gate control can lead to human errors and delays. In this project, I have designed an Automatic Railway Gate System using Arduino and IR sensors to enhance safety and efficiency.


                                                                                                                                                                                                             

🧰        Components Used

  • Arduino Uno

  • IR Sensors × 2

  • Servo Motor ×2

  • Jumper Wires

  • Power Supply

                                                                                                                                                                                                             

πŸ“ŸArduino Code


#include <Servo.h>

// Pin definitions
#define IR1_PIN   2    // IR sensor 1
#define IR2_PIN   3    // IR sensor 2
#define SERVO1_PIN 9   // Servo motor 1
#define SERVO2_PIN 10  // Servo motor 2
#define BUZZ_PIN   8   // Buzzer
#define LED_RED    6   // Red LED
#define LED_GRN    7   // Green LED

Servo servo1;
Servo servo2;

bool gateClosed = false;

void setup() {
  pinMode(IR1_PIN, INPUT);
  pinMode(IR2_PIN, INPUT);
  pinMode(BUZZ_PIN, OUTPUT);
  pinMode(LED_RED, OUTPUT);
  pinMode(LED_GRN, OUTPUT);

  servo1.attach(SERVO1_PIN);
  servo2.attach(SERVO2_PIN);

  openGates(); // Start with gates open

  Serial.begin(9600);
}

void loop() {
  int ir1 = digitalRead(IR1_PIN); // LOW means detected
  int ir2 = digitalRead(IR2_PIN);

  // Case 1: Train coming from left to right
  if (ir1 == LOW && !gateClosed) {
    Serial.println("Train detected at Sensor 1 (L→R) - Closing gates");
    closeGates();
    gateClosed = true;
  }
  if (ir2 == LOW && gateClosed) {
    Serial.println("Train passed Sensor 2 (L→R) - Opening gates");
    openGates();
    gateClosed = false;
  }

  // Case 2: Train coming from right to left
  if (ir2 == LOW && !gateClosed) {
    Serial.println("Train detected at Sensor 2 (R→L) - Closing gates");
    closeGates();
    gateClosed = true;
  }
  if (ir1 == LOW && gateClosed) {
    Serial.println("Train passed Sensor 1 (R→L) - Opening gates");
    openGates();
    gateClosed = false;
  }
}

void closeGates() {
  digitalWrite(LED_RED, HIGH);
  digitalWrite(LED_GRN, LOW);

  // Warning buzzer
  for (int i = 0; i < 3; i++) {
    digitalWrite(BUZZ_PIN, HIGH);
    delay(200);
    digitalWrite(BUZZ_PIN, LOW);
    delay(200);
  }

  // Move both servos to closed position
  for (int pos = 0; pos <= 90; pos++) {
    servo1.write(pos);
    servo2.write(pos);
    delay(15);
  }
}

void openGates() {
  digitalWrite(LED_RED, LOW);
  digitalWrite(LED_GRN, HIGH);

  // Move both servos to open position
  for (int pos = 90; pos >= 0; pos--) {
    servo1.write(pos);
    servo2.write(pos);
    delay(15);
  }
}
                                                                                                                                                                                                     

πŸ”Œ Connections


1) IR Sensors
  • IR Sensor 1

    • VCC → 5V

    • GND → GND

    • OUT → D2

  • IR Sensor 2

    • VCC → 5V

    • GND → GND

    • OUT → D3                                                                         

2) Servo Motors 

  • Servo 1

    • Signal (Orange/White) → D9

    • V+ (Red) → 5V 

    • GND (Brown/Black) → GND

  • Servo 2

    • Signal → D10

    • V+ → 5V (same supply as Servo 1)

    • GND → GND

                                                                                                                                                                                               

Advantages

  • Prevents accidents at railway crossings

  • Fully automated, no human operation needed

  • Low-cost and easy to maintain


 Applications

  • Rural & semi-urban railway crossings

  • Smart transport systems

  • Educational automation projects


Contact us. sugantharajan17@gmail.com

Pulse Oximeter Using Arduino project

                    Pulse Oximeter Using Arduino project                                              by sugantharajan  |18th  august      ...