Turn Your Light Off Via Text: Using Particle and Twilio For Home Automation

Spark_Core_and_Twilio_DemoThere’s a sinking feeling in your stomach when you’re on your way to work and you think “Oh man, did I leave those lights on?” Krishnaraj Varma has a solution for your forgetful self, and it’s not driving all the way home. Call Twilio, enter a PIN and listen to the sweet voice confirmation that your light is being turned off.

In this Particle and Twilio hack, Krishnaraj runs you through how to leverage the ol’ internet of things to control your lights via a Twilio Voice call. Read Krishnaraj’s original post here. But first, learn a little more about Karishnaraj and how he put the hack together in this interview we did with him.

Reason for the hack:

Most of the Home Automation solutions has a Mobile Application that has to be installed on a Smartphone. I was thinking about calling a mobile number, enter a PIN and control your devices. In this case the you call a Twilio number enter a pre-configured PIN and then you can control anything that is attached to the Particle Core. This can be anything like a light, Air Conditioner, etc.

Preferred Languages:

I have been coding for 17 years, started in C/C++. Then I moved to VC++, Java and Objective C, Android, iOS. I also code in Node.js, JavaScript and C#. I love C/C++/VC++.

Closing Pre-Tutorial Words

Immediately I wanted to add a Web Interface to configure the PIN number and interface to configure different devices. Now it has only 1 for turn on a light and 0 to turn off. After that I like to add a two-factor authentication along with the PIN.

Tutorial Time: How To  Use Particle and Twilio For Home Automation

First, grab yourself a Twilio number and one of these.

Now for the PHP side of things.

Here’s what your Twilio UX will look like.

Particle+Twilio1

Here’s the magic in action:

Let us know what you think and if you need any help – @twilio.