Introduction: Smart Crystal Light String

As Christmas approaches and I’m in full research of diy home automation and smart objects, I decided this year to try to make a smart, nice looking, RGB light string.

I did a lot of research about DIY solutions around the web, on the one hand some projects consist of adding a Wifi relay or smart plug to control the power of the light string on the other hand some projects uses addressable led strips with a wifi controller to fully control the leds. I liked the way the controller is used to control addressable led strip but for me a LED strip isn’t looking good enough for a great Christmas light string.

I was a little bit running out of time to order some electronic component, so I chose to create my own smart light string with customizable and changeable light bulb diffuser and with the maximum feature I could get using only component I had in my office.

Overall the smart light string came out very well, the diffuser used are looking great and the features given by the Wled firmware are awesome. You can really fully customize your lights matching your needs. But this project is far from being perfect, I still consider it as a beta version and some improvement need to be done to it. I will explain further what I would do to make it way better the next time I built it.

Step 1: Parts and Tools Needed

I only used parts I had in my office for this project as it's not fully optimized i will give you the parts i used and also some parts you could use to optimize the light strip.

Parts:

      Tools:

      • 3D printer
      • Soldering iron
      • Cutting pliers
      • Tweezers
      • Multimeter
      • Micro USB cable

      Optional:

      Step 2: 3D Prints

      To create the light bulbs, I modified a 3D model I found on thingiverse (here is the source ). The original model was designed to be Christmas baubles. I modified it using Fusion 360 to add a screw thread on the bottom of the part. I mainly used the "Thread" function from Fusion360 and reduced the size of both thread by 0.15mm on each part to make sure to have enough clearance for the piece to fit one in the other.

      To make the light string and hold the LEDs, I designed a socket with hole for the power and data wire, a small recess for the LED from the ws2812b strip and a thread to be able to screw the light bulb into the LED socket. The holes for wiring through the socket are a little loose to allow you to put 4 wires in case you need some power injection due to the length of your strip. In this case you can have 3 wires for 5V, Data and Ground and the 4th one to bring another 5V to connect to the end of your strip.

      The pieces are made in a way that the thread will clamp the wires connected to the light when both pieces are tighten together avoiding to tear off the wires when manipulating the light string.

      To print the pieces I used:

      Clear PETG for the diffuser with 0.12mm layer height, 0% infill and 2 walls to keep some strength

      White PETG for the LED Socket with 0.12mm layer height, 100% Infill to limit the light coming through the bottom of the socket

      I’ve been able to print all the LED socket in one print as the print quality is not too important on this print.

      For the light bulb I would recommend to print then one by one. They are very thin and printing them all at once can cause you bad finish on the bulb and even some strength issues on the threaded part.

      Here are the 3D printed parts used for this project :

      https://www.thingiverse.com/thing:4672612

      Step 3: LEDs Preparation

      In my case I used 5V WS2812b LEDS but notice that any addressable LEDs would work for this project.

      For this part if you can, it would be way better to use preassembled standalone ws2812b round PCB. It would make your light strip way more reliable and will make the assembly of the LED in the LED socket easier.

      If you use a ws2812b light strip just like me, you will have to cut your LED one by one from your strip, making sure you are keeping enough from the solder pads on the strip to solder your wires in the next steps.

      If you don’t succeed to keep enough solder surfaces on each LED you can keep only one over two LED by sacrificing a LED and cutting the ful lenght of its solder pads between two LEDs.

      Next you will have to prepare all your wires. Choose a length you want between two bulbs (I chose to have around 30cm) and a number of LEDs you want on your string (I used 20LEDs) and cut all of your wire to the length you choose. You will need to have 3wires per LED. (In my case I needed 3x20LEDs so 60 wires of 30cm each). Your power adapter will depend on the number of LEDs you are using in your strip. At full brightness 5V WS2812b are requiring 60mA you need to multiply this number per the number of LED to have the power requirements needed on your power adapter. In my case the maximal power needed is 20LEDs x 60mA = 1200mA. I used a 5V/3A I had laying around but I could have used a less powerful power supply.

      If you don’t plan to use your light strip on a solid white pattern with full brightness your light strip will never need full power. As a Christmas light you can consider that you only need 1A for 40LEDs.

      Once they are all cut you can strip each side of all your wires and tin them. (This is quite a long step…)

      If you want you can wrap you wires 3 by 3 to make them looking nice between the LEDs and to make them less likely to snag in your Christmas tree.

      You can now tin all of the solder pads on your LEDs.

      When everything is tin, put your LED in place in the LED socket, LED facing upward.

      Step 4: Wiring

      Now comes the trickiest part of the project. You will have to chain all the LED together using the wires you prepared before.

      For this insert a 3wire cable through one of the hole of your LED socked, and with your solder iron, solder the cables to the LED solder pads. (try to use a very thin tip on your solder iron) You must be quick when you solder not to heat and deform the LED socket.

      To solder your LEDs in chain, be careful to truly respect the orientation of your LEDs!!

      You can use the arrow on each LED to be sure to respect the wiring direction. If you don’t take care about it you will fry LEDs wired backward.

      For those who choose to wrap the wires, you will have to use a multimeter to spot each end of the wires you will have to connect to the next LED. (It’s always better to check before than repair after testing)

      Make sure everything if well welded with your multimeter during the process to verify your solder to avoid cold or poor soldering. A bad welded LED will result in all the LED after this one non or bad working. If you have an issue of LED not lighting up, check the solder at first (I tell this by experience ;) )

      Step 5: Programming

      I selected a Wemos D1 mini for the controller because I already worked with that board. They are quite cheap, reliable, easy to program and include a Wifi antenna.

      I found the WLED project on github, it’s a firmware made for LED control over wifi, exactly what I needed for my project!

      WLED is a really great firmware developed by Aircoookie, compatible with Esp8266 and ESP32 boards and with a lot of features. For example :

      • Over 100 special lightning effects
      • LED Segments to set different effect and colors to different parts of a LED strip
      • Web control UI to control your LEDs with your computer
      • Smartphone App to control your LEDs with your phone
      • Infrared remote control
      • Home automation compatibility
      • Alexa Voice assistant compatibility
      • Adding relay to control your light power
      • Adding an external button to control you LED without Wifi
      • Synchronize multiple WLED devices over your local network

      And way more…

      Discover all the possibilities on the Github of the project: https://github.com/Aircoookie/WLED

      Flashing Wled to an esp8266 is not so hard. There is nothing specific needed. You only need to follow these steps :

      Go to the Wled Github page to download the last firmware (https://github.com/Aircoookie/WLED/releases)

      For Wemos D1 Mini download the file that ends with ESP8266.bin

      Go to the Python page to download and install Pytno (https://www.python.org/downloads/)

      Install the newest Python version for your OS

      Open a Terminal and use the following commands :

      pip install esptool

      To check is the tool is correctly installed use the next command:

      esptool.py

      If you get trouble with the Esptool.py you can try to download the esphome-flasher. This installer does exactly the same but uses a graphical interface.

      You can now connect your Wemos D1 mini board to your computer with the micro USB cable.

      Once connected use the following command to flash Wled on the board :

      esptool.py write_flash 0x0 ./WLED_X.X.X_ESP8266.bin

      You only need to replace ./WLED_X.X.X_ESP8266.bin with the path of the .bin file you have download previously.

      Your Wemos board should now successfully be flashed with WLED 😊

      Step 6: Connecting the Board to WiFi

      Now that your board is flashed, when you power it up you should see a new Wi-Fi network called WLED-AP. Try to connect to this Wifi network and use this password:

      wled1234

      You will be redirected to a web page, you just have to follow the steps to connect the board to your home WiFi

      After you have configured your board to your home WiFi, swap to your regular WiFi network and open a new browser to connect to the mDNS name you set up before

      You should end up connected to the following web page:

      Step 7: Control PCB

      This part is not a requirement for the system to work. You can only connected the power unit to your strip and to the Wemos D1 mini and then use a wire to connect the Data In from the LED strip to the D4 pin on the Wemos D1 mini.

      I wanted to try the relay and physical button feature, so i took a protoboard to make a prototype of the system to have a proof of work solution.

      I mainly used a wiring schematic i found on the WLED Wiki and slightly modified it to add the relay and the button using the GPIO usage given on the same page of the WLED Wiki.

      To add the relay to your project, you need to power up your relay with your 5V power line and ground, and connect the GPIO12 (D6 pin on Wemos D1 mini) to the command pin of your relay. On the other side of the relay, connect your relay in the middle of your 5V power line by connecting the 5V input on the input pin and the 5V output on the NO (Normaly Open) pin of the relay. By default the WLED Firmware turn the GPIO12 pin ON when turning the LEDs ON, by connecting the 5V line on the NO pin you will power up the relay when turning ON the LEDs and turn OFF the relay when turning OFF the LEDs (that is what we want to achieve).

      You can also add a button to your circuit when you don't use a clock to control your LEDs. To wire whe button, connect it between the GPIO 0 (D3 on Wemos D1 mini) and the ground. The button can be configured in the WLED app interface to do special actions from one tap, double tap and hold (Next Effect, Preset Cycle, ON/OFF for example).

      The capacitor connected on the light strip power line is used to smooth the power line and absorb potential power spikes. wire it after the relay and as close as possible to the start of your LED strip for a better usage.

      The resistor on the Data Line input of the strip is there to protect your LEDs strip to burn from this input. Potentially if you have the data line connected but the positive power rail disconnected, there is a risk of attempt to power the LED through the data pin and burn it out.

      If you have a long wire cable from your controller to your first LED you can use a Level Shifter to have a reliable data input on your LED string. There are component made to do this job, but you can use a cheap alternative by using one LED from your strip as a level shifter. To achieve this goal, connect one of the LED directly on your protoboard close to the output of your controller. Then you can connect your LED strip connector after this LED. By passing through the frist LED, the Data Line will be affected in the same way than using a level shifter. (To avoid this LED to brighten up with you LED strip, there is an option in WLED LED preferences to check to skip the first LED).

      Once everything is wired take some time to check all your connections and solder.

      If everything is fine, you can now connect your power supply and you LED strip to your circuit board.

      Step 8: Enable the LED to Work With WLED

      To enable your light strip to work well in Wled you will have to go in the settings of the web interface, then in LED preferences and enter the LED count you have on your LED string.

      You can also limit the max current you want your light string to draw for your power supply to be very safe.

      Save your settings and go back to the main page to test yor light strip.

      You can now choose different colors and effect to illuminate your christmas tree !

      Find a full wiki listing all the presets and possibilities of effects on the Wiki page of WLED project : https://github.com/Aircoookie/WLED/wiki/List-of-e...

      Step 9: Results

      I think the Light Strip came out very well for an alpha version, crystal bulb work great as a diffuser with clear PETG and the control offered by the WLED software is awesone. For sure this is not the last time i will use WLED to add smart light in my house.

      Next time i will try to to a light strip i will use more reliable component as the WS2812b pcb and i think i will try the Wled Wemos Shield that offer a better looking PCB with some more features (A fuse for even more safety for example). I will also try to make something waterproof for the next version to offer the possibilites to add the strip outdoor.

      Thanks for reading this instructable i hope it has been usefull for you, I will update this article when the second version will be done, stay tuned if you are interested :)