A work in progress

September 22, 2012 1:12:29 AM CDT

Here's one of the circuits I've been working on lately:

ready for publication

Ugly sucker, innit?

The circuit:

Functionally, it scratches a couple of the circuit designer's perennial itches: switch debouncing and power control.

Each of the three pushbutton switches (those blobby things to the left) controls a pair of mosfets in the array to the right. Pushing the button once turns the power on, pushing it again turns the power off. The way the circuit moves from one state to the other makes it immune to the momentary burst of on-and-off pulses called 'switch bounce' that happens whenever the contacts of a switch first meet.

The mosfets are a P-type and N-type pair, so shutting them off effectively disconnects the load from power at both the high and low ends. The jargon for that is 'tri-stating' the load.

Usually you only put one switch in the power feed to a circuit. If it sits between Vcc and the circuit, you have what's called 'high-side control'. If the switch sits between the load and GND, you have 'low-side control'. Doing both counts as either "all of the above" or "none of the above", depending on how you want to look at it.

The specific mosfets are pretty cool.. the device numbers are NTR4170N and NTR4171P. They cost about 10c each, are rated for 3.2 amps of continuous current, and have an on-resistance of 50-100 milliohms.. only slightly worse than a short chunk of copper wire.

(if there was ever doubt about my geek status, there you have it: solid documentation showing me waxing enthusiastic about a transistor's on-resistance. You need special equipment to get more hopeless than that)

The final neat feature of the circuit is the capacity for ladder logic.

Without going too far into details, the capacitors to the left control the state of each switch. If you feed power into the capacitor through the connected diode, its voltage stays HIGH, the mosfets stay off, and pushing the button doesn't do anything.

Thing is, you can drive circuit 2's diode from the control signals of circuit 1, meaning that button 2 will only work when button 1 is turned on (or off, depending on which signal you use). Not only does button 1 control its own load, it also acts as a master control for circuit 2's load. You could then control button 3 from button 2's control signals, creating another master/slave control layer.

the ability for one circuit to control another like that makes it possible to build complex logical systems if you string enough signals together, and most industrial control systems are built exactly that way. The Allen-Bradley division of Rockwell does a fair turn of business building bulletproof versions (in some cases literally) of the same basic design.

The challenge of single-sided layout:

Laying out the circuit so all the signals can be etched from a single sheet of copper was a pain in the tukus.

Once I get things prettied up a bit, this will be another SMT tool, and I want those to be as DIY friendly as possible. That means no double-sided boards or plated vias. I also want the boards to look good, and that means as few jumpers as possible. I have my own way of faking multilayer PCBs for my own use (I have a couple of posts about those in the pipeline), but they aren't techniques I'd want to fob off on someone just getting used to SMT.

That meant as close to a pure single-sided design as possible.

For the past couple of weeks, I've shuffled parts around and routed traces in every pattern I could imagine. Tonight, only a couple of hours ago, I finally got all the "you can't get there from here" problems worked out.

The picture above is a butt-ugly in terms of pure design, but topologically, it's beautiful. Now that all the really hard problems are out of the way, tightening up the layout and making it pretty present a vastly lower level of difficulty.

Celebrating the ugliness:

I figured I'd post a snapshot of the board at this important halfway stage of its design for a couple of reasons.

First, it's good to bring the ugly parts of the design process out in the open. Picasso once said that anything new will be ugly because when you start, you don't know where you'll end up. Pretty takes planning, and you can't plan exploration of the unknown. The world shows us way too many finished products though, so its easy to get frustrated or depressed with a design because it isn't as pretty as the work everyone else seems to be doing.

Screw that.. I'm willing to show people my work before it's had a chance to shave, if only to let them know that someone else is making ugly stuff too. More to the point though, when I finally do get a pretty version of this ready to publish, people will be able to go back and see one of the steps along the path from "how the hell do I make this work?" to "am I satisfied that it's pretty enough to ship?"

My second reason for posting this is that I'm enormously happy with that ugly snarl of bad routing up there. I've put a lot of effort into finding a layout that tells me pretty is even possible, and tonight it paid off.

Today has been a good day.

Random brain cookies:

A classic is something that everybody wants to have read and nobody wants to read. -- Mark Twain, "The Disappearance of Literature"