Project tutorial
Control your Light System Using Smart Phone

Control your Light System Using Smart Phone © GPL3+

Now you can control your light system in your home using your smart phone by writing a character the LED turn on or turn off.

  • 43,078 views
  • 5 comments
  • 63 respects

Components and supplies

About this project

The project idea is to proof that you can control your home lighting system using only your smart phone, so the LEDs in the project represents different systems in our home as an example.

All you need for the project:

1- 1sheeld

2- Arduino Uno

3- LEDs

4- Jumbers

then connect the circuit as shown below

First let's know more about 1sheeld:

1Sheeld turns your smartphone into 40 different Arduino shields. So we don't have to buy shields for Arduino as we have them in our smartphone.

How to use 1sheeld?

1- Stack 1Sheeld on top of your Arduino board, and write the code using 1Sheeld library.

2- Pair 1Sheeld board with 1Sheeld app over bluetooth.

3- Select the shields from a list of over 40 shields.

for more information about 1sheeld and how to use shields follow this link

http://1sheeld.com/tutorials/getting-started/

Let's back to our project...

Open 1sheeld app and connect the app with your 1sheeld then open "keyboard" shield.

Press 'R' Red LED will turn on

Press 'Y' Yellow LED will turn on.


Press 'G' Green LED will turn on

and finally to turn off all press 'C'


Code

control_light_sysArduino
#define CUSTOM_SETTINGS
#define INCLUDE_KEYBOARD_SHIELD

/* Include 1Sheeld library. */
#include <OneSheeld.h>

/* LEDs on pin 11,12,13 */
int ledRed    = 13;    //for Red LED
int ledYellow = 12;   //for yellow LED
int ledGreen  = 11;   //for green LED

void setup() 
{
  /* Start communication. */
  OneSheeld.begin();
  
  /* Set the LED as output. */
  pinMode(ledRed,OUTPUT);
  pinMode(ledYellow, OUTPUT);
  pinMode(ledGreen, OUTPUT);
  
  /* Keyboard callBack function. */
  AsciiKeyboard.setOnButtonChange(&keyboardFunction);
}//end of void setup

void loop()
{}

/* Function to be invoked once a new character is pressed. */
void  keyboardFunction(char data)
{
  /* Check on the incoming character. */
  if(data == 'R')
  {
    /* Turn on the LED. */
    digitalWrite(ledRed,HIGH);
  }//end of if
  else if(data=='Y')
  {
    /* Turn off the LED.*/
    digitalWrite(ledYellow,HIGH);
  }//end of else if
  else if(data == 'G')
  {
    digitalWrite(ledGreen,HIGH);
  }//end of else if
  else if(data == 'c')
  {
    digitalWrite(ledRed, LOW);
    digitalWrite(ledYellow, LOW);
    digitalWrite(ledGreen, LOW);
  } //end of els if 
  else
  {
    digitalWrite(ledRed, LOW);
    digitalWrite(ledYellow, LOW);
    digitalWrite(ledGreen, LOW);
  }//end of else
}//end of keyboard function

Schematics

circuit.fzz
circuit.fzz

Comments

Similar projects you might like

Control your light system with your voice

Project tutorial by Maha Raafat

  • 33,109 views
  • 22 comments
  • 147 respects

Home Management System - Control your home from a website

Project tutorial by Ahmed El-Hinidy

  • 31,455 views
  • 21 comments
  • 115 respects

Voice Controlled Robot using your Smart Phone

Project tutorial by Ahmed Yassin

  • 3,059 views
  • 0 comments
  • 7 respects

Control electronics by sliding your phone

Project tutorial by Tanishq Jaiswal

  • 14,755 views
  • 13 comments
  • 61 respects

Control a LED from your Phone

Project showcase by Kaustubh Agarwal

  • 14,155 views
  • 5 comments
  • 37 respects

Control Robot Arm with your Android Phone

Project tutorial by Ammar Atef Ali

  • 10,605 views
  • 0 comments
  • 22 respects
Add projectSign up / Login