Show you how to set the controller up, but from there you simply plug it into a USB power. Brick sit back and listen to your wife. Tell you how beautiful it is all right here today in Daves, Garage, Music, hey, Im, Dave welcome to my shop in our last episode, which youve already perhaps seen if youre a subscriber, we covered the history of LEDs and introduced the individually addressable LED in case you Missed it, those are what well be using to provide the light show within the boxes. Long story short: we can control the color and brightness of every LED on an individual basis that will allow us to do color Fades, Blends, palettes, Sparkles and more well start with a simple off the shelf, plug in controller that works right out of the box, and Then well try a software package called night driver that comes with far better effects built in and that will allow us to create and program our own effects as well Ill build it two different ways. So you can pick your favorite and either way well be assembling. Everything from off the shelf hardware and open source software – you can get it working as is, and then you can modify and personalize it as much or as little as youd, like its a great way to learn the basics. Now the first thing we need, unless youre super crafty, you can make them yourself out of chicken wire and fireproof Angel feathers are a set of translucent decorative LED boxes.

Fortunately, Amazon has what appears to be literally dozens, if not hundreds of choices. To save you. Some time Ill put links in the video description to all the parts that I used, so you at least know that they work together now the ones Im using came with some basic white illumination, and that way I know the material should be tolerant of whatever heat Leds happen to make once weve selected a set of boxes. We need to choose the LEDs, we plan to add to them Im going to show you two different approaches. In the first case, Ive added a 32 LED ring to the base of each box and theyre chained together into a string of 96 sequential LEDs. I next used strands of single LEDs like these, that are also available on Amazon, and if you want to be really fancy you could even do both. Our next step is to install the LEDs into the boxes. In my ring case, I am simply going to set the three rings on a flat surface facing upwards and then lower the boxes over top of them yeah its that simple, if you want it to be, or you can be as elaborate as you like, just as Long as your LEDs are installed, as one long sequence make sure that you keep track of the number of LEDs in each box so that we can configure the software later for the Strand case Ill stuff. The single LEDs in such a way as to appear haphazard and random, but with about one third of the 50 LEDs in each of the boxes, so theyre distributed somewhat evenly.

Ive used zip ties to hold the Strand up to the top side, so they dont all settle to the bottom. With the LEDs installed. We need something to control them because individually, adjustable LEDs dont do anything if you do not have a controller telling them what to do. They dont even turn on at all. As I alluded to up front, there are at least two ways that we can control the LED colors show inside the boxes. The first way is to purchase a cheap dongle with some built in effects set up and forget it thats the easiest way to get started and its all well and good, but well also go one major step further by using our own microcontroller and programming an effect Using an open source piece of software known as night driver before we can run, however, we should learn to walk, and that means Ill start with the pre made controller. I grab this one off Amazon and there are several to choose from just make sure you get one that supports 5 volts and that is intended to be used with individually adjustable LEDs, which you can generally determine by looking at the connector. If its the same three wire plastic, connector, its probably the right type but read the description to be sure what youre looking for is ws2812b control to use the dongle. We just plug the connector into our LED strand or rings and then plug a 5 volt power.

Adapter into the dongle itself, it should immediately start producing some kind of garish effect to change or control. That effect, we need to install an app on the phone lets, scan the QR code right off the dongle, which should take us to the App Store you can see. I already have it in installed so Ill, just pick open once Im on the main screen of the LED controllers app, I click the plus sign to add a device. This is where the whole internet of things breaks down in my eyes, because you must now give this thing, your Wi Fi credentials. If you want to do much with it, no, fortunately, this one appears to work without creating an online cloud account of any kind. At least so, it tries to get you to create one to make the connection we go to our Wi Fi settings and we join the phone to little Wi Fi hotspot that the LED dongle has created. It will be a random when named with something like LED and then a bunch of numbers. Once weve joined the dongles Wi Fi, we return to the phone app and let it do some negotiation we can select, which real Wi Fi. We want the dongle to use and then give it the proper credentials now Im not going to give some offshore LED vendor my real Wi Fi credentials. I mean why make it easy for them? You can make it not so easy thats right you can, and so I did by creating a special VLAN or SSID for all of my iot devices in the home.

