Project tutorial
SMS your Home

SMS your Home © CC BY-NC-SA

Remotely control home appliances (ON/OFF switching) by sending SMS

  • 6,899 views
  • 0 comments
  • 17 respects

Components and supplies

About this project


Code

Untitled fileArduino
/*

SMS Your Home

This is a code to switch home appliance ON/OFF through sending SMS

This example shows an application on 1Sheeld's SMS shield.


*/

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

/* 

A name for the LED on pin 12.

A name for the Lamp on pin 13.

*/


int WledPin = 12;
int LledPin = 13;


void setup()
{
	/* Start communication. */
	
	OneSheeld.begin();
	
	/* Set the LED pin as output.
	
	   set pin 12 as output
	*/
	   
	pinMode(WledPin, OUTPUT);
	pinMode(LledPin, OUTPUT);
	
}

void readSMS (String phoneNumber , String messageBody)
{
    //confirm sender is a specific numer//
    String strMobileNumber = "+12345678900000";
    
    /* Print out the phone Number and message on Terminal shield. */
    Terminal.println(phoneNumber);
    Terminal.println(messageBody);
    
    
    if (phoneNumber == strMobileNumber)
    {
    	//can detect upper and lower case//
    	messageBody.toLowerCase();
    	
    	//turn ON white led on pin 12 if "white on is recieved"//
    	if (messageBody == "white on")
    	{
    		digitalWrite(WledPin, HIGH);
    	}
    	
    	
    	//turn OFF white led on pin 12 if "white off is recieved"//
    	else if (messageBody == "white off")
    	{
    		digitalWrite(WledPin, LOW);
    	}
    	
    	
    	//turn ON lamp on pin 13 if "lamp on is recieved"//
    	else if (messageBody == "lamp on")
    	{
    		digitalWrite(LledPin, HIGH);
    	}
    	
    	
    	//turn OFF lamp on pin 13 if "lamp off is recieved"//
    	else if (messageBody == "lamp off")
    	{
    		digitalWrite(LledPin, LOW);
    	}
    }
    
}

void loop ()
{
	
	SMS.setOnSmsReceive(&readSMS);
	
}
Arduino Code

Schematics

Circuit layout
Sms%20ur%20home%20 %20sketch bb
Fritzing file
sms%20ur%20home%20-%20Sketch.fzz

Comments

Similar projects you might like

Motion activated SMS Shield- Tutorial

Project tutorial by Burger

  • 5,150 views
  • 2 comments
  • 7 respects

My Motion Activated SMS sender

Project tutorial by Christiaan Neil Burger

  • 2,598 views
  • 0 comments
  • 5 respects

SMS based Home Automation system using 1SHEELD

Project tutorial by Tanishq Jaiswal

  • 30,130 views
  • 11 comments
  • 64 respects

Using SMS messages to control LED color

Project tutorial by SteiniBrodda

  • 9,206 views
  • 0 comments
  • 6 respects

Security System With 1Sheeld

Project showcase by nada abdelnaby mady

  • 2,212 views
  • 0 comments
  • 2 respects

Control your light system with your voice

Project tutorial by Maha Raafat

  • 42,026 views
  • 22 comments
  • 160 respects
Add projectSign up / Login