Light Controlled Humidifier

Made by David Hoysan

The goal of this project is to use the Particle platform to turn a humidifier on at night and turn it off during the day.

Created: January 28th, 2016



My girlfriend likes to use a humidifier at night during the winter so that she doesn't wake up dry. The intention of this project is to create a connected device that is able to turn off the humidifier during the day, turn on an LED and the humidifier at night, and log the data using IFTTT and a Google spreadsheet.



The goal of this project is to invent and learn about IoT products. My connected product will employ three components, share sensor information via the cloud, provides simple status feedback locally, and offers more detailed information online. 



Components Used:

1 - 10 kohm resistor

1 - 1 kohm resistor

1 - servo motor

1 - green LED

1 - photoresistor

1 - humidifier

1 - Particle Photon & breadboard

Jumper cables

I also hot glued a bracket to the servo motor so that it could grip the humidifier knob.


The schematic below shows how to set up the components


The circuit is setup so that whenever the light intensity drops below the threshold, the green LED will light up and the servo motor will turn on the humidifier. Whenever the light climbs above the threshold, the LED will turn off, the servo will rotate to turn the humidifier off, and the light reading will be sent to a Google spreadsheet. 

// Identify the Servo
Servo david;

// Identify the led
int led = D1;

// Initial position for the servo
int pos = 0;

// Photo Resistor
int photoCellPin = A0;

// Store the sensor reading
int photoCellReading = 0;

// threshold for being covered
int threshold = 2300;

void setup()
  // connect the photo cell reading to the cloud
  Particle.variable( "light", &photoCellReading, INT );

  pinMode(led, OUTPUT);


  Serial.begin( 9600 );

void loop()
  photoCellReading = analogRead( photoCellPin );

  // see if the room is dark
  if( photoCellReading < threshold )
    digitalWrite(led, HIGH);
    digitalWrite(led, LOW);


Click to Expand


The youtube video below shows the light controlled humidifier in action. When I shine light on the humidifier, the servo motor turns the knob off. When I remove the light, the LED lights up and the servo motor turns the knob on. When the humidifier is turned off, data is logged in a Google sheet through IFTTT. Unfortunately, I do not have a feature to constrain the servo motor. The video shows me holding the motor. The next step in this project would be to build a support for the servo so the device can ultimately run on its own.
Light sensitive humidifier
dhoysan -


Initially, I wanted to my device to measure the humidity of the room and only turn on the humidifier when the humidity drops below a certain level. Unfortunately, I did not have a humidity sensor at my disposal. I decided a light sensor would work equally as well, since my girlfriend only runs the humidifier at night. Even though I did not carry out my original plan, I still was able to gain experience connecting environmental inputs to output actions.

Share this Project


49-713 Designing for the Internet of Things

· 4 members

This course charts the emergence of the now "connected world" to explore the possibilities for future products and connected spaces.


The goal of this project is to use the Particle platform to turn a humidifier on at night and turn it off during the day.