Simple Voice Controlled Home Automation
When I was little I always dreamt of living in the home of the future where everything was automated and voice controlled. Though the home of the future is becoming more and more of a reality the cost of having such a smart home can be very pricey. And, frankly, I think I can do it myself much cheaper. So let’s see if I’m right. So here’s the basic idea of what I’m trying to create something that can turn the lights on and off the can be controlled wirelessly either from my phone or through voice or both and also something that is relatively cheap. Can I do it? I don’t know. So let’s start tinkering. In order to remotely turn this lamp on and off all need something to control the flow of power.
One good method of doing this is by using a “relay”. Basically it acts as a switch that is “off” until an external current is applied which triggers the switching mechanism turning it “on”. I will need to put this relay somewhere between the plug in the power source which means I’ll be messing with the dangerous amount of electricity. So I opted to go the safer route in just buy a premade 120 volt power cable with a relay already built in. Alright, the next thing to do is figure out how to trigger it going to require some type of device that I can program to trigger the relay whenever i send it a command. My go to device for such a task is an Arduino which is a simple to use microcontroller. So what I can do is connect these two relay terminals to these two Arduino terminals and then i cant connect the Arduino to a computer and upload this code.
This code tells the Arduino that whenever I send it a “1” from my computer it turns lights on. And whenever i sended it a “2” it turns the lights off. And it totally works! But it’s not a wireless solution. To solve that problem I opted to go with Bluetooth for its short-range proximity and its easiness to pair with Android devices. Connecting it to an Arduino was equally as easy. You just connect the “TX” to “RX” and the “RX” to “TX” and the “VCC” to “power” and the “ground” to “ground”. Then I tweaked the code a little bit to allow for commands through the Bluetooth and that was it for the Arduino side. Now on to the next challenge which is controlling it from the Android side. What I ended up doing was making an app using “App Inventor” that connects the device through bluetooth and can send it commands.
I made it so that if the “on” button was pressed, it would send a value of “1” to the Arduino. And if “off” was pressed, it sends it “2”. As an added bonus, I found that I could also add voice recognition using “App Inventor”. I made it so that if the word “on” was spoken, it sends the value of “1” and when “off” is spoken, it sends the value of “2”. Then I put everything in a nice little case and tested it out.
You can download my app from the App Store use the link below. Or you can watch my behind the scenes video if you want to make your own. If you have any ideas that you like to see please submit your vote for your favorites at www.tinkernut.com/ideas Again you can click here to watch my behind the scenes video. Or you can click here to watch more of my automation presentations.
As found on Youtube