dominicklee / High-Tech-Christmas-2.0

A wireless E1.31 system for controlling Neopixels (WS2812) with ESP8266 and Vixen Lights

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

High Tech Christmas 2.0

A wireless E1.31 system for controlling Neopixels (WS2812) with ESP8266 and Vixen Lights

Background

Christmas comes around every year and there are many passionate embedded enthusiasts such as myself who find the desire to animate colorful lights around the house. Neopixels (WS2811 or WS2812) are serially addressable RGB LEDs that can be controlled individually. There are LED controllers out there but I want a wireless lights controller that conventionally will work with Vixen Lights, which is a free software that many people are familiar with.

A couple years ago, I wrote an Instructable about to animate Chirstmas lights with an 8-channel relay, some outlets, and my custom application called "High Tech Christmas 1.0". The lights were manually programmed to work with music but they were not able to change colors or brightness.

This year, I decided to upgrade that setup to something that feels more modern while enhancing the show. To do that, I wanted a system that cost less than $100 to implement but perform as a far more sophisticated setup than goes beyond entry-level systems found on Amazon.

Disclaimer

The system we are working with will require that you have basic knowledge working with electronics. The author is not responsible and shall not be held liable for any damages or injuries as a result of attempting this project. You agree to perform this project at your own risk.

Power Supply

You will first need to calculate the power supply that you will require. That depends on how many pixels you will power. According to an article on Adafruit, you would use the following example equation:

60 Neopixels × 20 mA ÷ 1,000 = 1.2 Amps minimum

In my case, I am using a 16.4ft reel of Neopixels with 300 pixels. So 300 Neopixels x 20 mA ÷ 1,000 = 6 Amps minimum. Obviously, I will likely have more than one reel of Neopixels, so it would be best for me to choose a power supply 10 Amps or above. With that in mind, it is also important to note that it is not good to turn on all the Neopixels unless we are confident that we have sufficient supply of power. Otherwise, it would pose a hazard.

Materials

The following parts are needed:

Overall, these parts should cost roughly $100 or less. If you buy a larger power supply or more reels of Neopixels, that may increase the cost.

Supplies/Tools

It is not required but highly recommended that you have these tools. It will make the project much easier to accomplish.

  • Scissors
  • Wire stripper/cutter
  • Electrical tape
  • Hot glue or UV glue
  • Electrical connectors
  • Duct tape
  • Windows laptop or tablet (with Vixen 3 Lights installed)

Quick Assembly Instructions

  1. Order and prepare all the supplies and materials above.
  2. Place Wemos D1 Mini into the enclosure case.
  3. Place the Drok 5v regulator into the enclosure.
  4. Hot glue or UV glue the 5v cooling fan to the enclosure plate.
  5. Connect the 5v fan to the output of the Drok 5v regulator. Connect the ground wire as well.
  6. Connect the 1000uF cap between the input and ground of the Drok 5v regulator. Connect those two terminals to the output connector.
  7. Connect the logic level converter to the Wemos D1 data outputs (D5, D6, D7). Don't forget to connect the Gnd and 5v and 3.3v VCC.
  8. Shut the enclosure and apply UV or hot glue on the edges.
  9. Download Arduino v1.8.8 IDE, set the board to NodeMCU 1.0, select COM port, and upload the code in this repo. You may need to first download the libraries for ESP8266, E1.31, and Adafruit Neopixels.
  10. Open up Vixen, configure, and patch this controller. Follow Vixen instructions as needed.

Vixen Setup

Vixen Lights is a fantastic free software that can control Neopixels, DMX lights, and more. In our case, we will have to configure Vixen to recognize our hardware configuration. Although there are tutorial videos out there for Vixen, your E1.31 configuration may be unique depending on the number of reels and length of your pixels. This guide will show you how to calculate and set up your configuration.

According to an article on Vixen: In DMX, only 512 channels of data could be carried on a DMX cable. This was a limit based on the balance of data rate, distance requirements, multidrop topology and refresh rate. With all of those factors considered, 512 channels was defined as the standard number of channels in a universe. As shows grew, and designers needed more than 512 channels to control a show, it became necessary to implement multiple independent DMX networks. While not part of the standard, the term “universe” became the standard term to refer to each separate DMX network. In the DMX world, every group of 512 channels was its own physical network and this network was called a universe.

A "universe" by no means is equivalent to a reel/strand of lights. It is not equivalent to any specific decoration either. A universe is just a fragment (aka chunk) of your lights show that comprises of channels that go up to 512. If your lights show is below that number, then you don't have to worry about configuration. If you go over that, you will have to do some calculations.

Despite our wireless approach, each universe is still bound by the 512 channel convention. Each Neopixel consumes 3 "channels", one for red, green, and blue. If you divide 512 by 3, you would understand that we can control a maximum for 170 Neopixels in a universe. Nowadays, a reel of 16.4ft Neopixels contain 300 pixels. In other words, 300 pixels X 3 = 900 outputs. These 900 outputs cannot fix in a single DMX universe since it exceeds 510. You will need to add an extra universe for the overflowed amount.

In our current setup, we have 2 reels (each with 300 Neopixels) and 1 strand of 50 Neopixels. So that gives us a total of 650 Neopixels. We want to organize these into universes that would allow us to easily patch them into "elements" for the display.

Hardware Setup Summary

Reel A (300 pixels):
170 pixels in universe A (510)
Start 1
130 pixels in universe B (390)
Start 511

Reel B (300 pixels):
170 pixels in universe C (510)
Start 901
130 pixels in universe D (390)
Start 1411

