The way you teach is very detailed, even giving a lesson about that exposed wire, that is a real step by step video, your channel deserves a lot more views by the way
Never mind I figured it out.... But I would like to add that I have never done any programing or code before this project. By just watching the videos you put out, I have completed this project and feel very confident to do many more. You are very good at what you do and its amazing that you do these videos so people like myself can learn and complete some pretty kick ass projects. Thank you
This is a *VERY* good tutorial! 👏😃 Thank you for slowing down and going through the _details_ of what you're doing! That was really helpful for me! 🙂👍 If you hadn't done that - then I would only know *_WHAT_* to do, but not understand *_WHY!_* So I would probably not have been able to implement the knowledge of all these components into other projects, which might need to have a slightly different setup! 10/10 🥞 Pancakes! 😌👌
This video is such a great tutorial. I understand everything you're doing (I'm doing something similar), but I don't know how to access the apache webpage from phone. Did I miss an explanation in the vid?
Is it possible to use this concept on a regular desk lamp? How can I connect the relay to the lamp? Would I have the cut the lamp's cord and then connect those wires to the relay? Thank you very much!
At somewhere around 7:30 you mention something about not showing us the other side because its not safe to play with mains, and then you mention that the adapter the leds are using is 12V, so that makes it safe. Doesn't the relay support up to 250V? That part kind of confuses me because I might be doing doing a project for a school in the near future. The school uses manual bells connected to a button, and I intend to make an automatic one that rings in the defined times using a raspberry pi and a relay switch. Also, you have 2 dongles there. One is for WIFI, but you never mentioned what the other one is for.
+MightKeeper 250V will kill you. 110V/250V is mains power. 12V is a much lower power, that won't kill you. The project you mention, shouldn't use mains electricity. The second dongle is for Bluetooth, that I never got working.
Cool! I got my relay to work just like yours, but am trying to control the brightness of the same LED strip that you have there. Have you tried that before? My pulse width modulation doesn't seem to be working, the duty cycle doesn't look like it is changing!
Loved this and your other videos. Could you link me to a good place to read about "mains" power? Everyone says how bad it is, but I've yet to find a very good explanation as to exactly what it is, and why it's bad. Is it just bad for beginners, or are raspberry pis (the relays) not capable of working with it?
boughtout Mains power is the electricity that's in your wall socket. It comes in 100~240volts depending on where you live. It's bad because it can kill. The Pi stuff says that it can handle it, but I spoke to an electrician friend of mine and he was very concerned about putting mains power through it. I tried a project that used mains and I thought I knew what I was doing. Within minutes of posting it, I was shown the mistakes I'd made and was told that I was going to kill myself. And, again, I thought I knew what I was doing... If you want to learn about Mains electricity, you should sign up for an electrician's course. They're widely available and can make your hobby a serious career. P
Wow thats outstanding! What about covering the bottom of the relay breakout board with low temp hot glue as an insulator to isolate it form the bottom of the drip tray?
t. indy :) The advantage to the tape and screws is, if the relay fails I can replace it. And if the relay gets hot, that could melt the glue. But.. yeah, if I didn't have a drill and I did have hot glue - I totally would have done it too.
skiwithpete :) I've been looking for a solution for adding blue light to aid in working overnight shifts this was just the ticket! I have 2 Pi's just waiting for a job! I'll definitely share when I get em done! Thanks for the great project. Looking forward to the next ones!
+skiwithpete you used a screwto attach the relay? I thought it was just a circle of tape on top of the patch of tape. Couldn't the glue for the tape also melt under the heat too?
Great video ! Some questions though: Can this project be expanded to have the lights gradually light up? what about controlling the different lighting modes from the phone instead of using the remote?
I have to built this setup and I have some Questions Regarding this Home Automation system... I have to Implement home automation system using Raspberry pi controlled over wifi using smart phone..... here are some of my questions for this Project. 1. I want this System To control The entire home switches which will require allot of ports on the rasberry pi how should I over come it 2. The relays will be distributed to each and every corner of house how I m gona provide power to them. 3. If I use wires to controll each and every relay it will be a large mess how to overcome this problem.. please sir Do Answer me..... Thanks :)
Hey question, so do you have to use a different raspberry pi for each project? Cause i'm searching for a way to give order to one raspberry and that can give order to for instance, the lock of the house, the lights, uhm the t.v etc, but what i saw is you placed the raspberry pi in there... so do i need to use a new raspberry pi for each project? Or is there some wifi adapter to give the relay the order like on and off.... Hope to hear from you and a very good video....
Hello! Nice tutorial! But the problem is i still dont understand in what GPIO pins you did connnect the relay! Please tell me what pins they are (pin 1) or a close photo to gpio pins
I have 2 power cords. And there's two parts to the story. I could run both off the draw of the 12V, but then I'd need a more powerful 12V supply. Or I could run a 12V extension cable into the base and separate the power there... but in the end, I just went for quick + cheap + easy and ran two cables in. I like your thinking tho. Let me know how you solve it.
Good job, nice tutorial. I'm wondering... can you safely disconnect and reconnect the relay when RPi is switched on? I've heard that a RPi's GPIO is kinda sensitive and easy to damage... so? Should I shut down my RPi before reconnect the relay or not?
skiwithpete so let’s make it clear- should I olways shut down the Pi when I connect/disconnect something to tge GPIO? Or it's only related to the relay? (to be honest: I've plugged many times Dallas 18b20 thermometer when my RPi was operating, without any harm to it!)
Hi, I watched your video and it is awesome. But i have a question. I clicked on the relay link and i found that it was 5 VDC relay. So far that I know, raspberry produces 3.3 VDC for the output. How can raspberry drives the relay?
dimas adityamurthi The Raspberry Pi has a 5V power source on the GPIO rail (pin2 and pin4). This other video I made might help. th-cam.com/video/oaf_zQcrg7g/w-d-xo.html
skiwithpete I saw it. I guess the relay board uses transistor or MOSFET so that relay can be activated using 5 VDC instead of 3.3.Thank you. :) i really enjoy your video
skiwithpete I saw it. I guess the relay board uses transistor or MOSFET so that relay can be activated using 5 VDC instead of 3.3.Thank you. :) i really enjoy your video
Hey! Cool video :) Is there any way to connect the relay and the pi wirelessly? I'm thinking if I want to use the same Pi for controlling more than one device? :)
there are wireless relays but they tend to be quite expensive. however you might choose pi zeros to control the relay and have one pi control them all...
WTma0812 It's just how you put it together. Here's a link for the cylinder shape I went for th-cam.com/video/YP_YLcYEcoc/w-d-xo.html BUT, there's lots of vids like this, you can make all sorts of shapes!
hi dude my name is akshay ... can pls tel the me the steps like on how exactly did u connect ur phone to the system......and help me out i m using windows 10 ,.....i really need ur help.......i m doing a project....soo i want your help......
Hi,i'm planning to make one of this in my house as my school project,can i have the drawing for the schematic circuit? Because i still cannot get how to connect all the device
In my opinion the best tutorial for raspberry beginners..but can you give me an help for the code? the tutorial is perfect for the hardware side but software side? what i have to do with the python code and apache?? sorry but i really want to try this project
Gabriele Follesa The code is in the About Section. Start by putting the python code in the /home/pi folder and run it with the command sudo python lighton_1.py the instructions for Apache are in the "Raspberry Pi Packages" link. Cheers, P
skiwithpete thanks for the quickly reply..but i have to create a **.php file with the php code and put it on the phone right? is there any control to check if the phone is comunicating with the raspberry or not? because i have already created the 2 py file and the php file. thanks again in advance
Gabriele Follesa you put the php code in index.php in the /var/www folder on the pi. You put nothing on the phone. You're building a webserver on the pi. And you're accessing it through the phone...
skiwithpete Hello, sorry if I stressed you again :) ..but I've mounted the the relay in this way: VCC in pin #2, GROUND in pin # 6 and IN in pin# 5 like this scheme (raspilab.files.wordpress.com /2014/08/gpiosb.png) and as us showed in your other video. However, the relay remains with the two LEDs always on even if I press Lighton or lightoff from php page accessed through apache. I've already launched the python code as you suggest. Can you give me a hand to fix? Thanks in advance as always
Gabriele Follesa In the lighton_1.py and lightoff_1.py change pinList=[3] Because pin#5 on the board is GPIO3. So you need to make that change. This morning I posted another video about relays. You should check that out. th-cam.com/video/OQyntQLazMU/w-d-xo.html
Sameer Bhagwat As far as I know there isn't a safe way to do this yet. But be sure to subscribe, because as soon as there is, I'll be posting in my channel. Best, P
Is there a component that I can add to brighten and dim an LED strip(s) light timed with your "alarm clock feature" using a 4 way relay and timed music components to a speaker system?
noroz k Hey, I made it so it's copy and paste - all the code is in the about section... But you're right, this isn't really as beginner friendly a video as you are looking for. Maybe try checking out my 4-channel relay video: th-cam.com/video/OQyntQLazMU/w-d-xo.html or even better, start with my alarm clock th-cam.com/video/julETnOLkaU/w-d-xo.html
hi pete, all your tutorials are put together very well and easy to follow but i am stuck on the php file,I loaded the Raspberry Pi instructions for Apache ok and had no problems, the lighton and lightoff scrips switch the relay on/off in the terminal with the sudo command ok but when i go to var/www i find the index,html file but cannot put the php code into it can you advise..............rgards cliff
Cliff Torrance you need root privileges to change the stuff in that file. Look in the toolbar of PCmanFM (the file explorer) to view current directory as root. That will let you copy files. And don't forget if you do paste it into index you need to change the extension to .php
skiwithpete Hi Pete, thanks for the fast reply the info was spot on and all is working well, I have the same 8 relay board that runs our internal lights if we are away from home :-bedroom, landing1, landing2, bathhroom, wc all set up with crontab and works well. Now relay 6 will switch 4x external lights [1.5kW] with my mobile and ipad on my local network thanks to you.So i will have to set up my raspberry in my router to control the external lights from any where, thanks again..........................regards cliff
Hi there! I followed your directions as absolutely closely as possible and I cannot get anything to occur when I press the buttons on the webpage. Any suggestions on how to get diagnostic output so I can troubleshoot?
Thank you for a very fast reply. I did change the paths and did the modification to the sudoers file. However I think I found my issue in that I didnt rename to index.php instead of index.html
Hello, I don't know if you'll see this as the video is old'ish. But, I was wondering if I could use the relay that i got to control a lamp rated at 20 watts and 120v. I know you say not to use mains, but from what I've seen, it seems like you're referring to 220-230v and not 120v. Is there a way to use this with 120v?
+Caleb Schnell He's not saying that the relay won't work with it... because it will. He's saying to not do it for your own safty. If you feel comfortable doing this, and know what you're doing, the equipment will handle it.
The equipment does handle it. I used it for a while with a 120v desklamp I had. I didn't really care for having 120v going through a relay like that, even if it's rated for 220v. So I purchased some LED lights and fitted it for my lamp, they're rated at around 6v which is quite nice.
yeah it's okay, i sussed it soon after. Brilliant tutorial. Wrapped lights around a pringles can.lol Got some css styling for the buttons although now I'm thinking a nice toggle switch would look sweeter.
Hi could someone help me, the relay turns on when you execute the Python files, but when I go to the web page the command goes through (little green light on board) but nothing happens to the relays
skiwithpete i have some questions 1. see on your raspberry pi what operating system and can you link me to which one so i can run it on mine. 2. for the raspberry pi what power does it need ? to power up ? can a 12v power it ?
You need to update your video. Almost all the links given in the description and even your PHP code are dead links. Thought it was a super cool project you did and really wanted to follow along. I'll just have to find and buy the newer parts. Tutorial and concept stays the same, so that's nice. It would just be convenient to have links that worked is all.
Im not sure if you gonna read this but i have followed every step but im stuck in this problem were both codes are turning the lights on and none of them can turn it off any idea why i really need help :(
What will happen if you turn on the light by your phone, but turn it off with remote control? Is there any way to detect it by the relay, send a request by the WiFi dongle and then manage it on the server side? For example: I want to control the light by the mobile app and by the remote control. I won't have 2 buttons like you. I want to create a switch bar. I turn on the light by the phone (switch swipes to the right, makes itself green). Then I turn it off by remote control, not by the phone (server detects it and update my mobile app state - switch swipes to the left and makes itself gray)
I'm pretty new to the whole Raspberry Pi thing, but so far I have been able to run the Lighton_1.py program and turn the light on the relay on, but it didn't turn the 12V lights on. Any ideas? Also, my Lightoff_1.py didn't seem to work as the relay light just stayed on. Thanks!
Ryan Washburne if the relay is coming on, but the light isn't then you've wired the front incorrectly. If lightoff_1.py doesn't work then there must a pin number problem in the code - check that they're both the same...
skiwithpete Hi again. I've included an imgur album showing the wiring of my pi and the relay. The problem I am still facing is being able to run the Lighton_1.py script and having the lights turn on, but when I run Lightoff_1.py, nothing happens. Thank you again! imgur.com/ZlKf9b4,HfIrUx0
Ryan Washburne Image 1) you have put the connection to the relay in GPIO 15. Be sure that pinList = [15] on BOTH scripts. The only difference between Lighton_1.py and Lightoff_1.py should be Line19. Otherwise they should be identical. Image 2) Looks correct. My instinct says this is an issue you have with the scripts.
Help! Everything works except the html code. If I execute the .py files as standalone they turn the LED on and off. The buttons display if put the entire code of lpaste.net/raw/113783 into an .html file. What am I doing wrong if I am not getting the buttons to exec the python files?
Skiwithpete, I have used all the links in this and the 4 channel video for the apache2 and python programs. I put the text in for the sudoer. The program runs fine when I use SSH and run it in python. On the webpage, the buttons are there, but when I click I get the below error: 405 Not Allowed nginx/1.6.2Any ideas? I did not add permissions to the Apache and cannot figure out how (I thought switching the sudoer would alleviate that?)
Kurt Schoeps Yeah, the second one is bluetooth. Have you been following my alarm clock project? I intend to switch to bluetooth speakers in the near future and I've been experimenting recently.
hello skiwithpete, i have put the PHP code in "nano /var/www/index.html". everything works fine. i have a lighton and lightoff button on my webpage, but when i press on or off nothings happing on my relayboard. can you please help me out here? what might the problem be?
hello i got the web page up and all running but when i run the lighton_1.py it works but when i press the other off button nothing happens maby something to do with the quit
You're right, as it was part of that project, it eventually upgraded, and the code you're looking for is just a part of this... but alas. Here's what you need: github.com/skiwithpete/sesamepi - this is the same code, but adapted for a garage door. The only difference, with this code is that it has a 0.5second duration. You'll just want to comment out that part of the code, so that the light stays on.
Omaralfarouq Alfazazi put your Home Raspberry Pi on the public network. Put a password on your page, but you can then control it from anywhere you can access the internet.
Thank you very much Can you show me from where I can get more information about how to do this from zero , also if you have your own vedios talking about these staffs
Omaralfarouq Alfazazi I don't currently have a video about this - but I do plan on making one. It's on my list - I just haven't done it yet. I don't know where to look because every modem is different... Basically, it's all done on your modem/router. First you need to make your Raspi static. Then you want to do portforwarding, so that incoming requests go to your pi. then you want to sign up to a service like dyndns (just google it). There's a number of steps - and you need to figure your router out - but it can be done.
Hello, I am able to open my light with a sudo command but I cannot open it from my web site. When I click on the button "light on" on my web site, the raspberry led flickers but the lamp does not turn on. What ca I do to find my mistake? Thank you.
Is there way to also control colors and settings from the phone? Because whats the point of doing all this just to turn something on and off and not anything else. And if there isnt a way currently is it even possible?
skiwithpete Can you PM me? You have some cool projects and i want to try some in fact im placing an order on this light and everything tonight. I'm new to Raspberry PI i have the 3 and would like to get some help and you seem to really know what you're talking about.
Sorry, I get dozens of requests per day like this. Unfortunately, I can't act like a Raspberry Pi tutor. Watch my channel, learn and discover. Ask questions... but sorry, I can't PM.
Hi, I followed the code build as per your instructions. now when I press the light on the relay switches over fine, press Light off and nothing happened, the relay is still on!? any further info would be greatful Thanks
My apologies if my explanation dose not come across well.. I installed all the relevant code for the light on/off project as per say. The issue I seem to have is when I press the "Light On" from the web browser my relay turns on and I have around 3 volts present at the GPIO pin. now when I press the "Light Off" button the relay dose not switch back, the relay's green LED is still on. I measured the voltage at the GPIO pin in the OFF state and its gone low to 0v, this i beleave also to be correct? The relay I'm currently using is JQC-3FF-S-Z. I'm supplying the relay with a constant 5v with plenty of amps from an external PSU and NOT from the Raspberry Pi's 5v rail. I've tried several GPIO pins with the same result as above. Any further help/info would be gratefully received on this. Raspberry Pi 1 B latest Rasbian Jessie installed and all relevant updates/packages
skipwithpete, i have, over and over again. I'm no coding expert, but it all matches that off what you have links too! as i copied and pasted the code into my .py files. both On/Off files are saved in /home/pi. both files have the correct permissions granted, and to any of the other relevant code/files. Regards
I think most people would have probably cut the 12V power supply connector off and wired the relay in, instead of making the inline dongle thing, but whatever. That appears to be the leftover tube from a roll of kraft paper, BTW. We go through a lot of it.
Sorry to bother you but we need help running the light on and light off files when we try running them it gives us a warning message "runtimewarning: a physical pull up resistor is fitted on this channel GPIO.setup(i, GPIO.OUT) Also in the files it has several red messages saying to fix some things or to do some things do we just ignore those, and we've watched your videos and we can't set up our 1 channel reylay
I had some proplems with php script, but i solved it alredy. There is apache server index.html page already. /var/www/index.html I used super user modify file to index.php and added the code. Make sure you have Lighton_1.py and lightoff_1.py /home/pi folder.
That lamp looks OASOME!
The way you teach is very detailed, even giving a lesson about that exposed wire, that is a real step by step video, your channel deserves a lot more views by the way
Thanks for being so kind.
skiwithpete Hi, I'm interested in making a smaller version. Will the Raspberry Pi Zero W work with this?
Never mind I figured it out.... But I would like to add that I have never done any programing or code before this project. By just watching the videos you put out, I have completed this project and feel very confident to do many more. You are very good at what you do and its amazing that you do these videos so people like myself can learn and complete some pretty kick ass projects. Thank you
Thanks! I definitely appreciate the positive comments. I don't get them very often, and I'm very thankful when I do. Cheers, P
This is a *VERY* good tutorial! 👏😃 Thank you for slowing down and going through the _details_ of what you're doing! That was really helpful for me! 🙂👍
If you hadn't done that - then I would only know *_WHAT_* to do, but not understand *_WHY!_* So I would probably not have been able to implement the knowledge of all these components into other projects, which might need to have a slightly different setup!
10/10 🥞 Pancakes! 😌👌
This video is such a great tutorial. I understand everything you're doing (I'm doing something similar), but I don't know how to access the apache webpage from phone. Did I miss an explanation in the vid?
Excellent video, i just want to know if you can put the status lights on the web (if it is on or off) as it is the first time i do this.
This was a fantastic tutorial. I learned a lot and I am confident I could do this. Thank you.
You totally should do this! Let me know how you go. And thanks for the kind words.
sir can u please tell me the detail of the software part..hardware past is very nicely mention ...thank you
Thanks for the awesome tutorial. Can one use Jump Wires to connect between the male and female connectors?
yes.
nice video by the way,may i know do i have to store the codes inside one folder?
Thank you so incredibly much for this video! I was trying to get my relay board to work for DAYS with no avail but this made it make sense for me :)
Excellent way of explaining everything !!
Great job man!!
Is it possible to use this concept on a regular desk lamp? How can I connect the relay to the lamp? Would I have the cut the lamp's cord and then connect those wires to the relay? Thank you very much!
At somewhere around 7:30 you mention something about not showing us the other side because its not safe to play with mains, and then you mention that the adapter the leds are using is 12V, so that makes it safe. Doesn't the relay support up to 250V? That part kind of confuses me because I might be doing doing a project for a school in the near future. The school uses manual bells connected to a button, and I intend to make an automatic one that rings in the defined times using a raspberry pi and a relay switch. Also, you have 2 dongles there. One is for WIFI, but you never mentioned what the other one is for.
+MightKeeper 250V will kill you. 110V/250V is mains power. 12V is a much lower power, that won't kill you. The project you mention, shouldn't use mains electricity. The second dongle is for Bluetooth, that I never got working.
+skiwithpete Thanks for clarifying that.
How did you create the light on and off buttons in your phone, excellent project.
The code is in the about section. :)
Cool! I got my relay to work just like yours, but am trying to control the brightness of the same LED strip that you have there. Have you tried that before? My pulse width modulation doesn't seem to be working, the duty cycle doesn't look like it is changing!
Caine Jette haven't tried that yet. But, keep me posted on your progress.
Can I get the configuration command for the relay switch.
The configuration link you drooped was that of alarm setting.
I have a couple of relay videos with that code in it. Do a search for skiwithpete relay or I'll try to post links later.
@@skiwithpete kindly post it. Many thanks.
@@Noble-BenChukwuma-oz4xt th-cam.com/video/OQyntQLazMU/w-d-xo.html&ab_channel=skiwithpete
Loved this and your other videos.
Could you link me to a good place to read about "mains" power? Everyone says how bad it is, but I've yet to find a very good explanation as to exactly what it is, and why it's bad. Is it just bad for beginners, or are raspberry pis (the relays) not capable of working with it?
boughtout Mains power is the electricity that's in your wall socket. It comes in 100~240volts depending on where you live. It's bad because it can kill. The Pi stuff says that it can handle it, but I spoke to an electrician friend of mine and he was very concerned about putting mains power through it. I tried a project that used mains and I thought I knew what I was doing. Within minutes of posting it, I was shown the mistakes I'd made and was told that I was going to kill myself. And, again, I thought I knew what I was doing... If you want to learn about Mains electricity, you should sign up for an electrician's course. They're widely available and can make your hobby a serious career. P
Wow thats outstanding! What about covering the bottom of the relay breakout board with low temp hot glue as an insulator to isolate it form the bottom of the drip tray?
t. indy :) The advantage to the tape and screws is, if the relay fails I can replace it. And if the relay gets hot, that could melt the glue. But.. yeah, if I didn't have a drill and I did have hot glue - I totally would have done it too.
skiwithpete :) I've been looking for a solution for adding blue light to aid in working overnight shifts this was just the ticket! I have 2 Pi's just waiting for a job! I'll definitely share when I get em done! Thanks for the great project. Looking forward to the next ones!
+skiwithpete you used a screwto attach the relay? I thought it was just a circle of tape on top of the patch of tape. Couldn't the glue for the tape also melt under the heat too?
Great video ! Some questions though: Can this project be expanded to have the lights gradually light up? what about controlling the different lighting modes from the phone instead of using the remote?
+Isabelle Giuong u can use the phone and the gradually light up either
I have to built this setup and I have some Questions Regarding this Home Automation system...
I have to Implement home automation system using Raspberry pi controlled over wifi using smart phone.....
here are some of my questions for this Project.
1. I want this System To control The entire home switches which will require allot of ports on the rasberry pi how should I over come it
2. The relays will be distributed to each and every corner of house how I m gona provide power to them.
3. If I use wires to controll each and every relay it will be a large mess how to overcome this problem..
please sir Do Answer me.....
Thanks :)
Can you tell me what kind of style/brand wire stripper you used? It looks like you don't have to know the size wire your stripping to use it.
technoprocessor hey, there's actually a link to it in the About Section. Let me know if you're having trouble finding it.
skiwithpete Thanks, oh yea !
Hey question, so do you have to use a different raspberry pi for each project? Cause i'm searching for a way to give order to one raspberry and that can give order to for instance, the lock of the house, the lights, uhm the t.v etc, but what i saw is you placed the raspberry pi in there... so do i need to use a new raspberry pi for each project? Or is there some wifi adapter to give the relay the order like on and off.... Hope to hear from you and a very good video....
I use a raspberry per project. doesn't mean you need to. but I tend to.
skiwithpete okay thank you
how long did you cut the poster tube to?
Does any power coming from the LED's power supply go into the Raspberry Pi?
If not, could I use a higher rated relay to control powerful devices?
Hello! Nice tutorial! But the problem is i still dont understand in what GPIO pins you did connnect the relay! Please tell me what pins they are (pin 1) or a close photo to gpio pins
And olso to what pins you connected the relay by gpio
Coolcraftteam comunity
This will help you: th-cam.com/video/Z2B67hybdAA/w-d-xo.html
skiwithpete thank you!
How do you run the PHP code?
Hi when you talk about not using mains power do you mean the wall plugs? How can I try this project without using mains power?
I use a 12v light. So I'm interrupting 12v, not 120v and definitely not 240v.
@@skiwithpete oh so you mean don't just plug into an outlet and instead interrupt it?
@@abdalleali5005 Interrupt the lower power.
Do you have two power cords(one for the lamp and one for the pi)? or is there a way you can power the pi with the lamp power?
I have 2 power cords. And there's two parts to the story. I could run both off the draw of the 12V, but then I'd need a more powerful 12V supply. Or I could run a 12V extension cable into the base and separate the power there... but in the end, I just went for quick + cheap + easy and ran two cables in. I like your thinking tho. Let me know how you solve it.
Good job, nice tutorial. I'm wondering... can you safely disconnect and reconnect the relay when RPi is switched on? I've heard that a RPi's GPIO is kinda sensitive and easy to damage... so? Should I shut down my RPi before reconnect the relay or not?
77gawryl you absolutely should shut down your pi. There might be a sequence that wouldn't harm the pi while it is on, but I still wouldn't do it.
skiwithpete so let’s make it clear- should I olways shut down the Pi when I connect/disconnect something to tge GPIO? Or it's only related to the relay? (to be honest: I've plugged many times Dallas 18b20 thermometer when my RPi was operating, without any harm to it!)
77gawryl
And I've done the same. But, I wouldn't say it was safe. Like, sometimes I swim after eating - but I know I'm not supposed to.
can i use arduino in place of RPI?? please suggest some detailed guide thank you for wonderful video
Hi, I watched your video and it is awesome. But i have a question. I clicked on the relay link and i found that it was 5 VDC relay. So far that I know, raspberry produces 3.3 VDC for the output. How can raspberry drives the relay?
dimas adityamurthi The Raspberry Pi has a 5V power source on the GPIO rail (pin2 and pin4). This other video I made might help. th-cam.com/video/oaf_zQcrg7g/w-d-xo.html
skiwithpete I saw it. I guess the relay board uses transistor or MOSFET so that relay can be activated using 5 VDC instead of 3.3.Thank you. :) i really enjoy your video
skiwithpete I saw it. I guess the relay board uses transistor or MOSFET so that relay can be activated using 5 VDC instead of 3.3.Thank you. :) i really enjoy your video
Awesome video! Will try this as soon as my Pi arrives!
Cool, let us know how you go!
I'd like to do this with the 4 relay board and 4 different lights. Is this possible?
Hey! Cool video :) Is there any way to connect the relay and the pi wirelessly? I'm thinking if I want to use the same Pi for controlling more than one device? :)
there are wireless relays but they tend to be quite expensive. however you might choose pi zeros to control the relay and have one pi control them all...
Thanks for the reply! I like the idea - one Pi to rule them all :) zero's seem affoardable enough.
try looking at tosr, google it.
Do you have a tutorial using a programmed app not on a browser? Thanks!
I really love this project ! Helped a lot! Thank you! By the way didn't you forget put CSS into desc?
Peter Gosselin
Do you have the link for the puzzle light?
Derek Dickerson Link to the Puzzle Light: amzn.to/1tr2lQE I bought 2X30packs to make my size of light.
skiwithpete How can I puzzle that to a tower? I think the product is a ball.
WTma0812
It's just how you put it together. Here's a link for the cylinder shape I went for th-cam.com/video/YP_YLcYEcoc/w-d-xo.html BUT, there's lots of vids like this, you can make all sorts of shapes!
hi dude my name is akshay ... can pls tel the me the steps like on how exactly did u connect ur phone to the system......and help me out i m using windows 10 ,.....i really need ur help.......i m doing a project....soo i want your help......
Hi,i'm planning to make one of this in my house as my school project,can i have the drawing for the schematic circuit? Because i still cannot get how to connect all the device
Turned out so well! Nice! Thanks for the explanation :)
In my opinion the best tutorial for raspberry beginners..but can you give me an help for the code? the tutorial is perfect for the hardware side but software side? what i have to do with the python code and apache?? sorry but i really want to try this project
Gabriele Follesa The code is in the About Section. Start by putting the python code in the /home/pi folder and run it with the command sudo python lighton_1.py the instructions for Apache are in the "Raspberry Pi Packages" link. Cheers, P
skiwithpete thanks for the quickly reply..but i have to create a **.php file with the php code and put it on the phone right? is there any control to check if the phone is comunicating with the raspberry or not? because i have already created the 2 py file and the php file. thanks again in advance
Gabriele Follesa you put the php code in index.php in the /var/www folder on the pi. You put nothing on the phone. You're building a webserver on the pi. And you're accessing it through the phone...
skiwithpete Hello, sorry if I stressed you again :) ..but I've mounted the the relay in this way: VCC in pin #2, GROUND in pin # 6 and IN in pin# 5 like this scheme (raspilab.files.wordpress.com /2014/08/gpiosb.png) and as us showed in your other video.
However, the relay remains with the two LEDs always on even if I press Lighton or lightoff from php page accessed through apache. I've already launched the python code as you suggest.
Can you give me a hand to fix?
Thanks in advance as always
Gabriele Follesa
In the lighton_1.py and lightoff_1.py change pinList=[3]
Because pin#5 on the board is GPIO3. So you need to make that change.
This morning I posted another video about relays. You should check that out. th-cam.com/video/OQyntQLazMU/w-d-xo.html
witch pins you use for the gpio on the pi
thank you very much skiwithpete.....
But I want to do it with 230volt. sowhat should I do?
and where will i get that relay...
Sameer Bhagwat 230V can kill. Don't do it.
Thanks for reply
But I want to control all the home appliances on that. So is there any option to do that?
Sameer Bhagwat As far as I know there isn't a safe way to do this yet. But be sure to subscribe, because as soon as there is, I'll be posting in my channel. Best, P
Is there a component that I can add to brighten and dim an LED strip(s) light timed with your "alarm clock feature" using a 4 way relay and timed music components to a speaker system?
+Rose Bechtel You can use Pulse Width Modulation (PWM) to control the lights. But I haven't tried it yet. Let me know how you go. P
can you make a video about the coding part, as most of us don't have a strong programming background.
noroz k Hey, I made it so it's copy and paste - all the code is in the about section... But you're right, this isn't really as beginner friendly a video as you are looking for. Maybe try checking out my 4-channel relay video: th-cam.com/video/OQyntQLazMU/w-d-xo.html or even better, start with my alarm clock th-cam.com/video/julETnOLkaU/w-d-xo.html
Is there a way to control the color of the lights as well?
Pwm. I haven't gotten into it yet. But yes it's possible with pwm.
hi pete, all your tutorials are put together very well and easy to follow but i am stuck on the php file,I loaded the Raspberry Pi instructions for Apache ok and had no problems, the lighton and lightoff scrips switch the relay on/off in the terminal with the sudo command ok but when i go to var/www i find the index,html file but cannot put the php code into it can you advise..............rgards cliff
Cliff Torrance you need root privileges to change the stuff in that file. Look in the toolbar of PCmanFM (the file explorer) to view current directory as root. That will let you copy files. And don't forget if you do paste it into index you need to change the extension to .php
is there any other way to finish the job...............regards
Cliff Torrance sudo nano /var/www/index.php
skiwithpete Hi Pete, thanks for the fast reply the info was spot on and all is working well, I have the same 8 relay board that runs our internal lights if we are away from home :-bedroom, landing1, landing2, bathhroom, wc all set up with crontab and works well. Now relay 6 will switch 4x external lights [1.5kW] with my mobile and ipad on my local network thanks to you.So i will have to set up my raspberry in my router to control the external lights from any where, thanks again..........................regards cliff
Cliff Torrance You're very welcome. Just remember - don't play with mains. Get a certified pro in to do that...
rather then making a wifi button can, you make a touch screen button attached the the raspberry pi? how involved would it be,
+Luis Valenzuela You could just attach a touch screen, use the web browser on the pi and open it to the internet page, and boom
Hi there! I followed your directions as absolutely closely as possible and I cannot get anything to occur when I press the buttons on the webpage. Any suggestions on how to get diagnostic output so I can troubleshoot?
Alex did you rename html to php? Did you change the permissions? Does it point to the right directory? Those are common mistakes
Thank you for a very fast reply. I did change the paths and did the modification to the sudoers file. However I think I found my issue in that I didnt rename to index.php instead of index.html
Sir, could you please explain these three tasks given to Alex in a little detail.
I couldn't get your point.
I'm desperately working on this project
Hello, I don't know if you'll see this as the video is old'ish. But, I was wondering if I could use the relay that i got to control a lamp rated at 20 watts and 120v. I know you say not to use mains, but from what I've seen, it seems like you're referring to 220-230v and not 120v. Is there a way to use this with 120v?
***** I am referring to 120V. 120V is mains electricity. Start small. Start with a 12V lamp like I did. Mains can kill.
+Caleb Schnell He's not saying that the relay won't work with it... because it will. He's saying to not do it for your own safty. If you feel comfortable doing this, and know what you're doing, the equipment will handle it.
+Denton Melvin Actually, the equipment MIGHT handle it. I don't know. Some will, some won't.
The equipment does handle it. I used it for a while with a 120v desklamp I had. I didn't really care for having 120v going through a relay like that, even if it's rated for 220v. So I purchased some LED lights and fitted it for my lamp, they're rated at around 6v which is quite nice.
+Caleb Schnell You're referring to one you have in particular - not to all of them in general - which is what I was trying to make clear.
do you have to run both programs lights on and lights on?
thanks
+Elliot Payne ? Don't think I understand the question.
I meen lights on and lights off .py
+Elliot Payne you could run lights on .py and then when you want to turn it off, have lights on .py quit. But that's up to you
Thanks you are very helpful !!!
which pins do you connect from the gpio to relay?
if you are counting pins it is pin10, or gpio15 aka rxd. find a gpio 40pin reference (google).
yeah it's okay, i sussed it soon after. Brilliant tutorial. Wrapped lights around a pringles can.lol Got some css styling for the buttons although now I'm thinking a nice toggle switch would look sweeter.
Change the BCM to BOARD and just put what pin # you want I use 40 in the py file
Hi could someone help me, the relay turns on when you execute the Python files, but when I go to the web page the command goes through (little green light on board) but nothing happens to the relays
Thank you... finally some one who made this easy enough for me to understand...=) and with some nice and easy code..=)
Fantastically detailed video. I'm going to pretty much clone this project so thanks. :)
+Matt Plitnikas Cool, keep me posted on your progress!
Is there any guide on the code i am not that good at coding
skiwithpete
i have some questions
1. see on your raspberry pi what operating system and can you link me to which one so i can run it on mine.
2. for the raspberry pi what power does it need ? to power up ? can a 12v power it ?
+Shadi 1 The Raspberry Pi is powered with 5V only. If you put 12V to it you will blow it up.
You need to update your video. Almost all the links given in the description and even your PHP code are dead links. Thought it was a super cool project you did and really wanted to follow along. I'll just have to find and buy the newer parts. Tutorial and concept stays the same, so that's nice. It would just be convenient to have links that worked is all.
Updated with a GitHub link. Thanks for letting me know it wasn't working.
Wow! I really appreciate the fast response! The GitHub link was exactly what I was looking for!
Hello, how can i instal my rasberry pi for automatic home. Could you show me or send me link?
is there any app ???
then who to get switch display in our phone
how many reles can I connect on one raspberry?
Could you please provide us with the PHP code. Thanks!
Im not sure if you gonna read this but i have followed every step but im stuck in this problem were both codes are turning the lights on and none of them can turn it off any idea why i really need help :(
how did you connect your raspberry pi to your cellphone??
it would be good to see a video of your doing to code work as for me the set up is easy its just the coding i struggle with :-(
The code is in the "About Section" so you can grab it and take a look.
what happens if I connect the relay to the wall and to the light.
What will happen if you turn on the light by your phone, but turn it off with remote control? Is there any way to detect it by the relay, send a request by the WiFi dongle and then manage it on the server side?
For example:
I want to control the light by the mobile app and by the remote control. I won't have 2 buttons like you. I want to create a switch bar. I turn on the light by the phone (switch swipes to the right, makes itself green). Then I turn it off by remote control, not by the phone (server detects it and update my mobile app state - switch swipes to the left and makes itself gray)
What us the Raspberry pi OS you use in this ?
Abdul Azeez raspbian
I'm pretty new to the whole Raspberry Pi thing, but so far I have been able to run the Lighton_1.py program and turn the light on the relay on, but it didn't turn the 12V lights on. Any ideas? Also, my Lightoff_1.py didn't seem to work as the relay light just stayed on. Thanks!
Ryan Washburne if the relay is coming on, but the light isn't then you've wired the front incorrectly. If lightoff_1.py doesn't work then there must a pin number problem in the code - check that they're both the same...
skiwithpete Hi again. I've included an imgur album showing the wiring of my pi and the relay. The problem I am still facing is being able to run the Lighton_1.py script and having the lights turn on, but when I run Lightoff_1.py, nothing happens. Thank you again! imgur.com/ZlKf9b4,HfIrUx0
Ryan Washburne
Image 1) you have put the connection to the relay in GPIO 15. Be sure that pinList = [15] on BOTH scripts. The only difference between Lighton_1.py and Lightoff_1.py should be Line19. Otherwise they should be identical.
Image 2) Looks correct. My instinct says this is an issue you have with the scripts.
dumb question here.... What do you mean by "dont play with mains".
Are you saying this system isn't right for using your main house wiring?
Byte Deez yeah, your house wiring is very strong and can kill. Stick with lower voltages like this example which uses 12V.
Any instruction on setting up the web UI?
Kash green code is in the about section
Help! Everything works except the html code. If I execute the .py files as standalone they turn the LED on and off.
The buttons display if put the entire code of lpaste.net/raw/113783 into an .html file. What am I doing wrong
if I am not getting the buttons to exec the python files?
skiwithpete you are using two female jumper right?but which gpio pins in raspberry pi that you use?it is not very clear
Female to female jumpers yes. GPIO15.
skiwithpete means that both female jumper connected to GPIO15??
+5V, GND, and GPIO15
try this vid: th-cam.com/video/Z2B67hybdAA/w-d-xo.html
or: th-cam.com/video/oaf_zQcrg7g/w-d-xo.html
skiwithpete you means two pins from +5V that is GROUND & GPIO15 right?
No. 3 wires are connected. 1) +5V 2) GND 3) GPIO15.
Hope this helps,
P
Skiwithpete, I have used all the links in this and the 4 channel video for the apache2 and python programs. I put the text in for the sudoer. The program runs fine when I use SSH and run it in python. On the webpage, the buttons are there, but when I click I get the below error:
405 Not Allowed
nginx/1.6.2Any ideas? I did not add permissions to the Apache and cannot figure out how (I thought switching the sudoer would alleviate that?)
no, you still need to change permission
Do you have the text and location for that? I am finding conflicting info on the web
Is that ordinary motor relay?..
What is the second USB on the Pi? The first one is WIFI, second bluetooth?
Kurt Schoeps Yeah, the second one is bluetooth. Have you been following my alarm clock project? I intend to switch to bluetooth speakers in the near future and I've been experimenting recently.
How do you get the software for your phone to connect?
Like what I mean by that is how did you get it because I don’t understand how to connect phone to pi
@@keym2252 one answer is, it's a webpage hosted on the pi. The other is about static IP address on your router.
is this possible to do this one with pi B+
+anh phuong Le yes
Great tutorial! Subscribed.
the php wont work pete, the php file supposed to be in the /var/www/html directory right? changing the index.html...
my fault. saved it as .html, silly me.
good., i want this led strip how to i pay it?
+Sathish Kumar amzn.to/1VYgSCM
hi, when i pres the buttons nothing happens but the python code works as i have tested it on terminal , how should i triubleshoot
where do i put the php code and should there be another html file or just that
I have same problem
Can you please provide circuit diagram?
hello skiwithpete,
i have put the PHP code in "nano /var/www/index.html".
everything works fine.
i have a lighton and lightoff button on my webpage,
but when i press on or off nothings happing on my relayboard.
can you please help me out here?
what might the problem be?
+Tian Li you need to rename index.html to index.php
Still nothing.
Where do i need to put the php code?
+Tian Li in index.php
+skiwithpete u mean this command "nano /var/www/index.php"
if it is that then i've already done that
and notings happening
+Tian Li put a "sudo" in front of it
hello i got the web page up and all running but when i run the lighton_1.py it works but when i press the other off button nothing happens maby something to do with the quit
Can I get the code of the above project
It's in the about section
@@skiwithpete I am getting the code for alarmpi project
You're right, as it was part of that project, it eventually upgraded, and the code you're looking for is just a part of this... but alas. Here's what you need: github.com/skiwithpete/sesamepi - this is the same code, but adapted for a garage door. The only difference, with this code is that it has a 0.5second duration. You'll just want to comment out that part of the code, so that the light stays on.
I'm unable to open it in nano tho. It wont let me.
Does anyone know how I'd go about making an iOS app to control the lights?
Hi there. . I would like to control my house by mobile phone from "large distance" by sending messages using normal network , what can I do? !
Omaralfarouq Alfazazi put your Home Raspberry Pi on the public network. Put a password on your page, but you can then control it from anywhere you can access the internet.
Thank you very much
Can you show me from where I can get more information about how to do this from zero , also if you have your own vedios talking about these staffs
Omaralfarouq Alfazazi I don't currently have a video about this - but I do plan on making one. It's on my list - I just haven't done it yet. I don't know where to look because every modem is different... Basically, it's all done on your modem/router. First you need to make your Raspi static. Then you want to do portforwarding, so that incoming requests go to your pi. then you want to sign up to a service like dyndns (just google it). There's a number of steps - and you need to figure your router out - but it can be done.
Thanks a lot 😊 .. if I get anything new or facing any problems, l'll contact you " of course if you don't have any problem with that " thanks again
When i click the light on button on the web nothing happens. May i know why please help me!
Excellent video. Subscribed.
Amazing tutorial bro...Thanks!
Hello,
I am able to open my light with a sudo command but I cannot open it from my web site. When I click on the button "light on" on my web site, the raspberry led flickers but the lamp does not turn on. What ca I do to find my mistake? Thank you.
+Katherine G Did you rename the file .html to .php? Does the php point to the right place?
+Katherine G Did you rename the file .html to .php? Does the php point to the right place?
Is there way to also control colors and settings from the phone? Because whats the point of doing all this just to turn something on and off and not anything else. And if there isnt a way currently is it even possible?
Look for PWM - pulse width modulation.
skiwithpete Can you PM me? You have some cool projects and i want to try some in fact im placing an order on this light and everything tonight. I'm new to Raspberry PI i have the 3 and would like to get some help and you seem to really know what you're talking about.
Sorry, I get dozens of requests per day like this. Unfortunately, I can't act like a Raspberry Pi tutor. Watch my channel, learn and discover. Ask questions... but sorry, I can't PM.
I understand man and well than quick question how'd you set up the server from your phone to the Raspberry Pi
Setup the webserver on the Raspberry Pi, point your phone's browser to the webserver. Check the about section for how to setup an Apache Server.
Hi,
I followed the code build as per your instructions. now when I press the light on the relay switches over fine, press Light off and nothing happened, the relay is still on!?
any further info would be greatful
Thanks
No help from the community then!
I think you need to be more specific in your feedback. I followed it, and it doesn't do what it's supposed to... isn't very helpful.
My apologies if my explanation dose not come across well..
I installed all the relevant code for the light on/off project as per say. The issue I seem to have is when I press the "Light On" from the web browser my relay turns on and I have around 3 volts present at the GPIO pin. now when I press the "Light Off" button the relay dose not switch back, the relay's green LED is still on. I measured the voltage at the GPIO pin in the OFF state and its gone low to 0v, this i beleave also to be correct?
The relay I'm currently using is JQC-3FF-S-Z. I'm supplying the relay with a constant 5v with plenty of amps from an external PSU and NOT from the Raspberry Pi's 5v rail.
I've tried several GPIO pins with the same result as above.
Any further help/info would be gratefully received on this.
Raspberry Pi 1 B
latest Rasbian Jessie installed and all relevant updates/packages
Check the code.
skipwithpete, i have, over and over again. I'm no coding expert, but it all matches that off what you have links too! as i copied and pasted the code into my .py files. both On/Off files are saved in /home/pi. both files have the correct permissions granted, and to any of the other relevant code/files.
Regards
I think most people would have probably cut the 12V power supply connector off and wired the relay in, instead of making the inline dongle thing, but whatever.
That appears to be the leftover tube from a roll of kraft paper, BTW. We go through a lot of it.
could i acess it from anywhere on the world?
If you expose your network to the internet - which I don't recommend.
@@skiwithpete ohh well alright , could i somehow make it private and acessible only by me but make it safe?
@@michas.2475 There are tunneling softwares, but none that I use or am familiar with.
Sorry to bother you but we need help running the light on and light off files when we try running them it gives us a warning message "runtimewarning: a physical pull up resistor is fitted on this channel GPIO.setup(i, GPIO.OUT)
Also in the files it has several red messages saying to fix some things or to do some things do we just ignore those, and we've watched your videos and we can't set up our 1 channel reylay
When we try running our php code on the car/www it says there's a syntax error with the html
I had some proplems with php script, but i solved it alredy. There is apache server index.html page already. /var/www/index.html I used super user modify file to index.php and added the code. Make sure you have Lighton_1.py and lightoff_1.py /home/pi folder.