Ariani Gomez
Published © GPL3+

Lane Tech HS- Humidity Change Reminder

When humidity exceeds 58%, a To-Do is sent to my Evernote account that will tell me to turn the dehumidifier on.

BeginnerFull instructions provided2 hours197
Lane Tech HS- Humidity Change Reminder

Things used in this project

Hardware components

Argon
Particle Argon
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
DHT11 Temperature & Humidity Sensor (3 pins)
DHT11 Temperature & Humidity Sensor (3 pins)
×1
Resistor 10k ohm
Resistor 10k ohm
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE
IFTTT

Story

Read more

Schematics

Circuit Diagram

Circuit Schematic

Code

Particle Argon Code

C/C++
Code to test and update humidity variable
// This #include statement was automatically added by the Particle IDE.
#include <Adafruit_DHT.h>

//define the temperature and humidity sensor
#define DHTTYPE DHT11
#define DHTPIN D5


//initialize the DHT sensor with the name 'sense'
DHT sense(DHTPIN, DHTTYPE);

//humidity variable
double humidity;
double humidityCheck;

unsigned long lastDebounceTime = 0;  // the last time humidity was checked
unsigned long currentTime; // time its being run
unsigned long debounceDelay = 5; // how many minutes in between each change

void setup() 
{
     pinMode(D5, OUTPUT);
     //Particle.variable  linked to IFTTT so when it exceeds 58%, Evernote is appended
     Particle.variable("humidity", humidity);
     Serial.begin(9600); 
     sense.begin();
}

void loop() 
{
    currentTime = Time.minute();
    
    //one minute after last check, humidity is reset
    //this is so the Particle.variable is not overwhelmed and spammed
    if ((currentTime - lastDebounceTime) == 2)
    {
        humidity = 0.0;
    }
    
    //checks if time since last check is 5 minutes
    if (( currentTime - lastDebounceTime) == debounceDelay) 
    {
        lastDebounceTime = currentTime;
        

        humidityCheck = sense.getHumidity();
        
        // ensures that data is within reason
        if (0.0 <humidityCheck<100.0)
        {
            //changes humidity variable once it has been checked
            humidity = humidityCheck;
            
            Serial.print( " Humidity = " );
            Serial.print(humidity,1);
            Serial.println( "%" );
        }
        
    }
    


    
}
    

Credits

Ariani Gomez

Ariani Gomez

3 projects • 2 followers

Comments

Add projectSign up / Login