Darshan PatelNicholas Dunnerryan prusia
Published © GPL3+

Covid-19 Max Occupancy Device

Our project is the system that captures temperature, Humidity & occupancy data from an arbitrary room in order to reduce COVID transmission.

IntermediateShowcase (no instructions)Over 2 days171
Covid-19 Max Occupancy Device

Things used in this project

Hardware components

Argon
Particle Argon
×3
DHT11 Temperature & Humidity Sensor (3 pins)
DHT11 Temperature & Humidity Sensor (3 pins)
×1
Breadboard (generic)
Breadboard (generic)
×2
Grove starter kit plus for Intel Edison
Seeed Grove starter kit plus for Intel Edison
×1
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE
Hackster.IO
ThingSpeak API
ThingSpeak API

Story

Read more

Schematics

Formula/Equations Explanation

Temperature and Humidity Sensor Circuit Picture

Additional Picture of Temperature and Humidity Sensor

Proximity Sensor

This is a picture of the motion sensor part of the project completed with the help of the grove shield

Additional Image of the Proximity Sensor

Receiver Argon

This Argon receives a data collected from Temperature and Humidity Sensor Argon and Proximity Sensor Argon and alert system when there is max occupancy in the room.

Schematic Diagram of Temperature and Humidity Sensor Circuit

Schematic Diagram of Proximity Sensor

Temperature Graphical Data

This is the temperature data which is generated by temperature sensor which is showed graphically in Think Speak.

Humidity Graphical Data

This is the Humidity data which is generated by humidity sensor which is showed graphically in Think Speak.

Temperature and Humidity Data Video

Video Explanation of the Proximity Sensor

Explanation of Temperatures and Humidity Circuits Video

Proximity Sensor Explanation Video

Code

Temperature and Humidity Sensor

C/C++
// This #include statement was automatically added by the Particle IDE.
#include <Adafruit_DHT.h>

// This #include statement was automatically added by the Particle IDE.
#include <ThingSpeak.h>



// This example assumes the sensor to be plugged into CONN2
#define DHTPIN D6     // what pin we're connected to

// Here we define the type of sensor used
#define DHTTYPE DHT11        // DHT 11 

DHT dht(DHTPIN, DHTTYPE);

bool humid = false;

TCPClient client;


unsigned long myChannelNumber = 1365440;
const char * myWriteAPIKey = "486NJ6QUW9T7GMZF";


void setup() {
    
    ThingSpeak.begin(client);
    
 pinMode(D7, OUTPUT);
 Serial.begin(9600); 
 dht.begin();
 Particle.subscribe("Group_15_Temp-humid", l, ALL_DEVICES);

}

void loop() {
    // Wait a few seconds between measurements.
    delay(2000);

    // Reading temperature or humidity takes about 250 milliseconds!
    // Sensor readings may also be up to 2 seconds 
    float h = dht.getHumidity();
void setup() {
    
    ThingSpeak.begin(client);
    
 pinMode(D7, OUTPUT);
 Serial.begin(9600); 
 dht.begin();
 Particle.subscribe("Group_15_Temp-humid", l, ALL_DEVICES);
}
void loop() {
    // Wait a few seconds between measurements.
    delay(2000);
    // Reading temperature or humidity takes about 250 milliseconds!
    // Sensor readings may also be up to 2 seconds 
    float h = dht.getHumidity();
    // Read temperature as Celsius
    float t = dht.getTempCelcius();
    // Read temperature as Farenheit
    float f = dht.getTempFarenheit();
    // Check if any reads failed and exit early (to try again).
    if (isnan(h) || isnan(t) || isnan(f)) {
        Serial.println("Failed to read from DHT sensor!");
        return;
    }
    
    Particle.publish("Group_15_IOTf", String (f), PUBLIC);
    Particle.publish("Group 15_IOTh", String (h), PUBLIC);
  ThingSpeak.setField(1,h);
  ThingSpeak.setField(2,f);
  
  Serial.print(dht.getHumidity());
  Serial.println("h");
  Serial.print(dht.getTempFarenheit());
  Serial.println("t");
  
  ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);  
  delay(15000); // ThingSpeak will only accept updates every 15 seconds. 

    // Read temperature as Celsius
    float t = dht.getTempCelcius();
    // Read temperature as Farenheit
    float f = dht.getTempFarenheit();

    // Check if any reads failed and exit early (to try again).
    if (isnan(h) || isnan(t) || isnan(f)) {
        Serial.println("Failed to read from DHT sensor!");
        return;
    }
    
    Particle.publish("Group_15_IOTf", String (f), PUBLIC);
    Particle.publish("Group 15_IOTh", String (h), PUBLIC);

  ThingSpeak.setField(1,h);
  ThingSpeak.setField(2,f);
  
  Serial.print(dht.getHumidity());
  Serial.println("h");
  Serial.print(dht.getTempFarenheit());
  Serial.println("t");

  
  ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);  

  delay(15000); // ThingSpeak will only accept updates every 15 seconds. 

}

    void l(const char *event, const char *data) {
        
            digitalWrite(D7, HIGH);
            delay(2000);
            digitalWrite(D7, LOW);
            delay(1000);
       
    }
    
    
   
	

Proximity Sensor

C/C++
// This #include statement was automatically added by the Particle IDE.
#include <Grove_4Digit_Display.h>

#include <Grove_ChainableLED.h>     // RGB LED library
#include "Ultrasonic.h"             // Ultrasonic Ranger library

float distance2 = 50.0;             // far range boundary
float distance1 = 20.0;             // close range boundary

Ultrasonic ultrasonic(D4);          // Ultrasonic object constructor
ChainableLED leds(D2, D3, 1);       // LED object constructor

void setup()
{
	Serial.begin(9600);             // Begin serial communications
    leds.init();                    // initialise the LED
}

void loop()
{
	long RangeInCentimeters;        // Variable to hold the distance measurement
   float d =  ultrasonic.MeasureInCentimeters(); 
   Particle.publish("IOT_Group_15",String(d),PUBLIC)
	RangeInCentimeters = ultrasonic.MeasureInCentimeters();     // Get the current distance value
	Serial.print(RangeInCentimeters);                           // Out put the value over serial
	Serial.println(" cm"); // use 'particle serial monitor --follow' in the CLI to see serial output

	if (RangeInCentimeters > distance2){                        // If range is greater than far boundary...
	    leds.setColorRGB(0, 0, 255, 0);                         // green
	}
	else if (RangeInCentimeters < distance2 && RangeInCentimeters > distance1) { // range between far and close...
	    leds.setColorRGB(0, 255, 165, 0);                       // orange
	}
	else if (RangeInCentimeters < distance1) {                  // too close...
	    leds.setColorRGB(0, 255, 0, 0);                         // red
	}
		
	delay(100);                     // small delay, so the sensor has some time to do it's thing
}

Credits

Darshan Patel

Darshan Patel

1 project • 0 followers
Nicholas Dunner

Nicholas Dunner

0 projects • 0 followers
ryan prusia

ryan prusia

0 projects • 0 followers
Thanks to Ryan P and Nicholas D.

Comments

Add projectSign up / Login