I took my Particle Photon device and did a minor project on it using the provided photo resistor and made an anti theft module which sends out an SMS when it detects intrusion activity. I have published the project on  which is publicly accessible here
The Photon Device The photon is a tiny chip which has inbuilt wireless support and can be used as a very flexible IoT device. The basic concept of the project is using the photo resistor to detect light and photo activity in the surroundings and setting the threshold. There after it automatically senses the irregularities in disruption of light beam. And sends the SMS.
The components that we'd require for this project are : 

  • 1 Particle Photon 
  • 1 Photo Resistor
  • 2 Normal Resistors
  • 1 LED ( Optional )

The circuit diagram for the project is shown below. Take a note while connecting the longer end of the LED to D0. Also make sure that both the LED and the Photoresistor are facing each other so as to improve the signal catching.The Circuit Diagram
The code for the same to be deployed on build.particle.io platform is also provided below. Replace the SMS API host and path with the url of your SMS API.

// This #include statement was automatically added by the Particle IDE.  
#include "HttpClient/HttpClient.h"int led = D0; // This is where your LED is plugged in. The other side goes to a resistor connected to GND. 
int boardLed = D7; // This is the LED that is already on your device.int photoresistor = A0; // This is where your photoresistor is plugged in. The other side goes to the "power" pin (below).int power = A5; // This is the other end of your photoresistor. The other side is plugged into the "photoresistor" pin (above).int intactValue; // This is the average value that the photoresistor reads when the beam is intact.  
int brokenValue; // This is the average value that the photoresistor reads when the beam is broken.  
int beamThreshold; // This is a value halfway between ledOnValue and ledOffValue, above which we will assume the led is on and below which we will assume it is off.bool beamBroken = false; // This flag will be used to mark if we have a new status or now. We will use it in the loop.void setup() { Serial.begin(9600); 

pinMode(led,OUTPUT); // Our LED pin is output (lighting up the LED) 

pinMode(boardLed,OUTPUT); // Our on-board LED is output as well 

pinMode(photoresistor,INPUT); // Our photoresistor pin is input (reading the photoresistor) 

pinMode(power,OUTPUT); // The pin powering the photoresistor is output (sending out consistent power) digitalWrite(power,HIGH); digitalWrite(boardLed,HIGH); 

delay(2000); digitalWrite(boardLed,LOW); 

digitalWrite(led,HIGH); 

delay(500); int on_1 = analogRead(photoresistor); // read photoresistor 

delay(200); // wait 200 milliseconds 

int on_2 = analogRead(photoresistor); // read photoresistor 

delay(300); // wait 300 milliseconds digitalWrite(boardLed,HIGH); 

delay(100); 

digitalWrite(boardLed,LOW); 

delay(100); 

digitalWrite(boardLed,HIGH); 

delay(100); 

digitalWrite(boardLed,LOW); 

delay(100); digitalWrite(boardLed,HIGH); 

delay(2000); digitalWrite(boardLed,LOW); int off_1 = analogRead(photoresistor); // read photoresistor 

delay(200); // wait 200 milliseconds 

int off_2 = analogRead(photoresistor); // read photoresistor 

delay(1000); // wait 1 second digitalWrite(boardLed,HIGH); 

delay(100); 

digitalWrite(boardLed,LOW); 

delay(100); 

digitalWrite(boardLed,HIGH); 

delay(100); 

digitalWrite(boardLed,LOW); 

delay(100); 

digitalWrite(boardLed,HIGH); 

delay(100); 

digitalWrite(boardLed,LOW); intactValue = (on_1+on_2)/2; 

brokenValue = (off_1+off_2)/2; beamThreshold = (intactValue+brokenValue)/2; 

} 
HttpClient http;http_header_t headers[] = { { "Accept" , "*/*"}, { NULL, NULL } // NOTE: Always terminate headers will NULL  
}; 

http\_request\_t request;  
http\_response\_t response; 

void loop() { 

if (analogRead(photoresistor)>beamThreshold) { 

if (beamBrokentrue) { digitalWrite(boardLed,HIGH); 

delay(100); 

digitalWrite(boardLed,LOW); 

delay(100); 

digitalWrite(boardLed,HIGH); 

delay(100); 

digitalWrite(boardLed,LOW); 

delay(100); 

digitalWrite(boardLed,HIGH); 

delay(100); 

digitalWrite(boardLed,LOW); 

Serial.println(); request.hostname = "web host for sms api"; 

request.port = 80; 

request.path = "sms content"; http.get(request, response, headers); Serial.print("Application>\tResponse status: "); 

Serial.println(response.status); 

Serial.print("Application>\tHTTP Response Body: "); 

Serial.println(response.body); beamBroken=false; 

} 

else { 

// Otherwise, this isn't a new status, and we don't have to do anything. 

} 

} 

else { if (beamBrokenfalse) { request.hostname = "web host for sms api"; 

request.port = 80; 

request.path = "content of the sms"; http.get(request, response, headers); 

Serial.print("Application>\tResponse status: "); 

Serial.println(response.status); 

Serial.print("Application>\tHTTP Response Body: "); 

Serial.println(response.body); digitalWrite(boardLed,HIGH); 

delay(2500); 

digitalWrite(boardLed,LOW); 

// Finally, set the flag to reflect the current status of the beam. 

beamBroken=true; 

} 

else { 

// Otherwise, this isn't a new status, and we don't have to do anything. 

} 

} 

}