WiFi Controlled Christmas Lights With ESP8266

3,450

18

2

Have you driven by houses with fancy Christmas lights, often synchronized to music? Normally, these setups require commercial light controllers costing hundreds of dollars, commercial animation software that can also be quite expensive, a literal money pit for the average home owner.

This Instructable shows you how to build a low-cost, WiFi light controller using an ESP8266. This controller animates a string inexpensive lights found on Amazon, eBay, and lot of other online stores. The animations are created using the free xLights program. And the best part? Your lights are connected to your home wireless network, so you can place your lights anywhere in the house or in the yard, controlled and animated from the comfort of your computer!

The beauty is once you create multiple controllers as you add more lights to your house, xLights makes them all work together as a "show". You can do all of the wonderful animated lights that the professionals use, with a little bit of homemade building! xLights and all of the programs in this Instructable are free (no cost).

This Instructable will build one light controller that can animate a single string of 150 lights (the controller supports up to 680 lights). This string of lights can hang on a tree or the bulbs pushed into "coro" (a white plastic resembling cardboard) pre-made shapes such as stars, candy canes, and more. You can put lights into tubes for glowing arches, attach them to strips to make virtual trees, and so much more.

You'll be amazed how easy it and have the best Christmas (and other holidays) lights on the block! You can also visit my website www.itwinkle.org for much more information on building computerized Christmas lights.

Let's get started...

Step 1: Stuff You Need to Buy

Here is what you’ll need to build computerized, animated lights with ESP 8266:


ESP 8266 ESP-01 WiFi Wireless Transceiver Module with 1MB flash memory

This is the heart of the light controller. It connects to your home wifi network and drives the animated string of lights. When purchasing this module, there are some cheaply produced modules that can give you trouble. Stay away from modules that use PUYA memory chips. If you want a guaranteed, good quality module, buy your ESP from Addicore.com here.


"Pixel Pops" circuit board

This is a bare circuit board that the ESP and your lights plug into. It provides power to the ESP and your lights and allows to you program the ESP from your computer. Click here for a full description of what Pixel Pops can do. To buy a board, create an account on https://www.doityourselfchristmas.com, then send a private message to "ukewarrior" as he often has boards in stock, cheap! If ukewarrior is out of boards, you can order them in groups of 3 from OSHPark.

You will need to buy and solder a number of components to this circuit board, listed here:

LDO Voltage Regulator 3.3V 0.8A Positive (Mouser #511-LD1117V33)

Linear Voltage Regulator 0.1A Pos Volt Reg (Mouser #512-LM78L05ACZ) (note: this component is required only if you are using 12V pixels. Do not install this component if your light controller will use 5V pixels).

Multilayer Ceramic Capacitor MLCC - Leaded 50volts 0.1uF 20% X7R (Mouser #80-C320C104M5R)

MOSFET N-Chnl 60V (Mouser #522-ZVN3306A)

Metal Film Resistor - Through Hole 1/8watt 330ohms 1% 10ppm (qty: 2) (Mouser #71-RN55D3300FTR)

Diode - General Purpose, Power, Switching 100V Io/200mA BULK (Mouser #512-1N4148)

Tactile Switch SPST OFF-(ON) Round pushbutton (Mouser #506-FSM4JH)

Headers & Wire Housing 8P STR SR BDMNT SKT 3.5MM TAIL/8.5MMBODY (Mouser #517-9602086303AR)

Header & Wire Housing 6P HEADER GOLD 15u single row (Mouser #571-5-146280-6)

Pluggable Terminal Block 5P 3.81MM TERM BLK FIXED HORIZONTAL (Mouser #649-220327-D051B01LF)

Aluminum Electrolytic Capacitors - Radial Leaded 220UF 6.3V ALUM LYTIC RADIAL (Mouser #667-ECA-0JM221)


USB programmer

The CP2102 USB 2.0 to TTL module connects your ESP to your computer's USB port, allowing the ESP to be programmed to become a light controller. The CP2102 actually connects to the Pixel Pop circuit board and the ESP is connected to the Pixel Pop. You can get the USB programmer here.


Tube enclosure

The controller will fit into a 1" thin wall PVC pipe, making it weatherproof and small. Make sure that you buy "thin-wall" pipe as regular thickness PVC may not allow the ESP antenna to send/receive a strong wireless signal. Also buy two PVC caps for either side of the pipe.


Connectors

You will need a variety of weatherproof connectors outside the tube and regular connectors for inside the tube. Here is what you will need:

3-pin waterproof LED connector, outdoor, round, 18 AWG (two male, two female connectors) (be sure to choose "3pin big" for the size)

2-pin waterproof LED connector, outdoor, round, 18 AWG (three male, three female connectors)

2-pin JST LED connector 20 AWG (two male, two female connectors)

3-pin JST LED connector 20 AWG (one male, one female connector)

Power supply

The ESP light controller is designed to be used outside and is weather proof (note: not waterproof; it cannot be submerged). You will need an IP67 rated power supply. Here is an outdoor power supply that will drive up to 150 12-volt lights.

Ethernet cable

You will need two cables long enough to reach from the controller to the lights. One cable will be for power and data to the first 100 lights, the second cable will be to power the next 50 lights beyond the first 100. Make sure the ethernet cable has a low AWG (I recommend 23AWG) so that the wires are thick and can carry a fair amount of power with minimal voltage drop.


3 sets/strings of 12V WS2811 lights (50 bulbs each set)
These are digital lights that are animated with an industry standard protocol called ws2811. Your ESP, once programmed, will also know this protocol. These lights come in many shapes & sizes. As long as they support ws2811 or ws2812, they will work with your project. Make sure the lights operate on 12V DC and that the wire thickness is 20 AWG or lower. This ensures that the lights can be placed at far distances from your controller. Buy them here.

Note: This Instructable supports a string of 150 lights (3 strings connected end-to-end to form one, long string). The ESP supports a maximum of 14, 50-bulb strings per light controller (one, long string of 680 bulbs maximum). If you want to use more than 150 lights, you will need to calculate the power supply size and wire size for the number of lights that you intend to use. Long wire runs require larger gauge cable to account for voltage drop in the wire.

"Coro" plastic shapes

You can arrange your strings or lights any way that you want (hang them, put them on a tree, etc.). One popular way is to push them into plastic cardboard-like shapes like these: Buy shapes here.

Extension cable

This cord will be used to give your power supply 120 VAC. Any outdoor rated extension cord will work
for this project. Here is a great cord from Dollar Tree.

Step 2: Stuff to Help With Building

This equipment will certainly come-in handy while you are building your wireless light controller!

  • Heat shrink tubing
  • Heat gun, blow dryer, cigarette lighter, or stick lighter (to melt heat shrink tubing)
  • Jumper wires with alligator clips (useful for troubleshooting problems)
  • Soldering gun/iron & solder (especially a soldering iron for soldering components onto a circuit board)
  • Electrical tape
  • Craft/utility knife
  • Wire cutters
  • Wire stripper
  • Voltmeter
  • Colored labels (used to identify external connectors going to/from light controller tube)
  • Magnifying glass

Step 3: Solder Components Onto Pixel Pops Circuit Board

The Pixel Pops circuit board is a "carrier" for the ESP wifi module. The circuit board provides power to the ESP module and the first string of lights. You can also connect the USB programmer to the circuit board to upload the light controller software (a.k.a "firmware) to the ESP, turning it into a light controller.

The circuit board is really small, so use a magnifying glass to aid in soldering components to the board. The circuit board is clearly labeled for where the components go, too. The steps below will guide you through soldering the components on the board.


Diode - General Purpose, Power, Switching 100V Io/200mA BULK

This looks like a resistor, but has a single, black mark on one end. Solder this at the top of the board in the D1 location. Make sure that the black band on the diode faces left (toward the "D1" text on the board). Notice the diode symbol shown on the board.


Headers & Wire Housing 8P STR SR BDMNT SKT 3.5MM TAIL/8.5MMBODY

This eight-pin block (two rows of four pins) is soldered below the diode. After soldering, use the magnifying glass to ensure that the pins are not touching each from the bottom of the board from blobs of stray solder.


Header & Wire Housing 6P HEADER GOLD 15u single row

This six-pin row of pins is located vertically, below the "ESPixel Pops" label.


Tactile Switch SPST OFF-(ON) Round pushbutton

When fitting the switch/button to the board, the switch is shaped like a rectangle. As long as all four pins fit through the holes, the orientation is correct.


Metal Film Resistor - Through Hole 1/8watt 330ohms 1% 10ppm (qty: 2)

Solder both resistors to the spaces marked R1 and R2 on the board. The orientation of the resistors does not matter as long as they are mounted horizontally on the board.


Aluminum Electrolytic Capacitor - Radial Leaded 220UF 6.3V ALUM LYTIC RADIAL

Solder the blue, cylindrical capacitor to the space marked C2 on the board. The orientation is important; make sure the "-" side of the capacitor faces the left ( toward the 6-pin header).

Multilayer Ceramic Capacitor MLCC - Leaded 50volts 0.1uF 20% X7R

Solder the yellow, somewhat flat capacitor to the space marked C1 on the board. The orientation of this capacitor is not important.

LDO Voltage Regulator 3.3V 0.8A Positive

This regulator is large and has a metal tab with a hole through it. Solder this component the space marked U1 on the board. The orientation is important; the metal tab should face the bottom of the board (toward the "VCC GND" text). Before soldering, push the regulator as close to the circuit board as possible as the top of the metal tab could scrape the inside of the plastic PVC tube, making the circuit board difficult to insert/remove from the tube. It's also a good idea to bend the metal tab at an angle so that it fits into the plastic tube easier.

Linear Voltage Regulator 0.1A Pos Volt Reg

This regulator is much smaller than the one above, is somewhat cylindrical with a flat side to it. The orientation is important; position the regulator on the board with the flat side facing the bottom of the board (toward the "VCC GND" text). Notice the flat section of the white component outline on the board. Solder this component to the space marked IC1 on the board. Note: this component is required only if you are using 12V pixels. Do not install this component if your light controller will use 5V pixels).

MOSFET N-Chnl 60V

This component is smaller and thinner than the regulator above. If you look closely at it, there is a flat side to the component and the other side has beveled edges. The orientation is important; position the component on the board with the flat side facing the bottom of the board (toward the "VCC GND" text). The text on this component should face the top of the board. Solder this component to the space marked Q1 on the board.

Pluggable Terminal Block 5P 3.81MM TERM BLK FIXED HORIZONTAL

This green component is soldered to the bottom of the board (right above the "VCC GND" text). The holes where wires are inserted should face the bottom of the board.

A picture of a finished board appears in this step. Compare your work to the picture, notably the order of the two regulators and MOSFET that they are in their correct positions and orientations.

When you have finished soldering all of the components, it is very important that you use a magnifying glass to inspect the bottom of the board! Make sure that all solder points are self contained so that stray solder blobs do not touch nearby solder points, potentially causing a short.

Step 4: Building the Enclosure

Your light controller is small enough to fit inside a 1" PVC tube. There will be caps on each end of the tube; one end is for power "in" from the power supply, the other end is for connecting your string of lights.

Note that the enclosure is weatherproof, but not watertight. It will withstand harsh weather (snow/rain), but it cannot be submerged in water.

Cut the PVC pipe

With the thin-wall PVC pipe, cut a piece 6.5" long. This is actually longer than what is needed, but the extra length is handy in case you need to add a longer antenna to the ESP module. The built-in antenna works well if you have a strong wifi network, but may need to be augmented if you need better range.

Drill the end caps

With the two PVC caps, drill one 1/4" hole into one cap and two 1/4" holes in the the other cap. The first cap is for the "power in" connector and the second cap is for the "string" connector and the "power injector" connector (these are explained more later in the steps.

That's it! Your enclosure is built.

Step 5: Assembling the Power Connectors

Your WiFi light controller accepts 12V DC to power both the controller and your string of lights.

Build the 12V DC power connection

  1. Using the PVC cap with one hole, strip the wires of male 2-wire outdoor connector, then feed its cable through the hole with the stripped end on the inside of the cap.
  2. Strip the wires on one male 2-wire JST connector and one female JST connector. Match the wire colors of both connectors and twist them together. Twist the red wires together from both connectors and twist the black wires together from both connectors. Slide a piece of heat shrink tubing over each pair of twisted wires. These will be soldered to the outdoor connector in the next step.
  3. Strip the wires on the male 2-wire outdoor connector, then slip heat-shrink tubing over it. Twist this connector's black/brown wire to the female JST connectors' black wires. Solder these 3 wires together. Position the heat shrink tubing on the black wires over the new solder joint and shrink it in to position. Then do the same for the red/blue wires. This way, the outdoor connector's red/blue wire is connected to both red wires on the JST connectors; the same goes for the outdoor connector's black/brown wire connecting to both black wires on the JST connectors. Solder these wires, apply electrical tape to isolate the red and black wires from each other, then melt the heat shrink tubing over everything.
  4. When you are done, the outdoor connector's male end should extend from the PVC cap's outside while the two male & female JST connectors protrude from the PVC cap's inside.

Connect the 12V DC suppy to the circuit board

  1. Strip the wires on a male 2-wire JST connector. Twist the exposed wires to clump the strands together, then bend the exposed wires 180 degrees to make the strand clump thicker.
  2. Insert the red wire from the JST connector into the first pin of the green header block on the circuit board.This is the VCC pin as marked on the back of the board. This pin is near the "Input Power" text on the circuit board.
  3. Insert the black wire from the JST connector into the second pin on the green header block. This pin is directly below the large voltage regular marked as U1 on the circuit board. If you look on the backside of the circuit board, this is marked "GND".
  4. Connect one end of the female JST connector from the PVC cap to the male JST connector from the circuit board.

Note: You may have issues with the wires not staying connected to the green header block. If this happens, you can crimp the wires to a "crimp pin terminal" such as this. You can also see this type of connector in the attached picture.

You have now finished the power input wiring to the circuit board!

In the above steps, the power cable going to the circuit board provides power to the ESP module and the first string of lights (50 bulbs). To power the second and third strings, we need to create a "power injector" cable that bypasses the circuit board and powers these strings directly from the input power cable. This way the circuit board doesn't become overloaded with too much current going through it.

This power injector cable is easy to wire-up. Here's how to do it:

Make the power injector cable

  1. Using the PVC cap with two holes, strip the wires of a 2-wire male outdoor cable, then feed its cable through one of the holes with the stripped end on the inside of the cap.
  2. Slide heat shrink tubing onto the this cable on the inside of the cap.
  3. Strip the wires of one female JST connector. Join the wires of this JST connector to the round outdoor connector above, matching the colors. This way the red/blue wire on the outdoor connector mates the red wire on the JST connector and the black/brown wire on the round outdoor connector matches the black wire on the JST connector.
  4. Solder these wires together, isolate the red & black wires with electrical tape, then heat the heat-shrink tubing over everything.
  5. Connect the female 2-wire JST connector from the cap with two holes in it to the male 2-wire connector from the cap with one hole in it.
  6. You're done wiring the power injector cable!

Step 6: Assembling the Light String Connectors

This Instructable is designed to support three 50-bulb strings of lights, connected end to end. The beginning of this "long" string will connect to your light controller. The light controller's circuit board can power the first two strings. But to power the third string, we need to feed "fresh power" to this string, also known as "power injecting".

One end of the light controller tube will have two connectors. The first connector powers the first two strings of lights while the second connector adds fresh power to the third string. The first connector also provides the data feed to the strings, telling all three strings how to animate. Here is how to wire this up:

Assemble the string connector to the circuit board

  1. Strip the wires on a female 3-wire JST connnector. Twist the wire strands together, then fold the exposed wire on top of itself to make the wire thicker.
  2. Look at the green terminal block on the bottom of the circuit board. The first two terminals are power input that you already wired up in the previous step. The last three terminals should be empty.
  3. Now look underneath the circuit board. The three empty terminals are marked VCC, data, and GND.
  4. Connect the white/black wire from the JST connector to the GND connector on the terminal block (the third screw). This will provide ground to the string.
  5. Connect the green wire from the JST connector to the data connector on the terminal block (fourth screw). This will provide the data feed to the strings, telling them how to animate the bulbs.
  6. Connect the red wire from the JST connector to the VCC connector on the terminal block (fifth screw). This will provide power to the first and second strings.

Note: You may have issues with the wires not staying connected to the green header block. If this happens, you can crimp the wires to a "crimp pin terminal" such as this. You can also see this type of connector in the attached picture.


The next step is wiring the connector to interface the string from outside the tube to inside it.

Assemble the string connector in the end cap

  1. Strip the wires of a female 3-wire round outdoor connector, then feed it into the cap with two holes so that the stripped wires are facing inside the cap.
  2. Slide heat shrink tubing to the connector's cable on the inside of the cap.
  3. Strip the wires of a male 3-wire JST connector
  4. Twist the red wires together from this connector and the outdoor, round connector. This the power feed to the lights.
  5. Twist the white/black wire from the JST connector to the black wire from the round, outdoor connector. This is the ground connection to the lights.
  6. Twist the green wire from the JST connector to the yellow wire from the round, outdoor connector. This is the data feed to animate the lights.

  7. Solder these wires together, isolate them with electrical tape, then melt the heat-shrink over everything.

  8. When you're finished, you should have the round, outdoor connector on the outside of the cap connected to the JST connector on the inside of the cap.

  9. Connect the male 3-pin JST connector from above to the female 3-pin JST connector from the circuit board.

The final step is adding an outdoor, round connector to the first string of lights. This is needed because the connectors that come with the strings may not be entirely weatherproof.

Add a waterproof connector onto the first string of lights

Your lights should have come with JST connectors on both ends. You will need to cut off the connector on the "input" side of the string and solder in a round, waterproof connector instead. Figure out which end of the light string is the "input" end and which end is the "output" end. Typically, the input end has a female JST connector, but double-check to make sure. To do this, look closely at the first bulb on either end of the string. Each bulb has an "input" side and an "output" side. The input side is marked with "12V", "DI", and "GND" while the output side is not marked with these terms. A magnifying glass may help! The first bulb in the string is where the wires go into the "input" side of that bulb. On the other end of the string, the wires come from the "output" side of the last bulb. Make sense?

  1. Cut-off the JST connector from the "input" side of the first string, then strip the exposed wires leading to the first bulb.
  2. Strip the wires on a 3-pin male round waterproof connector to the three bare wires on the "input" side of the first bulb.
  3. The red wire on the connector is soldered 12V wire on the string.
  4. The black wire on the connector is soldered to GND wire on the string.
  5. The yellow wire on the connector is soldered to DI wire on the string.
  6. Plug the 3-pin male end of the lights connector to the 3-pin female end of round, outdoor connector coming from the cap with two holes.

The last step is connecting the remaining strings, then providing "fresh" power to the third string.

Add a connector to the third string for power injection

  1. Using the existing JST connectors, connect the "input" end of the second string to the "output" end of the first string.
  2. Using the existing JST connectors, connect the "input" end of the third string to the "output" end of the second string.
  3. Now you have one long string of lights, composed of three smaller strings joined together. The beginning of this long string terminates with a male 3-pin round outdoor connector. This connector plugs into the 3-pin female round outdoor connector from the cap with two holes.
  4. To provide fresh power to the third string, look at the input side of the third string. You will see two loose wires, one of them marked with a black strip. This is the "ground" wire for the third string while the unmarked wire is the "power wire". This allows fresh power to be injected into the string, even when this string is already plugged into the second string via the JST connector.
  5. Solder a 2-pin female round, outdoor connector to these two wires, matching the red power and black ground of the connector to the loose wires from the string accordingly.
  6. Connect this female outdoor connector to the 2-wire male round, outdoor connector from the cap with two holes. This connector provides fresh power to the third string.
  7. You're done!

Note:It is likely that the third string will be situated further way from the light controller tube, so the power injector connectors that you made above will not reach it. Simply make a two-wire extension cable with a male 2-pin outdoor connector on end and a female connector on the other end.

Step 7: Building Extension Cables

Most likely, your lights will be placed at a distance from the Wifi controller. For that you need to build two extension cables. One extension cable will provide power and data to the first 100 lights. The second cable will provide power to the lights beyond 100 (in this project, we are using 150 lights), so the second cable will power the final 50 lights in the long string.

The ws2811 lights that you purchased use three wires: power, ground, and data. But you can't simply use any three-wire cable for your first extension cable. That's because the data wire can pickup interference from the power and ground in the same cable. To get around this problem, use a specially wired Ethernet cable for your extension cables.

Note: I recommend no longer than 50-60 feet for your extension cables using this method. Also, be sure that the Ethernet cable uses 23 AWG or thicker wire.

How to build the first extension cable

  1. First, strip off the insulation on one end of the Ethernet cable.
  2. Strip the some insulation from all eight wires within.
  3. You'll notice that there are four solid-color wires and four white wires (actually, mostly white with some color on them). Twist all four mostly white wires together. This will be our ground "wire".
  4. Twist the blue, brown, and orange wires together. This will be our power "wire".
  5. The remaining wire (green) will be our data wire.
  6. Repeat these steps for the other end of the Ethernet wire.
  7. Use the 3-pinround outdoor connectors. Solder a male outdoor connector to one end of the Ethernet cable and a female outdoor connector to the other end. The red wire on the connector is soldered to the colored "power" wires on the Ethernet cable. The black wire on the connector is soldered to the white "ground" wires on the Ethernet cable. The yellow wire on the connector is soldered to the single green wire on the Ethernet cable.
  8. Stick colored labels on each end of this extension cable that this is the "light string" cable.

How to build the second extension cable

  1. First, strip off the insulation on one end of the Ethernet cable.
  2. Strip the some insulation from all eight wires within.
  3. Twist all four mostly white wires together. This will be our ground "wire".
  4. All four colored wires (blue, brown, orange, and green) together. This will be our power "wire".
  5. Repeat these steps for the other end of the Ethernet wire.
  6. Use the 2-pin round outdoor connectors. Solder a male outdoor connector to one end of the Ethernet cable and a female outdoor connector to the other end. The red wire on the connector is soldered to the colored "power" wires on the Ethernet cable. The black wire on the connector is soldered to the white "ground" wires on the Ethernet cable.
  7. Stick colored labels on each end of this extension cable that this is the "power injection" cable.

Step 8: Finished Cabling

Here is a picture of what the completed wiring looks like for the power and light string cabling.

Note: To prevent the waterproof connectors from pulling out of the PVC caps, attach zip ties to the end of each waterproof cable from inside the cap. That way, when the connectors are pulled from the outside, the cable will stop pulling once the zip ties hit the cap.

Step 9: Wire Your Power Supply

Add a plug to your power supply

  1. Get the orange extension cord from section. Use you wire cutters to cut off the female end of the plug.
  2. Carefully strip off about 1” of the extension cord orange jacket to expose the 3 wires. Be sure not to damage the jacket of the wires inside the extension cord.
  3. Cut back the green wire. You don’t need this wire.
    1. Because the power supply is not grounded, it is strongly recommended to protect your controller with a GFCI device. Plug the cord in to a GFCI outlet, or use a GFCI extension cord module with your controller cord.
  4. Place a piece of heat shrink tubing about 3” long over the orange extension cord. Also place a piece of 1” long tubing on both the blue and brown wires of the power supply.
  5. Strip the black wire of your extension cord. Strip the brown wire of your power supply. Twist these two wires together and solder them. Move the heat shrink tubing you put on the brown wire of the power supply and shrink it over the new solder joint.
  6. Strip the white wire of your extension cord. Strip the blue wire of your power supply. Twist the two wires together and solder them. Move the heat shrink tubing you put on the blue wire of the power supply and shrink it over the new solder joint.
  7. Position the piece of the heat shrink tubing on the orange extension cord in step 7.1.4 to cover the end of the orange extension cord and the new solder joints.

Your completed cable should look like the included picture.

Add a connector to the 12VDC wires of your power supply

  1. Strip the red and black wires of the power supply. Place a piece of heat shrink over each wire and a larger piece of heat shrink over both wires.
  2. Strip the blue and brown wires of a female 2-pin outdoor connector.
  3. Twist the black wire of the power supply with the brown wire of the connector. Solder this connection and insulate it with heat shrink tubing.
  4. Twist the red wire of the power supply with the blue wire of the outdoor connector. Solder this connection and insulate it with heat shrink tubing.
  5. Finish off your cable by moving the final piece of larger heat shrink over both joints and shrink.

Your power supply should look like the included picture.

NOTE: if you plan to connect the 12V power supply to the light controller to test the lights, be sure to disconnect the CP2102 USB programmer first. If the USB programmer is connected while operating the 12V power supply, it will instantly fry the USB programmer and possibly the ESP module as well. There will be smoke.

Step 10: Programming the ESP

When you buy the ESP module, it arrives with no programs on it. We need to upload a program that turns it into a WiFi light controller. The ESP module does not have a plug for connecting to your computer for programming. However, the circuit board has a connector. We can plug the ESP module to the circuit board, then plug a special USB programmer device into the circuit board. The circuit board acts as a conduit between the USB programmer device and the ESP module. Here is how to connect the ESP for programming.

Attach ESP module to your circuit board

  1. Plug the ESP module into the 8-pin header on the circuit board. Note that the antenna end of the ESP module should hang beyond the circuit board, like a "tail". See the attached picture for correct ESP orientation.
  2. NOTE: It is possible for the ESP module to come loose from the 8-pin header on the circuit board as you insert/remove the circuit board from the PVC tube. Try applying hot glue between the ESP module and the header to keep it firmly plugged in.

Connect the programmer to your circuit board

  1. On the USB programmer device, there are five pins: 3V3, TXD, RXD, GND, and 5V. Note: Do NOT use the 5V for anything, otherwise you will damage your ESP module!
  2. On the red circuit board, locate the 6-pin header. This is on the left side of the board under the "ESPixel Pops" text. Locate these pins on the header: GND (pin 1), VCC (pin 3), RX (pin 4), and TX (pin 5). Note that Pins 2 and 6 are not used for anything.
  3. Use jumper cables provided with your programmer to complete the following steps:
    1. 3V3 on the USB programmer to VCC on the circuit board
    2. TXD on the USB programmer to RX on the circuit board

    3. RXD on the USB programmer to TX on the circuit board

    4. GND on the USB programmer to GND on the circuit board

    5. Do NOT connect 5V on the programmer to anything!

    6. Plug the ESP module into the circuit board's 8-pin connector (two rows of four pins). Make sure that the antenna end of the ESP modules extends beyond the circuit board like a "tail".

Next, we will prepare your computer for recognizing the USB programmer device. Do NOT plug in the USB programmer device until instructed at the appropriate step below!

Prepare your computer to program the controller

  1. Windows on your computer may require drivers before you plug the USB programmer device into it. You can download the drivers here. Unzip the drivers into a folder on your compute before proceeding to the next step.
  2. Important! Disconnect all cables from the JST connectors going to the green terminal block on your circuit board. The USB programmer will be damaged if you feed power from the external power supply to the circuit board while loading the firmware. Therefore, it is very important to disconnect it.
  3. Hold down the button on the circuit board. While holding down the button, plug the USB programmer device into a USB port on your computer. Wait five seconds, then release the button.
  4. Windows will prompt for drivers, so point Windows to find the drivers in the folder that you unzipped in teh above steps.
  5. Red lights should appear on the USB programmer and the ESP module. In a few seconds, the red light on the USB programmer should go out.

Next, we need to install the uploading software that will send the light controller program from your computer to the ESP module.

Flash the firmware onto the ESP module

  1. This uploading software requires Java. If your laptop does not have Java installed, you can install it by going to www.java.com. If you are not sure if your computer has Java or not, open Control Panel. If Java is installed, you should see it listed there.
  2. Next, download the uploading software here. Unzip the file into a folder on your computer.
  3. Open this folder, then run the ESPSFlashTool.jar file. If Java is working on your computer, you should see the included screenshot of the program.

    When we flash the firmware onto the ESP module, it will become a light controller. In order to communicate and configure your light controller, the module needs to connect to your wifi network. This is done during flashing the firmware, so that when the module starts up for the first time as a light controller, it will connect to your wifi network.
  4. In the SSID field, the name of your wifi network may already be entered for you. If not, enter the name of your wifi network, spelled exactly with capital and lowercase letters if necessary.

    Note: If you are taking the class and are at the Schantz Makerspace, the SSID will be "lights_class". This way your light controller will connect to the wifi network at Schantz to finish the rest of these steps.
  5. In the Passphrase field, enter the password for your wifi network if there is one. If you are Schantz, the password is "1234lights". Note that passwords are case sensitive, so if your home network password has upper and lowercase letters, be sure to type it in correctly.
  6. The Firmware field should already be set to "Pixel (WS2811 / GECE)".
  7. In the Serial Port field, click the drop-down arrow to choose the port that reads something like "CP210x". This is where the USB programmer is connected to your computer.
  8. Click the [Upload] button to begin flashing the firmware. While it is flashing, you should see "Uploading" in the Status window along with increasing percentages (see included screenshot).
  9. When uploading has finished, the serial output should display an IP address. This indicates that the controller successfully contacted your wifi network.

NOTE: After flashing the firmware, it is best to disconnect the USB programmer from your computer and light controller, then power the light controller with a separate power supply. If you leave the USB programmer connected, sometimes the light controller will not boot properly and not connect to your wireless network.


NOTE: If the serial output did not display an IP address, the light controller could have still successfully connected to your wifi network. On on your router's configuration webpage, click the option to display connected devices via DHCP. Your light controller may be shown in the list as "ESP" with a number after it. If you see the light controller in the list, write-down the IP address that was assigned to it.


NOTE: If the controller did not connect to your wifi network, verify that your SSID and passphrase are correct. Unplug the USB programmer, hold down the button & plug it back into your computer, then release the button after five seconds. Then try uploading the firmware again.

NOTE: if you plan to connect the 12V power supply to the light controller to test the lights, be sure to disconnect the CP2102 USB programmer first. If the USB programmer is connected to the red circuit board while operating the 12V power supply, it will instantly fry the USB programmer and possibly the ESP module as well. There will be smoke.

Step 11: Configuring Your Light Controller

Your light controller not only controls lights; it functions as a web server! You can "see" and configure the controller by opening a special website on your computer. Here is how to do it:

  1. If your controller is still connected to the USB port via the USB programmer, leave it connected so that the controller receives power for the following steps.

    NOTE: If you plan to power the controller via the dedicated 12V power supply instead, make sure to disconnect the USB programmer from the light controller! Otherwise you will damage the programmer and ESP module when you apply 12V to the controller.
  2. Open a web browser on your computer.
  3. In the URL/address box at the top of your browser (not the search field in Google or similar), enter the IP address that you wrote down, then press [Enter].
  4. In a few moments, you should see a webpage that shows your controller's configuration (see included screenshot). If you do not see the webspage, receiving a "page not found" or similar message instead, try prefixing the IP address with "http://".
  5. On the controller's configuration webpage, write-down its MAC address. This makes it easier to find the controller on your wifi network later on.

Configuring the controller for your string of lights

Your wifi controller does not know how many lights are connected to it. Here is how to configure that.

  1. On your controller's configuration webpage, click the Device Setup tab.
  2. In the Pixel Configuration > Pixel Count field, enter the total number of lights used in your string.
  3. Click the [Save changes] button at the bottom of the screen.

Note: Do the below steps when you get home, not during the workshop!

Fine-tuning the connection to your wifi network

When your controller first starts up, it contacts your wifi router to obtain an IP address. The router provides a random address to every device on your wireless network. Your computer/laptop also has an IP address. When you connect your computer/laptop to your wireless network or plug an Ethernet cable in your router, the router provides an IP address. Any device on your home network, a computer, laptop, smart phone, smart TV, etc. are provided IP addresses from your router.

There is a small chance that the router can accidentally provide the IP address of your light controller to another device on your home network. This is because your router doesn’t know that the IP address for your light controller should be reserved. If your router provides the same IP address to another device, neither device will be able to communicate on the home network.

The simplest way to solve this problem is to limit the range of IP addresses that the router provides to other devices. For instance, if your router is configured to provide IP addresses between 192.168.1.2 and 192.168.1.254 (note the last digit changes from “2” in the first example to “254” in the second example), you can change this range within the router configuration. If your light controller's IP address is 192.168.1.250, for example, you can set the router’s IP address range to a maximum of 192.168.1.239. This way the 250 address is never provided to another device on your network.

Configuring your router to limit the range of DHCP IP addresses

To change router settings:

  1. Open a web browser and go to the “website” with the IP address of your computer, though the last digit should be a “1”. For instance, if the IP address of your computer is 192.168.1.175, go to this address in your web browser: 192.168.1.1.
  2. You may be prompted for a password. If you don’t know it, try a login name of “admin” with no password, or try a login name of “admin” with “password” for the password. If neither work, consult your router’s user manual to determine its default password.
  3. The attached "TP-LINK" photo is from a TP-LINK brand router. For this brand & model, the place to change the IP address range is in the DHCP Settings page.

    Note the “Start IP Address” and “End IP Address” lines. On other brands of routers, this could also be found the “Advanced > Setup > LAN Setup” or “Connectivity > Local Network > Router Details > DHCP Server” menu. Every router is different; look for the area that lets you change the DHCP settings.
  4. Ultimately, you want to change the last three-digit number in the “End IP Address” to xxx.xxx.xxx.239. This way, you are free to use address 240-254 for your controllers; your router will not assign these addresses to other devices on the network.
  5. Be sure to save your router changes when finished!

Configuring your ESP controller to use a static IP address

When you programmed the ESP module during class, it was assigned a temporary IP address from the class workshop's DHCP server. When you powered your controller at home for the first time, your home router assigned a different temporary IP address to the controller. But the problem is, we don't know what the new IP address is! We need to determine what address was assigned, then assign a "static" IP address to the controller.

To view router IP addresses assigned to your wireless devices:

  1. Make sure your light controller is powered on.
  2. Open a web browser and go to the “website” with the IP address of your computer, though the last digit should be a “1”. For instance, if the IP address of your computer is 192.168.1.175, go to this address in your web browser: 192.168.1.1.
  3. You may be prompted for a password. If you don’t know it, try a login name of “admin” with no password, or try a login name of “admin” with “password” for the password. If neither work, consult your router’s user manual to determine its default password.
  4. Your router can show which devices are connected to the wireless network and the temporary IP addresses assigned to them.
  5. The attached "DD-WRT" photo is from a D-Link brand router with upgraded "DD-WRT" firmware. For this brand & model of router, to view the temporary IP addresses assigned to wireless devices is at the bottom of the first page. Every router is different; look for the area that lets you view the DHCP addresses assigned to wireless devices.
  6. In the DD-WRT photo, you will notice that the "esps-087078" device is assigned DHCP address 192.168.1.114. Your controller device should start with "esps" as well. Write-down the IP address that was assigned to your controller.

To configure your ESP controller to use a static IP address

  1. Open a web browser on your computer.
  2. In the URL/address box at the top of your browser (not the search field in Google or similar), enter the IP address that you wrote down, then press [Enter].
  3. In a few moments, you should see a webpage that shows your controller's configuration (see included screenshot). If you do not see the webspage, receiving a "page not found" or similar message instead, try prefixing the IP address with "http://".
  4. Click the [Wireless setup] tab.
  5. Remove the checkmark next to "DHCP".
  6. In the "IP" field, enter any address from xxx.xxx.xxx.240 to xxx.xxx.254. This will become the permanent IP address for your controller. Your router will not assign this number to any other device on the network. For instance, if your home computer is assigned 192.168.1.175 by the router and you want to use "240" for your wireless controller, enter "192.168.1.240" in the "IP" field.
  7. In the Netmask field, enter "255.255.255.0".
  8. In the Gateway field, enter the address to access your router's configuration page (such as "192.168.1.1").
  9. Click the [Save Changes] button at the bottom.
  10. At this point, your web browser may lose contact with the wireless controller as the browser is trying to find it with the temporary IP address that is no longer used. Simply enter the controller's new "192.168.1.240" address (in this example; your address will be different) in the browser's URL to "find" the controller again.
  11. That's it!

NOTE: If you cannot access your wireless controller after clicking [Save changes] above, the controller may need manually rebooted. Simply disconnect its power, then power it up again.

Step 12: Testing the Lights

Your wifi controller's configuration webpage allows you to test the lights to see if the string is connected properly. You do not need to use the xLights animation program if you quickly test your lights. Here is how to do it:

NOTE: if you plan to connect the 12V power supply to the light controller to test the lights, be sure to disconnect the CP2102 USB programmer from the red circuit board first. If the USB programmer is connected while operating the 12V power supply, it will instantly fry the USB programmer and possibly the ESP module as well. There will be smoke.

  1. Power up your light controller.
  2. The string of lights may show random colors for a minute or so, then all go out. When the lights go out, it means that the light controller is ready.
  3. Open a web browser on your computer.
  4. In the URL/address box at the top of your browser (not the search field in Google or similar), enter the IP address that you wrote down, then press [Enter].
  5. In a few moments, you should see a webpage that shows your controller's configuration (see included screenshot). If you do not see the webspage, receiving a "page not found" or similar message instead, try prefixing the IP address with "http://".
  6. Click the Testing tab in the black toolbar.
  7. In the Testing Mode field, choose an animation that you want to see on your lights.
  8. Your lights should immediately light up, showing the animation.
  9. Set the Testing Mode to "Disabled" when you are finished testing.

if your lights do not light-up, please refer to the Troubleshooting section at the end of this Instructable.

Step 13: The Hardware Is Ready to Go!

We are finished with preparing the hardware and software on the circuit board and ESP module. You built the hardware, connected the lights to it, and uploaded the firmware to the ESP module.

From the ESP web interface, the lights cycle through the basic colors, meaning the lights are connected properly to the circuit board, that the ESP module is connected to your wifi network, and that the firmware is working fine. When you successfully "pinged" the ESP module IP address from your home computer/laptop, it means that the ESP is communicating successfully with your wifi network.

We've made it so far and congratulations! The final steps are installing the animation software onto your computer/laptop and controlling your lights from there. This is where it gets fun!

Step 14: Installing XLights Onto Your Home Computer/laptop

xLights is a free and open source program that enables you to design, create, and play amazing lighting displays through the use of DMX controllers like the one your just built. With it you can layout your display visually then assign effects to the various items throughout your animation.

While your controller supports up to 680 bulbs, xLights can support millions! You can build your controllers to support more lights; they all integrate into xLights to be controlled together.

xLights runs on Windows, Apple OSX, and Linux computers.

To install xLights...

  1. Download the latest version of xLights here
  2. After it has downloaded, run the executable to install the program
  3. During the installation process, you will be asked for a "show directory" or folder. This is where xLights will save all of its configuration for your particular lights. I recommend creating a folder named "xLights Show" inside your Documents folder, then tell xLights to select this as your "show" folder.
  4. When the installation has finished, xLights will create shortcuts on your Desktop.I

If xLights hasn't already started, double-click the "xLights" or "xLights64" shortcut on your Desktop. Do not use the xLights Scheduler shortcut.

Step 15: Configuring XLights to Use Your Wifi Light Controller

Before you design light animations, xLights needs to know about your light controller. Specifically, where to find it on your network and how your light strings are connected to the controller.

When you start xLights, you will see three tabs under the colorful effects toolbar: Setup, Layout, and Sequencer.

  1. Click the Setup tab.
  2. Under the "Lighting Networks" section on the left side of the screen, click the [Add E.131] button.
  3. In the "E131 Setup" window that appears, choose the following:
    1. Method: Unicast
    2. IP Address: Enter the IP address that was assigned to the wifi controller (for example, 192.168.1.240)
    3. Starting Universe #: 1
    4. # of Universes: 1
    5. Last channel: Enter the number of total lights in your string, times 3 (for one string of 150 lights, enter "450").
    6. Description: Type "ESP light controller" or whatever you want
    7. Click the [OK] button, then the red [Save Setup] button.

Now xLights knows about your light controller!

Step 16: Creating a Coro Model in XLights

Next to the Setup tab in xLights (below the colorful effects toolbar) is the Layout tab. This is where you indicate where your lights are arranged in your house or yard. You can take a picture of your house/yard, upload it here, then literally draw where the lights have been placed. For instance, if you placed your lights along the roof of your house, you can draw a line along the roofline to tell xLights that's where they are.

As you add more lights to your display, they are all shown on the Layout tab. You can have lines, arches, stars, candy canes, trees, whichever shapes you need to show how you arranged the lights.

In the middle of the screen, above the large black area, is a black toolbar. This is where you select shapes for your lights. Let's try a basic shape, just to see if your lights are working. The steps below assume that you bought the 23" coro Bethlehem star, but the steps work for other shapes bought from Boscoyo Studio, too.

  1. In the black toolbar, click the [Download] button at the end of the toolbar (it looks like a large arrow pointing downward).
  2. Move the mouse to the large black area,then attempt to draw a medium sized, tall box by dragging the mouse button.
  3. The attached screenshot shows the Download window that appears, listing all of the coro shapes offered by Boscoyo.
  4. In the Christmas > Stars section, click the "Bethlehem Star 23" option. A picture of the star will appear on the right.
  5. Click the [Insert model] button at the bottom.
  6. Right-click the star that appeared, then choose "Wiring View" from the menu that appears.
  7. The image shows the back of the plastic white "coro" star and where the lights should be inserted into the coro's holes.
  8. Insert the lights into the coro star; the tips of the bulbs should be facing the back of the star, according the wiring diagram.
  9. Close the wiring diagram window.
  10. Click the red [Save] button at the bottom of the left side.

You are just about ready to animate the lights in xLights for the first time!

Step 17: Animating the Star in XLights

Now we are ready to animate our star in a myriad of colors! The third major tab in xLights, Sequencer, is where you create animations. xLights called animations "sequences".

  1. Click File > New Sequence from the menu.
  2. On the "Sequence Settings" screen, choose the green [Animation] button.
  3. On the next screen, choose the green [20fps] button.
  4. On the next screen, click the [Done] button at the bottom.

You will see a large black area with "Star" on a line near the top. The box is arranged as a timeline; you will see seconds markers every five seconds at the top of the black area. You can drag animations (xLights calls them "effects") from the colorful toolbar at the top. To animate the star, drag an effect from the colorful toolbar to the line where "Star" is in the black area. Let's try one!

  1. In the colorful toolbar, point to the fourth icon called "Butterly" when you touch it.
  2. Hold down the mouse button, then drag to the line next to STar in the black area, at the "00" seconds mark in the timeline.
  3. You will see some purple lines in the timeline.
  4. Drag the right side of the purple lines, stretching the purple lines to the right until it becomes much wider.
  5. In the middle of the purple light, you will now see the butterfly icon. Click this icon once.
  6. In the preview area, you will see the star animating with rainbow colors!

Now that we created an on-screen animation for the star, let's see if we can make your real star light up!

Step 18: Lighting Up Your Lights!

So far, we configured xLights to see your Wifi controller on the home network, then we created a virtual star in xLights and learned how to animate it. The final step is telling xLights to animate your real star with the string of lights.

  1. Connect your star to the extension cord on one end then connect the other end to the light controller.
  2. Make sure that your Wifi light controller is powered on.
  3. At power on, the star should show random colors (mostly white), then go out. This indicates that the light controller is ready and listening for commands from xLights.
  4. Because xLights is running, the light controller will keep the lights off until you turn them "on" through xLights.
  5. In xLights, click the [Render All] button the top toolbar (the sixth button from the left). This makes sure that the animation is fully processed and ready to show.
  6. In the top toolbar bar, click the lightbulb icon at the end of the toolbar, turning it yellow. This button allows your star to light up from xLights; it is a master on/off switch, of sorts.
  7. Click the [Play] button on the top toolbar, about the ninth button from the left. If all goes well, your star will light-up in a myriad of colors! This is the "butterfly" effect that you chose in the previous steps.
  8. If your star does not light up, please look at the Troubleshooting step near the end of this Instructable.

Step 19: Where to Go From Here

Now that you have created your first computer animated lights controller, so much is possible. When you build more Wifi controllers, they become part of your growing display. xLights makes all of your lights work as one complete show! You can created dozens of lighted decoration using white “coro” shapes, arches that bounce and glow with lights, line your house with lights, create animated trees, and more. Check out this holiday display video that was made from wireless light controllers and xLights animation software.

You can also visit my website www.itwinkle.org for much more information on building computerized Christmas lights. There is an online community that can help with your questions with computerized holiday lights. If you are on Facebook, join these groups to make new friends and solve problems:

There are also excellent online discussion forums where you can learn much more about computerized lights:

DIY Christmas

AusChristmasLighting

The Engineer’s Guide to DIY Computer Controlled Holiday Lights

If you want to learn more about xLights, here is the manual, wiki, instructional videos, and discussion forum.

Step 20: Control Your Lights From the Internet!

Normally, your computer controls how your Christmas lights are animated. You create animations with the xLights software, then it sends commands to your light controllers and strings to animate the them.

While the convenience of having a single computer for creating animations and animating your lights is nice, leaving your computer powered on all day during the Christmas season is not that efficient. If you accidentally turn off your computer, reboot it, the computer crashes, etc., your light show stops. Powering a computer 24x7 is not efficient with electric, either.

Some people solve this problem by creating your animations using your home computer, then playing back the animations and controling your lights using a separate, low-power computer. This way you can continue to use your home computer as usual throughout the day, while the low-power computer is running 24x7, dedicated to playing your light show. The Raspberry Pi is perfect for this purpose. In xLights, you save your animations as playback files, then upload them into a special program (Falcon Player) on the Raspberry Pi that simply plays the files.

The Falcon Player software is quite powerful. With a little bit of tweaking, not only can it play animations created from xLights, but it can allow Internet control of your light show! By saving the xLights animations as multiple playback files (one animation per file, for example), people visiting a webpage can click buttons that tells Falcon Player which animation file to play. For instance, an animation can make your lights look like candy canes with red & white lights, while another animation file can make your house sparkle with twinkling lights. When no one is actively "controlling" your lights, a "regular" animation file is played for cars passing by.

The nice thing about Internet control of your Christmas lights is that is uses your existing knowledge of xLights (for creating animations). And if you are already using Falcon Player to playback the animations, you don't have to learn much new there, either! Internet control is mostly about tweaking Falcon Player to accept commands from the Internet and it's not that hard to do!

To learn more how to control your Christmas lights from the internet, click here!

Step 21: Running Your Light Controller Away From Home or Apart From Your Home Network

Your light controller connects to your home wifi network through your wifi router. Your laptop also connects to the wifi router; that way the laptop can “see” the light controller to animate your lights; your router acts as a conduit between the light controller and laptop.

Using your light controller away from home with your existing wifi router

Some people like to take their light controller “on the road” to demonstrate their lights away from home. The easiest way to do this is bring the light controller, laptop, and home wifi router with you. The ESP module on the light controller already knows the SSID and password to connect to your router, so when you use the router and wifi controller away from home, they will automatically see each other. You don’t need to connect the router to the Internet when away from home.

Using your light controller away from home with a different router

If moving your router out of the house is inconvenient, use a second router. Configure the second router so that its SSID and password match the original router. That way, the ESP module on the light controller will automatically connect to the second router without needing to reprogram the SSID and password on the ESP module. Note that passwords are case sensitive, so if your original router password has upper and lowercase letters, be sure to type it in correctly.

Next, configure the DHCP IP address range on the second router so that it provides IP addresses similar to the original router. For instance, if your original router gives out IP addresses beginning with 192.168.1.x, but your second router, out of the box, gives out IP addresses beginning with 10.0.0.x, then your light controller and laptop will not be able to “see” each other through the second router. All three devices (the light controller, router, and laptop) must have similar IP addresses to them to see each other. In this, the first three numbers in the IP addresses must be the same.

Changing the DHCP IP address range on your second router may be tricky, but is certainly possible.

Note: Your second router’s configuration page is normally accessed through a default, out-of-the-box IP address (such as 10.0.0.1). If you change the DHCP IP address range on this router to 192.168.1.x, for example, the IP address to access the router’s configuration page will change as well (it would change to 192.168.1.1). So if your change the IP address range on your second router and lose access to its configuration page, try using the new IP address that you assigned with a “.1” on the end.

Another note: If you configure a second router to match the same settings as your original router (as explained above), do not power on both routers in antenna range of each other! They will create a conflict and cause your wireless devices to lose connection to your network.

Using your light controller beyond your wifi network’s antenna range

The antenna on the ESP module in your light controller is very small. As such, your light controller may need physically placed near the router to get a good signal. The ESP module’s configuration page shows the signal strength to your router in the included screenshot in the RSSI field. The lower the percentage, the more likely your lights will not animate properly because of a weaker signal connection to the router.

If you need to place your light controller far away from the router, there are a number of things to improve the wireless range.

Improve the built-in ESP antenna

Consider replacing the antenna on the ESP module with a bigger/better one. This means physically cutting/disabling the built-in antenna and soldering in a replacement. You can google “ESP8266-01 antenna replacement” for ideas on how to do this; here is a link to get you started:

https://forum.pimatic.org/topic/2618/greater-wi-fi...

Install a wifi extender

Consider a wifi extender. These are devices that plug into a wall power outlet and extend the range of your existing router by picking up its signal and re-broadcasting it. For example, if your router is on the south end of the house and your light controller is in the north-end front yard, install the wifi extender on the north end of the house. It will receive the weaker wifi signal from the south end of the house then rebroadcast a strong signal on the north end. Here is an example of a typical wifi extender:

https://www.newegg.com/Product/Product.aspx?Item=N...

Add a wireless access point to your router

Consider an Ethernet to wifi router. Connect an ethenet cable to your original router, then run the cable to another router that is physical closer to your light controller. This second router should be configured to act as a second wireless network complete with a different SSID and password. You would also need to reprogram the ESP on the light controller to access this second wifi network.

On the second router, configure the DHCP IP address range similar to the original router, but make the fourth numbers on both routers non-overlapping. For instance, set the DHCP range on the original router to 192.168.1.3 through 192.168.1.110. Set the DHCP range on the second router to 192.168.1.126 through 192.168.1.239. The DHCP gateway on your original router should already be 192.168.1.1; set the DHCP gateway on your second router to 192.168.1.2. This allows your original router to reserve IP addresses 111-125 for future staticly assigned devices (like light controllers near the original router) and 240-254 for light controllers near the second router). Note that all of these IP addresses are suggestions/examples; your own scenario may/can be different.

Install a second router with existing cabling

If you don’t like the idea of running/burying an Ethernet cable from one part of your house/property to another, consider a powerline network extender. In this, connect an Ethernet cable from your original router to the powerline sending device, then plug the device into a regular power outlet. On another area of your property, connect the powerline receiving device to a power outlet. Your AC power cable acts as a “cable” to connect the two powerline devices, like a virtual Ethernet cable. The receiving device is also a wifi router, so configure it as a second router using the instructions above. Here is an example of a powerline network extender:

https://www.walmart.com/ip/NETGEAR-PowerLINE-1000-...

Note that both power outlets may need to be on the same circuit, but I do not know this for sure.

Step 22: Troubleshooting

If you are having problems getting your ESP wifi light controller to work for the first time, read this troubleshooting guide for help! You can also contact me at tominohio@gmail.com and I’ll help the best that I can.


I cannot flash the firmware to the light controller

Possible causes:

  • Before you plug the USB programmer into a USB port on your computer, press and hold the button on the red circuit board. After plugging in the USB programmer and waiting five seconds, release the button. This puts the ESP module into “programming” mode.
  • Make sure the ESP module is plugged into the red circuit board with the antenna end facing away (like a “tail”).
  • The RX pin on the USB programmer connects to the TX pin on the red circuit board. The TX pin on the USB programmer connects to the RX pin on the red circuit board.
  • Look at the Ports section in your computer’s Control Panel > Device Manager. If any devices in this section show an error, you need to load the drivers for the USB programmer (see Step 10). If there are no errors in the devices, note the COM port assigned to the programmer; you will need to provide to the firmware flashing program.
  • Be sure not to connect the external power supply to the red circuit board while programming the ESP module! This will fry the USB programmer board; you will need to get another one. During programming, the USB port on your computer provides sufficient power to the USB programming and ESP module.
  • With the ESP module plugged into the red circuit board, the red circuit board plugged into the USB programmer, and the USB programmer plugged into your computer, you should see lights on the ESP module and the USB programmer. If you do not, check the soldering connections on the red circuit board for possible shorts, broken connections, components soldered backwards, broken/loose wires, etc. Also make sure that the 3.3V and GND pins on the USB programmer is connected to the VCC and GND pins on the red circuit board near the “ESPixel Pops” label.

When I power on the controller, the lights do not turn on at all

Possible causes:

  • There should be a light on the ESP module at power on. If there is no light, check the 12V input power and GND connections on the green terminal block on the red circuit board (near the “input power” label). Also, check the wiring of the power supply’s AC plug, ensuring that the line, neutral, and group wires are connected correctly.
  • From my experience, when you power-up the light controller with a string of lights connected, some of the bulbs may turn white during power-up. This is normal. After a few minutes, the ESP module should contact and connect to your wifi router, then all lights will turn off. This means that the light controller is ready to receive commands from xLights.
  • Are the lights getting power? Use a voltmeter to test the power and ground wires coming into the first bulb (see VCC and GND near the “pixel out” section on the red circuit board). It should read roughly +12V.
  • Is the data wire for the lights connected to the correct pin on the red circuit board? It should be connected to the “data” hole at the bottom of the red circuit board.
  • Are your lights connected at the correct end? You cannot use both ends of the string of lights; only one end is the “start” or “input” end.

The self test works (some bulbs turn white at power-up, then go out as expected), but I cannot animate them with xLights.

Possible causes:

  • The computer/laptop cannot “see” your light controller. Open a command prompt, then “ping” the light controller’s IP address. If it does not respond:

    • Make sure that your wireless router is powered on
    • Compare your computer/laptop’s IP address with the IP address assigned to the light controller. The first three sets of 3-digit numbers must match. The fourth 3-digit number must be different between the computer/laptop and light controller.
    • Open your router’s configuration page. In the DHCP section, there should be a section that displays connected devices. If your light controller was assigned an IP address from the router’s DHCP service, it should show-up here with the name “esps” (refer to Step 11 in this Instructable). Try to ping that IP address, if it is shown.
    • If your light controller was set to a static address and you cannot ping it, download a tool that “pings” a range of address to hopefully find your light controller on the wifi network. For instance, if your wifi network uses IP addresses starting with 192.168.1.x, then ping all addresses from 192.168.1.1 through 192.168.1.255. Here is an easy command to ping a range of IP addresses easily:

http://start-run-cmd.blogspot.com/2011/05/ping-ran...

  • If you still cannot find your light controller on the network with a ping, the controller may not be connected to the wifi router. It may have trouble with the router’s SSID and password that you set while uploading the firmware to the ESP module on the light controller. Verify the accuracy and functionality of the SSID and password on your router (try connecting a new wireless device to it, such as a cell phone or a laptop), then re-flash the firmware to the ESP using the instructions in Step 10. Note that passwords are case sensitive, so if your home network password has upper and lowercase letters, be sure to type it in correctly. Also note that after flashing the firmware, the flashing tool should report the IP address that the ESP module received from the DHCP server on your router. If you see this IP address, you should be able to ping it at this point.

My lights are animating manually but not within xLights

Possible causes:

  • This means that the light controller is not receiving any commands from laptop/computer. Start xLights then click the lightbulb icon on the toolbar is yellow. This allows xLights to activate your lights.
  • In the xLights Setup tab, verify that the “Port” is set to the IP address that was assigned to your light controller. If using one string of lights of 150 bulbs, make sure that the “Baud Rate or E1.31 Univ” is set to “1” and that “Num Channels” is set to “450” (150 x 3).
  • Is the data wire for the lights connected to the correct hole on the red circuit board? It should be the hold marked “data” near the “pixel out” label.

I am using more than one string (I am using four strings of 100 bulbs each). How do I set this up?

The light controller only supports one string of lights. You can have up to 680 bulbs in this string, however. You need to connect each string end to end to form one, long string.

Please note that between every 100 lights you need to inject a fresh source of power and ground (like a vampire tap). The data line between every 100 lights does not need modified. This is for 12V lights. If you are using 5V lights, you need to inject fresh power and ground every 50 bulbs.

  1. In the xLights Setup tab, click “Add E1.31” to create a new Lighting Network. Use these settings:

    Method: Unicast
    IP address: (enter IP address of your light controller)
    Starting Universe #: 1
    Last Channel: 1,600 (this is the number of bulbs in your string, times 3). This example indicates 400 bulbs.
    Description: String 1
  2. Click [OK] to save your changes.
  3. Click [Save Setup] to save your changes.
  4. In the xLights Layout tab, draw one “Single line” model. Update the properties for this model to:
  5. Nodes/String: 400, Start Channel: 1
  6. Click [Save] button to save your Layout changes
  7. Create a new sequence and assign some effects to your “line” model!

Can I connect light strings together, end to end?

For 12V lights, you can connect two strings of 50 together, end to end, making a single string of 100 lights. Make sure that you update the web based configuration page on the light controller to reflect the longer string (see Step 11 in this Instructable). Also be sure to update the number of channels in the xLights Setup tab according (36 bulbs would be 108 channels, for instance) and the number of nodes in the models in the xLights Layout tab.

The wifi light controller will easily support up to 680 bulbs. This can be 13.6 strings of 50 bulbs or 6.8 strings of 100 (you can trim the last string short to make 680 bulbs total).

Can strings be shorter than 50 bulbs?

You can cut strings shorter, if you like. If you only need a string of 36 bulbs, for instance, cut off 14 bulbs at the end of the string (the “output” side). Be sure to update the number of channels in the xLights Setup tab according (36 bulbs would be 108 channels) and the number of nodes in the models in the xLights Layout tab.

My lights are animating, but there is a lot of flickering and/or incorrect colors.

Possible causes:

  • Make sure that the string is receiving a full 12V of power. Use a voltmeter to test the voltage at the first bulb in the string. Also test the voltage at every 100th bulb (for 12V lights) or every 50th bulb (for 5V lights).
  • Your string does not have fresh power injected every 50-100 bulbs. Test the voltage coming out of the “power injection” plug on the light controller; it should be 12V.
  • Your extension cable is too long (greater than 50-60 feet). Again, check the voltage going into the first bulb, after the extension cable.
  • You are not using custom wired Ethernet cable for your extension cable. This is important to reduce interference in the data line. Refer to the earlier steps on how to build this cable.
  • Inserting a 220-ohm resistor in series with the light string’s data line may fix the problem. This technique absorbs signal “bounceback” interference as it travels to the end of the string and back.

My lights animate for a while, then everything freezes. The lights on the light controller are off, too.

Possible causes:

  • Make sure that the input voltage that powers the light controller and string of lights is at least 12V.
  • Instead of sharing the power supply for the lights and light controller, use a separate power supply for the light controller (5V minimum). Be sure to connect a wire between both power supply ground terminals if you do this.

When I start xLights, I receive a message about some other process is using the lights.

Possible causes:

  • This can happen when you click the “xLights Scheduler” icon on the desktop instead of the regular “xLights” or “xLights 64” icon. It is a bug in the xLights pgram. You can ignore this message; it does not seem to hurt anything.

I may have damaged my circuit board by reversing the power and ground wires that feed it; how do I troubleshoot the components on the circuit board?

  • First off, most electronic parts won't survive reverse polarity power. First, remove the EPS module from the circuit board. Then place the board so that you are facing the green terminal strip. Counting from left to right, the terminals are numbered from1 to 5. Connect the voltmeter probes by touching the screw tops. The black probe to pin 2, the red probe to pin 1. Plug in the 12V power supply. You should read 12V plus or minus 1/2 V. Next, connect the red probe to the metal tab on the 3.3 V regulator, the large part next to the green terminal strip, the black probe should still be on pin 2. You should read 3.3V plus or minus 0.2V. Next, place the red probe on pin 4. You should read 5V plus or minus 0.3V. This tests the majority of parts, with the exception of the data line driver transistor. If any of the voltages are bad, replace that part before troubleshooting further.

Step 23: Credits

  • Thanks to my friend Keith for being a friend through the years, working on Christmas lights together. I couldn't ask for a better friend.
  • Thanks to the xLights development team (of which Keith is a member) for creating a free, constantly evolving/improving, flexible light animation system. And thanks to the xlights Facebook community for helping with my many questions.
  • Thanks to David who introduced me to the ESPixel Stick and the world of wireless pixels. David built the Pixel Pops" board, a re-swizzled version of ESPixel Stick that fits inside a 1" PVC pipe. He helped me worked out the bugs with building my first PP and is a good friend.
  • Thanks to the Schantz Makerspace in Orrville, Ohio for prototyping this light controller and working out all of the bugs. Makerspaces are a great way of bring great minds together, helping each other in community.

Share

    Recommendations

    • Toys Contest

      Toys Contest
    • Big and Small Contest

      Big and Small Contest
    • First Time Author

      First Time Author

    2 Discussions

    0
    None
    Michael114

    2 days ago

    Simply amazing! I have been looking to do the exact same project for several years now, sadly big home displays aren't really the norm where I live. But I will certainly take a closer look into the program for arranging the light patterns! Thanks.

    1 reply
    0
    None
    TomHammondMichael114

    Reply 2 days ago

    Thanks for the compliments and you are quite welcome. :)