Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

Arduino UNO Based Health Monitoring System with GSM Reporting

Image of Arduino UNO Based Health Monitoring System with GSM Reporting

Circuit Documentation

Summary

The circuit is designed to monitor various health parameters using an array of sensors, including a GSR sensor, an AD8232 heart rate monitor, a DFRobot DHT22 temperature and humidity sensor, a Myoware 2.0 muscle sensor, and a SIM800L GSM module for communication. The Arduino UNO serves as the central microcontroller, interfacing with the sensors and controlling a relay module, a buzzer, and an LED indicator. The data collected from the sensors is displayed on a 16x2 I2C LCD and can be sent via SMS using the GSM module. The circuit is powered by a 12V power supply, with the Arduino regulating the voltage for the other components.

Component List

  • Arduino UNO: A microcontroller board based on the ATmega328P, featuring digital and analog I/O pins.
  • GSR SENSOR: A sensor for measuring galvanic skin response, which can be an indicator of stress or emotional arousal.
  • AD8232 Heart Rate Monitor: A cost-effective board used to measure the electrical activity of the heart.
  • DFRobot DHT22 Temperature & Humidity Sensor V2: A sensor for measuring ambient temperature and humidity.
  • 16x2 I2C LCD: A liquid crystal display that can show 16 characters per line on 2 lines, with an I2C interface for communication.
  • SIM800L: A GSM/GPRS module that allows for SMS and voice communication.
  • 12V Power Supply: Provides the necessary power to the circuit.
  • Myoware 2.0 Muscle Sensor: A sensor that measures muscle activity.
  • RELAY MODULE: An electrically operated switch that allows for controlling high power devices.
  • Buzzer Module: An electronic sounder that can be used for alerts or alarms.
  • LED: Two Pin (red): A basic red LED for indication purposes.
  • Resistor: A 220 Ohm resistor, typically used for current limiting in LED circuits.

Wiring Details

Arduino UNO

  • 5V: Powers the 16x2 I2C LCD, SIM800L, Buzzer Module, DFRobot DHT22 Sensor, and RELAY MODULE.
  • 3.3V: Powers the AD8232 Heart Rate Monitor and Myoware 2.0 Muscle Sensor.
  • GND: Common ground for all components.
  • Vin: Connected to the positive terminal of the 12V power supply.
  • A0: Receives analog input from the GSR SENSOR.
  • A1: Receives analog input from the AD8232 Heart Rate Monitor.
  • A2: Connected to the SDA pin of the 16x2 I2C LCD for data communication.
  • A3: Connected to the SCL pin of the 16x2 I2C LCD for clock communication.
  • A5: Receives analog input from the Myoware 2.0 Muscle Sensor.
  • D11: Connected to the TXD pin of the SIM800L for serial communication.
  • D10: Connected to the RXD pin of the SIM800L for serial communication.
  • D9: Connected to one end of the 220 Ohm resistor.
  • D8: Connected to the I/O pin of the Buzzer Module.
  • D7: Connected to the INPUT pin of the RELAY MODULE.
  • D2: Connected to the Signal pin of the DFRobot DHT22 Sensor.

GSR SENSOR

  • OUT: Connected to the A0 pin on the Arduino UNO.

AD8232 Heart Rate Monitor

  • OUTPUT: Connected to the A1 pin on the Arduino UNO.

DFRobot DHT22 Temperature & Humidity Sensor V2

  • Signal: Connected to the D2 pin on the Arduino UNO.

16x2 I2C LCD

  • SDA: Connected to the A2 pin on the Arduino UNO.
  • SCL: Connected to the A3 pin on the Arduino UNO.

SIM800L

  • TXD: Connected to the D11 pin on the Arduino UNO.
  • RXD: Connected to the D10 pin on the Arduino UNO.

Myoware 2.0 Muscle Sensor

  • ENV: Connected to the A5 pin on the Arduino UNO.

RELAY MODULE

  • INPUT: Connected to the D7 pin on the Arduino UNO.

Buzzer Module

  • I/O: Connected to the D8 pin on the Arduino UNO.

