Jesse HaugheyBenjamin WilcoxKyle Jaskot
Published © GPL3+

Lazy Light Switch(s)

Have you been leaving the lights on and wasting precious KW-h of energy? Turn them off from anywhere - as long as you have WIFI.

BeginnerFull instructions provided120
Lazy Light Switch(s)

Things used in this project

Hardware components

Argon
Particle Argon
×3
Elegoo Button
×3
LED (generic)
LED (generic)
×2
Jumper wires (generic)
Jumper wires (generic)
×15
55g Servo
×1
32 ohm resistor
Resistor value for LEDs should be at least 32 ohm according to the amp rating of the LEDs.
×2
Resistor 22.1k ohm
Resistor 22.1k ohm
Resistor for Button. This is optional, but recommended. Since servo has relatively high power rating, there tends to be a lot of interference with signals. This resistor choice seemed to somewhat help with that.
×3
WEMO Power Block
×1
WEMO and Servo Bracket/ Holder Print Design
Project component bracket/holder designed by Benjamin Wilcox
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE
Maker service
IFTTT Maker service

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)

Story

Read more

Custom parts and enclosures

Servo, WEMO, Holder Design

55 gram servo held to WEMO device with bracket designed by Benjamin Wilcox.

Schematics

First Controller - Argon 1

Second Controller - Argon 2

Servo Receiver - Argon 3

Circuit Communication

Overview of how the 3 argons communicate with one another

Code

Argon #2 - Second Controller

C/C++
Consists of an output LED and Input Button - Push button to signal other argon(s)
int button=A3;
int led1=A1;
int light = D1;
int Value;

void setup(){

  pinMode(led1, OUTPUT);
  pinMode(button, INPUT);
  pinMode(light, OUTPUT);
  Particle.subscribe("on3",function);
  Particle.subscribe("on5",function);
  delay(1000);
}

void loop(){
    Value = analogRead(button);
    if (Value > 3500 ){
        Particle.publish("on4","1");
        delay(5000);
    }else{
    analogWrite(led1, LOW);
        delay(500);}

}



int function(const char *on, const char *data){
    analogWrite(led1, 255);
    delay(5000);
    analogWrite(led1, LOW);
    return 0;

Argon #1 - First Controller

C/C++
Consists of an output LED and Input Button - Push button to signal other argon(s)
int button=A3;
int led1=A1;
int Value;
int light = D1;

void setup(){

  pinMode(led1, OUTPUT);
  pinMode(button, INPUT);
  Particle.subscribe("on4",function);
  Particle.subscribe("on5", function);
  delay(1000);
}

void loop(){
    Value = analogRead(button);
    if (Value >= 3700 ){
        Particle.publish("on3","1");
        delay(5000);
    }else{
    analogWrite(led1, LOW);
        delay(500);}

}



int function(const char *on, const char *data){
    delay(2000);
    analogWrite(led1, 255);
    delay(7000);
    analogWrite(led1, LOW);
    return 0;
}

Argon #3 - Servo Receiver

C/C++
Servo Receiver - Button to signal controllers.
int button=A3;
int Value;
int led1 = A1;

void setup() {

    Particle.subscribe("on3", myservo);
    Particle.subscribe("on4", myservo);

}

void loop() {
    Value = analogRead(button);
    if (Value >= 3900 ){
        Particle.publish("on5");
        delay(5000);
    }else{
    analogWrite(led1, LOW);
        delay(500);}
}

void myservo(const char *event, const char *data){
    Servo myservo;
int pos = 0;
    myservo.attach(D8);
myservo.write(0);
for(pos = 0; pos < 120; pos += 5)
    {
        myservo.write(pos);
        delay(15);
    }
    
}

Credits

Jesse Haughey

Jesse Haughey

1 project • 0 followers
Benjamin Wilcox

Benjamin Wilcox

1 project • 0 followers
Kyle Jaskot

Kyle Jaskot

1 project • 0 followers

Comments

Add projectSign up / Login