Тёмный

Control AC Devices with Arduino SAFELY - Relays & Solid State Switches 

DroneBot Workshop
Подписаться 600 тыс.
Просмотров 206 тыс.
50% 1

Learn how to safely control AC devices using an Arduino. I will show you how to safely experiment with solid state switches and relays. We’ll also build a light-operate relay and a marquis-style light chaser!
Detailed article with code samples: dronebotworkshop.com/ac-arduino/
More articles and tutorials: dronebotworkshop.com
Join the conversation on the forum: forum.dronebotworkshop.com
Subscribe to the newsletter and stay in touch: dronebotworkshop.com/subscribe/
** I had a few sound issues with some of the experiment scenes, the isolation transformer I was using interfered with one of my microphones, so I had to back it off and apply a sharp 60Hz parametric filter. I apologize if it sounds a bit weird in spots! **
In an earlier video, I showed you how to control DC devices with an Arduino using BJTs and MOSFETs. Today we will learn how to control Alternating Current or AC devices. And, most importantly, I’ll show you how to experiment with AC in a safe and controlled fashion.
Controlling AC using semiconductors is a challenge, as most transistors only conduct current in one direction. One type of semiconductor that will do the job is the TRIAC, which itself is essentially a fusion of two Silicon Controlled Rectifiers, or SCRs.
Another way of controlling AC (or DC for that matter) is a good old-fashioned relay. Although relays have been around for over 180 years they are still a popular and practical solution for controlling AC devices.
One extremely important issue when controlling line-voltage (or mains voltage, if you prefer) AC current is isolation. You need to make absolutely sure that there is no electrical connection between your low-voltage logic circuitry and the high-voltage AC.
An excellent device for achieving this isolation is an optoisolator. This device separates the two circuits with a beam of infrared light, completely isolating them.
Put an optoisolator together with a TRIAC and you have a Solid State Switch, or Solid State Relay (SSR). Combine an optoisolator with a relay and driver transistor and you have a Relay Module. We’ll be using both of these devices with an Arduino today.
Here is the Table of Contents for today's video:
00:00 - Introduction
03:06 - Controlling AC
08:00 - Alternating Current Safety
09:28 - My AC Workbench Setup
12:39 - Using Relays
16:34 - Arduino Light-Controlled Relay
24:29 - Using Solid State Switches
28:43 - Arduino Light Chaser
36:24 - IoT Relay
The last item, the “IoT Relay”, is a commercial product that allows you to safely switch any AC device without having to build anything. It’s certified for use in the US and Canada and is perfect for those who just want to get the job done, or who are uncomfortable working with high-voltage AC.
It also lets you use the Blink sketch to flash a desk-lamp!
Hope you enjoy the video, if you want the sketches I used please see the article on the DroneBot Workshop website.

Хобби

Опубликовано:

 

