How Do You Build A Relay CPU?

The Hackaday tips line is always full of the coolest completed projects, but only rarely do we see people reaching out for help on their latest build. We’ll help when we can, but [Tim]’s relay-based CPU has us stumped.

[Tim] already has the design of his relay CPU completed with a 12-bit program counter, sequencer, ALU, and a transistor-based ROM. The problem he’s having deals with the mechanics and layout of his homebuilt CPU. Right now, all the relays (PC pin, we guess) are glued top-down to a piece of cardboard. This allows him to easily solder the wires up and change out the inevitable mistakes. This comes with a drawback, though: he’s dealing with a lot of ‘cable salad’ and it’s not exactly the prettiest project ever.

The ideal solution, [Tim] says, would be a PCB with through-hole plating, but this isn’t easy or cheap for the home fab lab. We’d suggest some sort of wire wrap setup, but proper wire wrap sockets and protoboards are for some reason unreasonably expensive.

If you have an idea on how to do the mechanical layout and connections of a relay-based computer, drop a note in the comments. [Tim] has a very cool project here, and it would be a shame if he were to give up on it due to a lack of tools.

Video below, and if you’re having a problem with a project, feel free to send it in.

I see it available now only in EU… but there is a wirewrap pencil that uses spools of 30ga kynar insulated wire. Back in the day (like 1980) I would use the USA version to protoboard wrap up a whole 6502 with mem and supply in about a single evening. Just wrap at both ends then solder, the kynar would melt away and leave a good joint. It was so fast and easy using standard ic sockets that I stocked up a shoebox full of wire spools and pencils and still use them. Makes FAST work and changes. Link to that vendor is buried somewhere on this puter, but it’s 4th generation copied from machine to machine over the years…. will post when I find it, but you got the keywords… go look.

Thank you! I’ve considered this tool a long time ago, but I haven’t heard a good opinion about it.I guess it’s worth a shot, but still, if some relay dies, I will need to de-solder everything. How easily the coating is damaged by heat? Many times, in order to get to the joint, you will heat-up all neighbouring wires too.

Wirewrap done properly doesn’t need soldering. The connection is airtight and mechanically strong – the last wrap should be one turn of insulation. Changes can be made quickly and easily by unwrapping.

30ga wire doesn’t carry heat more than 1/4″ and the insulation of wires nearby won’t melt without direct contact of the iron (35W and still have that too!) If you’re planning ahead for repairs by wrapping only 2-3 times instead of 20 for each wire. Sockets help a lot but can be skipped just with a little thinking ahead. Repairs are quite visible but remain reliable.

Pay attention to current load. You may have to double up some connections.

a few years ago i did a whole CPU with discrete logic and wirewrap (the soldered kind). the simpler board worked just fine but the more complex boards with lots of wire and lots of routing never worked properly. i was stumped at first until i figured out that by trying to be neat and use those handy plastic holders i had so much wire at some point in my design that the crosstalk/induction messed everything up. so wirewrap with higher current/voltage is probably not such a good idea…unless you make it really simple.

Twisted pair and differential switching is your friend on really complex rat’s nests… As is shielding. Personally, I’d be taken some plays out of the playbooks of manufactures of the sort of equipment that waste/water treatment plants use on their walls. That or automobile manufacturers. They do the high-speed stuff with serial ports which aren’t too practical for a pure solinoid-based relay system, though.

TP can in theory double your wires (and relays!) but… there’s tricks to make it less painful, I bet.

I believe the Cray wiring looked like that because all the point to point connections had to be the same length. This was so all the signals on each of the lines of a bus would arrive at the same time as the clock signal. That probably won’t be much of an issue for a relay CPU. :-)

Neat project, by the way. And I’d second the wire-wrapping approach, at least if you have wire wrap sockets that fit your relays. It’s fast, you just strip the Kynar and spin it on, it takes just a few seconds per point. No soldering, and you can use the same tool to quickly loosen the wire if you change your mind.

Another option would be to design a custom PCB to hold a relay or two (or four or eight,) and to carry the lines out to solder pads. http://oshpark.com/ is one place to order custom boards. You could even get a bit fancy and add traces to support back-EMF diodes, indicator LEDs, and VCC and ground buses right on the boards, if you were so inclined. Their price is $5.00 per square inch for three copies of a dual sided board (no plated thru holes), and they deliver in about two weeks. (The cost is probably prohibitive for what you’re trying to do, though.)