So they cant see my personal Wi Fi, now thats a whole episode on its own, but its something you should look into. I also got stuck at this point because it kept saying that it had failed and I kept just retrying things once I finally gave up and canceled out, though I was surprised to discover that the device had successfully been added and that the error messages were just Some kind of erroneous bug of some kind, but what do you want for 12 bucks and thats? Just one reason why were gon na make our own very shortly? In any event, you should now be able to use the phone app to change the LED colors control them select the effects from the built in list and so on. The app even has the ability to create some limited sequencing and some new effects and tweak existing ones. So with some tinkering, you should be able to find a pleasing combination of some kind. Now you could stop there, but what fun would that be Im going to give you a taste of night driver by quickly setting up my own microcontroller from scratch? Downloading the night driver software from GitHub building it and flashing it onto the chip? Next, Im going to use the night driver server package to write a Christmas effect in C, sharp and then broadcast that affects color show over the Wi Fi network to the esp32, which will in turn display it live on the LEDs Overkill.

Perhaps so, Im going to blaze through the steps pretty quickly, so you can look at the big picture and then, if theres sufficient interest in setting up and using night driver, please be sure to subscribe to the channel and to let me know in the comments that Youd like to see a more detailed episode on fully deploying night driver and Id be happy to do one to run night driver. The next thing we need is a microcontroller to run the LED effects. Now Ive selected this esp32 module from Adafruit known as a TFT feather S3, and the last thing we need is a power brick with a USB output to power it. Whatever you wind up doing for LEDs, you should make sure that youre not exceeding the power supplies, ability to provide Power or the modules ability to regulate and distribute it. The last thing you want to do is create a hazard so check your data sheets to be certain. The first step is going to be soldering the LED connector to the esp32 module. Now this loose connector is almost always included with the LED strip or Rings or strands that youve purchased. The strip itself will have a male connector, and this female connector then gets soldered to the module. You could hardwire it if you dont have a connector. For some reason, but if you have it keep using it because it allows your module to save Plug and Play, the connections are simple and there are only three of them.

The connections are also clearly labeled on the module itself. First, we connect the ground pin to the module to the ground wire. The ground wire will either be black or white. It is not, and never is the green wire in this case. Green is the data wire and we connect it. Next, you can change what pin to use, but the software that were going to use assumes pin 5 by default, so well just connect the green wire to pin 5.. Finally, we need to connect the red power wire and we connect it to the 5 volt output on the module which, in my case is labeled USB. That means that the module will pass its 5 volts from the USB right onto the LED strip and power. The LEDs, its a handy shortcut but, as I said, you have to be careful not to draw too much power. Note that this only works because were using a 5 volt strip, and this is a 5 volt USB pin. If you had like a 12 volt strip that you were powering externally, somehow you would definitely not want to connect the 12 volt strip to the 5 volt module. In that case, you would just have ground and data and no power connection between the two. Now, if, for some reason, you didnt want to connect the boxes to each other in one long strand, the software that were going to be using night driver also supports wiring each box with its own strand, connected to a separate pin on its own data wire.

But thats a complication that well have to wait for another day and another episode if we were to power it up at this point, absolutely nothing would happen thats because we havent loaded any software onto the chip, yet so its not doing anything with those LEDs flashing. The microcontroller with code consists of three parts. We need Microsoft, Visual Studio code with the platform i o extension to do it. We also need git, so we can get the code from GitHub Ill proceed as though we have vs code with platform. I o and get already installed, so I can show you the steps that are specific to this project to get started. We bring up visual studio code and we pick clone git repository from the very start page that will copy down the code that we actually need. All we have to do is specify a location for it on our local hard drive and the rest should be automatic. If all goes well, when its done cloning, the code youll be asked. If you want to open the project, you should go ahead and say yes. Next, I need to create a file called secrets.h that contains my Wi Fi credentials, and it will bake them in to do so. Im just going to make a copy of the example file included and edit the specifics. I checked to make sure that the configuration selected in platform io.ne is appropriate for the feather chip that Im running and then I can simply press F1 and select platform.