26 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 233   
@n0madfernan257
@n0madfernan257 3 года назад
liked that "we are in an 'alternating' universe now" intro.
@moriambar6533
@moriambar6533 3 года назад
the multiple reminder about "safety first" deserves many thumbs up
@JonathanDeWitt1988
@JonathanDeWitt1988 3 года назад
Bill, A year or so back I watched a RU-vid video by Robojax where he showed how to control an AC load device that he cut the power cord on and wired directly to the AC wall outlet and to the relay module controlled by the Arduino. Your video just vastly expanded my understanding of relays and the fact that I was using a relay module with additional circuitry. Thank you for that. This video was very good.
@abegafouda9136
@abegafouda9136 3 года назад
As usual, perfectly explained, with simple, understandable words, cool voice and pace, organized demonstration, and more. You are a real "Master, not only in electronics, but also in communication. Thanks.
@Danielddiniz
@Danielddiniz 3 года назад
Bill what I’ve really appreciated was you calling us your Friends!! Really felt like I’m your friend!
@sbsarkar5659
@sbsarkar5659 3 года назад
Did you all notice guys, how Bill makes his presentations so interesting that u get glued to the channel...till he says " goodbye for now"...Excellent job Bill. I must admit that the voice modulation of Bill is one of the best I hve heard on youtube, or rather, de facto the best. The subject, topic, cautions, content, delivery, camera management, focus, details....well..u name it and it is here. Apart from teaching electronics, you are probably also teaching a thing or two to all those in teaching and tutorial business. Thanks Bill and keep it up. I wait for your videos. Regards
@subbielover9374
@subbielover9374 3 года назад
You are right. IMHO even the non native speakers understand every single word :) Just great stuff in every aspect ! I wonder how much time does Bill spend preparing for a single workshop lesson.
@johnpaulpineda9821
@johnpaulpineda9821 3 года назад
Hi Sir Bill / @DroneBot Workshop, I just finished watching it and Thank You! so much for your well-explained and very detailed tutorial - I love it! Your video tutorials are very big help for those people who want to learn or pursue a career in robotics. I do appreciate your effort in making this tutorial and keep up your very good work! I am from Philipines by the way :)
3 года назад
I love the way you explain things. It's very clear and comprehensive.
@KeithBofaptos
@KeithBofaptos 3 года назад
I'm so ready to learn the AC dimming. Love your vids!
@0ptixs
@0ptixs Год назад
Man, this is the exact video I needed. I understand very generally how electricity works, I don't need someone to explain it again to me. I just need the different methods of switching ac power safely. I cannot wait to see what other videos you have to offer sir! Thank you
@intellisound
@intellisound 3 года назад
“The blink sketch on steroids...” LOL! Your videos are simply the best.
@stevenlightfoot6479
@stevenlightfoot6479 8 месяцев назад
This is excellent, and I appreciate you bringing the IOT relay for AC power at the end, to my attention. I had kind of assumed such a thing existed, and now its clear it does and I can easily and safely make use of it.
@paultakoy7091
@paultakoy7091 Год назад
Great video as always, Bill. Exactly what I was looking for. Thank you!
@gpTeacher
@gpTeacher 3 года назад
Fantastic video! Incredibly well structured and informative. Thank you very much!
@caffeinatedinsanity2324
@caffeinatedinsanity2324 3 года назад
An idea I had once for making a ln AC switching device was to build some sort of box where the relays are contained inside and what comes out of the outputs are female outlet plugs. On the power input side, definitely add a circuit breaker, ideally with GFCI, assuming you properly grounded your setup.
@horus2369
@horus2369 3 года назад
Top notch education!!! Your teaching style reminds me of attending ITT
@carlos2004
@carlos2004 3 года назад
i like that new recording set up with only one camera; feels more natural. i really like the relay modules. they're super easy to use and control. since they're relays, they can be used for pretty much anything. for example, i needed to build a sound input selector, and all i had on hand was a double relay module which worked well. then i needed to control my room's light/fan, and again, i used the double relay module. i also had to use a relay (not a module, simply the components that came with the arduino kit) because it was my audio preamp and it had to be electrically isolated from the arduino circuit or else it would hum. what's more, i even found some tiny relays that are perfect for audio since they are tiny and are dpdt which is perfect for stereo audio. also a tip, just stick with the 5v relay module since if going for the 12v versions, you will still need to run 5v from the arduino or else the relay module will expect a 12v signal which the arduino can not provide in the output pins.
@justbeeeb2061
@justbeeeb2061 3 года назад
Thank You! You have been bringing joy to my life with your videos consistently. 👍🏻💅🏻💅🏻💅🏻💅🏻💅🏻💅🏻💅🏻💅🏻💅🏻
@TheDanyBelanger
@TheDanyBelanger 3 года назад
Thank you so much for this. Very good video as usual. Can’t wait for the dimming part :)
@kennethbeal
@kennethbeal Год назад
11 minutes in, this is really neat: one of the leads for my multimeter recently broke. Wanted to replace the lead; found it'd be cheaper to buy a new $10 unit. So, I bought two, in case one fails again; they arrived yesterday. So it's REALLY neat to see, the very next day, your demonstration of USING two multimeters for a project! :) I'm prepared, or at least, a little bit more. :)
@deankq4adj125
@deankq4adj125 3 года назад
Great video as always! I have been researching a way to control my pool pumps with an Arduino. Going to do more research on the IoT module you showed.
@shaunogrady6887
@shaunogrady6887 Год назад
I really enjoy the thorough explanation and demonstrations with multiple components/setups. Great vid, if there were a double thumbs up i would click it
@rc.9764
@rc.9764 3 года назад
Thank you for all your effort! Very informative. I don't miss any of your video
@cuper4295
@cuper4295 2 года назад
I looked through the comments and didn't see this one, so here goes. My memory from when I did this sort of stuff for a living (1970s) was that the open output voltage of transformers was always high as you found. This was so that when the transformer was used at its full power rating, the output voltage did not pull down to below the rated secondary voltage. The pull down is due to the I x R losses across the transformer secondary.
@Mippi12
@Mippi12 3 года назад
This is exactly what I needed . Thank You !
@crossbound
@crossbound 2 года назад
I am just getting started with Arduino and this photo resistor and relay demo enabled me to create a timer switch for my christmas lights. They turn on when it gets dark outside and stay on for 6 hours, after turning off they want turn on until the next sunset. Thank you very much for your fantastic videos.
@MsThekiller02
@MsThekiller02 2 года назад
Wow! This is exactly my usecase too! I watched this video entirely for that purpose!
@Steven-zv4kd
@Steven-zv4kd Год назад
I can't believe I've only just discovered your channel. This is top-notch material. Like & Sub well earned
@ericmwiggins
@ericmwiggins 3 года назад
I enjoy learning from you and watching your FANTASTIC videos. I wish I had you as a teacher in college. A++
@Leroys_Stuff
@Leroys_Stuff 3 года назад
Great video as always Bill.
@lollllloro
@lollllloro 2 года назад
"...and as the Arduino is a microcontroller, we're going to use it to control things." This made my day : )
@Danteelias08
@Danteelias08 2 года назад
Let me congratulate from Lima-Peru, I am chemist and try to know more about Arduino and control optoisolated relays... great information and very well explained... thxs.
@axelBr1
@axelBr1 3 года назад
Signs often placed near high voltage installations, "Not only will this kill you, it will hurt the whole time you are dying"
@bradandsusan96
@bradandsusan96 2 года назад
Are you speaking from experience?? Not the dead part obviously. I've had the crap knock out of me a few times. Good day and God bless
@axelBr1
@axelBr1 2 года назад
@@bradandsusan96 Only partly, considering my DIY skills it is surprising that I haven't electrocuted myself. But have had a few shocks off an electric fence, (5kV but only a few mA), and it's not an experience that you'd readily seek to repeat.
@MmMm-tg5mq
@MmMm-tg5mq 3 года назад
Very very helpful video. Your way in explaining is great . Keep going...
@camplays487
@camplays487 3 года назад
Thank you, you somehow guess what Arduino projects i want to learn about and now I have great reference information and tutorials now.
@WildLifeBackyardCamera
@WildLifeBackyardCamera 3 года назад
thanks you so much for all the work you put into making such an awesome video !! Its really appreciated :)
@MsThekiller02
@MsThekiller02 2 года назад
Excellent video, thank you for all the useful information.
@henrybartlett1986
@henrybartlett1986 Год назад
These are wonderful presentations. Many thanks.
@francoisrochefort5759
@francoisrochefort5759 3 года назад
I wondering for so long! Nice video tx
@miguelraulgonzalez7744
@miguelraulgonzalez7744 3 года назад
Excellent safety tips!! Thank you!!
@willozfam
@willozfam 5 месяцев назад
Just stumbled on your channel. Love your emphasis on safety. "a very ugly lamp" cracked me up. 😂
@chrisreynolds6331
@chrisreynolds6331 2 года назад
Great video thank you. Another safe method of controlling mains power that I do is to use 433mhz approved wireless switches and use the rcswitch library and the miniature 433 transmit and receive modules. Capture the codes from the original remote and get the sketch to send them.
@jimthannum7151
@jimthannum7151 3 года назад
Excellent tutorial!!
@thearchetype9829
@thearchetype9829 3 года назад
You can watch this is just awesome @DroneBot Workshop
@hadireg
@hadireg 3 года назад
great video as always! Thanks a million!
@alexsere3061
@alexsere3061 Год назад
Hi sir, I am doing a bachelor's in a technical university, and for a project we decided to make a microcontroller-controlled heater. This video was crucial in the project, thanks for the safety tips and attention to detail.
@michaelnierer8503
@michaelnierer8503 3 года назад
Thanks for introducing me to the IoT Relay. I built a homemade device similar to this. I use it with my computer usb port to turn off 120vac devices when I shut the computer off. I will be replacing my homemade unit with the IoT Relay.
@rondlh20
@rondlh20 3 года назад
Great job again, amazing tutorial... there could be feedback in the light-controlled light, it could start flashing
@kuravani1963
@kuravani1963 3 года назад
Good explanation. Thanks for the video
@sergeiziuzev7049
@sergeiziuzev7049 3 года назад
It’s great what you are raise topic of safety of AC voltage.
@toolooselowtrek7523
@toolooselowtrek7523 3 месяца назад
Emphasis on safety much appreciated!
@davelewis3963
@davelewis3963 2 года назад
Another great video. Thanks!
@decem_unosquattro9538
@decem_unosquattro9538 2 года назад
Ahh very good explanation of how to connect Arduino safely! Thanks Bill. 👍
@AreebAmir
@AreebAmir 3 года назад
Very nice video,great professor
@Peterkringle
@Peterkringle Год назад
Thank you. Thank you thank you. From the bottom of my heart. I'm a chemical engineer dabbling in the electricity realm, and you're a lifesaver. I will say, no need to throw shade (pun intended) at the lamp at the end. We're all a little ugly :)
@bybecker
@bybecker 2 года назад
Excellent video. Thank you very much for your information. You know how to explain very well. Congratulations.
@hanzotv3
@hanzotv3 10 месяцев назад
Your voice is soothing as a learning narrator... So I subscribe. 😅
@andrewlee2344
@andrewlee2344 2 года назад
Thank you for the great video more inspiration for home projects
@edac1078
@edac1078 3 года назад
Thanks, that was fun!
@vectorsigma9903
@vectorsigma9903 2 года назад
Awesome video. Thank you!
@electronic7979
@electronic7979 3 года назад
Helpful video. I liked it
@hthharrison7764
@hthharrison7764 2 года назад
Great information, thank you 👍
@keiththomas3352
@keiththomas3352 2 года назад
Very helpful & informative. I would like to see a video on how to control a high voltage heating element with the Arduino. Maybe auto adjusting using a thermocouple. PWM not PID.
@bobvines00
@bobvines00 3 года назад
Bill, thank you for this wonderful video! You did a great job covering safety and interfacing. Now you need to show a project working with tubes! LOL! Of course, if you could do that and show how to to it _safely_, it could be quite interesting. Thank you for making such interesting & educational videos. (Just curious: Will you be returning to your robot project in the future? Or drones?)
@rbpassos77
@rbpassos77 3 года назад
Great vídeo. Excelente chanel. from Brazil , thanks a lot
@lalitac
@lalitac 3 года назад
We would love if you make a video on how to make a proper optically isolated relay module explaining the circuitry and the reason behind choosing the equipments of such and such value. This video was very helpful.😀
@michaelgraff6978
@michaelgraff6978 3 года назад
It’s also about trace isolation including PCB cutouts.
@lalitac
@lalitac 3 года назад
@@michaelgraff6978 Yup!
@jstro-hobbytech
@jstro-hobbytech 3 года назад
I love your content and the dry humor hahaha
@dzee9481
@dzee9481 3 года назад
Very well done. I was would like to see a video on using Zero Crossing SSR. How would you use one of these devices using a microcontroller. With Zero Crossing SSR you can use to control the brightness of lights such as LEDs or incandescent lights.
@petermenningen338
@petermenningen338 2 года назад
Bill a commonly obtainable step down transformer is an old style door bell transformer. They are listed and one side either has a short pigtail power cord with a plug for 115-120 v and the other side has a screw terminal 2 screws for a nominal 24 V AC outlet
@keeleyhoek
@keeleyhoek 3 года назад
Also, the flyback diodes do not "block the emf", they allow the current through the coil they are connected across to (temporarily) continue flowing when power is disconnected, preventing a large emf from being produced across them in the first place.
@flickmew99
@flickmew99 2 года назад
I'm still wondering when the flyback diodes circulate around the current until it disappear, is the energy converted into heat or what ?
@keeleyhoek
@keeleyhoek 2 года назад
@@flickmew99 Yes, the energy stored in the magnetic field of the coil (because of its inductance) is dissipated as heat due to the resistance of the coil and diode themselves (because they are non-ideal), and the resistance of the traces which connect them.
@joaopedrokorzeniewski6530
@joaopedrokorzeniewski6530 3 года назад
The lamp is rather ugly, but your tutorial is beautiful. Thank you Mr from the DroneBot Workshop. I wish you a happy and long life.
@frendoify
@frendoify Год назад
very good proyect
@MrJohnnaz
@MrJohnnaz 3 года назад
Just a heads up when buying solid state relays, stay away from the Fotek brand. I had a 40 amp Fotek hooked to an electric heater for period of a few months. One day I could smell plastic burning, It was the Fotek, It was melted. Luckily it was in a proper aluminum enclosure and no harm was done. This was only a 10 amp load with a good heatsink with thermal compound. I took the relay apart and found it had only a 12 amp triac inside. I guess the Chinese have counter-fitted some of these Fotek relays, If you do get a Fotek make sure it is made in Tiawan and not China. I personally replaced the faulty relay with an American made Opto22 25 amp relay that does not get hot at all. It is also wise to de-rate any solid state relay by 50% or more for a more reliable unit. As Bill says "BE SAFE".
@rondlh20
@rondlh20 3 года назад
Lots of fakes around... use at a current much lower than specified (50-60%)
@splyit
@splyit 3 года назад
as alwayz. great vidéo
@stuffoflardohfortheloveof
@stuffoflardohfortheloveof 2 года назад
Very good! 🙂👍🏴󠁧󠁢󠁷󠁬󠁳󠁿
@hemeshchadalavada3430
@hemeshchadalavada3430 3 года назад
Amazing
@kabandajamir9844
@kabandajamir9844 Год назад
So nice
@electronical100
@electronical100 2 года назад
thank you so much.
@LittLe_PunK
@LittLe_PunK 8 месяцев назад
very responsibly tutorials sir.. safety is number one... btw is that possible if i made a fuzzy logic to control an alternating current fans? .. I think to make it as my final project in college. thanks in advance
@bikkies
@bikkies 3 месяца назад
One thing I learned from this video is the word "scads". I've never heard that term used in the UK, so I might see if I can start a trend over here. To be effective, I may need to involve scads of people though.
@romaric3545
@romaric3545 3 года назад
Thanks
@hydroponikstuttgart4515
@hydroponikstuttgart4515 3 года назад
Hi, could you make a follow up video where you explain how to controll certain AC Devices, like dimming a lamp/motor. And explain what kind of Devices can controlled in wich way and what devices cant be easily controlled ? Would be much apreciated!
@blackmegas2401
@blackmegas2401 Год назад
I luv that "ugly lamp"..🤣
@shawn576
@shawn576 3 года назад
About the isolation transformer at 12 minutes: bathrooms no longer have those. That was like 1970s and earlier. Modern ones have the full 15A in a bathroom but the circuit must be GFCI protected.
@neliosamch3195
@neliosamch3195 3 года назад
I sub because of a ton of good info. I can't find the episode for DC devices controlled by Arduino and solid state relays.
@steve91311
@steve91311 3 года назад
Same here. Can anyone help us find the DC version of this AC lesson? Many thanks in advance. 👍🏻
@arduinomerkaba6135
@arduinomerkaba6135 2 года назад
Brilliant video Bill Thank You! I was just wondering what the first two number in the speedvalue line relate to (0, 1023,)and what will happen if I change them?
@elareau1
@elareau1 2 года назад
Awesome video! I've been contemplating trying my Arduino on AC devices and have been pretty nervous. These IOT relays seem kind of hard to come by though, are there any cheaper than 60 bucks??
@newburypi
@newburypi 3 года назад
Great video Bill, but I would be remiss if I did not mention a few concerns I have regarding care around mains power. The isolation transformer will offer a layer of protection, but will not eliminate the risk of a 120 volt shock, and the step down transformer assembly you are using is unlikely an approved mains device. It should (minimally) be enclosed, thus blocking fingers from contacting the transformer primary. The concern over these hazards comes from my years of accidentally contacting mains voltages and surviving. As a teenager I survived contact with a 250 volt B supply on an old tube radio. I say survived because I have been one of the lucky ones, and my survival has enabled me to learn respect for electrical power. Anyone wishing to get a start in mains power control should stick with devices like the IOT power bar. At least until they can get certified training.
@ReelSpider
@ReelSpider 2 года назад
U.S. 120 volts generally wont injure a person who is able bodied and not restrained. I have been hit over 1000 times in my life as an electrician. Line voltage, 240 and up can, and did kill my uncle, a young electrician. Europeans use 240 volt at lower amperage, so I'm not really sure the electrical potential of their system.
@newburypi
@newburypi 2 года назад
@@ReelSpider just took a quick look to verify, but it seems that you can pull as much as 13 amps from a UK wall receptacle. More than enough to take care of a number of uncles. If by "potential" you mean power that outlet can deliver about 3,120 watts. Better than our wimpy 1800W. I agree with you that North America's 120V is unlikely kill a person (in most circumstances), but it has done so. Respect for electricity and care when working around it should not be taken lightly. I have worked in power plants where up to 26,000V was switched and run. I am greatful for the thoughtful training I received before being set loose in those places. Go with care and safety, Dale
@rich1051414
@rich1051414 3 года назад
SSR's are very useful noob friendly devices. Just remember that it usually iies about the current rating, and also requires heatsinking.
@siddharthgholap3725
@siddharthgholap3725 3 года назад
Awesome
@karounkapedrokilombo2374
@karounkapedrokilombo2374 3 года назад
This video will save a lot of live ( both human and microcontrolers) mine included
@horus2369
@horus2369 3 года назад
Have you done a series on how to build your own iot controllers to make your own smart home? Lights, interior and exterior, cameras of the wifi variety that allow you to see in and outside your house while you are away from home, and door/window alarms that notify you of potential break ins. Please excuse the security mindset, many years of Military service, so these are the first steps I'm aiming to accomplish in my father's home.
@stevenlightfoot6479
@stevenlightfoot6479 8 месяцев назад
This is great thanks. I was thinking about trying something like this, using the Arduino 4 relay shield, but when I looked closer it seemed that it is designed with relays for DC not AC. Can you advise, are there two kinds of relays, which are different, one type for AC and one type for DC? Thx
@stephenloto8984
@stephenloto8984 2 года назад
Good lecture, I want to know how to connect my electric motor with the relay and using rf to control it. Thank you.
@bonfacemusyoka2337
@bonfacemusyoka2337 Год назад
Nice video... I am working on a project of mutual induction using two coils. The source is a signal generator. am trying to figure out how to control the switching on and off of the primary coil using arduino uno. Which device might work well in this situation?
@petittoto7433
@petittoto7433 3 года назад
A good solution also is to use 433MHz remote plug with a 433MHz module for arduino...
@claudioveronese4863
@claudioveronese4863 Год назад
Super!!!
@banban8481
@banban8481 3 года назад
Can you please make video about ESP8266? Your video is really helpful when learning the electronic.
@mikehodgetts4864
@mikehodgetts4864 2 года назад
U.S. Electrical codes require ground fault circuit interrupters on outdoor circuits and other circuits where water is used as in kitchens, bathrooms, and garages. If isolation transformers were required they would have to be big and heavy and expensive to power 20 amp circuits !
@oriyogi
@oriyogi 3 года назад
Csn you explain the process how you make your wonderful videos - what editing software you use, process.....
@emadabuhagag222
@emadabuhagag222 3 года назад
You are great
Далее
Solid State Relay || DIY or Buy
10:21
Просмотров 1,2 млн
Using Basic Logic Gates - With & Without Arduino
1:03:51
Просмотров 553 тыс.
Driving DC Motors with Microcontrollers
1:04:32
Просмотров 619 тыс.
IR Remotes & Microcontrollers - Arduino & ESP32
1:31:50
Просмотров 171 тыс.
Everything you need to know about RELAYS
22:48
Просмотров 51 тыс.
Diodes  - A Practical Guide
40:10
Просмотров 30 тыс.
ESP32 Guide 2024 | Choosing and Using an ESP32 Board
41:06
Measure DC Voltage and Current with Arduino
37:29
Просмотров 197 тыс.
ВЫХЛОП НА ЯПОНЦА TWIN LOOP #shorts
0:52
Просмотров 968 тыс.
Первый Холодец Китаянки
0:51
🍁 Ты остался незамеченным
0:26