Project showcase
Get notified via Mobile, when your room light turned ON!

Get notified via Mobile, when your room light turned ON! © CERN-OHL

This device notifies you via mobile SMS, a custom app, buzzer or email if someone turns your room light ON.

  • 2,700 views
  • 1 comment
  • 9 respects

Components and supplies

Apps and online services

About this project

My project is about security, smart home, using Arduino board and 1sheeld, 1sheeld offers you +40 shield; so it saves me a huge amount of money to buy some sensors, it just lets me use my mobile sensors controlling them via the 1sheeld itself.

Why I made this project is, indeed, I do appreciate their privacy and their own personal things too, on the other hand for me, they do not! So I was determined to make this awesome project.

It is very simple and useful too, whenever anybody enters my room and just turns the light ON, I get notified via mobile buzzer, SMS, email, and just mobile notify with a line message.

"Hi, someone turned your room light on!"

Code

buzzerLDR.inoArduino
/* 

this project let the arduino notify you via buzzer shield
in your 1sheeld , when someone turn your room light on!
using LDR (Light Sensor). 
*made by Neb-bo , for contacting : nabehtal3t@yahoo.com*

*/
#define CUSTOM_SETTINGS
#define INCLUDE_BUZZER_SHIELD

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



/* a name for the LDR on analog pin A0 */
int photoPin = A0;

/* a variable to store the LDR input value */
int photoVal;

void setup() 
{
  /* Start communication. */
  OneSheeld.begin();

}

void loop()
{

/* read the LDR pin and store data in a variable called photoVal */
  photoVal = analogRead(photoPin);


  /* Always check the LDR state. */
  /* if the value read by LDR is above zero , this means that there is light near */

  if(photoVal>100)
  {
    /* Turn on the buzzer. */
    Buzzer.buzzOn();
  }
  else
  {
    /* Turn off the buzzer. */
    Buzzer.buzzOff();

  }
}
EmailLDR.inoArduino
/* 

this project let the arduino notify you via Email shield
in your 1sheeld , when someone turn your room light on!
using LDR (Light Sensor). 
*made by Neb-bo , for contacting : nabehtal3t@yahoo.com*

*/


#define CUSTOM_SETTINGS
#define INCLUDE_EMAIL_SHIELD

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

/* a name for the LDR on analog pin A0 */
int photoPin = A0;
/* a variable to store the LDR input value */
int photoVal;

void setup() 
{
  /* Start communication.*/
  OneSheeld.begin();

}

void loop()
{
/* read the LDR pin and store data in a variable called photoVal */ 
  photoVal = analogRead(photoPin);


  /* Always check the LDR state. */
  /* if the value read by LDR is above zero , this means that there is light near */
  if(photoVal >100)
  {


          /* Send an Email to you. */
        Email.send("example@example.com","Ligh ON!","Hi, someone truned the Light ON! ");
  }

  else
  {


  // send no mails
    
  }

}
notifyLDR.inoArduino
/* 

this project let the arduino notify you via notify shield
in your 1sheeld , when someone turn your room light on!
using LDR (Light Sensor). 
*made by Neb-bo , for contacting : nabehtal3t@yahoo.com*

*/
#define CUSTOM_SETTINGS
#define INCLUDE_NOTIFICATION_SHIELD

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



/* a name for the LDR on analog pin A0 */
int photoPin = A0;


/* a variable to store the LDR input value */
int photoVal;

void setup()
{
  /* Start communication. */
  OneSheeld.begin();
 

}

void loop()
{
/* read the LDR pin and store data in a variable called photoVal */

  photoVal = analogRead (photoPin);

  /* Always check the LDR state. */
  
  /* if the value read by LDR is above zero , this means that there is light near */
  
  if(photoVal > 100)
  {
    /* Send a notification to your phone. */
    Notification.notifyPhone("Someone trun the light ON!");
    /* Wait for 300 ms. */
    OneSheeld.delay(300);
  }
  else
  {   
    // do nothing
  }
}
SMS_LDR.inoArduino
/* 

this project let the arduino notify you via SMS shield
in your 1sheeld , when someone turn your room light on!
using LDR (Light Sensor). 
*made by Neb-bo , for contacting : nabehtal3t@yahoo.com*
*/

#define CUSTOM_SETTINGS
#define INCLUDE_SMS_SHIELD
#define INCLUDE_TEMPERATURE_SENSOR_SHIELD

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

/* Define a boolean flag. */
boolean isMessageSent = false;

/* a name for the LDR on analog pin A0 */
int photoPin = A0;

/* a variable to store the LDR input value */
int photoVal;


void setup() 
{
 /* Start communication. */
 OneSheeld.begin(); 
}

void loop() 
{

/* read the LDR pin and store data in a variable called photoVal */
  photoVal = analogRead(photoPin);
  
  /* Always check the LDR state. */
  /* if the value read by LDR is above zero , this means that there is light near */

  if (photoVal > 100)
  {
    if(!isMessageSent)
    {   
        /* Send the SMS. */ 
        SMS.send("123456789","someone trun the light ON!");
        /* Set the flag. */
        isMessageSent = true;  
    }
    
  }
  else
  {
    /* Reset the flag. */
    isMessageSent = false;
  }
}

Custom parts and enclosures

IMG_1303.JPG
Img 1303

Schematics

the main circuit
i made it using fritzing software
Ldr
IMG_1304.JPG
Img 1304

Comments

Similar projects you might like

Control your light system with your voice

Project tutorial by Maha Raafat

  • 35,016 views
  • 22 comments
  • 154 respects

Automatic Room Light Controller with Bidirectional Visitor

Project showcase by Amrendra Sahni

  • 2,527 views
  • 2 comments
  • 7 respects

Controlling LED light intensity using smartphone light senso

Project tutorial by Nikola Travis

  • 2,033 views
  • 0 comments
  • 3 respects

Room temperature sensor with display on Mobile

Project showcase by Kaustubh Agarwal

  • 23,925 views
  • 8 comments
  • 54 respects

Control a Fan with Your Mobile Phone

Project showcase by Khloud Mohamed

  • 1,894 views
  • 0 comments
  • 5 respects

How to control your light switch from your smartphone?

Project in progress by Mahmoud Ahmed

  • 22,819 views
  • 3 comments
  • 15 respects
Add projectSign up / Login