Project in progress
Smart Switch

Smart Switch © GPL3+

Use your Smartphone to turn power on/off.

  • 115 respects

Components and supplies

Apps and online services

Smart Switch Android
App On Android -
Smart Switch Windows Phone

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 (

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

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 -

Windows Phone Store -

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

It also requires open source Nuget package MvvmCross.

Details of the software are on my blog.


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.


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


This illustrates the sketch for Arduino


Similar projects you might like

smart robot

Project in progress by Team Arduino Arab

  • 1 comment
  • 10 respects

Smart Battery Charger Multiplexer with Smart Display

Project tutorial by leonzak

  • 25 respects

Home Smart Home

Project tutorial by Syed Sanoor

  • 253 respects

Bluetooth Controlled Light Switch

Project showcase by Team The Instrumentation Crustaceans

  • 29 respects

Smart Wardrobe

Project in progress by Tan See Youu

  • 69 respects

Bluetooth Smart phone control with remote arduino

Project tutorial by DFRobot

  • 14 respects
Add projectSign up / Login