Project tutorial
SMS your Home

SMS your Home © CC BY-NC-SA

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

  • 5,680 views
  • 0 comments
  • 14 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

My Motion Activated SMS sender

Project tutorial by Christiaan Neil Burger

  • 2,016 views
  • 0 comments
  • 5 respects

Motion activated SMS Shield- Tutorial

Project tutorial by Burger

  • 3,602 views
  • 2 comments
  • 5 respects

SMS based Home Automation system using 1SHEELD

Project tutorial by Tanishq Jaiswal

  • 27,240 views
  • 11 comments
  • 63 respects

Using SMS messages to control LED color

Project tutorial by SteiniBrodda

  • 6,972 views
  • 0 comments
  • 6 respects

Control your light system with your voice

Project tutorial by Maha Raafat

  • 33,684 views
  • 22 comments
  • 147 respects

4x4x4 LED cube with Arduino Uno and 1sheeld

Project tutorial by Hassan Ibrahim

  • 29,722 views
  • 6 comments
  • 60 respects
Add projectSign up / Login