Lighting Controller :: Part 3

I got the components mounted on the main and remote boards. After much deliberation we dropped $12 per remote node to pick up some waterproof plastic ammo boxes to put the electronics in. These boxes will be out in the yard exposed to snow/rain. The boxes worked out very well, as the 3-gang outlet box fit nicely inside. Just drilled a hole in the bottom so the cords can go in/out.

Wiring up the outlets was pretty easy. Common wire was shared across them all, and the hot (black) wire was sourced from the circuit board (triac). I did not use any ground wire as the Christmas light strings don’t have ground. I also used a pretty light gauge wire as I will only be driving a single string of LED lights per outlet.


Got everything wired up at the neighbors and everything worked well. Even with 100′ cat5 runs to some of the remote boxes everything worked well. We did have some flakeyness where it would lock up occasionally after a few hours. I upgraded the wallwart power supply to an old computer supply, and at the same time fixed a solder joint for the ground wire that looked ‘cold’. Not sure which of the two upgrades fixed the issue, but all is good now.

Below is a picture of the main controller board wired up on the workbench. Will post a video of the light show in the next update!

xmas controller

One thing you may notice is the FTDI controller connected via USB. This is due to the fact the Arduino Mega changed the way they emulate usb/serial. This new chip on the arduino is not identified by the software running the lighting show (Vixen). Using an older-style FTDI board remedied that situation…

2013 Christmas light controller :: Part 2

The controller portion of this project will be based off an Arduino Mega 2650.  Of that the intent is to use 30 of the available digital channels.  The target for 30 is arrived that for each remote board I can get 6 channels pretty easily.  That is driven by 8 wires in an rj-45, with 2 being used for power – leaving 6.  Based off how many lights we actually wanted to hang, we decided 5 groups of 6 channels should fit the bill.  Getting to the design on the Arduino shield I quickly discovered I was limited by the 4×3 inch area provided by the freeware version of Eagle PCB design.  In hindsight I should have just ponied up the credit card and purchased the hobbyist version.  I will probably end up getting that for next years’ inevitable growth.

With the working limitations I had, I needed to break the shield up into two pieces, as I could not fit everything in the 4×3 working area.  I ended up making one board for 18 channels, and another for 12.  Here is a zip with the eagle files.  I warn you in advance the .sch files are not pretty… 🙂  They are free to use for non-commercial purposes.

Overall its a pretty simple design.  Arduino pin goes high, opens the gate on an NPN transistor.  This grounds the led on board lighting it, as well as proving a ground leg for the remote board which turns on the remote LED and Optocoupler which in turn flips the triac on.  Simple daisy chain effect.

master board

Turning that into a working board was a bit trickier, as I couldn’t get it designed as a single sided board.  That mean I had to get the board aligned perfectly after milling one side and flipping it over.  After the first board which I got close but not quite (pictures below) I figured it out on the second board.  It turned out to be much easier than I was making it..

Of importance is the get the board aligned straight along the x axis.  I did this by routing a .1″ deep square the board fit in.  The square was oversized, I just wanted a straight x-axis line.  I then mounted the board against that axis with double-sided tape.  make sure there is 100% coverage on the board.. don’t leave tape gaps as board will flex down on z axis in those spots.  I then aligned the x/y corner and etched the bottom of the board, and drilled the bottom.  The gcode for these operations were created through pcbgcode which I wrote about in another article.

To get the top of the board, flip, re-tape, and align to the x axis.  Then jog the CNC to line up on a few selected holes from the previous drilling operation.  In eagle, hover your  mouse over these holes and you will see the x,y location.  Enter these in your machine, and validate a few other holes.  You should be good to go for etching on the top!

eagle xy

First attempt with trying to measure offsets for the front/back operations.  This created some offset holes, which had to be managed a bit with a dremel grinder.  Still a usable board.


Second attempt using the eagle offsets described above, which came out very nice.


Next update will show assembled boards, and hopefully a video of everything operational.

HT Controller : Troubleshooting

So I had some issues when putting the final product into use.  Which is to be expected, but this bugger had me opening the case at least 6 seperate times..

Issue 1 : when the 5v relays would kick in, it my 7805 voltage regulators didn’t have the reserver to engage them both at the same time.  I needed to add a capacitor.  I did it the easy way, and just screwed it into the terminals.  The +5v is wired in parallel so both relays benefit.

Issue 2 : I used digital pins 0 and 1 on the arduino to control the relays.  Turns out those pins are used for serial communications.  So when updating the board the relays woudl clickclickclickclick like no tomorrow.  No good, had to use different pins.  Obviously I didn’t account for that on the board creation, so they got solder to the pins directly.  Picture is a little out of focus, but it is the orange/yellow leads in the foreground.

