I'm just starting out with the Raspberry pi as a way to expand on the electronics that I have learned over the years and when looking for examples for relays I found your scripts. I've given them a try and I find them very helpful. Thanks.
@DotcomL10 жыл бұрын
Nice video :) I actually thought you could be harming the life expectancy of the relays, but went on to check and the number of switches is in the millions. That's the incredible!
@skiwithpete10 жыл бұрын
Guilawless nah! Use 'em. I reckon it'd be a badge to honor trying to kill one of these things.
@Ultramesh4 жыл бұрын
Very nice scripts. Works perfectly. Now I just want to link it all to the Alexa Echo Dot.
@ashutoshtiwari37855 жыл бұрын
You can almost do a music concert with those relay sounds. I liked that second script.
@wastinghours47588 жыл бұрын
Holy heck man! I've spent DAYS trying to launch my script through a browser. Your code showed me the way. Thank you so much for posting it!
@wastinghours47588 жыл бұрын
"sudo nano /etc/sudoers add to bottom of file: www-data ALL=(root) NOPASSWD:ALL"
@israelgoytom60858 жыл бұрын
sudo nano /etc/sudoers add to bottom of file: www-data ALL=(root) NOPASSWD:ALL" is this setting has no any effect regarding to security?
@asyrafhasanuddin80577 жыл бұрын
thanks heaps. this got my code working.
@RakTheGoose6 жыл бұрын
this allows sudo script access without providing root password.
@mvpsvable6 жыл бұрын
Exactly what i was looking for, my 4 channel relay is on its way. Thanks for posting good video!
@felixcomms7 жыл бұрын
A couple of days of trying this and that and it all works great.... Many thanks for the guidance
@andrewdavis69176 жыл бұрын
Wow, very nice. Glad you showed the trouble shooting. Hey from TX
@johnnyrizzo80578 жыл бұрын
that is really cool. do you think this can run on the FPP (falcon Christmas player) this would be a great tool used to turn 12v power supplies on and off remotely.
@talibiton39729 жыл бұрын
I Liked you're video very much, because its not like i've learnd how to use relay, i also learned how to trubleshoot which is as important! THANKS!
@skiwithpete9 жыл бұрын
+Tali Biton cool, thanks.
@wsoundman6 жыл бұрын
This is great stuff. And better again you never said "uhhhhh ". Most polished
@josecunha7319 жыл бұрын
...loved the tutorial. I need to do something very similar involving controlling relays remotely, you were an great help to get started. Thanks much!
@kabongemuhamadi52985 жыл бұрын
Did you achieve this , I want some help
@eaglewitharifle8 жыл бұрын
Hi, nice video. My 4 channel relay works but for some reason (depending on what GPIO it's plugged into) some of the relay lights illuminate with a dim red color when it starts up. The same as what your first LED does at 5:26. Why is this?
@AskShahzad7 жыл бұрын
Amazing and Lovely, nicely taught ! i tried it and it worked like charm !!! just anyone who wish to use remember to check your ports and remember them,
@dartbeats-k1x8 жыл бұрын
I'm assuming this doesn't need resistors while wiring those jumper cables, correct?
@fabicon7 жыл бұрын
Hi Man! great video. How would you include a GSM Module to this setup? im in process of trying to build this for my off the grid cabin(with solar panels)
@misteraon9 жыл бұрын
So looking at your code examples it looks like these relay boards are active low. I was planning on using one of these boards to operate sprinkler solenoid valves for my garden irrigation with WebIOPi. Do you see any concerns with the pins reverting to an active low state after a reboot...say the power goes out. Don't want my irrigation valves opening unexpected say if I'm away.
@xilefonemusic9 жыл бұрын
With the 5 and 5a programs, can i connect my garage door to the relay, and would it open and close? Also, can i just set the pi and the relay on a board, or do i need to wall mount it.
@gdjobufckngfruitcake9 жыл бұрын
Really great video, subscribed definitely. Im going to use a similar design to yours for a switch controlling cold cathode PC case lights.
@zhouyu99714 жыл бұрын
I’m very new to this. Is that possible to make some nice looking interface to cover the coding, then we can use a touchscreen to make a center control panel in home automation? I wish to use it on my motorhome.
@skiwithpete4 жыл бұрын
github.com/skiwithpete/sesamepi is the code for this: kzbin.info/www/bejne/pmPEk41vZZKYi5I yeah, you can control the relays on a web page.
@ArtisanASCII4 жыл бұрын
Hello! Can anyone point me in a direction where it shows using this relay with the Raspberry PI being isolated? From my web searching it seems to indicate that power be provided to JD-VCC & GND but the jumper seems to be bridging JD-VCC & VCC and I don't see a separate GND to use when connecting up a separate 5V power supply. I hope someone can shed some light on this. Thanks!
@nielsenaaa4 жыл бұрын
you are a php guy, im sure, i can tell ! proud to be one too ^^
@davetheglidingbum5 жыл бұрын
Thanks for this, I have learned a lot from your code in a short time. Do you think it would work as well on a pi zero?
@skiwithpete5 жыл бұрын
Yes. It will.
@sagnikbhattacharya8 жыл бұрын
Cool video. Can you tell me a. How to connect appliances such as sensors to the relay (not the software, just the circuit)b. How to power the relay with external power.
@Randy27475 жыл бұрын
Is it possible to hook pir up with these codes? Woukd it be hard to do? I'm new with the pi
@GiorgioSegatori5 жыл бұрын
Very nice really and I'm using it....but where can I find php section? I'd like to put it in a web browser
@sahilharit77369 жыл бұрын
Can you suggest me, which type of wiring should I do to operate mains(lights, fans etc) with relays so that the normal/manual switches also work if raspi system is not online?
@skiwithpete9 жыл бұрын
+Sahil Harit Don't play with mains!
@sahilharit77369 жыл бұрын
but I'm up for home automaton, that's why I'm asking!!!
@sahilharit77369 жыл бұрын
+skiwithpete ok... thanks!
@zakariaellougbi38937 жыл бұрын
a little tip for your next videos, you can use the Zoom option of your browser for bigger buttons... (just for the video ^^ ) Thanks for sharing (y)
@skiwithpete7 жыл бұрын
zakaria ellougbi nice tip
@yashindian42334 жыл бұрын
Awesome..planning to buy one can u please help me with..a video where u can add music to it
7 жыл бұрын
Nice tutorial. What Image do you use for the raspberry?
@matfloyd20088 жыл бұрын
FYI, in some of the python programs there are missing parenthesis. This causes an error message to populate, and the program will not work until the parenthesis for the print statements are typed. Parenthesis are required for python3.x. Ps. I just got my relay board to work just as your video shows! Thank you for all your help with the tutorial and your python code! I am planning on making a 3000 ft. AGL rocket that is controlled by the pi and the relay switches. And this is using the Pi 3.
@berkcan34759 жыл бұрын
is it dangerous to use relay module for controlling extending cable coming from mains electric???
@40nmugzy8 жыл бұрын
Hi pete. My name is Nick. I've been looking for a way to control a machine I've been building for my plasma cutter. I designed and built a relay circuit but it seems pretty bulky. Since I saw your video on relay board controlled by a raspberry pie I just know this would be perfect. Now the only thing I didn't see in the video was how to create a program to integrate contact switches to input to the raspberry pi. What I'm talking about is I need a motor to start. This spins an acme thread. A nut on the acme thread is connected to a sled, runs down on two polished rods that have linear bearings connected to the sled. The sled holds a plasma torch. The function of this machine is to run a plasma torch in a straight line to cut metal. So, turn on the torch, it needs to start the motor, run for a predetermined time, at the end of the cut turn off the torch, stop the motor, return the sled to start position and stop the motor. So if you could make a video on how to control the relays I would greatly appreciate it
@JCaliSwag969 жыл бұрын
Quick question... so I got everything to work, and I made new scripts that are identical to script5 and script5a, the only difference is the pin number. However, whenever I attach electronics (I'm using a lamp that I cut the wire in half) they only work when I touch the two ends of the wires to the center and right metal part. Whether the channel is on or off, the light turns on only with the center and right part. And whether the channel is on or off, the light never turns on when the wires are attached to the center and left part. What might have gone wrong? Maybe a problem with the actual relay? Thank You!
@adevilla8 жыл бұрын
Great work Pete, it worked a treat 1st time. Thanks.
@skiwithpete8 жыл бұрын
Find the scripts here: github.com/skiwithpete/relaypi/tree/master/4port To add PHP: Raspberry Pi packages: lpaste.net/raw/92403 index.php: lpaste.net/raw/117599 Watch my other Raspberry Pi relay videos: 1 channel relay video: kzbin.info/www/bejne/aaaXZpuqqraYl8k 8 channel relay video: kzbin.info/www/bejne/pZLJkK2HmNeabck 16 channel relay video: kzbin.info/www/bejne/infXZWtmqN2Bjck Check out my other Raspberry Pi projects: Garage door remote: kzbin.info/www/bejne/pmPEk41vZZKYi5I Outdoor Automated Lights: kzbin.info/www/bejne/rpSUlZR_l5Z_jMU File Server (NAS): kzbin.info/www/bejne/nHi8dKWPiZZkatE Weather Station: kzbin.info/www/bejne/moO3ZGybaLWEqM0 How to Bitcoin Miner: kzbin.info/www/bejne/i2PCpXmZnptkhqc Voice activated lights: kzbin.info/www/bejne/pqa4n5SCqNyUn8k Control a light with your Mobile phone: kzbin.info/www/bejne/jaGwYpSnaadrY6M Donate here: If you like the video or think it's useful buy me a coffee bit.ly/1kAous6 Donate with bitcoin! 1HfHr25qZQjPzwphPxpNaD5CytDNYcfzrJ Support this channel on Patreon! patreon.com/skiwithpete
@XW0RKS8 жыл бұрын
somehow php won't run python script for me. don't know what's the issue... I searched online a lot seams like I can't find the solution. it's probably something simple, but I can't figure out what.
@skiwithpete8 жыл бұрын
Check here for all the further information relating to this video. Get the relay here: amzn.to/1BoBucC Get the GPIO wires: amzn.to/1VyYIYb Get the WiFi dongle: amzn.to/1v8L7Ho Get a 5V2A power supply: amzn.to/13LeA49 Get the Macbook Air: amzn.to/1Hignwv And, the Raspberry Pi Model A+: amzn.to/1vxr85T Or get the new RaspberryPi2: amzn.to/1zJlP9L Get the parts in the UK: bit.ly/15XFRBH **Remember: Help each other in the comments section. And please repost your code.
@markkerr70948 жыл бұрын
got it running first time big step for me thanks again
@bobbyjoedill7 жыл бұрын
How hard would it be to control off road lights via the app and switches? Thinking of using a pi to control my truck lights. I have used ardiuno boards before and have limited programming skills.
@skiwithpete7 жыл бұрын
The disadvantage is that the Raspberry Pi needs to boot and shutdown properly, so I would say it would have limited use in a vehicle that doesn't have an "always on" power source.
@dr.agostefun9 жыл бұрын
Hello, Thank you for your great video tutorial. I try to do/run your examples about open and close some relays but I have some difficulties on closing the ralys. Do you know if I'm doing something wrong? (i'm using the same code as you wroten in script5 and script5a. script5 is working but script5a not). thank you for your answer.
@skiwithpete9 жыл бұрын
Dragos Florin Stefan From the information you've given me it's very difficult to tell what has gone wrong. I think that you should check if pinList = has the same number on both. Besides that, any further information about the error will help.
@dr.agostefun9 жыл бұрын
skiwithpete well... I can Open the relays but I can't close them. script5 is working, script 5a not working. :))
@skiwithpete9 жыл бұрын
Dragos Florin Stefan are there any error messages? what is does the line with PinList say on both scripts?
@isjesse17 жыл бұрын
im new to this, how do you program an android app to control a relay via raspberry access point or bluetooth?
@claudioguendelman2 жыл бұрын
hi from chile well done thanks
@pbrown49 жыл бұрын
sorry for the "silly" question, but can you only access the webpage (for 5 and 5a) from your home wifi? or can you do it from anywhere (eg. your work or friends house)?
@skiwithpete9 жыл бұрын
Peter Brown Only internally unless you do a lot of configuring (including Port Forwarding on your modem). I intend to do a video to show how this is done soon. But for now, only on your internal network. P
@JohnPaulLafata7 жыл бұрын
Hey, I'm new to all of this so sorry if this isn't a great question, but is the this configuration enough to power a 110v AC or 12V DC solenoid valve?
@jyvben15207 жыл бұрын
depends on the relay, most relays have that info printed on top example if it says 10 A 125VAC it can power a device that uses 110v ac and is about a 1000 Watts. it can also say 10A 28VDC then that is enough for your 12V solenoid valve and less than 120 Watts
@siddheshmhatre43666 жыл бұрын
can u suggest good relay board make.?
@BennyCFD8 жыл бұрын
Great video as always . 2 questions...1, in order to connect my laptop via WiFi to the raspberry pi how do you know what the access code of the raspberry pi is. 2, The raspberry Pl 3 uses I believe 3 or 3.3 volts in th GPIO.. Are there 3.3 volt devices like relays etc. Thanks
@rawl059 жыл бұрын
hey I am totally new to raspberry pi. can you guide me to use raspberry pi to control 4relays using input via switch from the user. and those relays to be also controlled wirelessly by android device via ip using web.
@WayneRigley6 жыл бұрын
Any way you can show how to make a script for turning a relay on and off for a specific time every day
@skiwithpete6 жыл бұрын
I would do that through cron, running the script. Rather than in the script.
@WayneRigley6 жыл бұрын
@@skiwithpete ya no idea on this stuff.. I'm new to the coding side
@skiwithpete6 жыл бұрын
@@WayneRigley ok, so choose the script that you want to modify (from my open source examples), and then add it to cron (which is a system level timer). So you can schedule things inside the OS. Like if you want a program (like a diskscan) to run at a time (3AM everyday). So step one, get the script working the way you want it to. Then step two, learn about cron to get the script to run at a specified time.
@WayneRigley6 жыл бұрын
@@skiwithpete thank you very much for taking the time to respond to me what I'm doing is I have a 12 volt linear actuator which is going to operate my chicken coop door as well as LED lighting inside the chicken coop. this is the reason for me wanting to automate this on my Raspberry Pi 3 B plus I have a 4 channel relay that's going into the mix both the actuator and the LED or 12 volt source. I'm very familiar with how relays work so that's not an issue it's mere getting the script to do what I want or the file I should say. I'll definitely be taking a look at your examples within the hour. Again thank you
@juggalizzle755 жыл бұрын
some people say to use a 3/3.3 v relay instead of a 5v relay. Have you noticed the raspberry pi not delivering quite 5v and failing to trigger the relays? I assume this is why the recommend using relays with a lower trigger value
@skiwithpete5 жыл бұрын
Not a problem with optocoupler relays
@FIGTHER0118 жыл бұрын
Hi skiwithpete.I am trying a lot here but no luck :( your script 4, can you make that in php wit out count down? just kiip it blink? and a butten there stop the script again?Cheers Jimmy
@FIGTHER0118 жыл бұрын
Any one maybe?
@raviratansingh180510 жыл бұрын
Can you share some thing controlling the 4/8 channel or relay () using Intel Edition for automation
@skiwithpete10 жыл бұрын
Ravi Ratan Singh I don't understand your question. The source code is in the About Section. What's that about Intel Edition?
@0streamer07 жыл бұрын
Thanks for the scripts they helped alote
@honeybadger61277 жыл бұрын
in what folder location on the pi do you store the index.php file at?
@jyvben15207 жыл бұрын
on a raspberry pi using apache2 webserver then probably in the /var/www/html folder check your /etc/apache2/apache2.conf file for
@charliemesa8 жыл бұрын
Hello, quick question. If you put this up on your lights at home...and somehow the pi is broken, how can you manually switch on and off the lights?
@Anonymous-vh6kp7 жыл бұрын
You can set the relay to be on by default. So if the relays lose power, everything will be switched on. You should control your circuits at the device itself rather than through an existing switch, that way your normal physical switch will still be functional.
@tratzum9 жыл бұрын
Thanks for the video..all of your videos. I know nothing of python so learning is slow going. question I have is how do you get the scripts to work through the web browser. It was mentioned you have to use php. I have the concept of using Apache but that's it.
@skiwithpete9 жыл бұрын
Matthew Tratz Yeah check the About section, I tried to make it as easy as poss. The PHP section lists which packages to install, and all you should have to do is copy and paste the php contents and you'll be away (as long as it points to the right place where the file is). Let me know if you hit any snags.
@PrimeGoat13579 жыл бұрын
Is it possible to have a single web interface with two or more Pi's (each having its own relay board)?
@skiwithpete9 жыл бұрын
+Alan Green Yes. But that doesn't mean I've figured out how to do it. Just have a text file on one, and the other reading it every so often interval... As a first thought.
@OfficialVeteranMusic8 жыл бұрын
yes just give them different local IP addresses and use PHP to access databases created seperately by each PI... very easy logic to follow
@onlyiwilknow6 жыл бұрын
How would I go about to switch on and off something using 4 - 5 kilowatt (20 - 25 Amps -220Volts). I could not find a RPi relay that will be able to handle that high Amps but I am sure a plan can be made. Perhaps two stage relay: %v to 30 Volt and a second 24V to 220 volt monster relay able to handle 30 Amps, or ir there an easier way of doing this?
@jeffpynnonen34456 жыл бұрын
Frits, why not use a SSR (Solid State Relay)? What did you use?
@jmsiefer9 жыл бұрын
Awesome video! Thank you so much for posting. :) Couple questions: 1) Do I need to have an OS of any kind flashed to the card prior to doing all of this? Or can I put the Python files directly on the SD card, insert it into the Pi, and run it like that? 2) I need a relay to turn on for 1 second every weekday at 8AM (watering a plant, for example). Is there a way to have the relays activate based on time and day, and then repeat all over again? I checked out your Alarm Clock video, but I'm afraid that's way more sophisticated than what I'm looking for.
@skiwithpete9 жыл бұрын
+J. Siefer You need Raspbian installed. And then to run the python code from wherever you put it inside Raspbian. Check out my Garage Door opener, that runs for .5 seconds. Change it to 1, and then set it on a timer.
@andrebugeja2838 жыл бұрын
i have tried this project but i ve gotten stuck, i do manage to turn the relay on but i cant seem to make the relay turn off. could you help?
@nokopeets9 жыл бұрын
cool video, will use information for university :)
@RohanHawthorne9 жыл бұрын
Thanks man, I bought you a coffee!
@joshuamlynn4 жыл бұрын
How are you using your Mac to control the RPi?
@skiwithpete4 жыл бұрын
SSH
@Fredters10 жыл бұрын
Nice tutorial very clear!
@stephanest-denis98017 жыл бұрын
Thank you, one thing, i use webpage to light on and off, but if i use the script2.py, i don't know how to stop it from my webpage, can you give a php code for stopping the flashing lights, thank you.
@MithunKarmakar9 жыл бұрын
should we use optocouplers to keep the pi safe?
@skiwithpete9 жыл бұрын
+Mithun Karmakar yes
@kluzz9 жыл бұрын
+Mithun Karmakar The relay boards in question typically already come with optocouplers.
@pbrown49 жыл бұрын
+skiwithpete what about transistors?
@MithunKarmakar9 жыл бұрын
My monitor goes mad whenevr the relay flips.. motor give a bad EMI/Pulse feedback.. even the optocoupler isnt helping!
@kg5nub Жыл бұрын
can i use this like in my work, i work on chicken houses all over the place, can i take this or say the 8 channel and hook it to my stuff and control it from anywhere in the world and the pi has internet access? how hard would it for a newbie that's not that smart and just getting into this...
@the.money.mentor.8257 жыл бұрын
So my led turns on and I hear the click, but nothing is coming out. When I hook up a multimeter to it nothing shows. What am I doing wrong? I'm trying to bypass a tactile switch using this.
@chrispospisil71806 жыл бұрын
you ever use xlights to control your relay boards
@prabanjam11118 жыл бұрын
hi, could u please teach without Rasberry, how to use dc relay ?
@letstalkcars99917 жыл бұрын
Hi, great video and thank you but i am having trouble where if i click on the html file i made and saved the python script is not initiating ? any ideas ? if i run the command through terminal to run the python program it works fine but via the browser, nothing ? is it something to do with the apache server i may be doing wrong ?
@skiwithpete7 жыл бұрын
it must be a php file. and the php server engine must be installed.
@letstalkcars99917 жыл бұрын
any chance you could point me in the direction of how to do this ? thanks in advance
@skiwithpete7 жыл бұрын
rename the html file to php
@teytu8 жыл бұрын
Thank you very much, I helped me a lot. Keep it up.
@victorpeter88409 жыл бұрын
Would this work with a raspberry pi 2b? If not, how do i get it working?
@skiwithpete9 жыл бұрын
+Victor Peter Yes, will work without modifications.
@dolo20238 жыл бұрын
Does it need to be web based? Can this be completely offline ?
@marksmanaz4 жыл бұрын
"I'm going to face the metal tabs outwards so if anything goes wrong I can test with my multi meter." Something goes wrong and no multi meter 😖 OCD must be tough to live with
@dgcompany5410 жыл бұрын
What's the purpose of that blue jumper on the relays?
@skiwithpete10 жыл бұрын
dgcompany54 the blue jumper links VCC and JD-VCC. If you want to isolate the relay coil drive voltage from the optocoupler VCC, you will need to drive the node labelled JD-VCC with another 5V supply. In the example in the video, I leave the jumper connected.
@alamgirkabirhira23289 жыл бұрын
great video for learning , thanks
@rimantasmatuliokas43074 жыл бұрын
Hi, hou to control boiler remotely via rasberry+module control+modem via mobile? Is it any video tutorial?
@skiwithpete4 жыл бұрын
Look at my garage door video. That's how I'd do it, but with a boiler instead of a Garage Door connected to it...
@rimantasmatuliokas43074 жыл бұрын
@@skiwithpete ok, but is it will work if i am in town and between my boiler and mobile phone is a 20kilometers distance? As i understand garage doors works only in range of wifi?
@skiwithpete4 жыл бұрын
@@rimantasmatuliokas4307 then you need to learn to expose your device to the internet. I try to cover that in a video. But it's risky.
@farhanryandi9 жыл бұрын
Thank pete, this video help me
@jitendravishwakarma15237 жыл бұрын
Hey I need help.... My relay board is not working(i cant hear d voice click ) whenever the program is run d light on relay board glows n relay isnt working..... Whats d prblm?
@ZGC.8 жыл бұрын
Everything is working fine but only the web part not im using the pi 3 and google chrome
@quiksilver32328 жыл бұрын
HI! i have done everything as shown. all works fine, except the .html php code Just nothing happens! Any help?
@skiwithpete8 жыл бұрын
File extension must be .php
@haroonnaseem16 жыл бұрын
why my relay Module is working inverted. Relay get activated when input signal to relay is Low.
@UnyBoy5 жыл бұрын
Hi, very good video, How to run python script with web browser?
@markkerr70948 жыл бұрын
found the scripts but how do i get them to run i paisted them into terminal but can't get the to run total new ti raspberry pi and code
@skiwithpete8 жыл бұрын
+Mark Kerr I'm pretty sure I show that in the video... if not, watch this one: kzbin.info/www/bejne/infXZWtmqN2Bjck
@kyleconway26919 жыл бұрын
Could someone write an example code of turning a relay on with say the button enter and then without changing the code save file hitting enter again and it shutting off the relay. So essentially code one displayed in this video except being on a timer make them operate on say a switch? press enter for on press enter for off
@lilchivi1610 жыл бұрын
Hey, really good video! I really hearing about your raspberry pi project. I have new raspberry pi and i am a little bit confused about one line of code: # loop through pins and set mode and state to 'low' for i in pinList: GPIO.setup(i, GPIO.OUT) GPIO.output(i, GPIO.HIGH) thr comment says that the GPIO has to be set to LOW. Then why is the GPIO output set to HIGH ?
@skiwithpete10 жыл бұрын
Erm. I erm... errr... Because... err... Are you saying I made a mistake? IMPOSSIBLE. Only humans make mistakes! (Well spotted, I've already adjusted the code and reposted it on lpaste - I've recently started a github too, and I'll post it there soon. I noticed another booboo too, but shhhh... don't tell anyone.)
@mrwess19272 жыл бұрын
@@skiwithpete there are no mistakes only happy accidents and Learning opportunities. :)
@markkerr70948 жыл бұрын
hi pete were can i get the scripts from
@skiwithpete8 жыл бұрын
+Mark Kerr They're in the About Section, but I've also just pasted them as a comment. Cheers, P
@brock11524 жыл бұрын
Great video
@chesterweirdo19789 жыл бұрын
Hi I have tried a number of these and I just can not get the Relay to turn off. Relay turns on using GPO 4 but does not turn off. I have copied the code exactly. The only error is scrit1.py:14: RuntimeWarning: A physical pull up resistor is fitted on this channel! GPIO.setup(i, GPIO.OUT) Can you help?
@SuperLefty20009 жыл бұрын
The easiest way to control relays is with Arduino. It has bunch of libraries and generally it's easier to manipulate it to suite your application.
@markkerr70948 жыл бұрын
Hi anybody show me how to edit a script got the four relays running but want to change the time the fire and repeat them them. prob best to wright a new script but can't figure it out
@minidgreat6 жыл бұрын
having trouble with installing php5 and libapache2-mod-php5.. they say its been removed and php7 is in the market. can we make the web work with php7?? Thanks
@skiwithpete6 жыл бұрын
Yes, PHP7 should work, no reason newer tech will break this, since it's all based on Linux.
@agumonkey7 жыл бұрын
ah wires, so simple yet so subtle
@TheCraftinator9 жыл бұрын
I would be very grateful if you could help me: I tried to do your examples (and also tried some own examples) but I have the problem that GPIO.output is not working. GPIO.setup will turn my LED on (and switch the relay) and GPIO.cleanup turns it off but every function using GPIO.output does nothing. I get no errors, it is just doing nothing. I tried updating the GPIO module and I also tried many different examples of HIGH and LOW (could have been that the error lays somewhere there) but nothing helps. Do you have any ideas what could be the problem? Thank you very much in advance!
@TheCraftinator9 жыл бұрын
+TheCraftinator I now found out that when I print GPIO.input() after changing with GPIO.output the state DOES change (from 0 to 1) BUT the LED on the relay stays the same and also the relay is not clicking independent of how often I change the state (only GPIO.setup and GPIO.cleanup makes it click and change the LED).
@TheCraftinator9 жыл бұрын
+TheCraftinator Still having this problem. Does someone have any idea what could cause that?
@MuminurRahman9 жыл бұрын
+TheCraftinator Which Raspberry Pi board are you using?
@TheCraftinator9 жыл бұрын
Muminur Rahman The new Pi 2 - And it is of course connected to the 5V (not the 3.3V). Thanks for your comment.
@MuminurRahman9 жыл бұрын
Can you try to use different GPIO pins? Don't use GPIO 2, 3 instead use GPIO 23, 24 also update the code accordingly. Let me know if it works. Which script are you trying? If you are trying script5.py? In this code GPIO.output code is commented out. I don't know why he did that. # GPIO.output(i, GPIO.HIGH)
@alexandreabreupassos25609 жыл бұрын
HI, I'm not sure why, using your PHP code, the Python script won't run. Other than have all packages deployed, what do you suggest to debug it?
@alexandreabreupassos25609 жыл бұрын
+Alexandre A. Passos If I run the Python script manually, it works. But not pressing the buttom on the PHP pag.
@TheyCallMeGoon9 жыл бұрын
+Alexandre A. Passos Same here! Any solution?
@RaymondRiveraTSH9 жыл бұрын
Any news as to why nothing happens when buttons are pressed.
@skiwithpete9 жыл бұрын
+Raymond Rivera I assume it's a permissions problem. Did you do all this? lpaste.net/raw/92403
@TheyCallMeGoon9 жыл бұрын
+Raymond Rivera Must add this line to your sudoers file, Without "" of course - "www-data ALL=(root) NOPASSWD:ALL"
@mradaChris8 жыл бұрын
Awesome video, thank you for sharing.
@mradaChris8 жыл бұрын
do you have a corrected script 1?
@lukeeskander607310 жыл бұрын
Hi, It is nice vedio. Thanks for all effort. I need to write Python Code to control this serial relay control board or amother serial similar cotrol board using my normal serial Comm port on my desktop under Microsoft Windows, I wounder if you have the code or can help n writing it?!. Thanks
@skiwithpete10 жыл бұрын
Luke Eskander I don't know Windows, sorry.
@aadityamundhalia8 жыл бұрын
i understand you posted it last year but i cant get it working. on pin 2 it is on cant turn it off and on pin 8 it is just off cant turn it on using raspberry pi 3 model b single relay. my relay has +, -, and s i presumed + for 5v, - for ground and s for signal. Hooked it + on pin 2 and - on pin 3. running your script gives Traceback (most recent call last): File "on.py", line 22, in GPIO.output(14, GPIO.LOW) RuntimeError: The GPIO channel has not been set up as an OUTPUT Any help will be appreciated.
@skiwithpete8 жыл бұрын
your traceback error tells me you have modified the code. unfortunately I don't have enough information to help you. the error you describe with lights staying on makes me wonder in you have the correct optocoupler relay. I suggest you look on Google for more help. thanks
@ramyrutu8 жыл бұрын
skiwithpete I can't get script5a to turn off my relay light ??!! please help
@barryblack14118 жыл бұрын
I have this working but I am using the Keyes 4 Solid State Relay 'High Level Trigger'. When I energize this unit, relay 1 and 2 light up. When I run the script first all the led's go out then it runs through the sequence as it should, but when it ends, relay 1 & 2 light up again. Also when I put my meter on the output terminal, there is no change of state of the relays. Anyone have any idea what is up with this? Thanks in advance.
@skiwithpete8 жыл бұрын
1) Is it an optocoupler relay? No. So it won't work. 2) Solid state relays typically have a minimum voltage, which your meter won't output.
@barryblack14118 жыл бұрын
It's a Keyes 4 Solid state relay. High level trigger. It came with some Arduino stuff I bought on Ebay. It has a red coloured circuit board and I see lots advertised. I will give it some load and see if that changes things.
@barryblack14118 жыл бұрын
I connected an led with a resistor and a 5V supply to one of the relay 'contacts' and although the input led's do as the should, the relay does not change state turning off the led. I tried it on all 4 relays and non work. Not sure how else to test this relay board. Any ideas?