Artur Pilatovs
Published © GPL3+

Lane Tech HS - PCL - Home Blind Opener

This project was part of the Lane Tech HS Physical Computing Lab course. I created this project as part of the Home Automation/IoT project.

IntermediateFull instructions provided4 hours222
Lane Tech HS - PCL - Home Blind Opener

Things used in this project

Hardware components

Photon
Particle Photon
×1
Continuous Rotation Servo - FeeTech FS5103R
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1
USB External Battery Pack 5V
Any brand will do as long as it fits the housing
×1
Wood Plank
I chose to build my housing out of wood that is 3 and a half inches wide. The size of your housing is up to you and your blinds.
×1
Thick Copper Wire
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE
Blynk
Blynk

Hand tools and fabrication machines

Hand Saw
Tacky Glue All Purpose Adhesive

Story

Read more

Custom parts and enclosures

20180301_2110481_FG1aVw6uTu.jpg

20180301 2110481 fg1avw6utu

20180301_1846461_f2xiSRmuUe.jpg

20180301 1846461 f2xisrmuue

Schematics

20180228_1213141_Uc0o5xB8Z7.jpg

20180228 1213141 uc0o5xb8z7

20180228_1213311_sJKkmJyMRt.jpg

20180228 1213311 sjkkmjymrt

Code

Untitled file

C#
I originally wanted to implement a photocell resistor before I found out that the Blynk App has a timer. The code for the photocell is still there but blacked out.
// This #include statement was automatically added by the Particle IDE.
#include <blynk.h>

// This #include statement was automatically added by the Particle IDE.


#include <Adafruit_PWMServoDriver.h>

// This #include statement was automatically added by the Particle IDE.
#define BLYNK_PRINT Serial
#include <blynk.h>

char auth[] = "72d37cd1c8844fbf8c405f9b5c65cb6f";


Servo motor;
int potPin=A0;
int potReading =0;
int motorPin = 0;
int photoVal=0;
int led1 = D1; 
int led2 = D7;

void setup() {
      Blynk.begin(auth);
      pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
    pinMode(potPin,INPUT);
    motor.attach(D0);
    Serial.begin(9600);
    //Spark.variable("pot", &potReading, INT);


}

void loop() {
      Blynk.run();
     //Code Below is for the photocell if chosen to be used
    /* potReading = analogRead(potPin);
    photoVal = potReading -1023;
   if(photoVal<500)
    {
        motor.write(90);
         // digitalWrite(led1, HIGH);
    }
    if(photoVal > 500)
    {
        motor.write(0);
        //digitalWrite(led1, LOW);
    }
    delay(100); */
}
BLYNK_WRITE(V5) {
        motor.write(param.asInt());
    }
   
BLYNK_WRITE(V1) {
    //small increments
  if(param.asInt()==1)
       {
       motor.write(180);
       delay(1000);
       motor.write(0);
       delay(75);
       motor.write(90);
       }
}
   BLYNK_WRITE(V3) {
       //big increments 
       if(param.asInt()==1)
       {
       motor.write(180);
       delay(2300);
       motor.write(0);
       delay(75);
       motor.write(90);
       }
   }
   
   
   BLYNK_WRITE(V4){
   int pinData = param.asInt(); 
  if (pinData == 1)
     {
      motor.write(180);
       delay(3000);
       motor.write(0);
       delay(75);
       motor.write(90);
    }
       }
 BLYNK_WRITE(V2) {
if (param.asInt() == 1) 
{
    potReading = analogRead(potPin);
    photoVal = potReading -1023;
   if(photoVal<500)
    {
        motor.write(90);
         // digitalWrite(led1, HIGH);
    }
    if(photoVal > 500)
    {
        motor.write(0);
        //digitalWrite(led1, LOW);
    }
    delay(100); 

    
    }
 }
    
   

Credits

Artur Pilatovs

Artur Pilatovs

2 projects • 1 follower
Lane Tech Class of 2018

Comments

Add projectSign up / Login