The Blog

03 Raspberry Pi Lighting controls GPIO Relay Switch Home Automation L...

03 Raspberry Pi Lighting controls GPIO Relay Switch Home Automation L… #Raspberry #Lighting #controls #GPIO #Relay #Switch #Home #Automation

- 18 Comments. in Technology

Notes and Scripts:

This video was sponsored by:
Karl Arvid
John Tedesco –
Steven C. Morreale

For help:

Intro Video by Milan Ristic
[2020 Latest] Wireless Charger, YEMO 3 in 1 Qi-Certified Wireless Charging Station for AirPods/Apple Watch Series 5/4/3/2/1,Fast Wireless Charging Stand for iPhone 11/11 pro/11 Pro Max/XS Max/XR



  1. Buried Alive - July 30, 2020

    Seems like this should be done with Arduino as the Pie is overpowered for this task:) Maybe setup a Pie with an control and command Apache Server for the Wifi enabled Arduinos (with relay) and place that on an isolated IOT wifi network. Port forward to the Pie for the web interface, rather that Pies everywhere. Save some Muuulah! Remember to buy, never build. Building is good for learning and teaching, but buying will give you a better housing in a smaller form factor that is almost always better than what can be produced at home. The rule of thumb is to buy once you are done learning what you can, if not for any other reason than space requirements, or the smooth manufactured look you just can't get any other way. Partly this is because they can produce the same product for $24.99 on Amazon that you are spending $60+ for, and not counting labor, and they don't have breadboards and wires everywhere:) I digress…however back on topic, maybe an Arduino network as mentioned would help cut costs.

  2. Randall Wood - July 30, 2020

    Hello! Did I miss your parts list? I’m looking for that relay you are using. Great video, thank you!

  3. Gaurav Sood - July 30, 2020

    Hey .

    Nice informative video. I've a problem related to this.
    If i had to go for implementation of this at my home, for a tech friendly person it's ok to use phone or whatever means but
    1. How to implement this in parallel to the one existing manual switching so that both old ppl and technology friendly ppl can use the solution?
    2. I know we can toggle the state of relay to make or break the circuit but what if we had to it over the internet , how can we read what is the state of manual switch? That means how will i know if my mom had switched on/off the light sitting in the office? Something like reading the voltage difference in the circuit thing.


  4. David Polite - July 30, 2020

    Fantastic set of tutorials! Just the pieces of the puzzle that I was looking for!

  5. Purdy Mouth - July 30, 2020

    is there a relay with 3 position?

  6. 조희진 - July 30, 2020

    hello!!! Is it works for Edison lamp?? like which having a analogue filament. plz!! answer me!

  7. Ricky Spanish - July 30, 2020

    Hi, can you help me build my final year project?

  8. sliman alfantazi - July 30, 2020

    Hey Kris can i follow the same steps using Raspberry pi 3 to control the lights ?

  9. Geraldy Martin - July 30, 2020

    Hello Kris. I saw u connect the wire from the wall to relay and relay to the light. I have wire with 2 wires inside, maybe it's for negative and positive. So, when i connect from wall to relay, should i connect positive to relay and negative to ground? Is that how it works? My house always blackout when i falsely connect the wire 🙁

  10. Nahid Ali - July 30, 2020

    Be sure to read Home Automation review on my blog before you buy. Go to smilereviews. com/home-automation-review/ Thanks. Lon.

  11. Zeinab Elhagan - July 30, 2020

    hello Eng/Kris
    ?can you explain the steps for me in details
    and sent to me on my email the reference and the script if it can ??

  12. 45ArmedJeepFreak - July 30, 2020

    The plug on the extension cord you cut has a narrow blade and a wider blade. The wider blade is connected to the wire that is 'identified' with a ridge or groove down the length of it and that is the "NEUTRAL" side of the outlet. Be sure not to switch the neutral wire with the relay because that leaves the hot wire connected to the lamp even when it is off and can get someone electrocuted!.

    Only switch the hot wire that is connected to the narrow blade of the plug!

  13. mrbulp - July 30, 2020

    hello kris.. can this script change to detect speedometer speed then automatically on some lights ?

  14. tadej - July 30, 2020

    could you make it so its on a time like 20hours on 4 off or 19 on 5 off… for a project

  15. Ashish Jayan - July 30, 2020

    Hey Kris! Great Video. I have setup a garage opener/closer with your help. I just need to setup how to know know the status of the door(open./close) with a magnetic switch or a distance sensor. What do you think?

    Btw Can you please do a bit of esp8266 12e module? It is a much cheaper way to home automation. Its a tiny webserver chip with wifi( isnt that great?)( the new model has more memory voltage converter and breadboard friendly). I was thinking of swithing out the pi to a esp8266 which is more efficient and cheaper.

  16. Sahil Harit - July 30, 2020

    Can I give my relay ,the 5V power through VCC through any external 5V supply without connecting it to my raspberry pi's 5V GPIO (and ground GPIO)?But only connecting the commanding GPIO between pi and Relay.

  17. Rob Monette - July 30, 2020

    Super cool! ha! I need a Pi soon!

  18. alex - July 30, 2020

    Will you do a video about home automation with the ESP8266 ?

Leave a Reply