Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino Uno R3 Based Health Monitoring and GPS Tracking System

View and Edit Project In Cirkit DesignerImage of Arduino Uno R3 Based Health Monitoring and GPS Tracking System

Circuit Documentation

Summary

This circuit is designed to monitor environmental sound levels and heart rate, and to send GPS location data via GSM when certain thresholds are exceeded. It utilizes an Arduino Uno R3 as the central microcontroller to interface with a sound level sensor (LM393), a heart pulse sensor, a Neo 6M GPS module, a Sim800l GSM module, and a buzzer for alerts. The Arduino Uno R3 is programmed to read the analog values from the sensors, compare them against predefined thresholds, and trigger the buzzer if the conditions are met. Additionally, it sends the GPS location through the GSM module as an SMS message in case of an alert.

Component List

Arduino Uno R3

LM393

Neo 6M GPS Module

Potentiometer

Heart Pulse Sensor

Sim800l

Buzzer

Wiring Details

Arduino Uno R3

LM393

Neo 6M GPS Module

Potentiometer

Heart Pulse Sensor

Sim800l

Buzzer

Documented Code

#include <SoftwareSerial.h>

const int soundPin = A0;  // LM393 Analog Output
const int heartRatePin = A1;
const int buzzerPin = 7;

const int gpsRxPin = 10;
const int gpsTxPin = 11;
const int gsmRxPin = 8;
const int gsmTxPin = 9;

SoftwareSerial gpsSerial(gpsRxPin, gpsTxPin); // RX, TX for GPS
SoftwareSerial gsmSerial(gsmRxPin, gsmTxPin); // RX, TX for GSM

const int soundThreshold = 500;
const int heartRateThreshold = 600;

void setup() {
  pinMode(soundPin, INPUT);
  pinMode(heartRatePin, INPUT);
  pinMode(buzzerPin, OUTPUT);

  Serial.begin(9600);
  gpsSerial.begin(9600);  // GPS baud rate
  gsmSerial.begin(9600);  // GSM baud rate

  Serial.println("System Initialized");
}

void loop() {
  int soundLevel = analogRead(soundPin);
  int heartRate = analogRead(heartRatePin);

  Serial.print("Sound Level: ");
  Serial.println(soundLevel);
  Serial.print("Heart Rate: ");
  Serial.println(heartRate);

  if (soundLevel > soundThreshold || heartRate > heartRateThreshold) {
    digitalWrite(buzzerPin, HIGH);  // Activate buzzer
    Serial.println("Danger detected! Buzzer ON.");
    sendGPSLocation();
  } else {
    digitalWrite(buzzerPin, LOW);   // Deactivate buzzer
    Serial.println("Safe. Buzzer OFF.");
  }

  delay(1000);
}

void sendGPSLocation() {
  gsmSerial.println("AT"); // Check connection
  delay(1000);
  gsmSerial.println("AT+CMGF=1"); // Set SMS mode to text
  delay(1000);
  gsmSerial.println("AT+CMGS=\"+1234567890\""); // Recipient phone number
  delay(1000);

  gsmSerial.println("Danger detected. GPS Location:");
  
  while (gpsSerial.available()) {
    char c = gpsSerial.read();
    gsmSerial.write(c); // Send GPS data to GSM
  }

  delay(1000);
  gsmSerial.println((char)26); // End SMS with Ctrl+Z

  Serial.println("SMS sent with GPS location.");
}

This code is designed to run on the Arduino Uno R3. It initializes the serial communications for both the GPS and GSM modules, reads the sound level and heart rate, and triggers the buzzer if the readings exceed the set thresholds. It also contains a function sendGPSLocation to send the current GPS location via SMS using the GSM module.