Powering your Lights
For a table runner you will probably want to power your lights by a power bank, for Christmas tree lights an AC Adapter (Power Adapter) is probably a better choice.
Go to the Power Banks or AC Adapter section, as appropriate.
Power Banks
For small and portable light chains a power bank is probably the best option.
When using a power bank, the computer should be set to limit the maximum power consumption to 500ma. This unlikely to be an issue, as, unless you are trying to have all LEDs on at once at full brightness, or you have way more than 30 (LED) lights, you are unlikely to exceed 500ma, even without setting this limit.
Setting the limit is important as the micro-USB plug and socket, as well as the tracks on the computer’s circuit board are not rated for any higher current This is why most USB ports on computers cannot supply more than 500ma. Also note that in searching for the ratings of micro-USB plugs and sockets I found that most were only rated at 250ma making 500ma seem a bit excessive.
C-Type USB does raise that limit to 3amps (3000ma) and in some cases 5amps, but I doubt very much that the tracks on the CPU are designed to carry this.
The smallest power bank I could find was rated at 3000ma, thus it will drive your lights for at least 6 hours from a full charge.
Wiring up your lights for powering from a power bank is as follows:
You will need 3 short female to female (socket to socket) jumper cables. You can get them from here https://www.aliexpress.com/item/1005001520271890.html although you can probably source them quicker from your local ‘electronics store’.
Female to Female jumper cables
Connect your Lights and CPU together like this
Gently place everything in the 3D printed box like this, the pins on the NodeMCU will be up and the Micro-USB socked will be slightly in the hole at the bottom of the box. The led string socket is inside the box.
Now gently slide the lid over the box.
The lid latches slightly when closed, but it shouldn’t be too hard to open it again, especially with a bit of upward pressure near the ‘latch’.
That’s it for the assembly of your Lights, Processor and Power. All you need to do is connect your power bank to your Processor via the socket in the hole of your box.
AC Adapter
For large and fixed lighting chains consider an AC Adapter (Power adapter)
You will need a 5 volt unit, with a current rating high enough to drive all your LEDs (lights) at the brightness required. 100 LEDs at full brightness (also implies White as the colour) could theoretically require 6amps, although, based on measurements and calculations 4.2 amps seems closer to the mark. In this application your are very unlikely to want all lights on at maximum brightness, so a 4amp power supply would seem to be totally adequate.
I got mine from here https://www.aliexpress.com/item/978238060.html remember to select the correct plug and current rating. You might be able to get this quicker from your local ‘electronics store’.
You will need a socket for the plug on the end of the power supply https://www.aliexpress.com/item/1005002144846941.html You want ‘type A Female’, and select a quantity, although we only need one, when I looked 3, 5 and 10 were all the same price, hopefully you will find a use for the other 9. Again, you might be able to get this quicker from your local ‘electronics store’.
You will need 3 short female to female (socket to socket) jumper cables. You can get them from here https://www.aliexpress.com/item/1005001520271890.html although you can probably source them quicker from your local ‘electronics store’.
Cut a pair of Red and Black wires in half, then strip them for about 1cm and twist them together.
Fold the wires back onto themselves and insert them into the female socket, Red to +ve and Black to -ve and tighten the screws.
Connect your Lights and CPU together like this.
Plug the power supply’s plug into the socket and gently place everything into the 3D printed box like this, the pins on the NodeMCU will be up and the Micro-USB socked will be slightly in the hole at the bottom of the box. The led string socket is inside the box. The power lead is in the top left, the power plug and socket angle down to the bottom right, this is a tight fit.
Now gently slide the lid over the box.
The lid latches slightly when closed, but it shouldn’t be too hard to open it again, especially with a bit of upward pressure near the ‘latch’.
That’s it for the assembly of your Lights, Processor and Power. All you need to do is connect plug in your AC Adapter.
When programming your CPU, remember to unplug the Red wire to the processor, otherwise you could end up destroying your computer, your CPU, or both! (Or neither, but, please, don’t risk it)