Building your own DIY security system is a great way to learn more about technology, especially if you use a microcontroller like Arduino. And you don't have to be a tech whiz to get one set up quickly. With a few parts (or just some free software), you can create a security system that will send you a text message when it detects motion.

With a little extra work, you can even have an alarm and flashing lights to scare away intruders! Here are a few ways to get started.

The Basics: A Free Webcam Security System

To create a very basic system, all you need is a PC with a built-in webcam. Adding a USB webcam (or two or three) will give you even better coverage of your home or office, and a wireless IP cam will be even more effective. But to get started, you'll just need a PC and iSpy Connect, a free piece of software that serves as a security camera and motion detector.

ispy-connect

Once you've downloaded the software, you'll need to connect the cameras you're going to use. ISpy supports built-in cameras, USB webcams, IP cameras, USB cameras running on other computers via iSpyServer, and even the Xbox Kinect camera. You can connect an unlimited amount of cameras—use one to monitor your home office, or a whole fleet of them to monitor your entire house!

After setting setting up the cameras with iSpy Connect, you can choose a motion detection function. You can monitor specific areas of the camera's view range for motion and ignore others, for example, and determine how much motion is required to trigger the camera. You can also use the background modeling function to teach iSpy Connect to ignore constantly moving objects, like a fish tank.

ispy-motion-detection

Finally, give iSpy Connect your phone number and tell it to alert you when it detects motion—you'll get a text when something moves in your house. It's as simple as that! It can send a text, an email, or a tweet.

An alternative to iSpy Connect is Sighthound, another piece of software that will help you monitor an area from a built-in or external webcam. The basic version is free, and you can update to the Pro version after a 14-day trial. Sighthound also supports IFTTT, which could be very useful in setting up your notification system or creating a more fully featured alarm (see below for some ideas on adding features to the system).

Using an Arduino Motion Detector

If you don't have a webcam, or you just want to do some tinkering, you can also create a simple text-messaging-based security system with an Arduino and a simple motion detector. Many Arduino starter kits come with a motion detector—if you need to buy one, I recommend this Parallax PIR Sensor.

Matt Williamson has posted a tutorial on GitHub of how to make this whole project work, as well as the Arduino code that's required. Here's the code:

        // Declare Constants
const int sensorPin = 2; // PIR Sensor is attached to digital pin 2
const int ledPin = 13; // Built-in LED
const int ledBlinkTime = 500; // Blink one for half a second while calibrating
// Wait for the seonsor to calibrate (20 - 60 seconds according to datasheet)
// 60 Seconds in milliseconds
const unsigned int calibrationTime = 60000;
void setup() {
 Serial.begin(115200);
 
 pinMode(sensorPin, INPUT);
 pinMode(ledPin, OUTPUT);
 
 // We need to wait one minute for the sensor to calibrate
 // Get out of view of the sensor for this duration!
 
 // Blink the LED while calibrating
 for (unsigned int i=0; i<calibrationTime; i+=ledBlinkTime*2) {
 digitalWrite(ledPin, HIGH);
 delay(ledBlinkTime);
 digitalWrite(ledPin, LOW);
 delay(ledBlinkTime);
 }
}
void loop() {
// Constantly check the state of pin 2
// If it is HIGH the sensor is detecting motion
if (digitalRead(sensorPin) == HIGH) {
// Turn the LED on
digitalWrite(ledPin, HIGH);

// Tell the host computer we detected motion
Serial.print(1);

// Sleep for a second to prevent flooding the serial
delay(1000);
} else {
// Turn the LED off
digitalWrite(ledPin, LOW);
}
}

By combining this sketch with the functionality provided by some Python libraries and TelAPI, an online telephony service (as detailed in the full tutorial), your Arduino will send you a text message whenever motion is detected. It doesn't provide as much functionality as a webcam does—you can't see who's in your house, for example—but if you're looking for a simple security system that includes a little hacking, this is a great project.

Adding More Features

Of course, once you've created a text-message alert security system, you can add all sorts of cool features to it. If you connect your Philips Hue lights or another smart light system to IFTTT, you can have iSpy Connect send an email that will turn on your lights (and make them red if you use Hue). You could also use TelAPI to send an email to IFTTT and trigger anything connected to your SmartThings hub. With IFTTT's constantly expanding list of actions, you can come up with your own creative recipes for your security system.

If you're using an Arduino, you could also follow our tutorial on how to make a security alarm that flashes LEDs and sets off a piezo buzzer and combine it with the text-sending system above, so you can both scare off intruders and get notified when someone trips the alarm. A little Arduino programming could give you alarms in different areas of your home, additional notification options, or even trigger a sprinkler system to soak the potential intruder (or just as a prank!).

Endless Possibilities

Using iSpy Connect or Arduino and TelAPI are just two ways to set up a very affordable text-messaging security system. There are tons of others; we've reviewed the Canary home security system, demoed a Wi-Fi home surveillance system, and shown you how to use old smartphones as security cameras. With a few tools and a very small amount of technical know-how, the possibilities are almost endless!

Have you created a cheap text-messaging security system? What did you use? Has it been useful in the past? Share your experiences below!