Muhammed Shibin PMuhammad shaheem
Published

SunGuard Heat Stress Detector

The SunGard Heat Stress Detector is a portable device created to prevent heatstroke tragedies by providing an early warning.

BeginnerWork in progress125
SunGuard Heat Stress Detector

Things used in this project

Hardware components

Seeed Studio XIAO ESP32S3 Sense
Seeed Studio XIAO ESP32S3 Sense
×1
CJMCU-GUVA-S12SD Sunlight Ultraviolet Ray Intensity UV Sensor
×1
Bosch GY-BME280-3.3 Precision Altimeter Atmospheric Pressure Sensor Module
×1
RGB Backlight LCD - 16x2
Adafruit RGB Backlight LCD - 16x2
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

SunGuard Heat Stress Detector Circuit

​It is the SunGuard Heat Stress Detector, a portable, ground-based device designed to provide an early warning for heat-related illnesses. The project was created to address the serious health risks faced by outdoor workers and athletes in regions like Kerala, where extreme heat and humidity are a major concern. It goes beyond a simple thermometer by combining multiple environmental factors to give a more accurate and proactive risk assessment.
The device is designed for simplicity. You would place the detector in an outdoor area to get real-time readings. It uses a BME280 sensor to measure ambient temperature and humidity and a GUVA-S12SD sensor to measure UV radiation. The microcontroller processes this data to calculate a comprehensive Heat Stress Index. The results are then displayed instantly on an LCD or OLED screen, giving you a clear risk level from "SAFE" to "DANGER."

SunGuard System Architecture

This block diagram illustrates the high-level architecture of the SunGuard Heat Stress Detector. The central XIAO ESP32 S3 Microcontroller serves as the brain, processing data from the input sensors. The BME280 and I2C LCD communicate with the microcontroller via the shared I2C Bus. The GUVA-S12SD UV Sensor sends its data via a dedicated Analog Input pin. This shows the flow of data from the environment to the final display.

Code

SunGuard Heat Stress Detector Code

C/C++
Arduino code for a portable heat stress detector using an ESP microcontroller, BME280, GUVA-S12SD, and I2C LCD.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Adafruit_BME280.h>

// ==== Pin Definitions ====
// GUVA-S12SD analog pin
#define UV_PIN A0

// ==== UV Index Thresholds ====
#define UV_SAFE       3.0
#define UV_MODERATE   6.0
#define UV_HIGH       8.0

// ==== Objects ====
LiquidCrystal_I2C lcd(0x27, 16, 2); // Change 0x27 if your LCD address differs
Adafruit_BME280 bme;                // I2C mode

void setup() {
  Serial.begin(115200);
  Wire.begin();

  // ==== LCD Setup ====
  lcd.init();
  lcd.backlight();
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Starting...");

  // ==== BME280 Setup ====
  if (!bme.begin(0x76)) { // Change to 0x77 if needed
    lcd.clear();
    lcd.print("BME280 Error!");
    while (1);
  }

  delay(2000);
  lcd.clear();
}

void loop() {
  // ==== Read BME280 ====
  float pressure = bme.readPressure() / 100.0F; // hPa

  // ==== Read UV Sensor ====
  int uvAnalog = analogRead(UV_PIN);
  float uvVoltage = uvAnalog * (3.3 / 4095.0); // 12-bit ADC
  float uvIndex = uvVoltage * 10.0; // Approximation — adjust with calibration

  // ==== Determine Rating ====
  String rating;
  if (uvIndex <= UV_SAFE) {
    rating = "SAFE";
  } else if (uvIndex <= UV_MODERATE) {
    rating = "MODERATE";
  } else if (uvIndex <= UV_HIGH) {
    rating = "HIGH RISK";
  } else {
    rating = "EXTREME";
  }

  // ==== Display on LCD ====
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("UV:");
  lcd.print(uvIndex, 1);
  lcd.print(" P:");
  lcd.print(pressure, 0);

  lcd.setCursor(0, 1);
  lcd.print(rating);

  // ==== Debug Output ====
  Serial.print("Pressure: "); Serial.print(pressure); Serial.println(" hPa");
  Serial.print("UV Index: "); Serial.println(uvIndex);
  Serial.print("Rating: "); Serial.println(rating);

  delay(1000); // Update every second
}

Credits

Muhammed Shibin P
1 project • 3 followers
Muhammad shaheem
1 project • 3 followers
embedded systems, and IoT development. ESP32, sensors, and PCB design, with a growing focus on AI-powered devices

Comments