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 Again you can click here to watch
my behind the scenes video. Or you can click here to watch more of my
automation videos. If you enjoyed this video and would like to support my channel, please
feel free to like, subscribe, comment, follow me on social media, or donate at Alright,
that’s it for this tutorial. For more go to

92 Replies to “Simple Voice Controlled Home Automation

  1. I've got a Rasperry Pi Version B laying around.
    Can I use the same code as for the arduino?
    And How?
    Btw. I really enjoy your videos.
    I love how much effort you put into them but it's worth it they always look great!

    Greeting from Germany 🙂

  2. Would it not be better if you switched the relay via an NPN transistor to avoid damage to the micro from back emf when the coil field collapses? Cool project BTW.

  3. A voice controlled house used to be the house of the future, but now I'm waiting for a future where everything is mind controlled.

  4. was any thought given to using a development board kit using the esp8266 you would be limited to wifi, until the esp32 is realised in mass, but pretty cheap way to control the light.

  5. One and two. TWO? Really? One and TWO? 0 means off, 1 on, 2 means.. Very on? More on? Twice as on as one?
    God, why?
    😀 😀

    Press a button then speak to turn on the light, or press a button to turn on the light. Very useful 😀

    Btw you can make the app with one button, first turn of, the turn off. 🙂

  6. 5 DOLLAR? ARDUINO?!? Where do I get that?
    I live outside the US and they charge over 20 euroes for it -_-

  7. Very inspiring. But the tech is getting so cheap off the shelf these days. Wireless tags and a smart thermometer. I got for a under 100 bucks. I do now want to make an app for lighting. Thanks for that

  8. Very nice project! I like the concise style of the video and I'm sure it's much more easy for you to deliver (and debug) them ^_^

  9. pretty cool. Now can we make it so its done over the internet when were away from home, and/or a at home with a microphone thats located somewhere in the general room/house which then could be used for multiple devices??

  10. You could just have used an esp and Blynk to control the io pins. But you wouldn`t have voice control.

  11. Would it be possible to go for always-on voice recognition? that would make this actually practical.

  12. I would have used an arduino nano and built a custom socket that draws some power for the arduino and then used a normal relay. Then you just screw that socet into the lamp and the bulb into the new socket

  13. thank you so much i was waiting for a video like this and now you do one i am verry happy to see you tinkerin and i wil be a sub til the end

  14. is there a car power supply version of what you showed with that homeplug with the built-in relay with the lead sticking out of it?

  15. Maybe someone can make a Cydia package to add the voice feature into siri.

  16. This would work well using an app called automate on google play because it can accept google now commands. I'd love to see a video demonstrating this

  17. Cool, but isn't the Arduino Uno kind of a waste for this purpose? You only need 1 GPIO, so an ATTINY85, which is much smaller and cheaper, would probably work fine.

  18. Hi! Can you make tutorial how to use cheap LED RGBW lamp (~$10 on Aliexpress) as ambilight for PC? For ambilight we have only one expensive solution: LED strip RGB (not so cheap). Mine LED lamp can be controled via Bluetooth (full range of colors). Any ideas? 🙂 I also have Arduino with advanced kit, BT USB module, Raspberry Pi B+. Thanks! 🙂

  19. Not concerning this projecting. Though, I was wondering if the below mentioned extruder plus filament could replace the 3D printing pen in the 3D printer project.

  20. Hello friend nice idea but can I use a raspberry pi instead of the arduino and code in python? it would be the same I guess?

  21. Nice, realy nice! Great job 🙂
    Realy good ideas. Nice concept.
    Have you maby try to control light from locked screen? Or at least will be nice if you will have buton on home screen… just this button to start listen?

  22. its a good project .. I love it .. can u jus make it better by adding more buttons in the app such that we can control more appliances .. and ,I would like it more if u can give voice commands when the app is not active (without pressing voice I/p button in app and from home screen )

  23. I would love to be able to do this via wifi…but to just turn off then turn back on…thus restarting my router and modem….any ideas?

  24. ترجمة
    Young girls I ask you to participate in the two channels and has participated in the Elkana type the word was i will subscribe fp your channel.

  25. Please continue this project until you have your whole home and auto rigged, big dream of mine to see and do that for a reasonable cost

  26. hi,I saw the video i like it and i have a question.
    1) Can we use a old mobile bluetooth?
    2) If it is possible could you guide me with it.

  27. Really Cool! been trying to get into Arduinos myself, seems fun and this seems like a great way to start getting into practical uses!

  28. hey! I made an app to control my Raspberry Pi powered spybot which uses hc-05 as it's bt module. but whenever I am trying connect it it gives an error 507 which says that unable to connect is the device turned on? your help on this matter would be very appreciable. thank you.

  29. this may be a little crazy to ask but can you make my phone explode? the idea is that in colombia the phone theft is really regular and almost impossible to stop. With this idea I would not just hurt them enough to identify them in the streets but to show the kids that bad acts had bad consequences. what are your thought on this matter?

  30. How many relay do I have to use separately? Please Tell ? I want to try If it can be made a bit more cheaper . The power switch 2 is way more costly in India .

  31. dude, you can still only control it through your mobile devices. Also you have to open the app and the voice recognition becomes useless because the on off switch is above it in the app. With voice controlling, I would use one of those arduino voice controlling units that have a microphone attached to it. This way you don't have to pick up your phone, unlock it, open the app, tap the speak button, say lights on, wait for a whole second and put your phone away. With that you just speak and it will turn on within a second. No need for unnecessary handlings.

  32. Nice video. You may also want to checkout the review of home automation on my blog at carlreviews. com/home-automation-review/ Thanks, Paolo.

  33. Good video. But I have a question.

    Before you use the little box to contain the Arduino, I see you using USB port to give Arduino power.
    But I am wondering how you give power to the Arduino afterward. A power bank??

    I am always thinking to do this kind of things to my house, but using power bank is a non-consistent way while using a 5v charger might sacrifice a socket outlet, and convert a 220V to 5V directly from the wire sounds dangerous to me.

  34. Is there any pre configured relay devices available which supports Apple Homekit or similar stuff which can be also controlled by Amazon Alexa or Google Home?

  35. What's the point of having a voice command, when you have to press a button on your phone/tab to activate the voice command software..

Leave a Reply

Your email address will not be published. Required fields are marked *