I’ve been busy on a side project for my Relay Computer which I thought I’d share.
I’ve been trying to find a way to simulate ‘Relay logic’ which is is different to ‘Real logic’ of ones and Zero’s. I’ve tried Logisim and a few other simulators but nothing really worked or gave me what I needed to help me design my relay based computer. So I bit the bullet and have written my own Simulator!
It is heavily influenced by projects like Logisim but with a few advantages.
Firstly, all pins are bi-directional.
I’ve modelled the relay’s to have a use adjustable lag time. When a relay is energised it takes a number of milliseconds before the contacts close, and again when the coil is de-energised.
All wires turn Red if they are HIGH, and the Relay graphics change depending if the coil is energised.
I’ve designed two different DPDT relay’s, one is a more logical relay, the second is a more realistic pin-out design.
The code is barely operational at the moment - but it works! Here’s a quick video of it in action simulating a ‘Harry Porter’ style data register with two bits.
This was all written in Python (another learning curve!). If there is any interest in this I’ll happily upload the code to github and develop this in the community!
Splendid - I’m always interested to see code developed in the open, and a relay simulator is an interesting project.
(I would guess that I might use ‘current’ and ‘no current’ rather than high and low, in the case of a relay simulator - your relays, switches, and lamps all respond to current primarily, and only incidentally to voltage differences. But don’t let me disrupt a working project.)
Yes and there are different kinds of relais, contactors and Flip-Flops, like bi-stable, self-holding, auxiliary, RS JK, combination of normally open and normally close (changeover) follow-up changer, pre-closing contacts etc. That reminds me of the PLCs and their predecessors. They usually use markers with or without batteries and can store the data without power.
I have not built a time delay relay yet but it should be straight forward. Every component type has it’s own library so it should be quite easy I think (Famous last words!).
I would be interested in your project. We have, in our local water system, an ancient, relay-controlled pump control panel that I would like to model, for better understanding. There is nobody still alive who knows anything about this thing.
It would be fun to use this to emulate one of the early relay computers. I wonder if the design files for the Dutch “ARRA” still exist; That was a one-off machine at U. Amsterdam, built by people with no computer background. It used dual-coil relays which they attempted to use for an OR function, with limited success. It only ever barely worked, and was in due time replaced by an entirely different design, called ARRA 2 to hide the fact that ARRA 1 was actually an utter failure.
For anyone who’s interested I’ve just uploaded a more in depth demo to youtube. I’m happy to open source this onto GITHUB if anyone is interested (as soon as I work out how!). Any feedback would be appreciated!
Now all that is left, is to check for way real relays may fail and add that.
On September 9, 1947, a team of computer scientists and engineers reported a moth caught between the relay contacts of the Harvard Mark II computer in Cambridge, Massachusetts. They taped the dead moth into the logbook for the computer. “First actual case of bug being found,” one of the team members wrote in the log. Programmer Grace Hopper
Very interesting! However, for a beginner it’s a bit hard to follow. Especially as the buttons and indicators are the same style and I think sometimes both grey. Maybe also change the locations.
Also it should be better explained or titled what the purpose is on each project.
That’d be great - easiest way is to upload a zip file. Ideally, start by copying your directory structure, then in the copy delete all the clutter (backups, derived files), and then zip up the clean copy.
YES! I am interested as well. I just spent a few days playing with logisim; I think its great for digital logic. But I have this relay cpu project in the back of my head for more than a decade now, so I really would like to test your simulator!
hey look, it’s the actual report, and not the apocryful story about it that gets things backwards and says that “coding bugs” were named after literal bugs. always nice to see that. (as I understand it, “bugs” in coding were named for the fact that they would… bug you, like be bothersome and annoying. and the moth thing was just a funny occurance well after the term was common)