Use Arduino to Switch Power On and Off!

Поделиться
HTML-код
  • Опубликовано: 3 окт 2024
  • Mike picked up a $10 SainSmart 8 Channel DC 5V Relay Module, hooked it up to an Arduino micro controller (a Raspberry Pi should work, too!) and the next thing you know he's remotely controlling 8 electrical devices... it's like building an 8 channel remote, each relay on the board can handle some serious juice, up to 10A 230V AC, 30V 10A DC. It's super easy to set up. Learn how in the video!
    www.arduino.cc/
    arduino-info.wi...
    www.ebay.com/sc...
    www.ebay.com/it...
    Subscribe! www.youtube.com...
    Have an idea for something we should build? E-mail us!
    DIYTryin@revision3.com
    *New Episodes Every Week*
    Subscribe for free!
    www.youtube.com...
    DIY Tryin on Revision3:
    www.revision3.c...
    Tekzilla on Twitter:
    / tekzilla
    Patrick on Twitter:
    / patricknorton
    Michael on Twitter:
    / palmdalian
    DIY Tryin is a brand-new show about do-it-yourself solutions and maker culture from the Tekzilla team! Here on DIY Tryin, we live by the motto; "Why buy when you can make?"

Комментарии • 361

  • @gmslayton
    @gmslayton 10 лет назад +55

    Cool episode. It would been cool to see how the lights and fan were hooked up and powered. Seeing that could give me more insight as to how the wires are.

    • @diytryin
      @diytryin  10 лет назад +13

      Think of the relay switch as interrupting one of the wires. When it's switched off, it's like you cut the wire.
      For the fan we literally cut one of the fan wires and put one half in the COM (common connection) and one in the NC (normally closed) slots.
      Take a look at this page for a better explanation:
      arduino-info.wikispaces.com/ArduinoPower

    • @Lyrabon
      @Lyrabon 7 лет назад +1

      DIY Tryin My L led is off and NO is dim what does that mean?

  • @Kattemageren
    @Kattemageren 9 лет назад +2

    I really like the atmosphere of this video, very smooth and friendly. Very unlike some of the akward episodes I've seen on e.g. Tested

  • @neppy5
    @neppy5 10 лет назад +1

    cool demo and great to see Patrick after all these years, used to watch him on The Screen Savers lol

  • @pingu99991
    @pingu99991 10 лет назад +5

    I like the apple logo conspicuously hiding behind the tape haha

  • @andrewk8636
    @andrewk8636 8 лет назад +175

    thats right cover that apple logo, hiding the shame lol

    • @rabbitdrink
      @rabbitdrink 8 лет назад

      Hehe

    • @peachpark7568
      @peachpark7568 8 лет назад

      i dont understand, wheres the shame in using apple?

    • @rabbitdrink
      @rabbitdrink 8 лет назад +13

      It means "i am an idiot because I spent all my money on a computer from the 90s"

    • @peachpark7568
      @peachpark7568 8 лет назад

      lololololololololololololol thanks

    • @zm7160
      @zm7160 8 лет назад +24

      Apple will fuck you on the price of their hardware, and the hardware is always last generation.
      That said, OSX is a very decent OS; If your into hacking / software dev, having a *NIX based OS that works is GREAT.
      For productive use, it really can be good for some people.

  • @SeeJaysPlace
    @SeeJaysPlace 9 лет назад +8

    Patrick Norton, I'm not sure if I'm old school or not but, I miss watching Screen Savers

  • @spokosjr
    @spokosjr 10 лет назад +17

    you covered the apple logon on the macbook but you forgot down on the right the apple box

  • @nogster
    @nogster 10 лет назад

    Seeing Patrick here really makes me miss the days of TechTV. I actually was able to attend a taping while in San Fran back in the day.

  • @EEEnthusiast
    @EEEnthusiast 9 лет назад +46

    Using relays to drive LED strips... Interesting...

    • @lolz2018
      @lolz2018 9 лет назад +12

      Sarcasm? :p i would think mosfets are way better?

    • @shyamharidas1828
      @shyamharidas1828 9 лет назад +10

      EEEnthusiast they were probably just trying to inrodyce us to the idea. We can even apply this to AC appliances

    • @michaelsills8038
      @michaelsills8038 7 лет назад

      @diederik you are correct that mosfets would be much better for these types of applications. Either works tho.

    • @raidzor5452
      @raidzor5452 7 лет назад

      Yeah... But there is no real difference... Relays are just easier to connect...

    • @MrFixBroken
      @MrFixBroken 6 лет назад

      They literally applied it to an AC appliance in the video (the fan)

  • @DarkStar851
    @DarkStar851 9 лет назад +8

    Just thought I'd toss this in for anyone interested in toggling a mechanical style relay with any sort of frequency like Michael did with the 40ms delay -- you're going to burn the thing out fairly quickly if you're doing something like that all day long. You should consider a solid state relay (more expensive than these old mechanical ones) for that application. Or a high-power MOSFET (which effectively is all a solid state relay is, just without the heatsink and terminal block attached)

  • @MainlandRC
    @MainlandRC 10 лет назад +19

    basic coding etiquette: if someone posts their code online to share it is perfectly acceptable to use some, or all of their code in your own code; however, if you share any code that has other people's work in it you should credit them just like any other work.

  • @anthonyvolkman2338
    @anthonyvolkman2338 9 лет назад

    I like to use solid state relays because they act as a transistor, whatever frequency you give it, it can turn on and off at that frequency, a mechanical relations can only oscillate so much

  • @danrtavares
    @danrtavares 9 лет назад

    wow you are a genius ! you pick a pre build relay shield and put in a newbie programmable system named Arduino and make it work ! sincerely you deserve a nobel prize.

  • @DaveHurka
    @DaveHurka 9 лет назад +14

    gee, I wonder what kind of laptop he is using...

  • @gmctech
    @gmctech 7 лет назад

    Endless options here! I just ordered a DTMF decoder, arduino and relay bank... I'm going to use my two way radios to operate my garage door using dial tones.

  • @UmairHussaini
    @UmairHussaini 9 лет назад +1

    I may be wrong here, but I think that the Arduino is not a microcontroller. It is a development board with a microcontroller (Eg Atmel AtMega328) at its core and peripherals on board that allow for easy project making.

  • @PhattyMo
    @PhattyMo 10 лет назад +5

    Stick an ethernet shield on there,and WE can control your fan!

  • @DarrenLandrum
    @DarrenLandrum 10 лет назад +2

    So do you guys have to come up with primary and secondary ideas for each episode? Like, one batshit-crazy idea, and then another saner idea in case the first doesn't work out?

    • @diytryin
      @diytryin  10 лет назад +7

      You've always got to have a Plan B (and C, and D, and E, and sometimes F)

    • @DarrenLandrum
      @DarrenLandrum 10 лет назад +2

      Well, here's to more Plan A's working out. :)

    • @alcool1729
      @alcool1729 8 лет назад

      Try this ==> facebook.com/1517160868604660/photos/a.1517166945270719.1073741828.1517160868604660/1519730448347702/?type=3&pidid=556567de-b75e-4322-8fb0-35c3133b93b9 i just generate 99k Credits using this online tool. Works on all devices. 100% working Use Arduino to Switch Power On and Off!

    • @rabbitdrink
      @rabbitdrink 8 лет назад

      +Al cool there's no such thing as arduino credits idiot

  • @Aterrebgnuoy
    @Aterrebgnuoy 8 лет назад +9

    Did anyone else feel bad for those relays when he set the delay to 40ms?

  • @RealDealHolyfield2099
    @RealDealHolyfield2099 10 лет назад

    Music with the relays is a great idea! This other channel on RUclips, MrSolidSnake745, plays midi music with stepper motors from old floppy disk drives. I'm pretty sure he uses Arduinos too. Really cool and really fun stuff!

  • @sth6027
    @sth6027 7 лет назад

    Yes it is legal to use codes from arduino that other ppl put online, because it's Open Source which means anybody can work on it to improve it.

  • @paziipa
    @paziipa 8 лет назад

    Subbed just for that ending dance

  • @TimurIskhodzhanov
    @TimurIskhodzhanov 7 лет назад +5

    Are you sure it's safe to flip that relay every 40ms? There must be a minimum time to flip that's safe to use without overheating and mechanical wear etc. Be careful with high voltage.

    • @edlingja1
      @edlingja1 7 лет назад

      Timur Iskhodzhanov
      Well you certainly aren't using this to light up a room. It's for like r/c airplanes and drones, to like switch a clutch on and off. Cvt transmission servo motor operation, some lighting, etc. You just gotta learn the silly code :#

    • @caffeinatedinsanity2324
      @caffeinatedinsanity2324 5 лет назад

      I'm much more worried about the coils generating voltage spikes.

  • @benlambert8481
    @benlambert8481 Год назад

    LOVE the channel name...

  • @JustifyJustin
    @JustifyJustin 10 лет назад +1

    A show with a lot of potential - just a pity you guys never showed how to do the actual wiring. Hope nobody electrocutes themselves trying to emulate this ;)

  • @nautitard
    @nautitard 7 лет назад

    I love the tape over the logo. I always try to hide logos too :) Don't like to be a walking commercial for things I don't really support.

    • @TheMrFrontera
      @TheMrFrontera 7 лет назад

      it does jack shit. obviously it's a macbook. Makes no sense to me, except maybe they can't get sued now. But in terms of support, means nothing

    • @nautitard
      @nautitard 7 лет назад

      If you're looking it does. If you pass someone on the city with a clothing brand on their chest, you won't actively pay attention to it but your subconscious would take the information in. Obviously advertisement works, so I try not to encourage people to consume unneccesary things x)

  • @stampgermany
    @stampgermany 9 лет назад

    You've been so helpful! Thanks! I really like your videos and their quality!

  • @tuckervaldeze7179
    @tuckervaldeze7179 10 лет назад

    I know this video is 2 months old but I purchased a Sainsmart 8 channel relay board for my arduino and i was wanting to know if the relay is Active LOW or Active HIGH, and what you used as a power supply to isolate the arduino and relay board, I can't seem to find a straight answer anywhere, and I watched your video and thought I might get a straight answer here.

  • @Wisdomofautumn
    @Wisdomofautumn 7 лет назад

    I’m a beginner Arduino experimenter and found this video very useful, interesting, and entertaining! I am wanting my first project to be a small weather station looking at temperatures and humidity...any pointers?

  • @rowebil00
    @rowebil00 10 лет назад

    Now some of your relays have been switched to normally closed and normally opened.
    That is a lot of switching for those relays. :)

  • @mark22732
    @mark22732 9 лет назад

    I like how you cover the logo on the laptop but leave a blatant apple sticker uncovered in the background

  • @kralkatorrik34
    @kralkatorrik34 8 лет назад +13

    Raspberry Pi is not a micro controller.

    • @latzobear
      @latzobear 7 лет назад

      lmao. true

    • @skkar2k2
      @skkar2k2 7 лет назад +3

      Raspberry Pi is not just a micro controller........

  • @WOLFSCHRAMM1
    @WOLFSCHRAMM1 10 лет назад +1

    theoretically, you should be able to drive all 8 relays, the UNO can handle 20ma per output, with a total of 200ma total, and each relay is designed to be driven by 20ma, so 20ma x 8 relays= 160ma, this is on the specs of the relay board and on the arduino, you do can drive all of them, but is not wise to do so if you are going to use it a lot, it will shorten the life of the arduino board, is always better to use power driven devices with an external power supply

    • @FathinLuqmanTantowi
      @FathinLuqmanTantowi 9 лет назад

      or just use transistor driver to draw current directly from source

  • @toycarfoushboy
    @toycarfoushboy 6 лет назад

    I subbed up guys! Really like learning this kinda of stuff and seems like y'all are gonna teach me some.

  • @prajasena1
    @prajasena1 7 лет назад

    thanks for the useful practical demo

  • @JustinOnScreen
    @JustinOnScreen 7 лет назад

    Very neat. Thanks for the tutorial.

  • @rageshadey
    @rageshadey 7 лет назад

    *cough circuit board with a micro controller cough*
    Love your videos. I really needed this to help me learn techniques to use on my arduino. Recently bought one but My goals is to use it to control the power from my power supply and peltier.

  • @beadgcf1754
    @beadgcf1754 10 лет назад +3

    i think this was the first episode i saw braces on patrick.. >.>

  • @MrHurricaneFloyd
    @MrHurricaneFloyd 10 лет назад

    Arduinos dont have the power to turn on a single relay, the signal is optocoupled to the relay board and the relays are actually powered by an external source ONLY.

  • @nitishroat
    @nitishroat 5 лет назад +2

    Would the laptop be on the whole day ?? to ON and OFF the relay??

  • @meemvids738
    @meemvids738 9 лет назад

    Thanks guys, very useful. Although it's fun to watch you dance about while switching on lights. I would like to know HOW you switched those colours. lol Do you have a particular video on the serial port? I'm total noob.

  • @itsgoubie
    @itsgoubie 7 лет назад +6

    4:10 and i thought i was tab-hoarding...

  • @daze8410
    @daze8410 4 года назад

    Arduino is rated for 6 - 20 VDC. Raspberry Pi, as a I learned the hard way, is only rated for 5VDC.

  • @ixamBee
    @ixamBee 6 лет назад

    Hey, I want to use an arduino to make a circuit which when I turn on switches off within 1 second
    Anyone has an idea how to do that

  • @melissaalleyne5835
    @melissaalleyne5835 8 лет назад

    you have to check the license to see what is legal to do with the software taken from other developers. it's not generally 'accepted and cool' if the license does not say so

  • @account3935
    @account3935 5 лет назад

    Finally people who speak english

  • @randomaccessbrains
    @randomaccessbrains 10 лет назад

    Lcome to the church of the flying spaghetti monster!

  • @edilmarlulab1981
    @edilmarlulab1981 5 лет назад

    deadpool? wade? is that you?

  • @zirkoni42
    @zirkoni42 10 лет назад

    Arduino is not a microcontroller, it's a development board brand that uses different microcontrollers.

  • @unwin42
    @unwin42 10 лет назад +2

    Be careful buying Arduinos from eBay. Many, many are counterfeit. I'd buy from Adafruit, Sparkfun or Makershed (or Radio Shack as they note in the video) where you can get authentic Arduinos, or good, supported, compatible boards.

    • @TheCarWashChannel
      @TheCarWashChannel 10 лет назад

      I've bought two from Amazon from Mp3carstore and they have both been authentic.

    • @unwin42
      @unwin42 9 лет назад

      I specifically meant counterfeit in the trademark sense.

  • @bartbonnyns
    @bartbonnyns 4 года назад

    Hello guys,
    Thnx a lot for your great RUclips, It means a lot if you char what you’re good in, so we can learn from each other. I hope you have time for a small simple question. Is there power on your relay coil when the NO contact is closed (when you’re hooked up appliance is on) like a standard relay or does it gets a pulse each time you switch on and off you’re appliance?
    Greats
    Bart

  • @vaper1986
    @vaper1986 10 лет назад

    Will play around with this, thanks for sharing.

    • @diytryin
      @diytryin  10 лет назад

      Let us know if there's any other cool projects or ideas you'd like to see in the future!

  • @lennova5846
    @lennova5846 5 лет назад +1

    Great video!
    Just what I was looking for.
    The link for the code is down any chance of getting the info? also any help on how to do the serial control would be appreciated.
    Thanks!

  • @firasalrubaiee2599
    @firasalrubaiee2599 8 лет назад +3

    would you show me the project with more details I mean how you connect wires from zero to end and I procreate you

    • @kevinsymss8373
      @kevinsymss8373 7 лет назад +1

      you don't connect 0 and 1 on arduino,
      relay 1 connect to 2 , relay 2 connect to 3 and so on

  • @mikesimmonds1916
    @mikesimmonds1916 7 лет назад

    If you wanted to set a pair of Christmas lights flashing for 10 minutes then swap to another pair for 10 minutes, how would this work with this relay?
    Mike

  • @vistanationrockafellaz
    @vistanationrockafellaz 4 года назад

    Patrick you old tech guys buddies is Rosevelt right

  • @l.b.4817
    @l.b.4817 10 лет назад

    Deserve aThumbs up and subscription from Brazil ;)

  • @kevinnewell5996
    @kevinnewell5996 2 года назад

    I know enough about this stuff to know that I don't know anything about this stuff, except that it can be built to do with I need done. Unfortunately, I don't know enough about this to do it.

  • @Beall619
    @Beall619 9 лет назад

    you have earned a subscriber

  • @thinkvantage1684
    @thinkvantage1684 6 лет назад +1

    hey guys thanks for the video. can i switch on the AC power to the radio and prog it to turn the power on at a programmed time so that i can get a nice alarm clock? thanks.

  • @themattypower2642
    @themattypower2642 9 лет назад

    I think I'm getting an arduino kit for Christmas.

  • @unwin42
    @unwin42 10 лет назад

    If you need to turn stuff off rapidly or over a very large number of cycles, look for a solid state relay board. Same people make one and that can go very fast, for a very large number of cycles, and is silent.
    If you just want to turn one thing on/off with an arduino, very safely and easily, look up the PowerSwitchTail2, a hobbyist product that has everything (except the arduino) safely isolated, tested, etc.

  • @alfidapvl9994
    @alfidapvl9994 6 лет назад

    Can you guys put a video how to control electric appplainces using headcount

  • @luukvandenberg99
    @luukvandenberg99 10 лет назад +2

    Sorry, but you made a mistake, a Raspberry pi is microprocessor not a microcontroller.

    • @punjabhajsaki5764
      @punjabhajsaki5764 9 лет назад +2

      Its neither its a single board computer that has a soc that contains a microprocessor

  • @Reaptechsolutions
    @Reaptechsolutions 8 лет назад

    Hi guys, great channel!!! liking the relay idea, please post the arduino codes up that you used to drive the 8ch board, thanks

  • @ipconfigearth102
    @ipconfigearth102 7 лет назад

    Please make a short and simple video on remote turn on of pc... No wake on lan option in mobo.

  • @FreeParkingSearch
    @FreeParkingSearch 9 лет назад

    I have the fan hooked up to the relay. The relay is switching on and off and directed in the code, but the fan does not turn on. When I fan wires directly into a house outlet it powers up. What am I doing incorrectly?

  • @spokosjr
    @spokosjr 10 лет назад

    you covered the apple logon on the macbook but you forgot down on the right the apple box

  • @Arabic_
    @Arabic_ 2 года назад

    guys you are awsome, may god bless you

  • @vistanationrockafellaz
    @vistanationrockafellaz 4 года назад

    Just copy and paste on and of fans and LED common growth up.That setting suitable for LED show..my friend use to monitorong Kwh Meter and Bill from work via GSM..common Patrick do something

  • @adryx_92
    @adryx_92 10 лет назад +2

    Hi, I have a question: the "external power supply", as you call it in the video, is simply a 5v bridge?

    • @FathinLuqmanTantowi
      @FathinLuqmanTantowi 9 лет назад +1

      6-12V, since 5V usually comes with less than the label, which is bad. it works but won't give you proper 5V output from arduino

  • @dansnow7
    @dansnow7 10 лет назад

    How about adding bluetooth and an app for mobile devices?

  • @fernandovera7363
    @fernandovera7363 6 лет назад

    What power supply did you use?, Do you use a power regulator? How did you make they conections?

  • @Sorcli
    @Sorcli 7 лет назад

    Great info. Could this also be used as a 12v fuses box, so if one was running 12v devises it would protect them?

  • @melannieworld
    @melannieworld 3 года назад

    Love the energy... I've been looking around for some advice. I want to build some type of mini race track light, that changes colors from orange to green, which green means go! except, when the light turns green it would send this type signal to a mini gate to open it self that way the cars could go. Any idea?>

  • @supermanpussy
    @supermanpussy 7 лет назад

    It will be nice if you show how you connect them.

  • @MrChezco1995
    @MrChezco1995 8 лет назад

    This is nice if you want to do something like a Home Automation setup :D

  • @PontusWelin
    @PontusWelin 10 лет назад

    hmmmm. Maybe I should get my hands on one of those. Could be fun to write some code for. Not sure what I would use it for right now though =)

  • @saleembukhari7728
    @saleembukhari7728 5 лет назад

    hi, i need to operate 4 relays each relay should be work after 10 minutes and when finish the cycle after last relay should be operate again relay 1 so like this cycling

  • @johnpleskina9268
    @johnpleskina9268 9 лет назад

    How can I power the relay externally? It appears my relay module is not properly interupting 120VAC

  • @Zack-dk3pt
    @Zack-dk3pt 9 лет назад

    i used bluetooth to control the arduino wirelessly from my phone with an app to turn relays on and off only problem is i havent figured out how to get the arduino to stay in whatever state it is when i exit the app as soon as it losed blutooth connection power to the relays returns to default

  • @ExStaticBass
    @ExStaticBass 7 лет назад

    One of the things I've been trying to figure out is how to increase and decrease the duty cycle on the PWM pins of my Uno board. The goal is to make some DIY signage that changes brightness with an LDR so that it's as visible in bright light as it is in dimly lit situations whereas it can also save power. I've figured out how code for the sine change from let's say "open" to "closed" using some transistors and a diode AND gate network. The brightness thing with the LDR though is a little harder to wrap my head around. Little help?

  • @JmsarchitectIn1
    @JmsarchitectIn1 7 лет назад

    hi
    i want to simulate a push button using bluetooth from my phone on a music system
    what i want to achieve by doing this is when we power on the music system(by using WiFi enabled Sockets), by default it starts in aux mode
    by using mobile with bluetooth it changes it from aux to bluetooth mode so we can connect it with mobile and play music at scheduled time by using Tasker app
    so we dont have to physically push any button
    thanks

  • @rabbitdrink
    @rabbitdrink 8 лет назад

    It would be nice if you could teach me how to wire this up.

  • @AlcoholicGam3r
    @AlcoholicGam3r 9 лет назад

    I'd like to have an arduino connected to the power button leads on my pc so when I want to turn on my pc before I get home, I can give the arduino the signal and it'll connect the power button leads together, turning on my pc.

  • @alexrodgers8367
    @alexrodgers8367 9 лет назад

    Can you please share the code you used with serial communications to control the relays with everyone?

  • @JordanMiller1117
    @JordanMiller1117 7 лет назад

    The "external power supply", what exactly is it? What is with the screen on it?

  • @davewalters9926
    @davewalters9926 6 лет назад

    Any idea why i can get my relay to work with my arduino is powered by a battery, but when i connect my arduino to a 9 volt power supply (actually sending 9.2 volts), the relay doesn't work properly? ...it sticks "closed" (LOW) and won't disconnect?

  • @malikattaurrehman4723
    @malikattaurrehman4723 7 лет назад

    i m using this relay module for home automation project using IOIO OTG but this relay module is operatin by giving grnd of ioio to chnl 1 or chnl 2 WHY ??

  • @azimalif266
    @azimalif266 6 лет назад

    Is it possible to split a large load among multiple relays? so that an arduino can control a large load.

  • @mdafroz4190
    @mdafroz4190 8 лет назад

    this is a nice and awesome video and i have a request for you can you make this relay control by smart phone via bt hc 05
    please

  • @CanvasDonRane
    @CanvasDonRane 9 лет назад

    How to connect an external power supply for the relay module?

  • @RobbieFPV
    @RobbieFPV 8 лет назад

    that 'switching' thing around the 6min mark is really bad for your relays man.

  • @dalivrubot5909
    @dalivrubot5909 10 лет назад

    Mike, how did you manage to wire up the external power supply to the relay in order to save the Arduino MC from having to power it? What power supply did you use, just one that was lying around?

  • @program_brain
    @program_brain 8 лет назад

    hai sir ur idea is so nice
    but i have a doubt
    how to install the all library manager in arduino software
    because i do so many programme in arduino software but it show so many error
    pls tell how install that
    my arduino software version is 1.6.9

  • @lorenzo3
    @lorenzo3 7 лет назад +1

    I can control 12v load with this relay 5v arduino?

  • @wello00o
    @wello00o 10 лет назад

    would you tell me how to control a solenoid (12v) with arduino through a relay ?

  • @Oracle8008
    @Oracle8008 8 лет назад

    Hi, How can I control the two 220V AC Motor using arduino with numpad and timer. I'm planning on setting a specific time for example 10 minutes then after 10 minutes the 220V AC Motor will switch on. Thanks

  • @akiljames83
    @akiljames83 7 лет назад

    hey great episode! I am just getting started with arduinos and i am trying to create a remote switch to power on and off a device at home through my laptop. Would this work?

  • @Decentralized_World1
    @Decentralized_World1 8 лет назад

    Can this be set to turn on and off at certain times without having to change the code each time. Example a school bell that goes on to alert students a period is over 9 times a day automatically. Can it also be fixed so that it automatically sets daylight savings time? I'm trying to work on this project making it function automatically without anything extra done to it once it is complete.

    • @shifty51008
      @shifty51008 8 лет назад

      with the right code it can do all of that stuff