Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Gabriela Setyawan
Published

One Health Makeathon

An interdisciplinary makeathon focused on addressing problems related to extreme heat held by the UW-Makerspace

BeginnerShowcase (no instructions)3 days161
One Health Makeathon

Things used in this project

Hardware components

Spresense boards (main & extension)
Sony Spresense boards (main & extension)
Used by two of the participants
×1

Story

Read more

Schematics

A Schematic from the Heat Warning System Team

Created by Biswajit Mishra and Manguru Rakhra

Code

heat_warning_system_code.ino

Arduino
By Biswajit Mishra and Manguru Rakhra
#include <LiquidCrystal_I2C.h>;

// Initialize LCD
LiquidCrystal_I2C lcd(0x27, 20, 4);

void setup() {
  Serial.begin(9600);

  lcd.init();
  lcd.backlight();

}

void loop() {

  int sensorValue = analogRead(A0);
  float voltage = sensorValue * (5.0 / 1023.0);
  float temperature = voltage * 100;
  //float temperature = 98; //We can change this value for testing purposes

//Data Storage
  Serial.println("Time, Temperature");
  Serial.print(",");
  Serial.println(temperature);

  int roundedTemp = (int)temperature;

  String tempStr = String(roundedTemp);
  tempStr = tempStr + "F";
  

if (temperature > 50 && temperature < 95){
  lcd.clear();
  lcd.setCursor(2, 0);
  lcd.print("Temperature");
  lcd.setCursor(6, 1);
  lcd.print(tempStr);
  delay(10000);
  
  lcd.clear();
  lcd.setCursor(4,0);
  lcd.print("Nice and");
  lcd.setCursor(4,1);
  lcd.print("Comfy!");
  delay(10000);
}
else if (temperature > 95 && temperature < 105){
  lcd.clear();
  lcd.setCursor(2, 0);
  lcd.print("Temperature");
  lcd.setCursor(6, 1);
  lcd.print(tempStr);
  delay(5000);

  lcd.clear();
  lcd.setCursor(2,0);
  lcd.print("High Risk");
  lcd.setCursor(2,1);
  lcd.print("of Heatstroke");
  delay(5000);

  lcd.clear();
  lcd.setCursor(2,0);
  lcd.print("Hydrate");
  lcd.setCursor(4,1);
  lcd.print("Often");
  delay(5000);

  lcd.clear();
  lcd.setCursor(4,0);
  lcd.print("Stay");
  lcd.setCursor(4,1);
  lcd.print("Inside");
  delay(5000);
}
else if (temperature > 105){
  lcd.clear();
  lcd.setCursor(2, 0);
  lcd.print("Temperature");
  lcd.setCursor(6, 1);
  lcd.print(tempStr);
  delay(5000);

  lcd.clear();
  lcd.setCursor(4,0);
  lcd.print("DANGER");
  lcd.setCursor(2,1);
  lcd.print("STAY INSIDE");
  delay(10000);
}

else {
  lcd.clear();
  lcd.setCursor(2, 0);
  lcd.print("Temperature");
  lcd.setCursor(6, 1);
  lcd.print(tempStr);
  delay(10000);
}

}

Credits

Gabriela Setyawan
1 project • 1 follower
Student at UW-Madison who is passionate in using technology to solve real-world problems related to climate, health and equity
Contact

Comments

Please log in or sign up to comment.