Hardware - artillect/serial-typewriter GitHub Wiki

How it works

My Arduino controls the typewriter using two multiplexers, one connected to each of the keyboard connectors. The multiplexer’s signal pins are connected so they can be used to connect pairs of pins on the keyboard connectors together. To send a key, the Arduino selects a pin on each multiplexer to connect them, which tricks the typewriter into thinking that a key has been pressed.

The Arduino is connected via serial to the Pi, which has the serial console enabled on its UART pins. I chose to use an Arduino in addition to the Raspberry Pi because I’m more familiar with them, and it makes interfacing with the Raspberry Pi’s UART console much easier. The Arduino and the Raspberry Pi communicate at a rate of 120 characters per second, but the typewriter can only type 12 per second. To prevent long messages from getting cut off, I added serial flow control to my code. This allows the Arduino to tell the Pi when to start and stop sending text. The Raspberry Pi is running Raspberry Pi OS Lite, since I only need access to the terminal.

To scan the keyboard, I used essentially the same circuit; two multiplexers, one for the rows, one for the columns. The Arduino scans the keyboard one key at a time by selecting a channel on each multiplexer. When it detects that a key has been pressed, it sends that character to the Raspberry Pi so it can be processed. I could have used the typewriter’s original keyboard for this project, but I chose to replace it with a custom mechanical keyboard with Matias Alps switches, which are super clicky and should feel great to type on!

Schematic

Schematic

Bill of Materials

Part name Qty.
Brother AX-25 Typewriter* 1
Arduino Nano 1
Raspberry Pi Zero W 1
CD74HC4067 16-Channel multiplexer 4
0.1uF Ceramic Capacitor 4
330 Ohm Resistor 5
Keyboard Switches (Alps or MX) 70
Keycaps** 70

*: This code should work with most AX-series typewriters, and can theoretically be modified to work with any typewriter with a similar design.

**: 104-key set recommended for compatibility.