Level Up Your WLED Projects: A Guide to adding Components (no code!)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
wed has support for numerous types of peripherals to extend your LED projects in this video I'll cover how to wire each one your controller and then the steps to configure various types of components including buttons switches motion sensors relays and more no custom compiling or coding needed at the end I'll show an example with seven different types of components attached simultaneously to a single LED [Music] controller hi and welcome to resin Kim tech for today's video I'm going to be using a standard wed controller using an esp32 installed with the latest production version of wed now while it's possible to use a lot of other types of peripherals if you download user mods and compile your own version of wed or if you use a fork of something like Moon modules what I'm going to show today will work with a standard version of wed that you can install directly from the web browser be sure to check the video description there you'll find a link to a written guide of this project that'll have copies of all the wiring diagrams that I show information on the configuration steps in wed for each component type proper selection of GPO pens links to all the parts that I show and additional information I just didn't have time to include in the video of course if you're interested in a particular component type you can use the links down here along the video timeline to jump to that particular component but if you stick around to the end you'll see an example of how I create a Franken controller where I connect seven different peripheral to a single wed controller this is the breadboard version of a standard wed controller I'm going to be using today I'm not going to go over stepbystep how to build the wed controller if you've never built one before I have another video that will show you how to build this install and configure wed in about 15 minutes so I will assume that you're already able to build a wed controller now if you have watched that other video you will see this looks slightly different it is wired exactly the same but I am using a 30 pin esp32 board here the other thing I've done here is I have split out my 5 volts on one side my 3.3 volts on the other side to create a couple of power rails this will allow me to connect multiple peripherals or components since I've only got one 5vt and 1 3.3 volt pin available on this board I have gone ahead and installed standard production wed on here and the current version of that is the time of this recording is 0.14.1 sorry to break in here for a moment but naturally as soon as I finish the recording for this video wld released version 0.14.2 now it primarily contains bug fixes and the ability to double the clock speed on an esp8266 so I expect everything in 14.2 will work exactly like it does in 14.1 but I did want to mention that a new version has been released I did opt to add in the auto audio reactivity since it's now available to install directly from the web previously you had to download that and compile your own but since it's now available I went ahead and added that in here so we can also explore connecting microphones and using sound reactivity most everything I show today will work with the esp8266 as well as the esp32 except for audio reactivity audio or sound reactivity is only supported now on the esp32 so you won't be able to use a microphone if you're using something like a D1 mini and of course your gopo pins are going to be different even different esp32 boards break out different pins so your gpio pins that you have available might not be the same as mine in most cases that's fine uh you can use other GPI op pins and just tell wled which ones you're using but be careful all GPI op penss are not created equal you could do something like connect a switch to the wrong GPI open pin and prevent your board from booting if you want to know more about the GPO pens and choosing the proper ones please see my written guide to this particular project for more details but let's get started by connecting what is probably one of the most common and useful peripherals to your wed controller and that is a simple push [Music] button adding a simple push button to your controller especially for task lighting like under kitchen cabinets provides a quick and simple way to toggle your lights off and on without needing to pull out your phone use a tablet or yell at a smart speaker and other family members May thank you for this simple option but of course you aren't limited to just toggling the LEDs off and on with a push button a push button is also one of the easiest connections you can make to your ESP or your wed controller we only have two wires here one of them we need to connect to a gpio pin I'm going to connect mine to gpio 18 and the other one simply connects to ground either to your ground pin or in my case I'm going to connect to the ground on my power rail here now I'm using a normally open push button you can use normally closed push buttons just be a little bit careful if you're going to use a normally closed Button as to which GPI open you pick because you can actually prevent your ESP board from booting if you connect it to the wrong GPI also note I have my board power down here anytime you're connecting or removing connections to your controller you should always unplug the power but now that I've got this connected I can go ahead and connect my power back up again to Define our button wed we just go to the config menu select LED preferences now it might seem like a weird spot to put your buttons but this is actually the LED and hardware setup page you scroll down we see we have four slots for buttons we can use any of these buttons Z has a couple of special uses I'll talk about it in just a second all we need to do is select the GPO GPO pin that our button is connected to in this case it's gpi8 and we need to tell it that we're using a push button now if you're using a normally closed button you probably want to select push inverted and I'll talk about these other types in a few minutes but we'll select push button and we'll go ahead and save that now slot zero comes with some predefined actions for your button without you doing anything else at all when using the button Z zero slot to Define your push button the default actions are a single press will simply toggle your LEDs off and on and a long press or press and hold will actually just select a different random color for your LEDs it doesn't currently have a default double press action there's one other special feature about the button zero slot and that is if you push and you hold the button for more than 6 seconds it's going to reset your Wi-Fi and start rebroadcasting the W LED hotspot in addition if you push and hold that button for more than 12 seconds it's actually going to erase the flash on your ESP board so if you're putting this into a situation maybe a small child's room where they might have a tendency to want to push and hold that button you might want to use a slot for your push button other than button zero and of course that's easy enough to do we will just set these back to disabled and we'll go down here and say we're going to use button slot one instead now that doesn't have the reset if you hold the button down but also has a couple of different default actions and this applies to buttons 1 two and three when you're using button slots one two or three the default actions for the push button are now a single press will simply cycle through and change the effects at random so you can select different effects a long press will actually ramp up the brightness probably can't see that too well on the camera but it's definitely getting brighter and a double press will actually just change the color palette to to a random pallet so again those are the default actions for slot zero and Slots one 2 and three what if we want to do something with our push button that isn't one of these default actions to create custom commands for our push button or our other peripherals we're going to make use of wled presets now you may be familiar with presets for saving kind of your favorite effect with your own custom colors and speed and brightness but you can also create a preset that consists of commands you click a preset button you simply uncheck the used current state it now provides you with this API box where you can enter in commands and there are a lot of commands available I'm going to show just a few examples but check out the wed website for a full list of these commands also note that you can enter them in in the H HTTP API format or for even more control and more options you can actually use Json again that's all described on the wed website the important thing here is this ID number that's what we're going to need to use for our custom commands for our buttons I've created just a few examples here and these are really simple ones so in this first one all I'm going to do is I'm going to set up a command in here to toggle the state of the LEDs to turn them on and turn them back off again kind of like we had for that default option when we used the button slot zero I've also created one here that's going to allow me to Loop through my preset list so I'm going to start with preset one through preset six and every time the button is pressed it's just going to Loop through to the next one and it will cycle back to the first one when it hits the end the final one I've created here is just going to run a particular preset in this case solid white I could use the six here or I could use the 103 for my command this is just showing you an example you could also launch a playlist using the same command now this isn't meant to be a wed tutorial but just know that you need to set up presets for whatever commands or actions you want to use with buttons or your other peripherals once you have those defined we need to come back over here to config but this time we're going to go to time and macros if I scroll down there are my four button slots and anytime you see a zero it means it's going to run the default action now I'm still connected to button one and remember the default action for a short press or a single press for button one was to Simply select a random effect instead I'm going to set this to my preset of 101 in that case that's the toggle to turn the lights off and on so now button one will work just like the default action did for button zero for my long press I'm going to set it to my preset 102 two that's going to cycle through my presets instead of just random effects and for the double press I'm going to set that to 103 which is just going to select a default white for the LED strips so I'll go ahead and save that and then let's go over and take a look at the actual strip and use of the button now that I've assigned my own presets so back over here on the wed controller this is the same button same GPI openin it's still defined in button slot one now if I just give a single press instead of selecting a random effect is going to toggle my LEDs off and on just like it did with slot zero a long press will actually Loop through my different presets you can see how it's looping through those and if I do a double press it's actually going to select solid white and again I can toggle back off so using these presets you can Define your own custom actions for each of the three types of button presses what if three actions aren't enough we'll simply wire up a second push button to a different GPI openin come in here Define that save it now I have three additional actions that I can assign to this second button so theoretically you could connect four buttons and have up to 12 actions that you can assign but enough about buttons just realize that whenever I talk about other peripherals here and we talk about assigning actions we're going to be using those wed presets to do [Music] that next let's talk about switches or toggles this is very similar to a button except obviously when you flip this on it stays in the state and doesn't return to the other state now I'm using a 12vt uh toggle that I just happen to have laying around here so I won't be using the third terminal to light up the little LED I certainly could but I just need two terminals here and it's connected and configured very similar to a button I have one wire that I connect to a gpio pin in this case I'm going to use gpio1 19 now this is a case where you have to be very careful about your GPO pin selection selecting the wrong PIN and if your switch is in the wrong position it can actually prevent your ESP board from booting again check out my written guide where I talk more about proper selection of GPO pens the other one we just connect to ground just like the button that's all there is to the physical connection now we just need to go set it up in wed back on the LED and hardware setup page you can see I've moved my original push button back to button slot zero here when I add my switch to button slot one once again I just need to tell at the GPI pin that I'm using come over here and say I'm using a switch and save like push buttons there is default actions assigned to a toggle or a switch and you're probably not surprised to figure out that those default actions are to toggle your LEDs on and toggle your LEDs off but just like a push button as well you're not limited to those default actions back over on the time and macro page this is where we can set again custom actions via presets for our button one now do note if you look right here at the top you see that your push buttons have three different actions but your switch only has two actions when it goes from on to off and off to on there's nothing available for such a thing as a double press for a switch so if I really wanted this to run a particular effect or run a particular preset I could set this to a value and it would do that when I flip the switch on or in this case flip the switch off but I think for a switch the most common thing is to just toggle the LEDs off and on but I did have my button set to also do that for a short press so now I no longer need that I can set that to a different preset value for something like increasing brightness now I have this configured again so my toggle will simply toggle my lights off and on but my button press instead of toggling on I can now actually increase the brightness and I still have my other things such as a long press or a double Press buttons are probably a little more common than toggles or switches but a toggle or switch can be really handy in a situation where you might have family members that that don't remember the difference between a single or a double or a long press and they just want a simple way to be able to turn the LEDs off and on and just like buttons If you have a need for it you can hook up more than one toggle up to four to your W LED controller if you have a special [Music] need the next peripheral is an interesting one and that is a p motion sensor this is the first peripheral we've talked about so far that's actually going to require power and the one I'm using here in am 312 will actually work off of 3.3 or 5 volts but always check your pin out and power requirements because as I showed in my previous video on motion and distance sensors if you get the polarity backwards on this you're very likely going to see some magic smoke but I'm going to go ahead and power this off my 3.3 volt rail over here by connecting it to my 3.3 and ground and then all I have to do is connect my data line to a gpio pin in this case I'm going to be using gpio 17 which on my board is actually labeled tx2 back over on our wled Hardware page I can pick any button slot I'll just pick button slot zero once again I tell it what GPI pin I'm using in this case it's 17 but now with P sensors you have a couple of different options the first one is to Define it as a switch when defined as a switch then whenever motion is detected the LEDs will be turned on and when motion clears they go back off again but notice that this particular sensor has a a very short cooldown period so the lights don't stay on for very long of course you could use different type of PR sensors something like a hcsr 501 where you can actually adjust that period of time that would keep your lights on longer you could even use something like a microwave radar detector that has an adjustable cool down or active period now if I come over and take this same P sensor and I switch the type from switch to P sensor it now gives me the ability to have two different actions I can assign so now back over on my time and macros page I can set two different actions for when motion is detected and for in motion clears so just as kind of a silly example remember I've got my P sensor defined in the button zero slot I'm going to say when motion is detected I want it to run my command that's going to cycle to my next preset well I still need something to stop those LEDs from going off as soon as motion clears so I have just kind of a dummy preset defined that's really just going to set the brightness level to the standard default brightness that I'm using and I can go ahead and save those those actions now defined now whenever motion is detected instead of the lights turning off and on they're actually going to cycle through my presets and also note that the LEDs don't turn themselves off when motion clears and that's because I've got that default action to just set the brightness to the same brightness I have for all of my presets so there's a lot of things you can do with the motion detectors and the custom actions other than just turn the LEDs off and on and do note that like with buttons and switches I could connect multiple P sensors so I could have one say at the end of a hallway and the other one at the opposite end or at the top and bottom of staircases set them both to toggle the LEDs as I walked past one it would turn the LEDs on when I walk past the other it would turn the LEDs off now there are some limitations to that and you still have to deal with the cool down period and at this point wed doesn't have an automation engine so you might need something like home assistant to do the more fancier stuff and there are also user mods for things like stair lighting but we're talking about here what we can do with standard wed without any user mods or compiling our own [Music] version so up this point everything we've talked about with buttons switches and P detectors are all binary sensors so you're not limited to just these really anything that can put out a 3.3 volt binary data signal that you can connect to a GPI pin on your ESP board can be used to control your LEDs through custom actions so for example if I have something like a digital light level sensor this will put out a high or low 3.3 volt signal on the data pin based on whether the light is above or below a certain threshold which can be set here so I could easily connect this to a GPO pin go into wled configure this as something like a switch and then have it be able to turn my LEDs on when the light drops below a certain level and turn them back off again when the light rises above that set point so just know that you aren't necessarily limited to just these types of binary sensors any binary sensor that can be connected to a GPO pin can be configured and used with wled and those custom actions through [Music] presets the last button type I'm going to cover is the analog button and what we're really talking about here is a potentiometer it's not really a button but you use one of the button slots to Define it and it's analog because we're actually going to connect the output of this to one of our analog pins on our ESP board and not one of the digital gpio pins now since our pins are only 3.3 volt tolerant we're going to connect up our two outer legs of our potentiometer to 3.3 volts in ground now the wed documentation recommends using at least a 10 kilohm potentiometer I'm using a 20 kilohm here we're going to take our output and we're going to connect to one of our analog gpio pins now if you're using an esp8266 you only have one pin available normally labeled a z but you have a number of analog pins available on an ESP 32 however there is a restriction that you've got to use one of the adc1 pins the adc2 pins can't be used the same time that Wi-Fi is active so I'm going to pick one of the adc1 analog pins in my case I'm just going to pick GPI 4 and that's all we need to do for our wiring now we just need to go over and configure it in wed so once again we come back over to our LED and Hardware page down to our button slots and once again I need to tell it which GPI pin I'm using my case I'm using gp34 notice this is marked as a readon pin and I'm going to tell it that I want this to be analog now we have to go over to the time and macros page and tell it which property we want this analog button to control again I'm hooked up to button zero we always set the short and the long to zero and then we specify a value in the double column based on what property we want to control now you can control things like the brightness uh the effect speed and intensity but NOS that some effects like solid don't really have a speed the most common one here is going to be control brightness so I'm going to put a 250 in here and I'm going to go ahead and save that so now what I have is I basically have a variable brightness control I can use this potentiometer to actually control the brightness of the LEDs I do note that by default wed will turn the LEDs off at the extreme ends either end of the potentiometer but you can change that behavior by adding a fixed resistor and the wed website talks about the resistor size based on the potentiometer that you're using you can also change your range by changing the potentiometer or adding a fixed resistor if you do find that the brightness is backwards when you're turning the knob up the brightness is going down you can either reverse your positive and negative on the potentiometer or you can go in and select analog inverted in wed but it does give you nice variable control for some features like brightness speed intensity and a few others so that covers most of the button and binary sensor types you can add to your wed controller there is one type left listed here and that's touch you can add a touch control as well and most of your esp32 boards have touch enabled pins I'm not going to go over that particular option here if you are interested check out the official WD website instead I'm going to put this back to being unused and we're going to move on to the next type of peripheral which is an IR receiver so that we can add an IR remote to control our [Music] LEDs adding an IR receiver can be a simple and inexpensive way to add remote control capabilities to your LED display this can be especially handy for guests other family members or even younger children to allow them to have almost complete control over the LED display without having to use a web interface or memorize a bunch of button sequence presses wlad has built-in support for a number of different types of remotes this is the one I'm going to be using today but note that I have the ability to reprogram these keys or if I can get the codes from any other IR remote you can use just about any IR remote that you have with w LED and I'll talk about the remotes and the codes after we get the IR receiver hooked up and tested this is the IR sensor I'm going to be using it's a ky 022 module uh they're inexpensive you can have find them for a dollar or less and it's also very simple to hook up now always check your documentation for your particular receiver but this one will run off of 3.3 or 5 volts so we just have our voltage our ground and a data signal out so it's very easy to hook up much like the buttons or a p sensor I showed previously so my particular receiver supports 3.3 or 5 volts I'm just going to go ahead and hook mine up over here to my 5vt rail this time instead of using the 3.3 but you could use 3.3 as well and I'm going to take my data and I'm going to hook this one up to gp4 in this case again any appropriate digital GPI pin is acceptable back over in wed again once under our LED preferences or our LED and Hardware page you scroll down and right underneath where we defined all of our buttons before you'll see an option for IR all I've got to do once again is select the gpio pin I'm using in my case I'm using gpio4 and then I need to tell it what type of remote that I'm using now I'm using the 44b or 44 key RGB remote but if you click the little I info here it'll take you right over to a page and you can actually see a list of all the different types of build-in remotes that work with wed without you needing to program any codes whatsoever but I'm just going to use the defaults right now so all I've done is Def find my gpio and selected my remote I'm going to save that and let's see what all we can control with that remote now so now using the remote I have the ability to turn the LEDs off back on I can increase and decrease brightness I have about what is that 16 different colors I can select and jump directly to and again you may not be able to see this real well on the screen but you can also watch the wed interface down there and see how things are changing I can also launch a number of my resets using the buttons and a number of other controls that are available on the remote by default now if I don't know what a button does or actually want to change what the button controls or again if you want to use your own custom IR remote that's where we can go back and we can easily edit and upload a Json file for the remote if you want to review or customize any of the built-in remotes or even add your own I remote all we have to do is come in here and select Json remote and now notice it's going to give me an option to upload a Json file that contains your own custom codes all the IR info is available here if you select a Json I remote you can see that it provides the default Json for all of these so you can tell what each button does and again modify that if you want or again if you can obtain the codes from your own IR remote you can create your own Json file but do notice that as far as the commands if you look at these commands they ought to look very familiar they're the same kind of commands or codes that we used when we were creating presets for things like our buttons or our switches one final note about the IR remotes is since they are IR they are line of sight and I found the range for this particular receiver and this particular remote to be somewhere around 18 to 20 ft give or take but also note that if you happen to have more than one LED controller installed in an area and they both have I receivers a single remote can control both of the displays that can be a blessing or a curse depending on exactly how you have things set up and how you want to remotely control them and adding an IR remote is a convenient way to be able to control your LEDs and most of the features without having to launch the web interface or the mobile app or even physically walk to the device and push a button now let's take a look at the next peripheral and that is adding a microphone for sound [Music] reactivity now microphones are the only peripheral I'm going to show to in this video that only works with the esp32 audio reactivity is not supported on the esp8266 it does also require that you install this as part of your installation of wed technically it's still considered a user mod but unlike other user mods that you have to download and compile into your own binary version of wld you can install auto reactivity with your default installation from the web installer since Auto reactivity is still considered a user mod that's where we're going to go to set up all of our Hardware now if you don't see audio reactive listed here that means you didn't install it as part of your installation you need to go back and reflash your esp32 and make sure that you choose audio reactivity a wled supports both analog and digital mics but you're going to get much better performance reactivity and frequency response out of a digital mic so I highly recommend you use a digital mic but I'm going to show the hookups for both analog and digital one final note is there have been reported issues when trying to use microphone and sound reactivity with an IR receiver in remote in fact the sound reactive Fork of wed at least last I knew had disabled the IR functionality I haven't had any particular issues when using a digital microphone and an IR receiver but your mileage may vary and if you're finding strange things going on you may have to disable the IR functionality again while a digital mic is recommended I'm also going to show you how to connect an analog mic in this case this is the max 984 which is one of the recommended analog mics to use we're going to connect it to 3.3 volts in ground and then we have a different gain value we can set as to whether we leave this disconnected connect it to ground or connect it to 3.3 volts the recommended gain level for This is 40 DB so we're going to connect that to 3.3 volts as well and then we we've got our out pin which again in this case is an analog out I've made my connections to 3.3 volts in ground and my data out I've connected to gp32 which was one of my adc1 analog pins on the esp32 remember you can't use the adc2 analog pins and Wi-Fi at the same time there is one other restriction here you cannot use a analog button and an analog mic at the same time so back when we talked about using a potentiometer as an analog button to control things like brightness or speed you can't use that and an analog mic you can use a digital mic and an analog button at the same time with the microphone wir we now go to wled to configure that now remember that audio reactivity is still considered a user mod as of this release but now we come down here and we find the audio reactivity we need to enable that and then we need to select the GPI pin that we used underneath the analog mic in my case that was gp32 now one thing and this took me a while to discover you might think that's all you need to do I couldn't get it to work until I realized I also need to change this under the digital mic to say General anal analog notice that this also requires a reboot so we will save this and we will reboot the controller so with the controller rebooted we now need to come over here and select a sound reactive or audio reactive effect obviously something like solid is not going to do anything with sound the good news is you do have filters at the bottom so you can select the one that has either a single note I believe that's an eighth note I'm not a musician or a 16th note the two notes the single notes or the eighth note indicates those that react just to volume so we'll just select one of those to start select this one here and you can see already the lights are reacting to my voice I click here I'm getting reactivity I select something like a frequency effect again you can see I am getting sound reactivity now the one thing I found with especially with these analog mics is I have to go back into the configuration and you can go into here and you can adjust squelch and gain but what I found is that it's very in terms of the type of music something that's heavy bass versus something that's that's a lot of vocals and and of course the distance replacement to the mic I found I'm having to come back here and modify the squelching again anytime different types of music comes on or even from different sound reactive effect to another it's not something that you see with the digital mics but just be aware that you may have to come in here and play around with your squelch gain and your automatic gain control to get the best results out of an analog mic also note depending on the particular effect that you've selected you do have the ability to tweak things like the frequency responses for individual effects but you're just not going to get the responsiveness out of an analog mic that you do out of a digital mic so let's take a look at a digital mic connection next for digital microphone I'm going to be using the inmp 441 which is actually the recommended mic for w LED note that this is an iqu S device so we'll be using three GPO pins powering it off at 3.3 volts and we also o need to connect ground not only to the ground pin but to the l/r pin I've connected my mic up according to this diagram and do note that I'm using GPI pins 14 15 and 32 now we need to go over to W LED back over underneath our user mods I come under the audio reactivity enable it if it's not enabled clear any GPI pins I might have been using for my analog mic and the inmp 441 you should select a type of generic i s s for that if you're using a type of mic obviously select the the proper type that matches your mic and then I just need to set the three gpio pens that I connected to my mic this particular mic does not have a Master Clock pin so we just leave that set as unused so I'm going to save this but notice anytime we make a change here it does require the reboot so I will save and reboot the wed controller okay the controller is rebooted so now all I need to do is come back over here select my audio reactive effects and simply pick one and you can see how it's already reacting to my voice and I've even moved some distance away at this point from the microphone but we'll just try a few different effects here and you can see how responsive this microphone is it will actually pick up my voice or music from all the way across uh my basement so I don't have to have the mic right next to the Sound Source much like I did with the analog mic again I can also check out some of the frequency response although with just my uh talking obviously the frequency isn't going to have a big wide range but this does work much better than an analog mic and you'll find it to be much more responsive and you have all the tweaks and controls here plus some gain and Squatch settings that you can set back over underneath the configuration as well but it's definitely a much better option than an analog mic if you want to add a microphone for sound reactivity I've got one more peripheral I want to take a look at and that is adding a relay to your wed [Music] controller how the most common use for a relay with a wed controller is to actually kill the power to your LED strips when you turn the LEDs off in wed by default when you turn those lights off the LEDs continue to draw a little bit of power I didn't actually measure and verify this but according to the wed website your LEDs will continue to draw about one watt of power for every 200 LEDs again may not matter for a very small display but if you got a rather large display you can add something like a relay so when you turn the LEDs off in W led the relay will actually kill the power to the LED so they don't continue to draw that small amount of current there are a lot of different type shapes and sizes of relays out there this is the one I'm going to use for this demonstration but they all have a few things in common for one they're generally going to have two voltage or power ratings one rating is going to be the voltage needed to actually signal the relay to turn off and on and to power the relay itself in this particular case this is 3 volts DC so I need a 3vt signal to tell the relay to turn off and on and I actually need 3 volts to power the relay itself well that works out perfect for our ESP board because our GPO pins are 3.3 volt I also have a 3.3 volt power rail for powering the relay but I'm going to come back to that in a little bit your other power rating is the amount of power that can actually be connected to be switched off and on in this case you can see this can handle up to 30 volts DC at 10 amps or 250 volts ac at 10 amps so we can use this with a 5 Vol 12vt or even a 24v LED strip but do be aware of that 10 amp limitation if you have a large LED display it's very possible to exceed that 10 amps so you may need to look for a relay with a higher power rating let's go ahead and take a look at the basic hookup for this and again I'm going to talk a little bit more about powering the relay itself so this is the basic hookup of the relay I'm using gpi2 as my signal tell the relay to turn off and on and right now I'm powering this off my 3 3vt power rail which is coming off my 3.3 volt pin again this is probably not the best way to to do it I'll show an alternate way in a minute but on the other side I'm simply splitting my positive voltage line to my LEDs and again this can be 5vt 12vt or 24 volt between the common and in my case I'm using the normally open Terminal but let's go ahead and configure this as is with W LED and test it then I'll come back and talk about probably a better way to power this relay so once more back over in wed we're going to go to our configuration our LED preferences which again is our LED and hardware setup scroll down and underneath the buttons you're going to see an option for a relay all I've got to do is once again is tell it which GPI pin I'm using I'm using 12 then there's an option to invert that's going to be somewhat dependent upon whether you're using the normally closed the normally open terminals on the output side if you do find that the relay is working backwards from what you want you can go ahead and come in and either check or clear this box I happen to know that I do want this to be inverted so I'm just going to go ahead and save that then we'll go back over to the board and see if the relay works as expected currently my LEDs are turned off and the relay has turned off and you'll be able to see when the relay turns off and on with this little LED indicator but at this point with the LEDs off I have no power going out the LED strip I come over to W LED and I turn the power on you notice my relay came on and now my LEDs are receiving power once again I can turn that power back off and you can see that the relay turns off and kills the power to the LED strip but I do want to talk about powering the actual relay itself off the 3.3 volt pin on your ESP board now your relay is going to draw current anytime that it's energized the actual spec for this relay was listed as 65 milliamps when it was powered on when I actually measured it I found it to be closer to 73 milliamps and just recall you can only pull so many milliamps off your 3.3v pin and the amount of milliamps that are available also has to power your ESP chip itself so why might be okay on this do note that some cheaper clones or ripoffs of some of these ESP boards actually use a cheaper power regulator and if you start connecting additional peripherals like some of the others that I've shown that require 3.3 volts it's entirely possible to exceed the max current draw on your 3.3 volt pin and that can lead to all sorts of problems such as brown outs for your chip random reboots or even possibly damage to the board itself so a better way to do this is we'll go ahead and use the 3.3 volt signal off our GPI pin but we're going to get our 3.3 volts off of our main power supply that's powering our LEDs and to do that we're going to use a simple Buck converter I've installed a variable Buck converter here and this Buck converter can handle an incoming voltage of anywhere from 4.5 to 28 volts in and can be adjusted to Output a voltage of anywhere from8 to 20 volts out so I'm using 5 volts here coming off my power supply again you can do this with 12vt or 24volt LED strips as well as well so I'm feeding the 5 volts in I've adjusted this to Output 3.3 volts and I'm now going to power my relay off of this this can handle up to 3 amps so there's no problem with the 70 or so milliamps required to power this but I'm still going to trigger off my GPI openin on my ESP board now when I turn my LEDs on and the relay energizes it's still getting it signal to turn off and on from the ESP board but it's actually drawing the power directly off the power supply for the LED strip this is probably a much better and safer way to power your relay and in fact if I installed a buck converter like this I would probably actually use the 3.3 volt output for this to power my 3.3 volt Rail and remove these so that why I'm powering all my peripherals off of this as opposed to the 3.3 volt pin because this can handle up to 3 amps which is significantly more than you can put on a 3 volt pin on your ESP board so while controlling the power to your LED strips is most common use for a relay again you're not limited to that you can really switch power off and on to any kind of external device that falls within the ratings of the relay itself so maybe you've got a small amplifier and speaker or some other type of display every time you turn your LEDs on you will power up that external device and anytime you turn the LEDs off the power will be shut off to that external device as [Music] well up until this point I've showed connecting one peripheral at a time and you certainly aren't limited to that you can mix and match to meet your project needs let me show you an example of taking the idea of multiple peripherals a little bit to the extreme so this is my Franken controller it's where I've basically attached every peripheral that I've shown in this video so far to a single wed controller let me pull the camera back a little bit so we can see all the different peripherals okay this is kind of crazy and you're probably never going to connect all of these peripherals at the same time cuz you're going to see some are kind of at Cross purposes to each other or or duplicates the actions of each other but it really just shows you an example I've already got everything configured and defined in wled so let's just go through all the different peripherals that I have attached first I've just got a standard toggle switch which I'm going to use to turn the LEDs off and on also note that whenever the LEDs come on notice that my relay is now outputting my voltage to whatever this could be like to my LED strip when I turn the power back off notice that the relay also shuts off as well so we've got the toggle switch I have a push button and with my push button I'm simply toggling through my different presets then up here I have a p motion detector and of course when motion clears on that it's going to turn my LEDs off when motion is detected it turns them back on again but there's a situation where I'm kind of at Cross purposes when the pr sensor turns the LEDs off I now have to come back over here to my toggle switch and toggle my LEDs back on again I also have an analog button or my potentiometer here that I can use to control the brightness of my my LEDs I have the IR sensor connected for remote control so kind of hard to get this in screen here but uh I can again change the colors of my LEDs I can power them off which again turns the relay off and back on again so that works so the only thing left here to test is actually the digital microphone so let me go over here and select some kind of sound reactive option here on that and I don't know how well you can see it on the screen but it is reacting to sound let me turn this off here see if we can see it there maybe you can see a little bit better it is now reacting to sound so I have a toggle switch a push button a p sensor a potentiometer an IR receiver a digital microphone and a relay all connected to one W LED controller and everything is functioning so everything I've shown here could be done with just standard wed like I mentioned at the beginning there are other types of peripherals you can also connect to your W LED controller through the use of user mods or particular Forks of wld now of course I did all this on a breadboard which means almost all this can be done with no soldering the only soldering I had to do was attach some pin headers I think to the digital microphone and the buck converter but you probably aren't going to want to have some kind of Franken controller like that done on a breadboard so you can always create things on a prototype board like an electro cookie board or even go as far as to designing your own PCB where you connect the components directly to the controller but that's going to do it for this video please let me know down in the comments if you have any thoughts ideas or suggestions of things you'd like to see me cover in the future but until that time I'd like to say thank you for watching and I hope to see you soon
Info
Channel: ResinChem Tech
Views: 36,645
Rating: undefined out of 5
Keywords: WLED, ESP8266, ESP32, WS2812b
Id: 1Qj1jJAam-8
Channel Id: undefined
Length: 43min 36sec (2616 seconds)
Published: Sat Mar 23 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.