One of the things I’ve wanted to learn to do since joining the lab has been designing my own printed circuit boards. Also, having worked with the Arduino for a little while, one of the things I’ve found it lacks is support for 0-10v analog outputs. In fact, it really lacks any analog outputs at all; the closest it has are six 5v pulse width modulation outputs, which I find less useful than a proper analog output. The logical solution to both of these dilemas was to design my own shield which would allow the PWM outputs to be converted to 0-10v.
The first decision that had to be made was what PCB layout software to use. Eagle seems to be a rather popular package for PCB layout (for both hobbyists and professionals) and I’ve used it at work, but it’s proprietary. As a free software developer, I’d much rather use a free (as in speech) tool if at all possible, so I set out to find one. Enter gEDA. gEDA is a GPL-licensed suite of PCB design tools.
One of the things that I’ve heard people complaining about when designing Arduino shields is the non-standard pin spacing. I didn’t really get what they were complaining about until I set out to make one of my own. There are four headers (two with six pins and two with eight) on the board, and for the most part they’re pretty standard: 100mil spacing between pins on each header and a 200mil spacing between pins on the gap between the bottom two connectors, but a 160mil gap between the two headers on the top. In the PCB editor, you could just use a 100mil grid if it weren’t for that one header. It really was a bit of a headache to get the pads in the right places.
Not wanting to have to do the work of getting the pins set up properly twice, I decided to make a custom symbol and footprint for an Arduino Uno board. That way, on future Arduino shields, I could simply drop a block representing the Arduino into the schematic and it would automatically place all the pins on the PCB where they’ll fit the board. If I drag one header around, the othes will follow to maintain proper spacing. Quite handy.
Being a suite of programs rather than a single monolithic program, creating PCBs with gEDA is a little more involved than it is with Eagle, but it’s still pretty straight-forward. You start by creating one or more schematics (one per page) with gschem. The schematic files are in a well-documented plain-text format, so you could make them with a simple text editor, but that’s way too hardcore for even me. With gschem, it’s all drag and drop.
The next step is to use the gsch2pcb program to convert your schematics into a pcb file and a netlist (it also creates a .cmd file, but I don’t know what that’s for). From there, you open the pcb file with their pcb layout editor (creatively named pcb) place the components, import the netlist, and then you can use the auto-routing feature to draw all the traces on the board. I had to play with trace and via sizing so that I could get all the traces to fit into two layers. Don showed me a way to manufacture PCBs, but it only works for two-layer boards.
Unfortunately, there are now a number of vias on the board that have a hole size of 20mil… that’s going to require a steady hand to drill. Perhaps in a later version, I’ll use SMT components to free up some space on the board so I can use larger vias.
That’s about it for my progress so far. I’ll be sure to blog some more as I actually attempt to manufacture these boards. They’re going to be a little more complex than I’d like for a first attempt at using this manufacturing process, but I’m always up for a challenge.
EDIT 5 Mar 2011:
I almost forgot to post links to the actual project.
- Here’s my list of custom symbols.
- Here’s my list of custom footprints.
- And last but not least, here’s the actual shield.
Also, there’s a more descriptive tutorial on how to use gEDA on their website.