I o build from the menu when thats complete. I make sure the chip is plugged into the computer and then I just select upload as long as theres. Only one esp32 module plugged into your computer at any one time platform IO will generally figure out the right port for you automatically. It only takes about 20 seconds to upload the firmware to the chip, at which point it will reboot. When it first starts up, not a lot happens. It lights every 10th led to show me that its indeed running but thats about it thats, because night driver can do both built in effects as well as receive effects over Wi, Fi and Ive opted for just the latter. That means we can write our effect on the computer side using almost any language of our choice and the night driver server will pump the results over Wi Fi to be shown on the night drivers strip code running on esp32 and send it on to your LEDs. The way it works, at least in general, is that content is generated for the LEDs on the server side, but its done a few seconds in advance and then sent over Wi Fi to the chips which in turn buffer and hold that data until a timestamp on It comes due at which point it then displays it. The server and the chip both use the ntp protocol to keep their clocks in perfect sync, and so you could even build a Jumbotron out of smaller matrices and theyd.

All display in perfect sync Id build one to show you, but the panels are expensive and I cant find anybody willing to donate a bunch of color matched Hub 75 panels for a demo like that. But perhaps one day Ill find a video wall abandoned on Facebook. Marketplace you never know back to reality, lets jump into C sharp for a moment, since the server is a.net core app that can run on Windows, Mac or Linux equally well, by the way, thats. Also true of vs code and platform. I o I try to keep all my code fairly cross platform these days for maximum flexibility. In fact, when I run this setup Ill be doing it on a Mac, while the server code runs remotely in a Linux VM under proxmox, and talks to an esp32 LED strip controller running free rtos code that I originally wrote Under Windows. It doesnt have to be like that. It just can be. The customer factor I want to create will be a smooth pallet blend that will fill each box with a different rotating color and it Sparkles every 10 seconds to do it Ill, create a new, LED effect class and call it the presence effect Ill have an inner Effect, which is the smooth palette effect, so it can do all the real drawing work for me, but all you have to do for any new effect is to implement the render method Ill first call that inner effects draw frame.

So it can draw my background, which will be the pallet sweep and then every 10 seconds when a modulus is with zero Ill draw some random white pixels over top that palette Ill use a sine function to sort of wrap the sparkles in and out over the Course of that second and thats about all there is to it now the night driver server Im using already serves all the LED functions here in my shop and outside, so it already serves about 15 different locations. Even the windows and the LED knickknacks behind me are running a VM off in the closet on the storeinator to add the presence class Ill. Add a new Christmas presents class to the list of locations and tell it how many frames per second it should draw at next. I can Define the location which basically just knows how to keep track of its own LEDs and what effects are running on them at what scheduled time with that complete Ill run, the server app and it will spin up and run all 16 LED features. My presence will be the first one in the top left here we can see the IP address of the controller. What the Wi Fi signal is like the socket status, the clock status, the buffer depth, even how much power the LEDs are using on that strip and so on. As a final experiment, I decided to try the cubes with both the Rings and The strands to make that work.

All I needed to do was to plug the strands into the end of the Rings and then update the total number of LEDs in the Strand code. Night driver can send updates to the LEDs at more than 60 frames per second, if needed, so its limited really by the number of LEDs you have in the chain, in the sense that if you have about a thousand LEDs, it drops to 30 frames per second, As the best you can do, thats not a concern for this shorter set, of course, just something to keep in mind for long sets. If you have any interest in matters related to autism, Aspergers or ASD, please check out my book on Amazon secrets to the autistic millionaire its got nothing to do with money and everything to do with living a successful life on the Spectrum, its everything I know now That I wish Id known back then and if youve enjoyed todays episode, please make sure that youre subscribed to the channel. So you dont miss any follow up. Episodes on a night driver LED software, remember Im mostly in thats for the subs and likes. So please be sure to leave me one of each before you go today in the meantime and in between time.

https://www.youtube.com/watch?v=TX9EZ3gPnok