Mostly 3D Printed Binary Encoder




Introduction: Mostly 3D Printed Binary Encoder

About: A retired software developer, living in Waterloo, Ontario, Canada, who appreciates having the time to make whatever the heck he damn well feels like!

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

Infill: 20%

Perimeters: 2

Supports: No

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:

  1. Slide the four Lever Micro Switches between the Encoder Base retaining walls as shown in the first picture above.
  2. Snap on the Encoder Switch Top to lock the switches in place.
  3. Attach the Encoder Wheel Top to the Encoder Wheel making sure the lock tabs are in place.
  4. Add the Encoder Pegs to the Encoder Wheel using the table above.
  5. 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.
  6. Position the Encoder Top onto The Base and attach with the four M3 x 3 mm bolts.
  7. 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:

  1. Four LED cathodes (short wires) to ground.
  2. Common terminal from each of the switches to +5V.
  3. 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.

Be the First to Share


    • Back to School: Student Design Challenge

      Back to School: Student Design Challenge
    • Halloween Contest

      Halloween Contest
    • Microcontroller Contest

      Microcontroller Contest


    Gregg E.
    Gregg E.

    2 years ago

    I like seeing people build versions of this device. But it's not actually a computer. It's more like a fancy abacus. The operator has to manually manipulate the functions. The operator can also introduce errors by opening or closing the wrong switch or turning a BCD switch to the wrong position. Then they're left wondering why the output isn't right.

    BCD Switch, or Binary Coded Decimal Switch, is what this part from the book is showing how to build. When I first read the book (years ago) this part was the most interesting to me. "Cool! It's showing how to build BCD switches!" But when I got to the part on using it, and it described how the program drum turns on lamps and the operator has to open and close the bent paperclip switches in the memory according to the lamps... "Bah! It's not actually a computer!" Thus my desire to build one of these was squashed.

    I'd love to see a build of this where all those manual operations are automated using solenoids and motors - so that to load a program the drum steps itself and the "Memory" switches open and close on their own, etc. When one of these is made where a program sheet can be wrapped onto the drum then a go button pressed and it takes off doing everything on its own, then it'll be a computer.

    Such a build could have a switch for manual or automatic operation, even be setup to isolate different functions for manual or automatic. The design was meant to be a training tool to demonstrate the bare bones lowest level functions of digital computers. One company built a commercial version of this design for that purpose.

    To have the ability to function as an automatic computer would enhance that teaching capability. Have students run a program through it manually, then have them repeat it as they watch it run itself, especially if the student flipped a switch wrong in manual mode. Automating it would also make it possible to have a button to reset everything to a default state.


    Reply 2 years ago

    "Not a computer", it's an encoder in the title. Such encoders exist for decades, I've got some built in the 70s, they are encoder wheels mainly used in machine configuration.

    Alex in NZ
    Alex in NZ

    2 years ago

    Awesome! Wonderful teaching device for showing folk what's involved in a simple operation that they have probably never thought about. Thank you for sharing :-)


    Reply 2 years ago

    You are welcome. And thank you for the kind words.


    2 years ago

    This is a fantastic project... The concept of binary can be very intimidating.. This presents it with a very comfortable and familiar "clock face" like object that wont scare off the student before they've had a chance to try to understand. Bonus points for having it be a mechanical device that they can then look inside to see how it works!! My son is now in college, but if he was younger, I definitely would make this to help him learn! You should make an advanced version that goes up to 15, and have it labeled both in decimal and hex (ie: "10" is also labeled "a", etc..) so they can take the next step!!


    Reply 2 years ago

    Wow. I just made the panel you see to test the encoder, I never really considered the educational aspects. Great idea. A hex version would be pretty easy to make and I'll certainly add it to my project list. Thanks.

    2 years ago

    The old man in the TV shop downstairs gave me a copy of that book when I was 10. It was my first instruction in binary arithmetic, logic, and computer operations. When I told people about it later, they didn't believe me.
    I am in awe of your reconstructions and I'm looking forward to watching this one.