Introduction: Mostly 3D Printed Binary Encoder
An encoder converts information from one format or code to another. The device presented in this Instructable will only convert the decimal numbers 0 through 9 into their binary equivalents. However, the concepts presented here can be used to create encoders for any reasonable number of items and codes (say 20 or less). Aside from a few easily obtained microswitches and screws, all of the parts for this mostly mechanical machine can be 3D printed.
Why Am I Doing This?
I recently came across a book published in 1968 entitled "How to Build a Working Digital Computer" by Edward Alcosser, James P. Phillips, and Allen M. Wolk. Believers in the "learn by doing" philosophy, they show how to construct such a computer using "simple inexpensive components usually found around the house or in a neighborhood electrical parts store". This is often called the "paperclip computer" book since they use paperclips to create various switches throughout the design.
So I'm going to make a "Working Digital Computer" based on the book that I am calling the WDC-1. The book is divided into sections based on the main components of the computer like Arithmetic Logic Unit, Core Memory, Control Unit, and you guessed it Decimal to Binary Encoder which I am going to tackle first.
Above is a diagram from the book showing the encoder construction. They used an empty thread spool, wrapped it with uninsulated wire, then covered the wire with paper that had cutouts for the binary codes. Four paperclips were used as contacts to read the codes (I told you there would be paperclips). It was an ingenious design using only the promised household items.
Upgrading the Design
While my design does not use paperclips, I believe it embodies both the concept and spirit of the original. I'm not going for a "pure" replica here. At the end of the day someone should be able to "run" programs from the book on the new machine. Starting with the Decimal to Binary Encoder.
In addition to the printed parts you will need the following (seen above):
- 4 Cylewet Momentary Hinge Metal Roller Lever Micro Switches - Amazon
- 4 M3 x 3 mm bolts
Step 1: Print the Parts
Print parts in their default orientation. Unless otherwise stated use the following print settings:
Print Resolution: .30 mm
Filament: I used AMZ3D PLA
To create a Decimal to Binary Encoder you will need to print the following parts:
- 1 Encoder Base
- 1 Encoder Knob
- 15 Encoder Peg - Set resolution to .10 mm, add a small brim, and lower the first layer speed to 5 mm/sec
- 1 Encoder Switch Top
- 1 Encoder Top
- 1 Encoder Wheel
Step 2: Assemble the Parts
Putting together the Decimal to Binary Encoder is pretty easy:
- Slide the four Lever Micro Switches between the Encoder Base retaining walls as shown in the first picture above.
- Snap on the Encoder Switch Top to lock the switches in place.
- Attach the Encoder Wheel Top to the Encoder Wheel making sure the lock tabs are in place.
- Add the Encoder Pegs to the Encoder Wheel using the table above.
- Slide the Encoder Wheel onto the Encoder Base shaft. Be careful not to bend the switch levers. You may have to hold them back as you attach the Encoder Wheel.
- Position the Encoder Top onto The Base and attach with the four M3 x 3 mm bolts.
- Slide the Encoder Knob in place lining up the shafts and holes.
That's it. Your Decimal to Binary Encoder is ready for use.
Step 3: Testing the Digital to Binary Encoder
The first picture above shows the Decimal to Binary encoder panel from the book. Since I'm not quite ready to tackle that yet I made the test panel you see in the second picture. I mounted the Binary Encoder with four M3 x 8 mm bolts, and added four 3 mm LEDs in some home grown panel mount sockets.
The wiring is pretty straight forward. I attached the:
- Four LED cathodes (short wires) to ground.
- Common terminal from each of the switches to +5V.
- Normally Open terminal from each of the switches to the Anode of the corresponding LED.
Well you can see the result from the last two pictures. Success. The Binary Encoder actually has a pretty nice "feel" to it. You just know when the knob is locked into a number. Cool.
Step 4: Final Thoughts
I don't expect that many people will be needing a mechanical Digital to Binary Encoder any time soon, but I do think that the techniques demonstrated here can be generalized for other encoding tasks. With the WDC-1 project for instance, in addition to the two Binary Encoders needed, I will be making an encoder to map the machine instructions (ADD, SUB, SHIFT, etc.) into the seven control signals my Arithmetic Logic Unit needs to perform those tasks.
If you like this, you might want to check out some of my other Instructables. The Mostly 3d Printed Rotary Switch might be of some interest.