Keane ThompsonEthan Masunaga
Published © GPL3+

Student Sleep Monitor

Monitoring temperature, humidity, and other meta tags, we seek to find factors in the classroom that cause students to sleep.

BeginnerShowcase (no instructions)2 hours713
Student Sleep Monitor

Things used in this project

Hardware components

Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Pushbutton switch 12mm
SparkFun Pushbutton switch 12mm
×1
DHT22 Temperature Sensor
DHT22 Temperature Sensor
×1
Photon
Particle Photon
×1
Resistor 10k ohm
Resistor 10k ohm
×1

Hand tools and fabrication machines

Laser cutter (generic)
Laser cutter (generic)

Story

Read more

Schematics

schematic_PBlggV0OcD.png

Code

code for taking temperature and humidity

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



#define DHTPIN 4            // what pin we're connected to
#define DHTTYPE DHT22       // DHT 22 (AM2302)

DHT dht(DHTPIN, DHTTYPE);

double hum;                 // current hum
double temp;                // current temp

void setup() {
    Serial.begin(9600);
    pinMode(DHTPIN, INPUT);
    
    Particle.variable("hum", hum);
    Particle.variable("temp", temp);
}

void loop() {    
    double checkHum = dht.getHumidity();
    double checkTemp = dht.getTempFarenheit();
    
    if (checkHum > 0 && checkHum < 100)
        hum = checkHum;
        
    if (checkTemp > 32 && checkTemp < 100)
        temp = checkTemp;
    
    Serial.println("Temp: " + String(checkTemp));
    Serial.println("Hum: " + String(checkHum));
        
    delay(3000);
}

Credits

Keane Thompson

Keane Thompson

-1 projects • 1 follower
Ethan Masunaga

Ethan Masunaga

-1 projects • 1 follower
Coder. Builder. Lover.

Comments