LED: Two Pin (red)

  • anode: Connected to the other end of the 220 Ohm resistor.
  • cathode: Connected to the common ground.

Resistor

  • pin1: Connected to the D9 pin on the Arduino UNO.
  • pin2: Connected to the anode of the red LED.

Documented Code

#include <DHT.h>
#include <LiquidCrystal_I2C.h>
#include <SoftwareSerial.h>

// Pin Definitions
const int gsrPin = A0;         // GSR Sensor
const int ecgPin = A1;         // ECG Sensor
const int dhtPin = 2;          // DHT22
const int emgPin = A5;         // EMG Sensor
const int relayPin = 7;        // Relay for steam generator
const int buzzerPin = 8;       // Buzzer
const int ledPin = 9;          // Red LED

// GSM Module Pins
SoftwareSerial gsmSerial(10, 11); // RX, TX

// DHT Sensor Initialization
DHT dht(dhtPin, DHT22);

// LCD Display Initialization
LiquidCrystal_I2C lcd(0x27, 16, 2);

// Timing Variables
unsigned long startTime;
const unsigned long maxDuration = 20 * 60 * 1000; // 20 minutes
const unsigned long alertTime = 15 * 60 * 1000;   // 15 minutes

void setup() {
  Serial.begin(9600);
  gsmSerial.begin(9600);
  dht.begin();
  pinMode(relayPin, OUTPUT);
  pinMode(buzzerPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
  digitalWrite(relayPin, LOW); // Turn off steam generator
  digitalWrite(buzzerPin, LOW); // Turn off buzzer
  digitalWrite(ledPin, LOW);    // Turn off LED
  lcd.begin(16, 2); // Initialize the LCD with 16 columns and 2 rows
  lcd.backlight();
  startTime = millis();
}

void loop() {
  unsigned long currentTime = millis();
  if (currentTime - startTime >= maxDuration) {
    digitalWrite(relayPin, LOW); // Turn off steam generator
    return; // Stop the loop after 20 minutes
  }
  if (currentTime - startTime >= alertTime) {
    digitalWrite(buzzerPin, HIGH); // Turn on buzzer
  }
  // Read Sensors
  int gsrValue = analogRead(gsrPin);
  int ecgValue = analogRead(ecgPin);
  float temperature = dht.readTemperature();
  int emgValue = analogRead(emgPin); // Read EMG sensor
  // Control Steam Generator based on Temperature
  if (temperature < 40) {
    digitalWrite(relayPin, HIGH); // Turn on steam generator
  } else if (temperature > 46) {
    digitalWrite(relayPin, LOW);  // Turn off steam generator
  }
  // Stop steam generator if hydration exceeds limit
  if (gsrValue > 600) { // Example threshold
    digitalWrite(relayPin, LOW); // Turn off steam generator
    digitalWrite(buzzerPin, HIGH); // Turn on buzzer
    digitalWrite(ledPin, HIGH);    // Turn on LED
  }
  // Prepare data for GSM
  String message = "GSR: " + String(gsrValue) +
                   ", ECG: " + String(ecgValue) +
                   ", Temp: " + String(temperature) +
                   ", EMG: " + String(emgValue);
  // Send data via GSM
  sendSMS(message);
  // Display on LCD
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Temp: " + String(temperature) + "C");
  lcd.setCursor(0, 1);
  lcd.print("GSR: " + String(gsrValue));
  delay(2000); // Update every 2 seconds
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("ECG: " + String(ecgValue));
  lcd.setCursor(0, 1);
  lcd.print("EMG: " + String(emgValue));
  delay(2000); // Update every 2 seconds
}

void sendSMS(String message) {
  gsmSerial.println("AT+CMGF=1"); // Set SMS mode
  delay(100);
  gsmSerial.print("AT+CMGS=\"+1234567890\""); // Replace with doctor's phone number
  delay(100);
  gsmSerial.println(message); // Message content
  delay(100);
  gsmSerial.write(26); // Send Ctrl+Z to send SMS
  delay(100);
}

This code is responsible for initializing the sensors and communication modules, reading sensor data, controlling the relay,