engrcjc
Published © GPL3+

Automated Construction PPE for Accident Detection and Report

Design of PPE with Accident, High Body temperature and Hazard Detection

BeginnerWork in progress117
Automated Construction PPE for Accident Detection and Report

Things used in this project

Hardware components

Arduino Mega 2560
Arduino Mega 2560
×1
Arduino UNO
Arduino UNO
×1
Arduino GSM shield V2
Arduino GSM shield V2
×1
Gravity: Digital Vibration Sensor
DFRobot Gravity: Digital Vibration Sensor
×1
DHT11 Temperature & Humidity Sensor (4 pins)
DHT11 Temperature & Humidity Sensor (4 pins)
×1
Infrared Receiver, 38 kHz
Infrared Receiver, 38 kHz
×1
Infrared Emitter, 18 °
Infrared Emitter, 18 °
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Breadboard, 830 Tie Points
Breadboard, 830 Tie Points

Story

Read more

Schematics

Automated PPE Code

Code

FULLSEQUENCE.ino

Arduino
#include "SPI.h"
#include <IRremote.h>
#include "DHT.h" 
#define DHTTYPE DHT11
#include <SoftwareSerial.h>
#define DHTPIN 2


DHT dht(DHTPIN, DHTTYPE);

SoftwareSerial SIM800C(10,9);

int receiverpin = 7;
int vs =8;
int buzzer = 5;
int Buzzer;  

IRrecv irrecv(receiverpin);
decode_results results;

void setup() {
  SIM800C.begin(9600);
  dht.begin();
  pinMode(receiverpin, INPUT);
  pinMode(vs, INPUT); 
  pinMode(buzzer,OUTPUT);
  Serial.begin(9600);    
  irrecv.enableIRIn();
  beep(50);
  beep(50);
  beep(50);
  Serial.begin(9600);
  delay(1000);
}


void loop() {
  irReceive();
  //readTemp();
  //vibrationSensor();
  if(Buzzer==1){
        int i=0;
    for(i=0; i<=5; i++){
    beep(200);
    }
    Buzzer=0;
    results.value=0;
  }
}
void beep(unsigned char delayms){
  analogWrite(5, 20);                 
  delay(delayms);          
  analogWrite(5, 0);      
  delay(delayms);           
} 

void vibrationSensor(){
  long measurement =vibration();
  measurement/100;
  if (measurement > 30000){
    
    SendVS();
  }
  delay(5000);
}

long vibration(){
  long measurement=pulseIn (vs, HIGH);  //wait for the pin to get HIGH and returns measurement
  return measurement;
}

void readTemp(){
    float t = dht.readTemperature();
    Serial.println(t);
  if (isnan(t)) {
    Serial.println(F("Failed to read from DHT sensor!"));
    return;
    
    }
if(t>=37){
  SendTempmessage();
}
delay(5000);
}

void irReceive(){
  if (irrecv.decode(&results))
  {if(results.value==629145||1341165347){
    Buzzer=1;
    irrecv.resume();
    delay(2000);
  }}
}

void SendTempmessage()
{
  Serial.println ("Sending Message");
  SIM800C.println("AT+CMGF=1");
  delay(1000);
  Serial.println ("Set SMS Number");
  SIM800C.println("AT+CMGS=\"+639508788886\"\r");
  delay(1000);
  Serial.println ("Set SMS Content");
  SIM800C.println("Wearer A from Project Site A exceeds normal body temperature!");
  delay(100);
  Serial.println ("Finish");
  SIM800C.println((char)26);
  delay(1000);
  Serial.println ("Message has been sent");
}

void SendVS()
{
  Serial.println ("Sending Message");
  SIM800C.println("AT+CMGF=1");
  delay(1000);
  Serial.println ("Set SMS Number");
  SIM800C.println("AT+CMGS=\"+639508788886\"\r");
  delay(1000);
  Serial.println ("Set SMS Content");
  SIM800C.println("Wearer A from Project Site A just had an Accident!");
  delay(100);
  Serial.println ("Finish");
  SIM800C.println((char)26);
  delay(1000);
  Serial.println ("Message has been sent");
}

Credits

engrcjc

engrcjc

0 projects • 2 followers

Comments