Back in 1982 or so, when I was 15 or 16, my school was throwing out an ASR33, so I appropriated it. I had a Jupiter Ace microcomputer, whose claim to fame was that it was programmed in Forth rather than Basic. Great little machine, commercial flop, so there was very little software and no hardware add-ons available. I decided to use mine to build a micromouse for a school project; a friend and I designed a parallel I/O board using TTL logic and veroboard to control the robot. Parallel port worked well, the robot sort of worked - had to build everything from scratch in the school metalwork shop.
And then the teletype turned up, and I really wanted to use it as a printer. I remembering scouring the town libraries trying to find anything that explained this mystery RS232 protocol. I also had the usual teenager problem of lots of time and no money. In the end, I implemented RS232 using a 24V smoothed power supply scavenged from a scrapped ATM to give +/- 12V, a couple of power transistors desoldered from some other scrap board to switch the 12V rails, and bit-banged the protocol in Forth using one pin of the home-brew parallel port. Took a lot of trial and error to get the timing right, as I didn't have any test gear. Worked great in the end - as far as I know, I had the only Jupiter Ace with a printer, and it cost me precisely nothing. Happy days. The skills learned back then figuring things out for myself have served me well over the years in research.
It mentions a couple things worth noting: for 20ma loops, depending on distance, speeds over 19.2kb might not work. It also mentions RS-422 [1] , RS-485 (both up to 10 Mb/s) as options. (Both can be full-duplex.)
It also mentions a part (rarely mentioned these days) called an 'opto-isolator'. Might be an addition worth considering ... fun toys that let you keep the smoke-testing on the cheaper side of the project.
20ma for an ASR-33 is easy. You're just driving a transistor, not the selector magnet itself. The ASR-33 has its own magnet driver.
The older teletypes, the Model 14 (1920s) and Model 15 (1930s), take more driving. They need 60mA at 120V DC, because you're operating the selector magnet directly. The usual setup is a 120VDC supply with a 10K 2W resistor in series, switched with an opto-isolator. That is simple and works fine.
I designed and built a driver for the older machines that's powered entirely from a USB port, and converts 5V to 120V.[1] This was a fun electrical engineering project. Had to design an unusual switching power supply. A few other people have built this board, including some from the Computer Museum in Mountain View. That packages up the whole power problem in a nice little box. Requires surface mount soldering, though.
When I was a kid, my dad connected a Model 19 teletype to our Apple II computer for amateur radio teletype (RTTY). He used an opto-isolator to protect the Apple II from the 60 ma loop that the Model 19 used.
0-20mA or 4-20 mA loops are super common in industrial automation for analog sensors (pressure, temperature, etc) as they're very resistant to electrical noise unlike those using voltage. The nice part is they can be easily converted back to voltage at the point of terminus using a resistor.
Somewhat similar project I've got on my todo list; my grandpa had an old C64 setup in his cellar, so when going through his stuff recently, I picked up the setup (minus datasette reader, which was defective according to the smoke marks).
So now I'm looking into plugging the MPS-802 into my Linux server and have it print healthcheck or other error messages from the MPS onto endless paper. There seem to be some Arduino-related project to talk on the C64 Bus (it's not a too terribly complicated bus) and my only worry is that the ink catridge has dried up (though it seems to be carbon, so wouldn't even be a worry, but refilling is).
It seems it might be better to create a current source using a BJT or darlington pair and a larger resistor attached to the base. That would take pressure off the little GPIO pin and give you a consistent 20ma current, regardless of the resistance of the current loop.
And then the teletype turned up, and I really wanted to use it as a printer. I remembering scouring the town libraries trying to find anything that explained this mystery RS232 protocol. I also had the usual teenager problem of lots of time and no money. In the end, I implemented RS232 using a 24V smoothed power supply scavenged from a scrapped ATM to give +/- 12V, a couple of power transistors desoldered from some other scrap board to switch the 12V rails, and bit-banged the protocol in Forth using one pin of the home-brew parallel port. Took a lot of trial and error to get the timing right, as I didn't have any test gear. Worked great in the end - as far as I know, I had the only Jupiter Ace with a printer, and it cost me precisely nothing. Happy days. The skills learned back then figuring things out for myself have served me well over the years in research.