Wireless, Mains-Rated Relay Module with an ESP01 and Arduino Cloud

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
i'm going to show you how to create a tiny relay module that you can control from anywhere in the world using arduino cloud and one of these esp-01s tiny little boards that have quite a few great iot features including wi-fi connectivity and the small size makes them a really good option for applications with limited space we've been experimenting with combining an esp-01 with a mains rated relay unit they'll give you a compact cheap way to make any appliance remote control so let's take a look how to do this okay so you would do yourself a big favor if you got one of these um small ftdi uart um usb to serial adapters and i've got the one that has a connector just the right size for an esp or one so you can plug it in there no and you don't need to do any soldering now when you're programming an esp-01 you have to connect gpio0 to ground to put it into programming mode now i know this looks really really rough i've just soldered some wires on the back of the uart so i can connect those together as it gets plugged into usb into the usb port and then it's in programming mode ready to be added to arduino cloud so make sure that these wires are gpio0 is connected to ground one way or another and then you can plug that into your usb and after that it's in programming mode ready you can let go of the wires that doesn't matter anymore okay moving over to the screen we'll add a new device here in arduino cloud and we'll select a third-party device esp8266 because that's what the esp-01 is built on and the one that i found to work pretty seamlessly was here espn eno which is an esp12 module so select that one porsche okay let's call it porsche now here as with all uh esp devices when you're heading into arduino cloud it gives you a device id and a secret key which is how it keeps things secure the device id identifies a specific board and the the secret key make sure that it's you that's making use of it so copy those i'm just going to put them into this notepad for the moment i'd recommend you use a password manager of some kind bit warden's open source and very good copy the secret key because we're going to need that in a second continue okay so now the board has been added let's create a thing uh in this case we'll add a variable let's call it relay because we're going to control a relay with this and it's simply a boolean and that can be read-only add the variable which now lets us connect to the network this is telling the esp-01 what your credentials are so you can connect and you need the secret key here if you lose those you have to delete the board and add them again you can't recover those so now as we go to the auto-generated sketch i'm just going to add a few bits to this code okay so let's have a look in here you can see in the setup i've added pin mode 0 as an output and that's the that's the spare gpio on the esp-01 and we're turning that into an output and then down here in void you can see our relay variable and we've got that switching between high and low on pin zero okay nice and simple and let's upload that to the esp-01 this might take a moment a minute or two because it's a bit slower at receiving the data than an arduino board so be patient okay and that's finished uploading the sketch to the esp-01 so you can unplug the serial adapter unplug the asp-01 what we're using is we've been experimenting with one of these small relay modules which make this super easy you don't have to use the module you could just connect you could wire a relay up directly to the esp-01 but if you look here it's got connector so that you can plug it straight in there and it accepts a 5 volt input so you could use a usb adapter for power and it takes care of providing 3.3 volts which is what the esp-01 runs on so it takes care of everything for you really quite a nice really tiny little package so i've plugged the esp-01 in there it's powered up so that'll be connecting to the wi-fi and then arduino cloud and let's go over to the dashboard here i've got an empty test dashboard we will add a switch widget we'll link the variable relay that we just uploaded to the esp-01 and then when we switch this there you can you can hear the relay switching on and off there's a little there's an led on there as well so you can see that's a really tiny little package that you can use for controlling pretty much any home appliance this relay is rated to uh 10 amps uh 250 volts so that could switch more or less any light that you've got in the house most appliances all in this tiny little board and that's connected to arduino cloud which means you can control it from any computer any smartphone anywhere in the world great way to get started with automating a lot of existing devices around the house thanks for watching and go give it a try
Info
Channel: Arduino
Views: 11,147
Rating: undefined out of 5
Keywords: arduino, arduino cloud, iot, iot cloud, wireless, wireless relay, relay module, home automation, diy home automation, esp, esp8266, esp-01
Id: lGsFOYyZ0Dc
Channel Id: undefined
Length: 6min 46sec (406 seconds)
Published: Wed Jul 20 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.