Setting up a NodeMCU/ESP8266 to control Independently Addressable LEDs

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so today the squirrel i'm chasing are independently addressable leds so i know that we've been playing with the shelley rgbw2 super fun still love it it's still in my living room in what i would call production use like it's kind of permanently got a home in my living room to control that rgb led strip but that rgb led strip every led has to be the same color all the time i can't choose one led to be one color and one led to be another color which is fine for my use in there but man it'd be cool to really understand how these work not only for fun christmas lights outside of the house but also on our christmas tree because the lights on that tree on our tree specifically are out i replaced about 75 bulbs this past christmas like genuinely because i didn't know which one it was they're old incandescent bulbs i love the way the incandescent bulbs look but i thought if i'm going to have to replace them with leds at least make it fun so that's why i started this project and i'm hoping to really be thoroughly vetted uh vested to really understand it by christmas so the way i'm controlling these is through what's called a node mcu now these are extremely cost effective especially if you just get the one little container or the one little chip circuit um device um but i will say there is a reason why dr z's is selling out of his dig did juno's that are significantly more expensive than this but they come with all kinds of extra things that i thought i don't need any of that that's just like extra stuff i'm just playing with it on my workbench i'm surely i need oh my goodness i need those things that his his device comes with so i'll probably be buying one of those and giving a little review of that but realistically he probably does better reviews of that and better instructions um but you know maybe coming from someone else that's not financially vested in that it'd be good to to hear someone else's opinion but i can say this is super fun this is really neat so basically what this is what a node mcu is it's not an led controller it's it's a wireless um arduino basically it's kind of like you can run code on this and connect it to wi-fi and you can basically have like a little web server running on it and it can send and receive data over the gpio pins and it's crazy advanced for how small and cheap these things are so in fact i got these for whatever is on the screen and because they were so cheap i went ahead and bought a pack of cheap bread boards and so let's get started so obviously this one's already working this one i've already flashed a couple times to play with and it's running a different version of the software so let's just start from scratch so i'm going to unplug everything here and i'm going to turn off my power supply so i don't have any any voltage at all whatsoever coming out of anything going into anything we'll set this all off to the side and i have a brand new still in the wrapper package and by the end of this video the goal is we will have this set up on my wi-fi network with these lights plugged into it and it will be able to control them seems easy enough so let's start at the very beginning which is if you don't have the proper power supply you can like me have the improper power supply for me i got an old atx power supply those of you who have worked on computers may recognize this and some people will put like a little paper clip or a jumper wire to short out the green and black wire i just soldered them together and put heat shrink tubing on it not the best idea for a lot of power supplies but mine has a power switch on it so i can just cut kill power completely to it and restore power pretty easily warranty void if removed i'm never going to remove that sticker i think my warranty is voided by cutting these things so there's that green and black wire i've basically grounded that green wire which is the signal wire to turn it on and now i can just plug whatever i want into these and the important thing for my purposes are the red wires are 5 volt and the black wires are ground that's all i'm using for this project because the node mcu is 5 volt and i chose 5 volt leds specifically because i could power the controller and the lights from the same power supply smarter people would get 12 volt lights but i'm not smarter people so now that we have the power supply squared away we need to actually program the node mcu itself so the first thing we're going to do is show off that i got a maker knife because they're pretty neat i'm going to do that by opening this package there we go so now that we have the node mcu out of the package you can see that um it's really simple there's not a whole lot to it but it does come with this little handy usb port so you can easily connect it to your computer and flash it i don't know if this phone conducts electricity so i'll take it off to flash it so the first step we're going to do is grab the handiest closest micro usb cable so micro usb micro usb okay it's in there and this is how i plug them into my laptop first try so first thing we're going to do is we're going to download wled so i'm just going to go to releases there's release 0.12 okay and i'm choosing the esp8266.bin because i have an esp8266 card a little little board right here and so i'm going to download that i'm not downloading the 1m or 2m because i only have one of these not one or two million i have no idea what that is there's a really great page right here on which binary should i use i'm not smart enough to read that i'm just going to go look for it so um the next thing i need to do is install some drivers i don't remember where i got the drivers but they're already installed so um i think your computer might just recognize the node mcu but maybe i'll try and find those drivers and link them down below but if your computer does not see your node mcu it might be because you don't have the drivers so um check out the description below there might be links to the drivers that i used so the next thing i'm going to do is i'm going to grab this esp easy flasher because it's the most it's the one that worked for me so all you do is over on the right there's releases there's one release serial speed and i downloaded the zip file after downloading that zip file i went ahead and put extracted them into a folder so i'm going to take this file that we just downloaded and put it in the same folder as my esp flash tool or flat easy flash or whatever this is um and now i am going to run flash esp8266 and there's there's no com port to select huh so what i'm going to do is i'm going to skip the two-hour step i took last time of troubleshooting and going through 20 different ways to fix this issue and instead i'm going to unplug this cable and get a different usb cable look at that check it out so it still looks pretty much the same there's really no difference however now if i close this program run it again now it says com3 so it totally found this thing so something important to note is um these cables look the exact same i mean they when i looked at them before they looked like they had all their pins on both sides so it didn't look like it was just a charging cable but it is in fact just a charging cable the way you can tell the difference is by trying to flash um an arduino for two hours and if that doesn't work then it's probably just a charging cable that's what i did so under firmware it shows me that binary file because i just moved it into the same folder the file has to be in this folder for that to work and then i'll just click flash oh it failed are the settings correct uh i thought they were do i have to like press flash no okay let's try instead of 115 try 9600 i legit just did this like just did this just in case i'm going to rename this file and remove the parentheses in space just in case because i i seriously just did this that's totally what it was it was the space i bet uh or the parentheses you never know so it looks like this particular tool wasn't escaping some invalid characters which you know what um that's no big deal it's a binary file we're sending over serial it's okay to not allow spaces and special characters in the file name so this is now flashing the firmware on this once that's done hey it says flash complete so now we have this it's running wled there's a bright blue light that's pretty cool so how do we get this to actually connect to my wi-fi there's a couple ways but the way that i'm going to do it is there is a wled wi-fi network that that little guy just created so i am going to connect to it um gonna i'm gonna cancel so simply by connecting to it i didn't even need to give it a password or anything then i can go to wi-fi settings and put in my network my network password i'm going to leave this blank for dhcp and maybe i'll give it a fancy name so we'll go ahead and name it wled dash 3 because this is the third one [Music] and i'm going to fill the rest of this out off camera okay so i just click save and it says wi-fi settings are saved i don't know if that actually worked but what i'm going to do is i'm going to switch my wi-fi back to my main and i'm going to use a tool called advanced ip scanner i'm going to scan for stuff um i don't know if this is going to even get me or not because i don't really have a way to to frame this so um so now what i'm doing is i'm scanning my network to see if i can find this new wl83 okay so i don't see it on my wi-fi so i'm going to reset it let me give it a few seconds and then i'm going to scan again i wonder if i type in wled will it only show me the wleds and it found it it totally just found it so i am going to right click on it go to tools and http the other way to do this is by simply um going to a web browser and typing in that ip address but there we go we have an interface now the question is what do we do with this i've got my um node mcu connected to my wifi but what how do i actually control leds how do i even power the leds well i'm glad you asked so a long time ago i thought i was going to run all new cabling for some fancy controllers for my sprinkler system so i bought this seven conductor wire right here and basically it's um 18 gauge uh oh there we go 18 gauge sprinkler wire and it's really cool because even though i realized i am terrible at long maintenance um and we live in the desert so we got rid of the sprinkler system it gives me a ton of this uh 18 gauge wire so here's what i'm gonna do i'm gonna take one of these cheap breadboards and i'm going to unplug this okay oh no it's disconnected and i'm going to wish i had some way to see this better but basically i am plugging i'm lining up the holes so that i have a line of ports or holes i don't know what you call it on either side and i'm just going to kind of slowly work its way down until it's pretty flush just to make sure i'm making a good connection with the contacts inside the breadboard so now what i'm going to do is go back to my power supply over here and get this some power without a usb cable so get rid of this usb cable there's some it's packaging and whatnot and i'm going to choose some red and white wires so i'm going to very carefully plug in this red wire over here on voltage in which on my breadboard is line 15 because i plugged the first pin in on uh row one so row 15 for me is voltage in but you can really tell because it says voltage in right there trust me now i'm going to plug that into one of the red lines then i'll grab a white cable plug it into the ground gnd port right here this is the first time i've used this breadboard so it's very tight and then i'm going to plug that into one of these black lines in here this is really not the way to do this please don't consider this part of the like hey you should be powering your lights this way and now i'm going to do the same thing so i've got power to the board but i also need power to the lights so what i'm going to do is plug into the next black one and on my receive in now these are this is super important um you cannot send the signal through the end of it it's like through the out portion you can only send the signal to the lights through the in portion for the signal so voltage you can put voltage anywhere you want on the line in fact it has this particular strand has these two extra wires so you can add voltage um you know wherever you need to you can inject the power so uh i happen to know that this female end of the connector is where it goes in and the way you can tell is because i tried it on the other side and it didn't work that's really all i know so what i'm going to do is on this cable there is i don't know if you can see it on the camera but there's a black dotted line on here which represents ground on this side so i'll plug that in all the way on the left okay and now i'm going to grab another red line i find it crazy helpful to use the same colors for the same uh like when you're delivering voltage to make sure that you're using the same uh color scheme throughout the project so i'm just going to put that in the far right on the other side because um you can see inside the led uh where the positive and negative are it's just gonna be impossible to see on the camera but trust me in real life with a magnifying glass you can figure it out getting the voltage you know the 5 volt versus ground correct is very important now all that's left is the signal wire something to tell for this to be able to control these leds so i have this orange cable right here and i know that it is d4 let's see can i zoom in i can zoom in check that out so i know that it is d4 right there so that lines up with port five on this breadboard and i'm going to effortlessly just push that in there we go and now i'll do the same and push it in here and now we're good to go um i should be able to turn on the power and get my node mcu and lights up and running so i'm going to flip the switch on this and there we go i have lights and something that you may notice if i could zoom out even more is half my lights don't work so let's fix that i'm over here i'm going to refresh this page just to make sure so here's my wled and if you see i can move it over to red oh that's not working i can move it over to green well that that does doesn't work either i can move it to blue kind of so let's fix all these problems at least those two so far if i go here to config i'm going to go to led preferences and i am going to make sure okay really i should have verified 5 volt to begin with total led count is 30. well i have a strand of 50 right here so i'm going to change that to 50 and click save there we go they're all back so we'll go back to led preference preferences and if i go to the color order right here i see that it says grb but i know that these are rgb so i'm going to say rgb click save now if i choose red it goes to red green goes to green and blue and it goes to blue now i can tell that i still have a signal issue there's something wrong with the commands being sent to these leds but we'll figure that out on a future episode for now i'm gonna look at some of these color presets um let's see um i am not sure what those do so i'm going to go to effects instead so if i choose android woohoo it makes them go from one end to the other that's kind of neat so there we go we're moving the lights from one side to the other that's kind of cool i like it there are all kinds of fun effects um bpm is if you had these strung out uh it would look more like it's waving back and forth which is kind of cool um i don't know why it's not at least kind of working um i'll turn the brightness down on these and see if that helps at all that's way too dim effect speed we'll move that down a little bit nope you can still kind of see it um chase rainbow the flickering really kills it and i don't know what's going on with the flickering it just doesn't make sense to me what's weird is if i rock this back and forth it's not flickering it's totally a signal wire issue and one thing that i heard was that it's because of the length of the wire the distance between the controller and the lights and so here's my solution oh and the gauge of the wire so here i have some 18 gauge wire and that's a pretty pretty short um wire so let's plug that in instead so i'm going to unplug this is kind of fun unplug the cable and when i do that it's going to freeze everything where it is because it's not receiving any new instructions so let's get some new instructions so i'm going to go back to this [Applause] line right there i'm going to unplug the middle port on this and see if i can get all of this to fit it's a terrible idea to do it while it's all powered on don't do that that doesn't look good so now for some reason they've all lit up white i'm going to hit reset and try and change these there we go there's fire it's kind of fun fireworks okay and there we go this looks like it kind of works and this definitely works better than either of the other two node mcus that i used one of them i even tried soldering on a wire and if anything it just damaged the solder on the board itself pin d4 there does not have much solder on it so um so yeah i don't recommend trying to solder it directly onto the existing solder if you don't know what you're doing like i don't know what i'm doing um but there you go i mean we got it to work and actually that does look like it's working using the small jumper wire straight to this i don't know why my other boards didn't work this smoothly um but i will say what i have been told is it's because this board is sending out a kind of like a 3 volt signal to all of this and it really needs to have a 5 volt signal in order to go any reasonable distance you would need something to repeat that signal at a higher voltage and the two options the two common options are a logic level something something um so in a future video we'll talk about how we can solve this problem and still have the lights like maybe have the controller here and the lights on the other end of the room that's actually what i eventually want to do is i really want to have um a wi-fi controller with a long line maybe uh a bunch of this stuff um between the power supply the controller and the lights so that i can have the controller maybe somewhere out of the weather and the lights somewhere outside so i'll be going over that in a future episode and once we get the control smooth like it is now then we're gonna go ahead and jump into how can i program this so this is great i'm able to use these presets but maybe i want to make my own maybe i want to send a voice command to set a timer i'll be honest i might want to be able to tell my echo computer earl grey hot and then have it start an led controlled timeline to let me know when my earl grey tee is done these are all things totally doable with home assistant node mcu node red and um a little bit of free time and energy to chase squirrels so i hope this was exciting for you i hope this kind of sparks some interest because for me figuring out how to get the node mcu working was the majority of the battle so now that we have independently controllable leds that i can manage with my node mcu i think the next several episodes are probably going to be centered around how can i customize this what can i do to maybe turn this into a timer with a progress bar or write my own animations without like completely coding everything from scratch so that's it that's how to set up a node mcu with some independently addressable rgb leds i'll put links to everything that i used in the description leave a comment below if you have any ideas of what you'd like to see me do with this thanks for watching
Info
Channel: ChasingSquirrels
Views: 5,508
Rating: undefined out of 5
Keywords: WLED, Node MCU, ESP8266, LEDs
Id: xx0IjXg3Xys
Channel Id: undefined
Length: 32min 19sec (1939 seconds)
Published: Fri Jul 02 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.