Make a Light Controller

We have all seen "static" Christmas lights that always stay on, these instructions will allow you to build a Christmas tree light controller using a PLC (Programmable Logic Controller) to make dynamic light displays. In these instructions we will set up three sockets that are under control of the PLC, and you can plug lights into these sockets.

Steps

Connect Power to the CUSB

  1. Buy or obtain a PLC unit, preferably one that is easy to use. In this example we'll use the CUSB 22-R.
  2. Cut and trim back the outer covering of your AC power cord.
    • Find 3 wires inside, one green, one black, and one white.
    • Splice all three wires.
    • Hook up the green wire to the CuSB where its labeled "FG", which is frame ground.
  3. Screw down tight.
  4. Connect the black and white wires from your AC power cord onto the terminal headers as shown.
    • Black and White wires do not have polarity, so you can put either or onto the CUSB labels, N and L.
    • Leave these wires unscrewed or loose for the moment.


Hook up the AC Outlets

  1. Connect a wire from the CuSB connector labeled COM to the CUSB connector N.
  2. Connect a wire from the CUSB connector labeled P40, to one of screws on the AC connectors. Polarity doesn't matter so any of the two screws will work.
  3. Screw down tight.
  4. Repeat the above step for the rest of the AC connectors.
  5. Connect a wire from the CUSB label P41, to one of screws on the AC connectors and also connect from CUSB label, P42, to one of screws on the AC connectors.
  6. Connect a wire from CUSB label L to the other screw on the AC connectors.
  7. Repeat the steps above for each AC connector which will leave you with something like the image shown here.
  8. Connect light strings to each of the AC connectors.

Program the PLC

  1. Connect the serial cable to program the unit.
  2. Copy and paste the following code into CublocStudio and download to your CUSB:
Const Device = CB280
Dim Interval As Long
Interval=300
Do
   High 40
   Low 41
   High 42
  
   Wait Interval
   Low 40
   High 41
   Low 42
   Wait Interval
   If Interval>100 Then
        Interval=Interval-50
   Elseif Interval>0 Then
        Interval=Interval-10                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
   Else
        Interval=300
   End If
Loop


Check and Wrap up

  1. Check to make sure it all works.
  2. Tighten and check every connection.
  3. Insulate or protect where needed.

Things You'll Need

  • 1 CuSB22R
  • 1 AC power cord (like the one for your computer)
  • 3 AC Connectors from Home Depot
  • A bunch of spare wire.

Tips

  • You can also connect light strings in series, per a relay.
  • Change the Interval=300 line so the lights start blinking slower or make a completely different program for your controller.
  • Feel free to email me: [1]
  • Put PLC controlled lighting on a deer structure (or something similar) and time the lights so it appears animated.

Warnings

  • As with anything electrical make sure everything is disconnected from the wall power before making connections.

Related Articles