Project in progress
Smart Switch

Smart Switch © GPL3+

Use your Smartphone to turn power on/off.

  • 49,060 views
  • 6 comments
  • 109 respects

Components and supplies

Apps and online services

Smart Switch Android
App On Android - https://drive.google.com/open?id=0Bzg1cjKxyHUBWXlPRDZMaXdkWkE
Smart Switch Windows Phone
http://windowsphone.com/s?appid=dd4b173f-4179-413d-b9af-7bd2c753d55d

About this project


Use your phone to turn on/off fan/heater/any appliance.

The project originated from hesitation to get up in middle of the night to turn fan/heater on off. One should be able to do it by pulling out phone from under the pillow.

Using an Android/Windows phone, a person will be able to find paired Bluetooth device, connect to the desired device and be able to turn fan/heater on/off from it. It can also be used to turn coffee machine on when you wake up.

The phone communicates with JY-MCU Bluetooth shield that is connected to Arduino. Arduino listens to the on/off commands and activates its GPIO accordingly. This effectively turns the power relay on/off. You can connect any appliance such as fan/heater/coffee machine to it.

It requires assembly of the hardware and an app. The App can be downloaded for Android or for Windows Phone. For those want to build it themselves, the source is on GitHub (https://github.com/sameerkapps/smart-switch)

Building Arduino Hardware:

Step 1:  Connect Bluetooth

Connect TX pin of Bluetooth to Digital pin 11 of Arduino

Connect RX pin of Bluetooth to Digital pin 10 of Arduino

 

Step 2: Connect LED

Connect LED and resistor to digital pin 7 of Arduino

 

Step 3: Connect the relay

Take a power cord and cut one of its wires to connect to relay. Connect one end to the common terminal of the relay and other to the NO (Normally Open) terminal of the relay. Be careful that the strands do not touch any other parts. Connect relay to Arduino as per schematics. Ensure that Relay is on non-conductive surface and preferably in non-conductive enclosure. This is important because the bottom part of the RELAY exposes HIGH VOLTAGE FROM the main electrical line. DO NOT Connect cord to main yet.

 

Connect Pin In1 of Relay to Digital Pin 6 of Arduino.

 

Step 4: Upload code to Arduino

The code is provided in https://github.com/sameerkapps/smart-switch

Upload it to Arduino.

In the Setup, it configures Arduino pins and starts the serial port via Bluetooth.

In the loop, it will listen to the commands from Bluetooth and turn LED and Relay on/off accordingly.

 

Pairing up the Phone

The app connects to one of the paired Bluetooth devices. So it is important to pair up the phone with the device.

(From Android/Windows Phone):

  • Go to Settings,
  • Turn on the Bluetooth. Look for device. Its name would be similar to HC-06.
  • Tap on Pair.
  • You may have to enter manufacturer’s password.

 

App (Download or Build):

You can either download the app or build it yourself.

Download Links

Android App - https://drive.google.com/open?id=0Bzg1cjKxyHUBWXlPRDZMaXdkWkE

Windows Phone Store - http://windowsphone.com/s?appid=dd4b173f-4179-413d-b9af-7bd2c753d55d

This app is not there on the Apple store.

If you choose to download it, you can go to How to use App.

 

Building the App

The App requires Xamarin Studio (for Android App) and Visual studio 2013 for Window Phone App.

This step may require related licenses for the software and for developing apps.

The code can be downloaded from

https://github.com/sameerkapps/smart-switch

It also requires open source Nuget package MvvmCross.

Details of the software are on my blog.

https://sameerkapps.wordpress.com/2015/07/21/smart-switch-using-xamarin-mvvmcross-and-arduino/

 

Running the App

It is important that the Arduino is paired with the phone prior to using the App. The app works only with the paired devices.

  1. Start the App

  2. Click Refresh

  3. Select the desired device. (It will be something like HC-XX if you use JY-MCU)

  4. Click Connect

  5. Wait for it to display “Connected Successfullly”.

  6. Toggle Off to turn the device on. This will change text on button to On.

    This should turn LED on. It should also turn on light on the relay. Once

  7. Toggle the button to turn it off.

    This should turn LED and relay light off

 

Now make sure that relay is not touching any conductive surface and connect its power cable to electrical outlet and the fan/heater. Have fun turning the device on/off from your phone.




Code

Github
Use Xamarin for Android and Visual Studio 2013 for Windowd Phone

Custom parts and enclosures

Source code for the App
This requires Xamarin Studio for Android and Visual Studio for Windows Phone

Schematics

Sktech
This illustrates the sketch for Arduino
SmartSwitch.fzz

Comments

Similar projects you might like

smart robot

Project in progress by Team Arduino Arab

  • 3,174 views
  • 1 comment
  • 9 respects

Bluetooth Controlled Light Switch

Project showcase by Team The Instrumentation Crustaceans

  • 23,397 views
  • 4 comments
  • 26 respects

Smart Wardrobe

Project in progress by Tan See Youu

  • 18,858 views
  • 8 comments
  • 46 respects

Smart Touch Switch Board

Project tutorial by Ashwini kumar sinha

  • 2,056 views
  • 5 comments
  • 10 respects

Bluetooth Smart phone control with remote arduino

Project tutorial by DFRobot

  • 4,903 views
  • 1 comment
  • 11 respects

Smart BT Lock with Custom Number

Project tutorial by jegatheesan

  • 4,035 views
  • 2 comments
  • 22 respects
Add projectSign up / Login