Nabeeh Talaat
Published © CERN-OHL

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

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

IntermediateShowcase (no instructions)7,129
Get notified via Mobile, when your room light turned ON!

Things used in this project

Hardware components

1Sheeld
1Sheeld
×1
1Sheeld
1Sheeld
×1
Resistor 10k ohm
Resistor 10k ohm
×1
Male/Male Jumper Wires
×5
Arduino Leonardo
Arduino Leonardo
×1
Photo resistor
Photo resistor
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Custom parts and enclosures

IMG_1303.JPG

Schematics

the main circuit

i made it using fritzing software

IMG_1304.JPG

Code

buzzerLDR.ino

Arduino
/* 

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.ino

Arduino
/* 

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.ino

Arduino
/* 

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.ino

Arduino
/* 

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;
  }
}

Credits

Nabeeh Talaat

Nabeeh Talaat

1 project • 3 followers
senior mehcatronics engineering student

Comments