Haystacking

September 9, 2010 11:50:13 PM CDT

I've been playing with prototyping techniques for some time now.

Making stuff means getting ideas out of your head and into a form that can either crash the computer or catch fire. That's how reality points out the gaps in your thinking.

There are several different ways to get a circuit out of your head and into the world, though. People tend to think of electronics as something that exists on a printed circuit board, but like most production-in-quantity technologies, PCBs suck as an experimental platform. Breadboards are a popular prototyping tool, but many of the components I play with only exist in surface-mount packages (seriously.. try fnding a single Schmitt trigger inverter in a through-hole configuration).

Fortunately, the world is full of people both smarter and more experienced than me. Two of them are Jim Williams and Bob Pease, staff scientists at Linear Technology and National Semiconductor respectively, both of whom favor a protoyping technique called 'haystack', 'bird's nest', or 'ugly' construction. The idea is to build circuits up from a copper ground plane, soldering the leads of the components together directly. Pease in particular insists that you want a sort of fog of components about 2-4" thick, so you have room to get in and tinker with things.

I've seen the pictures, I've read the app notes, and I finally gritted my teeth and tried building a circuit the way the big kids do.

Turns out it's everything it's advertised to be. It's fast, it's easy, it's flexible, it's powerful, and best of all: it's fun.

What it is:

The circuit to the right uses a couple of chips from my most recent parts order.

Using the first picture as our reference and starting at 3:00, we have a 74HC14 hex Schmitt inverter (one of my favorite chips) with one inverter configured as a ~1Hz relaxation oscillator. (10 megohm resistor, .1 microfarad capacitor.)

At 6:00 we have a 74HC393 dual 4-bit binary ripple counter, one side of which is being clocked by the oscillator.

At 10:00 we have a 74AHC125 quad 3-state buffer, taking output from the '393 and passing it to the LEDs at 12:00. Technically the buffer isn't necessary, since the '393 can source up to 25mA per pin (50mA total), and the LEDs are only pulling a couple of milliamps each. The chip is new to me though, and I wanted to play with it.

In operation, the LED all the way to the right blinks on and off roughly once per second. The one just left of it blinks every 2 seconds, the one left of that blinks every 4 seconds, and the one all the way to the left changes state every 8 seconds. In other words, we have a 4-stage frequency divider.

The chips are mounted on breakout boards of my own design and construction, and the 'ground plane' is an early design for a stackable prototyping board that needs more work.

Construction:

Placing the through-hole components was straightforward: put a blob of solder on one of the pads, stick the lead in the blob, let everything cool, then solder the remaining lead.

It's also easy to desolder components. The long leads flex enough that you can lift one out of its joint without turning the other one into a paperclip.

It took me a few tries to get comfortable wiring the floating breakout boards. My first thought was to solder the wires to the breakout board, then hook the free ends to the base plane.

That didn't work so well. The breakout board became an obstruction that made it harder to reach the pads on the base plane.

After redoing a few connections, I found myself starting with the end of the wire that connects to the base plane. Make that joint with wire directly from the roll, then spool out enough to reach the appropriate pad on the breakout board.

I also found that simple curves in the wire are harder to work with than complex ones. As you can see in the second picture, the power connections (the red ones) run straight along the trace, bend up, then make a second bend 90 degrees to the trace. That forms a simple flexure that makes it easy to align the end of the wire with the breakout pad.

As an aside, it's all 30 gauge wire in there, and I used tweezers to hold the wires while I soldered them. It's easier than it sounds. The wires are stiff enough to hold the board in place with even a single connection. Once you have two wires tacked down, the board is pretty much rigid for 'I just want to lay this next wire in place' forces.

The hardest part of the whole thing was actually soldering the yellow wires to the resistors. Next time I'll make that connection first, and then attach the other ends.

Analysis:

I'm sure there are ugly construction purists out there who'd say this circuit doesn't qualify. For starters, I'm not using an actual ground plane. Then there are the breakout boards, which are closer to Manhattan style construction than to haystack construction.

I really don't care though. The circut works, and the technique did everything that I wanted it to. I'll definitely continue to build circuits this way in the future.

Even though the leads are long, they're surprisingly strong. I wouldn't want to play hockey with the circuit or anything, but it's more than solid enough to stand up to general handling.

Having tweaked the oscillator three or four times, I now understand and agree with Pease's opinion that prototypes should be light and fluffy, not dense and compact.

One of the classic stumbling blocks in computer programming is premature optimization: programmers get so busy trying to design code that will be fast, efficient, and elegant that they never get around to writing anything that works at all. Experienced coders avoid that trap by cranking out a first program that does as little as possible by whatever means are necessary. They know that it's easier to expand and improve existing code than it is to design a complex system from first principles.

Bringing that idea over to hardware, getting the maximum component density is an optimization that doesn't belong in prototyping process. If you have to choose between making a prototype smaller and making it easier to build, go with the bigger one every time.

By that same token, floating the breakout boards above the base plane is a great trick. The curly, springy wires are easier to work with than short, straight connections, and as you can see in the bottom two photos, it's easier to make connections when you can just reach under another board to hit the correct node.

So is this a production-quality circuit? Hardly. It's a sketch done in hardware.

The beauty of the technique is that I can build this sketch almost as fast as I can draw the diagram on paper. It would probably take longer to draw a schematic in Eagle, and would almost certainly take longer to do a simulation in Spice.

Lessons learned:

The big take-away lesson is that this technique works and has a definite place in the development process: this is where you start.

There's no substitute for building a circuit that actually works. Neither is there a substitute for building a circuit that you think should work, but doesn't.

This technique puts very little extraneous work between getting an idea and pumping electrons through some components. This is where you make sure your ideas actually work, spot the obvious mistakes and omissions, and get a first taste for any glitches that might demand extra work.

It's where you learn what you need to do next, and that's a valuable thing.

Stuff that worked this time:

  • Long leads on through-hole components make for happy soldering.
  • Leads are stronger than you might think.
  • Bend wires into flexures for ease of attachment.
  • Start from the base plane and work up.
  • The space under the floating breakouts is really handy.
  • An SOIC-14 package fits comfortably in 1 square inch of board space.

Stuff I want to do better next time:

  • Having to wire power and ground on the base plane was a waste of time. Include those connections in the next version of the boards.
  • The .050" pitch of the breakout pads was a bit cramped. Put .1" pads on the next batch of breakouts.
  • Trying to solder two wires together in midair is an exercise in masochism. Solder the wire to the lead first, then connect both ends.

Stuff to play with:

  • I have a rough idea about using wire as a scaffolding to support components mechanically, and for running electrical nodes into the air. There are a bazillion alternatives there, so that's probably a whole field of research.

Gallery: