Introduction: Notifying Humidifier

This project allows a person to be notified when a particular humidity level is met. When the humidity of a room is below a set value, a led light will brighten up and a notification will be sent to the user's phone or specified device. The benefits of this project is to support a healthy environment as well as maintaining a regulatory humidity level in one's home.

Supplies

  • Particle Argon Board
  • Breadboard
  • DHT sensor (Digital temperature and humidity sensor)
  • Wires
  • Led lights
  • Humidifier
  • Tape
  • Scissors
  • Ruler
  • Charger
  • USB cable

Step 1: Gather Necessary Materials

It's important that all the necessary supplies are attainable before starting this project to ensure no problems on getting the actual materials. This step keeps all the materials organized and puts you on a great start.

Step 2: Plan Construction

Begin to plan out the physical look of your project. Create a mini sketch of where the charger, sensor, and breadboard will be on your humidifier. You want these items to be convenient to where they do not interact with the process of filling the humidifier with water. A ruler can be used to measure each component and find the most convenient spot on the humidifier.

Step 3: Complete Breadboard

Your breadboard may differ from mine and it's okay because there are a variety of ways to construct the breadboard. You will need to add the dht sensor and led light to your breadboard.

Step 4: Connect Components to Humidifier

You will now use your sketch from step 2 to support you in connecting your breadboard, dht sensor, and charger to your humidifier. Make sure that each component has space around them to stop wire from tangling.

Step 5: Programming

The code is split up into 3 sections. The first part is the global variables. The second part contains the set up for the dht sensor and the led light. Finally, the third part includes the code that creates the function for the project. Comments are included to help clear up confusion.


int led = 5;
#include "Adafruit_DHT_Particle.h"
#define DHTPIN D2     // what pin we're connected to for dht sensor
#define DHTTYPE DHT11

float humidityHighRange = 45;

DHT dht(DHTPIN, DHTTYPE);
int loopCount;

void setup() {
Serial.println("DHTxx test!");
Particle.publish("state", "DHTxx test start");

dht.begin();
loopCount = 0;
delay(2000);

digitalWrite(led, LOW);
    pinMode(led, OUTPUT);
}

void loop() {
float humidity = dht.getHumidity();
// Check if any reads failed and exit early (to try again).
if (isnan(humidity)) {
Serial.println("Failed to read from DHT sensor!");
return;
}

Particle.publish("readings", String::format("{\"Hum(\%)\": }", humidity));

if (humidity < humidityHighRange) {
    Particle.publish("Notification");
        digitalWrite(led, HIGH);
    }
    else if (humidity > humidityHighRange) {
        digitalWrite(led, LOW);
    }

delay(5000);
loopCount++;

Serial.print("Humid: "); 
    Serial.print(humidity);
    Serial.print("% - ");
    Serial.println(Time.timeStr());

}


Step 6: Test DHT Sensor

This step is crucial in the progression of this project. It is important that you can see the data from the dht sensor on a serial monitor because it ensures that the programming and breadboard are correct.

Step 7: Set Up Webhook

Create a webhook, which will be used to trigger the notification on your specified device.

Step 8: Set Up IFTTT (app)

Create an account.

Create an Applet and use these specific if/then statements.

Step 9: Enjoy

Congratulations!

From this step forward you may enjoy your humidifier. The function should be working as stated in the introduction of this project.