Full width home advertisement

Arduino project

Raspberry project

Post Page Advertisement [Top]

Raspberry pi remote light switch (by phone)

Following is project making remote light switch which can be controlled from (normal) Local switch or from Phone. It will help you to turn on or off light without touching Local switch on wall.
Just using a phone! Some cases like reading book on bed, no need to stand-up to turn off light, then go back to bed. By this project, you can use your phone to turn off light, then go sleeeep.

Here is result (demo):

Here is result (complete): PCB toggle switch + Phone application

1. Toggle circuit

This circuit is designed to detect pulse from "normal switch" or from "remote switch" (by phone)

This circuit will help User can turn on/off in by "normal switch" or by "remote switch". So, in case can't using "remote switch", User still can turn on/off light by "normal switch"

IC-555 is center of circuit for toggle switch.

As in Schematic, there are two section:
(A). Toggle circuit by IC-555
(B). Trigger signal:
(1). Capacitor and opto are used to detect rising/ falling edge from "normal switch"
(2). "Remote switch" (by phone)

Following is completed PCB board

2. Remote switch
Raspberry Pi will be used for "remote switch"
Raspberry Pi will host a local web (which contain "remote switch"), and also connect to Wifi. So, User will use phone (connected to Wifi), open local web to turn on/off light.

2.3. Web interface to GPIO of Raspberry
Local web uses php to control GPIO through WiringPI (installed in Section 2.2.1)
To interface between local web and Rasberry, there is tutorial in Instructable, this web project is mainly base on that tutorial, link here.

After modify again, making local web as following

Local web is save in /var/www/(note that: The file "temp" should be changemod to 777) Total my local web can be download at link here (Google share)

2.3. Control by Android app
Fortunately we successful made an Android App, it's easy for User to turn on/off light
The App can be download from Google store with keyword "Data2server" or this link

The screen of App looks like this:

There are 2 settings for local web address, and key setting:

First of all, user need to check connection status from Phone to Raspberry board. That's it! The light switch is in your Phone!

I used Eagle to make PCB Layout, you can download it herehttps://drive.google.com/file/d/0B1UeJfx4pZ1GS21DSWJYZWZSRms/view?usp=sharing

Frankly talking, make PCB will take a lot of time. Instead, i suggest to use another Arduino board act as Toggle circuit. As my experience, PCB should make some adjustment for resistor of transistor, sometimes it influence by noise.

with Arduino, you can control many Light switch, also reading Light status (ON or OFF), or even reading power consumption with current sensor. However, to communicate from Rasp to Arduino, i think we should use RF board. I will make another article about this: a solution for Home appliance by IoT

Good tips. I will be sharing this with all of my friends! I like this post because it is informative and helpful to all readers. I would like to revisit this post. If you planning buy the Wholesale Cell Accessories or Wholesale iPhone 6 Plus Accessories and other all type mobile phones accessories. WholeCellUSA is the Best platform to get Whole Cell Phones and Accessories. Screen protectors are one of the most important accessories in the world of smartphones.