Back in the pre-smartphone days, the Apple Newton was the first device in the PDA category. Newtons were only sold for five years between 1993 and 1998, when Steve Jobs pulled the plug on the program. Although Apple frequently took a ribbing for problems with the Newton’s handwriting recognition feature, its main problem with achieving market dominance was Newton’s high cost. Although it beat the wildly successful Palm Pilot to market, Newton could not compete on price.
One of Newton’s accessories was a very compact keyboard (just a hair over 10 inches wide). I had one rattling around in my spare parts bin and it was the perfect size to use with the SunFounder Display and Raspberry Pi one-piece computer that I recently assembled.
Only one problem, no way to plug it in. The Newton keyboard outputs a serial data stream and the RasPi (like most other modern computers) requires a USB keyboard. Further complicating matters, the Newton keyboard does not produce ASCII characters. Like the legacy IBM XT and AT keyboards, the Newt keyboard outputs a unique scan code for each key. One code is sent when the key is pressed and another gets sent when the key is released.
I was surprised to find that nobody currently sells a pre-built adapter to do the serial to USB conversion. (Such adapters exist for IBM keyboards, but are not pin or code compatible with the Newt keyboard). The only homebrew solution I could locate was from a guy in Japan who posted this video but little else in the way of details.
I was able to piece together the following information from various sources:
- The Newton keyboard runs at 5V (technically 4.5 volts) and produces a 5V TTL compatible signal
- Baud rate is 9600-N-8-1
- We can connect it to a microcontroller using three pins: pin 2 – +5V, pin 8 – signal, shield – ground
- The key scan codes are similar but not identical to those use by IBM AT keyboards
To make the Newt keyboard impersonate a USB keyboard, I would need to remap the serial data to USB. This job calls for a small, cheap, 5V tolerant microcontroller having both serial and USB interfaces.
The Teensy 2.0 board is perfect for this purpose. It can impersonate all kinds of HID devices like mice, keyboards, joysticks, etc. and it is compatible with the Arduino IDE, which comes with a great keyboard library that can do all the heavy lifting.
If you want to build your own adapter and are familiar with building Arduino projects, feel free to grab the sketch here. Pinouts are in the readme file and you can install the Teensy (or MC board of your choice) within the Newton keyboard or in an external enclosure.
If you’d like step-by-step directions for my build, please continue reading.
Bill of Materials
- Teensy 2.0 microcontroller development board (there are several Teensy versions; make sure you use one that operates at 5 volts).
- An 8-pin mini-DIN M/F or F/F cable like this one from Cables to Go. We will be cutting off the female end to connect to the Newton keyboard. Any similar legacy Apple serial cable would work
- A suitable enclosure for the Teensy. Note that there is plenty of room inside the Newton keyboard case. If you don’t mind opening it up, you can mount the Teensy board inside.
- A short USB A to mini B cable to connect your computer to the Teensy board
Hardware Assembly
- Cut off the female end of your serial cable leaving at least a couple inches of wire.
- If you are using the Cables to Go cable, solder the brown wire to VCC (+5 Volts), the purple wire to D2, and the uninsulated shield to GND (ground) as shown above. Use a piece of shrink wrap tube or tape to cover the shield wire so it doesn’t short anything on the Teensy.
If you are using a different mini-DIN connector, use a multimeter to find the wires attached to pins 2, 8 and the connector outer case. Pin 2 gets soldered to VCC and pin 8 gets soldered to D2. Looking at the female connector that you will plug the keyboard into, pin 8 is on the upper left. Here is my sketch of the connector that will surely end up hanging in the Louvre:
- Connect the keyboard to the connector you just soldered on and connect a USB cable to the Teensy. Mount it either inside the keyboard case or in a suitable enclosure.
Programming the Teensy
- Install the latest Arduino IDE, if necessary. It can be downloaded here.
- Download and install Teensyduino, which is an add-on for the Arduino software that adds Teensy support to it.
- Download the Apple Newton Keyboard to USB Converter library (Mac users: please Ctrl-click and choose Save As to prevent the ZIP file from automatically unpacking)
- Launch Arduino and install from the ZIP file by selecting
Sketch–>Include Library–>Add .ZIP Library - Open the Sketch named NewtonKeyboardToUSB, which is located in the folder Arduino/libraries/newtonKeyboard/examples
- Upload the sketch to the Teensy. If this is the first time you are uploading a sketch from the Arduino IDE, you will need to
- Your computer should immediately recognize that a new keyboard has been plugged in
Further improvements
There are lots of digital inputs and outputs available on the Teensy. It might be nice to use one of the outputs to drive an LED that indicates Caps Lock state. Or perhaps it would be useful to assign some inputs to keyboard macros.
Thanks for sharing this! I’ve been wanting to make an adapter for my Newton keyboard for a long time.
So glad you found it useful John!
Thank you for writing this up. Twenty years ago I made an adapter to connect a Newton keyboard to my Palm Pilot’s cradle. I took notes that way for a couple of years, and the Newton keyboard remains the standard against which I judge small keyboards. (I must have tried fifty of them over the years, and the only one I that didn’t make me want to scream was the IBM z50. Which made me want to scream for other reasons: WinCE.) What prompted the Google search that brought me to your page was trying to type a few paragraphs on a mini bluetooth keyboard. The resultant annoyance caused me to think back wistfully of my Newton keyboard – and it occurred to me that I can’t be the only one to recognize what a great little keyboard it is, and kludged together an adapter. Haven’t found any sign of a bluetooth adapter, but your post is enough to make me pretty sure I could make it happen. And has also served to remind me that what the Internet is really all about is people sharing knowledge with one-another. Thank you!
Carl – I’m glad you found this useful! It should be possible to add Bluetooth without much difficulty given the wide availability of Bluetooth modules. Some discussion about that here.
While we’re on the subject of wireless, there’s a lot of empty space inside the Newton keyboard. It would be pretty cool to put a lipo battery and the other circuitry in there and add a suitable connector for charging.
Cheers,
-Jim
Hey Jim—
Or maybe even enough room to turn it into a wholly self-contained rechargeable bluetooth keyboard….
When I started Googling yesterday, all I had were vague thoughts of a kludge. Now I just may have a genuinely cool project. Which I unfortunately have to put on the back burner til summer at the soonest. I’ll comment here again then.
I’d like to imagine it would have independently occurred to me to open up the keyboard and see what sort of space there was in there to make it less of a kludge. But the fact is, I didn’t open it twenty years ago when I did my Palm Pilot kludge. So I owe you a thank you for planting the idea in my head!
Cheers,
—Alex
(Oh, btw, feel free to call me Alex — everybody does.)
Using your information I put my old Newton Keyboard to work with an Digispark (this board use ATTINY85 microcontroller, it’s smaller ans cheaper than Teensy 2.0), this little board works with a micro USB port and I put it inside the keyboard opening a little window to show the USB connector, now I just use an USB cable like that used to connect Android cellphones and my keyboard work fine.
I need to remap all keys and improve some new functions, next version I will use some keys combination to emulate missing important keys like ESC, Function Keys F1..F12, Home, End, PgUp, PgDn.
I use the SoftSerial_INT0 make the ATTINY works fine with SoftSerial to keyboard and USB to PC at the same time.
Next step: Try to implement LED reading from USB interface and put the CapsLock LED on the keyboard.