Just an idea…what about wiring everything to a (not even socketed, just physical) riser board in some regular fashion, reducing the pins of each relay to, say, a column on the board, and then wiring up the board as a patch panel, thus reducing the whole thing to a “logical” grid? I wouldn’t think that propagation delay is going to be an issue in a relay CPU?? You might even be able to use a prototyping board as the patch panel since you don’t need the real estate for the components themselves. You might have to mod the traces on the proto board some. Also, what about telephony punch-down equipment?

not diminishing his work but he REALLY should learn some deadbug soldering skills before remaking his design …. but other than that this is an AMAZING design … i wont even try and figure out how it works … working with ASM alone boggles my mind

I’ve been soldering stuff for more than 10 years now :)
And btw, there are plenty good ASM tutorials out there, and this is not harder than programming with C – you just need to keep a little more things in your head, that’s it.

Tim,
As said in the main article wire wrapping would be a good solution if cost is not a consideration. Expect many relay failure, particularly if you choosed cheap relays. Although some of the first digitals computers were built using relays, they were not of the cheap kind. By the way it will make for a very slow computer. First you have to consider contact bouncing. When a mechanical contact close it bounce for a while. This bouncing may last as long as 10milliseconds. This means your logical gates can’t switch reliably more than 50 times/seconds (bounce at closing and bounce at opening). And this doesn’t account for propagation delays from to gate to gate. These delays add up. Have you considered this bouncing and propagation delays in your design?

To compute and approximate Mean Time Betwen Failure of the relays check the relay datasheet. It should give the number of switch the relay contact are designed for. If it is design for 100K switching and contacts switches 50/sec. Expect a failure at every 100,000/50 sec.
But the stress on contact depend on current passing through it. The higher the current the faster it will fail. As the contact control the next gates coils, the current through contact is the coil current multiplied by the number of coils connected to the contact. You have to limit this current to what the contact is designed for. Again see datasheet.

Good point accept that relays that are driven by other relays usualy don’t bother about contact bounce because, as you said, they are too slow.
The maximum number of contact switches may be a problem in time but I don’t think that that’s an issue at this stage.
So, good points but this doesn’t give a solution to Tim’s current problem.
I guess perf board may be a solution when soldering a wire it keeps the heat of the iron a little more away from the relay. On the other hand. Perf board pads can be soldered only so many times before the come lose.
Another option is to use sockets for the relays. When using DIP relays, the sockets are not too expensive and easily replaced when he melts one while soldering.
Combined with wirewrape with which i have not enough experience with, Tim might have a solution.

Gods, this! I’d soooo be tossing those in my spare parts bin and home-etching+drilling my own modular grid boards. You can design the circuit traces so that almost all of your wiring is on the board. You can also just does this with dead-bugging but then it’s a pain to fix/detect (sometimes literal) bugs in your relays. Combining this with riser cards sounds like a winner. Wire-wrapping is good for quick testing without having to touch a modern computer to (possibly write and) run a simulator, though.

Thank you for the reply, Good points about contact bouncing, but this doesn’t concern me, as long as the clock frequency is low. On each clock edge only one definitie thing happens, so even if something have glitched, there will be time to recover.
The problem with relay reliablility is still a bugger though :( I have already killed several relays just in some test-execution phases. A friend of mine suggested using lowered voltage. Too bad these relays are so cheap, they don’t even have a datasheet :)

Inductive loads are particularly hard on contacts because of the energy stored in the magnetic field it create a spark between the contact at opening. There is methods to redure the sparks, like a reverse diode shunting the coil or capacitor shunting the contact. Both increase cost and assembly time and complexity.

I’ve etched a numerous PCBs in my life already, the problem is:
1) there is no easy way to make through-hole plating at home (as the relays cannot be soldered from both sides)
2) the pcb design is solid. I will be unable to make any changes, if some will be necessary.

That’s why I suggested making only half-solid PCBs. Put down the connections that you know you’re going to need, like a power rail, LED + resistor. The rest you wire to connectors/headers. You could use these, for instance: http://www.adafruit.com/products/266

Single sided is not a problem if you put the components on one side, and the solder on the other.

