Smart Blinds

It's sunny, lower the blinds!

Made by Melanie Swartz

Introducing, Smart Blinds! This system can sense when the light is coming in the windows and automatically lowers the blinds. An LED symbolizes the motor of the blinds. When the LED is on the blinds are being lowered. As the pressure sensor is pushed, symbolizing the blinds coming to their resting point and being closed, the LED turns off showing the motor in the blinds has stopped as well. If the desired light threshold is exceeded, the above process is initiated. Otherwise, when light is below the threshold, it is showing that it is not bright enough to have the blinds down and the blind motor is off as well. Ideally, this would be part of a bigger system where one could customize their thresholds to regulate the amount of light coming through their windows. This would automate the process so your house could accommodate your desired comfort levels and make these adjustments for you.

Created: January 25th, 2015

0

Code

https://api.spark.io/v1/devices/53ff74066667574816262467/(LIGHT or FORCE)?access_token=3dbde39967c5352e63ca03340313520421961da9

0
// Define a pin that we'll place the photo cell on
int photoCellPin = A1;

// Create a variable to hold the light reading
int photoCellReading = 0;

// Define a pin we'll place LED on
int ledPin = D0;

//Create variable to store LED brightness
int ledBrightness = 0;

// Define a pin we'll place FSR on
int fsrPin = A0;

// Create a variable to hold FSR reading
int fsrReading = 0;

//
void setup(){

  // Set up the LED for output
  pinMode(ledPin, OUTPUT);

  // Create a cloud variable of type integer
  // called 'light' mapped to photoCellReading
  Spark.variable("light", &photoCellReading, INT);

  // Create a cloud variable of type integer
  // called 'force' mapped to fsrReading
  Spark.variable("force", &fsrReading, INT);
}

void loop() {
  // Use analogRead to read the photo cell reading
  // This gives us a value from 0 to 4095
  photoCellReading = analogRead(photoCellPin);
  // Use analogRead to read the fsr reading
  // This gives us a value from 0 to 4095
  fsrReading = analogRead(fsrPin);
  // light range over 2000 will trigger the light to be on
  // value based on test reads, 0 to 4095
  // light simulates motor for blinds
  // when photoCell reading is bright, blinds are traveling down
  if (photoCellReading > 2000)
  {
  // LED on because light is coming in
    digitalWrite(ledPin, HIGH);
}
  // otherwise, LED will be off because there is not enough light
  // blinds can be open
  // motor in blinds not on
else {
  digitalWrite(ledPin, LOW);
}
  // fsr sensor simulates blinds hitting a certain point, being closed
  // if the light coming in the window is above threshold and fsr sensor
  // is being pressed (blinds closed) then the blind motor will stop
  // values based on test reads, 0 to 4095
 if (photoCellReading > 2000 && fsrReading > 3000)
 {
  // blind motor will stop, light off
  digitalWrite(ledPin, LOW);
}

}
Click to Expand
0
http://youtu.be/mi7rkcYnvkA
x
Share this Project


About

Introducing, Smart Blinds! This system can sense when the light is coming in the windows and automatically lowers the blinds. An LED symbolizes the motor of the blinds. When the LED is on the blinds are being lowered. As the pressure sensor is pushed, symbolizing the blinds coming to their resting point and being closed, the LED turns off showing the motor in the blinds has stopped as well. If the desired light threshold is exceeded, the above process is initiated. Otherwise, when light is below the threshold, it is showing that it is not bright enough to have the blinds down and the blind motor is off as well. Ideally, this would be part of a bigger system where one could customize their thresholds to regulate the amount of light coming through their windows. This would automate the process so your house could accommodate your desired comfort levels and make these adjustments for you.