Issue 3 : In the external power strip where 6 seperate relays live and are controlled by the arduino here, I made a mistake in that I didn’t have any 10k pull-down resistors on the 6 control lines.  I should have put them in my original circuit, and instead I added them via a little ‘daughter’ board I added to my original circuit board.  Oh, and if you actually jump to read about the external power strip know I took the power supply and arduino out as they are replaced by this build.  All that is left is the transistors and relays.

Ribbon cable removed, and ‘riser’ pins installed:

Daughter board freshly machined:

And installed:

Lessions Learned :

* Patience.  I had to keep telling myself that there was no way I would get everything right on the first try.

* That a 7805 regulator needs a headsink in most cases.

* That a 7805 also needs filter capacitors.  You can’t just plop it in a circuit and expect clean output.

Isolation routing

I had very good success with my isolation routing endeavor.  After having to remember how to do things in eagleCAD, the actual manufacturing process was very straightforward.  To start with, I got the eagle files for an arduino board from adafruit.  I needed this to ensure the through-holes would line up so my board would end up being an arduino ‘shield’.  From there I laid out my components.  I won’t get into the actual circuit, but a few things to note:

  • You will be well served by increasing the trace width to .032″.  The smaller traces I have (seen below) will machine, but are a little small for comfort.
  • When you do the wire layout wizard tell it to put wires on the bottom of the board.  One-sided.
  • For optimal wiring I needed a few traces that ‘crossed’.  Normally you would bring them to the top of a two-sided board.  I wasn’t ready to mill two sides and try to get them to line up.  So I basically put in a 0-ohm resistor as a ‘jumper’ to cross over traces.

So this is my diagram:

From there to get the gcode to mill your board you need to run pcb-gcode.  This is a eagleCAD addon that does a wonderful job of creating gcode.  Installation is well documented on their site, so I won’t cover off on that.  There is no shortage of options to configure, but I didn’t change anything other than my machine type (mach3).  To run the setup options you type “run pcb-gcode-setup” in eagleCAD.

From there you can do your configuration.  Mine is included here, FWIW.

After you have everything configured, you have it work its’ magic by typing “run pcb-gcode”.  The output will e a file showing what the board output will look like.  Remember it will be ‘mirrored’ as its the bottom of your board.  You can close the preview, and the actual gcode will be in your eaglecad folder.  There will be two files, a and a file.

I ran the etch file with a 60 degree 1/4″ v-carve bit.  I ran it on 1″ pink foam first to verify it wouldn’t crash, but then ran it on my copper circuit board.  The etch file was awesome, and everything went smoothly.

The drill file was a little weird though.  It kept going back to x0,y0.. I think maybe for bit changes?  Sometimes it would go back to x0,y0 with z0.. so it would drag the drill bit lightly along the surface.  So I ended up hand editing the gcode a bit.. removing all the tool changes.  I have never edited gcode before, and this was very easy to do.  Its basically just three steps that get repeated:

G00 Z0.1000 (raise bit)

G00 X-2.0000 Y1.4000  (move to new hole)

G01 Z-0.0320 F10  (drill new hole)

You just take anything extraneous out.  And then run it on your machine with the bit zeroed an inch up (air carve!) to verify everything looks good.  My drill/etch files are attached at the bottom of post so you can check them out.  Only other change was I must not have had the material thickness setup right in pcb-gcode, so the drill depth didn’t go all the way through.  Easy search/replace on the drill file to replace the depth with a new one.  That’s the (G01 Z-0.0320 F10) above.  Just change the -.0320 for example to whatever depth you want.

I used a .9mm drill bit for this task, and all my components fit well in that hole.  From resistors, to regulators.


Snapshot of the board below.  You’ll see some scratches going to bottom-right (0,0) from the problem I noted above.  You will also see the size difference in the traces.  I will ensure I use all larger ones in the future.

Here is another photo after a light sanding to clean up the burrs.. pretty good!


Isolation routing

Working on a little project for the home theater cabinet, and wanted to make a small circuit board to remove what would otherwise have been a point-point wiring mess.  I am a rookie at eagle-cad, but can cobble together a schematic/board eventually.  In the past I have sent my boards off for manufacturing, but I wanted to try my hand at milling one.  There is a great plugin in called pcb-gcode that works well with eagle cad.  While it has tons of configuration options, don’t be daunted.. using the defaults and a 60 degree 1/8″ v-bit the results look as though they could be impressive.

I ran the trial on 1″ extruded foam to get a feel for the process.  PCB-gcode kicks out two files, one for routing, and the other for drilling.  The image above is just the routing, which includes  a small ‘dot’ on the pads which would be useful for centering a drill bit later.  I have not yet run this on copper, as I didn’t have any small enough drill bits.  I ordered up two #65 or .90mm bits from Midwest Circuit Technology.  As soon as those arrive I will route/drill the board.

After it is completed, I am sure I will recall a few things I left out of the schematic…