When I was doing double side embedded processor work I would route the traces on both sides and put isolations where the chips were. I would use wire wrap sockets so I could solder the top and bottom. No VIAs under the chips for easier trouble shooting. My VIAs were hand soldered with wire wrap wire. Descrete components soldered on top and bottom. I experimented with conductive epoxy too. This is slow enough that you could get away with it.

Thank you all guys for the replies and the good feedback!
I guess I will try and do the following:
I will stick to the plan, using glued relays on a cardboard, and I will do the supply wiring as before, using solid wires, and singal wiring using roadrunner wiring pencil. The tiny wires look kinda fragile to me, and I am not sure how hard it is to make multiple joints on 1 pin with this technique, but I guess its worth a shot.
When some progress will be made, I will upload a new demo video with all the schematics, compiler and logisim simulation file.

Reminds me of working with Ericsson telephone equipment years ago. Prior to exchanges going solid state everything was done with relays – timing, number analyses, call routing. There were tens of thousands of relays all wired together.
The way they did it was simple, but not an easy solution. Lay the relays out on a grid; rows and columns with channels for wiring looms in between. It’s laborious and you have to be disciplined. Keep things modular in functional units.
Better you than me.

I think the solution he has, glue it down and solder wires to the sticking up leads is almost as good as it gets. I think he is on the right track. That is actually a very common construction technique called ‘Dead Bug Style’ in amateur radio circles.

I wouldn’t suggest a PCB for something like this. Dead Bug lets you easily change your wiring. This is an experimental project right? PCBs are great when you are making a product which has already been prototyped and tested using another technique. Why would one ever use such a thing to build a relay cpu? The value in a relay cpu comes from being able to experiment and learn on it. Even if you did manage to get a working PCB design then what? Any further experimenting would require cutting traces, running jumpers or desoldering everything are rebuilding it on a new PCB. It isn’t practical.

Wire wrapping could be awesome. I see Karl offered a wirewrap panel. That is awesome Karl! Wire wrapping makes it easier to attach the wires. You still have to route them! That seems to be Tim’s problem right? He needs to figure out how to route all those cables in a way that is neat and easy to troubleshoot. I would suggest searching the net for other people’s wirewrap projects. Maybe there could even be some good books about it from the 70s or 80s at the library.

I think Dead Bug style is the best method available to most of us for experimental projects like this due to it’s ease of changing things. Wirewrap is probably better if you are lucky enough to have or be offered a wirewrap panel. (otherwise it’s too expensive). The problem of routing wires is the same either way. People solved it back in the ‘old days’ when wirewrap was common. I’d look to their projects for the solution.

Tim,
Telecom companies have solved the routing problem by using color coded scheme. Look at http://en.wikipedia.org/wiki/25-pair_color_code. If you can get a scrap length of 25 pairs cable it would be handy. They are 26 AWG solid wires.

I would look for relays with friction terminal connections on them, and then use a bunch of those cheap kits from the hardware store or automotive store to wire everything up. This way you don’t have to solder to remove a relay, just pull the wires off in order, replace the part, and put the wires back.

Sure, you are going to get noise through the connector, but as others have said, relays are so slow it shouldn’t matter.

To reduce the actual “wire salad” you could think of getting some clear PVC tubing and run all your wires through it. This way you can still see the wiring, but it has clear runs to make to go from point A to point B. Simple twisted pair should remove any problems you would have with cross talk, though that shouldn’t be a problem at these voltages and speeds.

Simple, homemade PCBs. I used Vero board, and those RadioShack pre-etched boards before. This process gives you exactly what you want every time.

While I am still in heavy development phase of my projects, I just etch the parts I know I’ll need and wire the rest manually or to breadboard. Surface mount is even easy if you etch your own boards since you don’t need to drill holes.

Not drilling is not necessarily faster if the end goal is to have a part soldered to a board. Then hope you never have to remove that part ever too. Because without specialized equipment re-working SMT is definitely not faster than working with through hole components.

You could also use brass tacks for point to point wiring or a power diode leg through the PCB to lift up the relays so you can solder them to the board. I like double sided boards with connections on one side ( or wire wrap sockets ) and vias away from the part so you can change the relay easily and solder on the opposite side of the board from the part.

By the way we did a lot of board prototyping with a capacitive discharge welder (aka “the zap gun”) and vero wire when I was a kid – be careful because the insulation on the wires lets off poisonous fumes.