Project tutorial
Wireless Light Switch Manipulator

Wireless Light Switch Manipulator © CC BY-NC-SA

Have you ever gotten out of bed just to turn off or on the light switch? Well worry no more!

  • 4,981 views
  • 7 comments
  • 17 respects

Components and supplies

Necessary tools and machines

3drag
3D Printer (generic)

Apps and online services

About this project

Ideation

So I'm not a fan of getting up once I've decided to fall asleep. Sometimes I just want to do some reading prior to falling asleep and need the light to be on. So I decided to make this light switch manipulator.

I realized this has a couple of other implications:

  • Children who are too short to reach the switch
  • People who are limited in mobility

The Project

This project is largely based on the 433 MHz RF boards talking to each other. Sometimes this can be quite a feat. If the code doesn't work well for you, try modifying these values in Slave_servo.ino:

const unsigned int upperThreshold = 70;  //upper threshold value 
const unsigned int lowerThreshold = 50;  //lower threshold value 
  • Master_Remote.ino goes on the Arduino with the transmitter
  • Slave_Servo.ino goes on the same Arduino as the receiver

Wiring

The wiring for this is quite simple, just use the images at this link, and the images under "Schematics".

Note

  • The button goes on the same Arduino as the transmitter, and the servo goes on the same Arduino as the receiver.

Wall Mount

As for the mount for the servo onto the wall, you are going to need access to a 3D printer. The servo mount has been modeling in OpenSCAD, you may have to change where the hole is located. I have included the OpenSCAD file, so that the hole parameters can be modified. You will want to print mhacks_lightswitchv4.stl for starters.

Once printed, secure the servo in and adhere the mount on the switch (this can be done with something as simple as command strips, or if you are really sure you like it, super glue (I don't recommend this).

Final Project

Here is the final project (I submitted this for an online hackathon called Mhacks).

The working project!!

To make the setup more permanent, you may want to print off an Arduino case. This case works really well. You can mount it as well as the breadboard to the wall using command strips.

Future Developments

  • Use an ESP8266 based board to control the servo, rather than 2 Arduinos
  • Make a light switch cover that embeds a servo more eloquently
  • Develop Alexa code such that it is capable of being voice controlled

Code

Slave_Servo.inoArduino
#define rfReceivePin A0  //RF Receiver pin = Analog pin 0
 #define ledPin 13        //Onboard LED = digital pin 13
 #include <Servo.h>

 Servo  servo;

 unsigned int data = 0;   // variable used tostore received data
 const unsigned int upperThreshold = 70;  //upper threshold value
 const unsigned int lowerThreshold = 50;  //lower threshold value

 void setup(){
   pinMode(ledPin, OUTPUT);
   Serial.begin(9600);
   servo.attach(9);
 }

 void loop(){
   data=analogRead(rfReceivePin);    //listen for data on Analog pin 0
   
    if(data<upperThreshold){
     digitalWrite(ledPin, LOW);   //If a LOW signal is received, turn LED OFF
     Serial.println(data);
     servo.write(0);
   }
   
   if(data>lowerThreshold){
     digitalWrite(ledPin, HIGH);   //If a HIGH signal is received, turn LED ON
     Serial.println(data);
     servo.write(90);
   }
 }
Master_Remote.inoArduino
 #define rfTransmitPin 4  //RF Transmitter pin = digital pin 4
 #define buttonPin 2    
 #define led 13    
 
void setup() {
  // put your setup code here, to run once:
pinMode(rfTransmitPin, OUTPUT);     
   pinMode(buttonPin, INPUT);   
   pinMode(led, OUTPUT); 
   Serial.begin(9600);
}

int buttonState = 0; 

void loop() {
  // put your main code here, to run repeatedly:
buttonState = digitalRead(buttonPin);
   if (buttonState == HIGH) {
    // turn LED on:
    digitalWrite(rfTransmitPin, HIGH);
    digitalWrite(led, HIGH);
    Serial.println("transmit");
    delay(10);
  } else {
    // turn LED off:
    digitalWrite(rfTransmitPin, LOW);
    digitalWrite(led, LOW);
    Serial.println("no");
  }

}

Custom parts and enclosures

Servo Enclosure
OpenSCAD Script for Servo Enclosure
mhacks_lightswitch_hpXQkie6X4.scad

Schematics

Transmitter Circut
Button kjy3vmq8ki
Receiver Circut
Servo c8sqeddqry

Comments

Similar projects you might like

How to control your light switch from your smartphone?

Project in progress by Mahmoud Ahmed

  • 22,611 views
  • 3 comments
  • 15 respects

Bluetooth Controlled Light Switch

Project showcase by Team The Instrumentation Crustaceans

  • 25,008 views
  • 4 comments
  • 27 respects

Switch on the Light - SOL

Project showcase by Akash Ravichandran

  • 2,710 views
  • 3 comments
  • 5 respects

Control Your Light Switch with Your Smartphone

Project tutorial by Alasdair Allan

  • 13,535 views
  • 1 comment
  • 33 respects

Controlling LED light intensity using smartphone light senso

Project tutorial by Nikola Travis

  • 1,757 views
  • 0 comments
  • 3 respects

Control your light system with your voice

Project tutorial by Maha Raafat

  • 33,205 views
  • 22 comments
  • 147 respects
Add projectSign up / Login