Strand C (50 pixels):
50 pixels in universe E (150)
Start 1801

Each universe must start at channel 1. The channels are relative to their own universes.

Vixen Configuration

  1. Install Vixen 3.7 or latest version.
  2. Click Setup Display.
  3. On the top-right corner, select Streaming ACN (E1.32) from the dropdown list. Click the "Add" button.
  4. Give your controller a name. In this case, I have named it BunnyPixel (E1.31). Right-click on it and select Configure.
  5. Enter the values as shown in the Hardware Setup Summary. If your hardware is different, ensure that the pixels are calculated properly.
  6. Select the "Destination" and enter the IP address of your Neopixel controller. Choose Unicast to the IP address you specified.
  7. On the top-left corner, select Generic Numbered Group from the dropdown list. Click the "Add" button. If your reel of lights is for the roof, name it "Roof Lights" with a prefix of "roof". Be creative and meaningful with these names since it will help later.
  8. Keep performing step 7 until you have added all your light reels and strands as "Elements".
  9. Select the Element you want to assign to the universe. This is known as "patching". In other words, select all the items in "Roof Lights" and then select the items on the right-side Controller that you want to map them to.
  10. Click the Patch Elements button.
  11. The WS2812 16.4ft 300 pixel reels I have use a "GRB" profile instead of an RGB convention. The WS2811 strand of 50 pixels use the typical RGB convention. You don't really need a dimming profile unless desired.
  12. Click "Save" and close the window.
  13. Click Setup Previews and give a name to your default preview.
  14. Click the "Background" button and select an image of your house. Adjust the opacity slider to around 50-60% to emulate a dark environment.
  15. Select the "smart shapes" multi-line tool, draw the outline of your lights on your house. Hit "Escape" once you are done. The lights may appear unevenly distributed.
  16. Click the Pointer Select button on the menu. Click on the line that you want to associate with an Element.
  17. You will see the properties box show details. You can change the size of the lights radius as well as changing the distribution of lights per string.
  18. Map the distribution of Elements per string. Save and exit.

Now you are ready to sequence some songs!

Sequencing Tips

Most tutorials normally just stop here and assume you know everything there is to know about sequencing in Vixen. If you are a season professional already, great! For the rest of us, I will share some key tips for you to get started with sequencing.

  1. First, choose a song (ideally a nice Christmas favorite) with a strong bass or rhythm track. Don't choose classical or slow songs for your first try. Download the MP3 for the song. (If you are playing it publicly, make sure you have obtained the rights)
  2. Click New Sequence button and type the name of your song.
  3. You will see the "Elements" of your display as "Tracks" on the left. You will see a blank timeline. Click Tools and Audio -> Associate Audio. At this point, you can choose to do Beat/Bar Detection, enter your key signature, and try to see if the system automatically generates the right bars.
  4. If you find that the automatic beat detection is inaccurate (sometimes that happens), then go to the bottom-right corner and select the tab called Mark Collections and delete the automatic beat map. We will create this automatically.
  5. On the top right, click New to make a new Mark Collection. Give it a name.
  6. Set your song speed temporarily to 50-60% to make it easier for yourself to map the beats. Hit the spacebar to begin the song.
  7. Hold down the CTRL key while you hit the spacebar along with every beat of the measure. Pretend you are a conductor in an orchestra and do your best to be on top of the beat.
  8. You can always stop the song by hitting the spacebar key alone. Or hit the F5 key to play/pause.
  9. Once you are done, drag some basic lighting effects. I normally set the brightness to 30-50%. If you have a weak power supply or insufficient DC injected supplies, you will see some flickering or unintended effects at 100% brightness.
  10. You can start the show by going to the Main Vixen Window and clicking Tools -> Web Server and visiting that URL to see your control panel online. You can even control your display from your smartphone!

Key Tips and Challenges

While setting up this fantastic display for the first time, it did not come without its own challenges. Here are some lessons learned and pro-tips here that may be helpful to keep in mind:

  • When provisioning your cable length, make sure you measure the dimensions of the roof edges where you plan to mount the LED strips. Using a measuring tape, measure all the way from your mounting location to the point inside your house or garage where you intend to plug in the DC power supply. This is to avoid a situation where you are short of wire length to reach the power supply or make compromises to your mounting location.
  • If your lights are more than 15 ft away from your power source, make sure your wires are 10 AWG or less (thick wires needed) to provide sufficient DC voltage to the lights with minimal voltage drop. Remember that the longer you extend your cables, the more power is lost along the way.
  • If possible, buy two DC power supplies to inject power at both ends of your LED strips, especially if you exceed a 16.4 ft strand or intend to extend it. In my situation, there is noticeable power drop when I set the LEDs to the white color. The end of the reel fades slightly yellow-ish color.
  • Make sure you securely nail your the connectors to the wall if possible. This prevents outsiders from tampering or putting tension on the Neopixel driver unit.
  • If you want a "big lights show", do make sure you always buy an extra reel or two just in case you need more lights to cover your perimeter. Your setup could always use an upgrade in the future.
  • Dedicate a Windows tablet and use the Vixen show scheduler to automate your show. This part seals the deal and makes your show operate all on its own.
  • In addition to sequencing your songs, make a Vixen sequence called Post Sequence where you put basic light patterns. This should be set and used as the default before and after your song plays. Otherwise, your house goes dark after the music ends.

About

A wireless E1.31 system for controlling Neopixels (WS2812) with ESP8266 and Vixen Lights

License:MIT License


Languages

Language:C++ 100.0%