Enigma machine – close replica

Intro and motivation

I was aware of the Enigma machine from many movies and I was interested in WW2 era (stories and movies) as I still am. When I saw the original machine in military museum in Pivka, Slovenia in august of 2024, I was explaining the technical details of it to my wife and son, I somehow started to think about creating a replica of the Enigma machine, because having a working replica would make the explanation simpler. This started me thinking about how to make the replica with currently available components – I didn’t want to spend time with reinventing (recreating) the buttons and connectors as I knew that if I get stuck at some non-important part of the develoment, I might not finish this. You know how hobbies are – you’re working on them while they are fun, but once the fun starts to disappear, your motivation starts to drop. So I’ve decided to use as much available components as possible, but still preserve the internal wiring of the machine as close to original as possible, so it still can be considered at least as a partial replica and not a completely different device with encryption done in a chip like some other replicas do. The device is split into few parts, and they will be described below.

enigma_bw_back

 

Plugboard

The plugboard consist of PCB and 26 connectors (ACJM-MV35-2S) – 3.5 mono jack connector with a switch. The plugboard without any cable inserted in any of those 26 connectors will just connect signals comming from keyboard to encryption rotors (e.g. letter A goes through the plugboard as lettter A). With cable being inserted into 2 connectors, those 2 letters will be swapped before sending to encryption rotors and also after comming from encryption rotors. That means that if you have a cable inserted in connectors A and N, when you press letter A, the plugboard will change this into N, and it’s the letter N that gets encrypted in the rotors.

A PCB was used to simplify soldering and improve reliability compared to using only wires. The modules are interconnected using flat ribbon cable with cimp connectors, which are easy to make and can be easily removed for possible repair of a module.plugboard

IMG_20240911_200023452

plugboard front

 

Keyboard

The keyboard uses 26 push buttons TL2202OAYA, which connect each wire from plugboard to lightsboard when when button is not pressed, and connecting VCC (5V) to plugboard when the button is connected. This switching from plugboard to VCC allows the encrypted letter from plugboard to be lit up, and also to avoid lighting up of the unencrypted pressed letter. The electrical part is easy.

IMG_20240828_142817562

lightsboard

 

What I didn’t expect was that the mechanical part of the keyboard – the actual button shafts going up and down in each button hole – would cause issues. As the 3D printed parts are printed in layers, the layers create slightly rough surface and that causes friction when the button’s shaft is going through the button’s hole. Additionally, the gray filament used for buttons was producing uglier prints than the black filament. To avoid the button wobbling fromside to side, the hole for the button shaft should be as tight as possible, but that also means that the rought surface of shaft and hole would grind together. This issue was somewhat mitigated by sanding the button shafts and holes.

The other issue caused by the buttons not being perfectly aligned to holes – either by slight variations in buttons placement when soldering, or due to minor differences between designed (drawn) and printed parts, or even due to the fact that my 3D printer is not large enough to print the keyboard cover in a single piece, thus printing it as 2 parts and glueing them together introduced additional misalignment. Fixing this issue took several design iterations to improve the usability of the keyboard.

IMG_20240917_062734221

IMG_20240917_104432907

IMG_20240917_065903420

  

Lightsboard

This was the simplest part of the machine. Some FYLS-3528PUYC LED were used, even though they later appeared much stronger than needed. As there is no moving part between the PCB and the top cover (unlike in the keyboard part) and the holes with letters are much bigger than the LEDs, the alignment of PCB to panel wasn’t that important and this just worked on the 1st try. Semitransparent paper was used to show the letters, the letters were just printed on a laser printer.

IMG_20240914_192427684

IMG_20240914_192438698

lights

Encryption rotors

This is where the magic happens! As in other parts, I didn’t want to spend eternity with wiring this using regular wires, so I’ve created the rotors on PCB and used SMD pogo pins, so the top and bottom pads of the rotors wouldn’t be connected. The pogo pins from one rotor touch the pads on PCB of the next rotor.

wheel

One of the problems with using pogo pins that are just surface soldered (SMD) onto the pcb is the sideways force during the rotation of the rotors, which would possibly break away the pogo pins from pcb, as the solder is weak and easy to break. To battle this I’ve decided to entrap the pogo pins, so the sideway force from the pins would be spread not only on the solder but also on the material holding the pogo pins from side.

The first attempt was to leave enough space around the pins so that epoxy resin can be poured around them, but this failed due to epoxy leaking out of the 3D printed rotors as it was glued from multiple parts together and the epoxy resin was thin enough to pass between the smallest of holes.

The second attempt was just to 3D print inner part into which the pogo pins would with with half of their thickness, then use 3D printed outer ring, and the pogo pins being tight between these 2 plastic parts. This option worked fine.

WHEEL2

IMG_20240901_100923622

What I didn’t realise when I started to work on the this enigma clone was that the encryption rotors need 2 additional parts – entry board, which connects the cable to the rotors, and reflector board, which reflects the encrypted letter from left side of the rotors back through the rotors. These are simple parts, but it’s still additional drawing and soldering that needs to be done.

reflector

entry

 

Rotation of the encryption rotors

This is the part where I cheated the most and I’m proud of the least. I watched other Enigma replicas in some YouTube vids, some of them were failing to move the rotors reliably, especially when the 2nd (middle) rotor should do a step to next letter. At that point I’ve decided I’ll just move the rotors using motors, because I was worried that trying to reproduce the original mechanical movement wouldn’t be reliable when I would do it (I’m no mechanical engineer), so using a slow motor (with a gearbox) was the safer option for me. To make the motor step exactly to the next letter position (360 degrees / 26 letters = 13.84 degrees farther) a photomicrosensor EE-SX1041 was used, with holes on the rotor determining the desired stop position. This stepping is controlled by Arduino. This could possibly be done without it using just some additional logic, but at this point I’ve decided to use Arduino to speed up the development / making.

IMG_20240903_081516321

Plastic case

As it is obvious in previous parts of this replica, I’ve created a 3D design of the machine based on the actual Enigma photos and 3D printed the case. I’ve used black, gray and white PLA filaments. The bigger parts were split into two pieces before printing as my printer is not large enough to print this in single piece, after the printing they were glued together using CA glue. The 3D design was drawn in Fusion 360 as that’s available for non-commercial use.

fusion2

IMG_20240918_091402343

IMG_20240918_091412232

 

Wooden case

The wooden case was made from 8 mm thick plywood. With no table saw I’ve still managed to cut the boards all-right-ish, but any professional woodworker would frown upon the result during a closer inspection. But you know what they say around here: it’s good enough for this village ;) The box was painted brown and hinges were added.

The work on this wooden box made me consider buying a table saw, but with me using it once a year and it being large enough to fit to my messy workshop – I’ll probably skip getting it (for now).

IMG_20240921_183757963

YouTube video

If you want to see the above info in a video form, follow this link:

 

Disclaimer

My admiration of the Enigma machine itself does not mean that I approve or admire any totalitarian regime that supresses human rights or causes suffering and loss of life – it’s the quite opposite – I condemn any regime that causes unnecessary suffering to people and animals. I’m interested solely in the technology of this machine.

 

Comments are closed.