Optocouplers for teletype current loop

From HeepyWiki
Jump to navigation Jump to search

Teletype machines decode serial data mechanically using a mechanism keyed by a selector magnet. It has a huge inductance so requires a high voltage to switch positions quickly enough. Typical loop voltage is 120 vdc and current is 60mA. Idle state is with current flowing (space state) and the loop opens up to signal data bits. Because of the inductance of the magnet coil, there are big inductive spikes when the circuit opens, so a snubber circuit is a good idea. It seems wisest to drive the loop using optocouplers, given the voltages involved.

Example for interfacing a 3.3v/5v microcontroller to a TTY loop safely

Ttl-to-loop.png

JP5 would connect to, for instance, an AVR breakout board with USB (such as http://pjrc.com/teensy) You can use it as a full-duplex interface with two loops if you want, or just put the two loop connections in series and use it half-duplex. Should you wish to try this, I wrote some very basic firmware for the Teensy 2.0 board to accomplish ascii/baudot character set translation, auto-CRLF, and various other stuff, which is available here: http://wtrc.net/usbtty2.zip


You can also get clever and use it to talk to an RS232 port by making possibly unfounded assumptions about rs232 control line voltages.

Ttyloop.png

Here are a few optocouplers with suitable specs for driving teletype current loops. They're all double-MOSFET output so they are polarity agnostic.
Fairchild HSR312L

expensive, slow, tested, works fine

Panasonic AQV257

even more expensive, a little faster than HSR312, same pinout, tested, works fine.

Toshiba TLP222GF

cheap (~$1.32), four pin, much faster than the two above, and better specs. Should try it.

Toshiba TLP592G

same pinout as AQV and HSR, cheaper ($1.26 quantity 10), try this too.

CEL PS7141E-1A-A

same pinout, very fast, $1.56 Q10, good to 400V off voltage, 120mA.

USB-to-Teletype dongle based on atmega32u2

This is a work-in-progress implementation of a usb-serial adapter which looks to the USB host like a CDC ACM class serial device, and to the teletype 60mA current loop like another teletype machine. In passthrough mode, it simply forwards characters back and forth, stripping all but the lower 5 bits in the host-to-teletype direction. In translate mode, it does bi-directional ITA-2 to ASCII character set translation as well, while maintaining LTRS/FIGS shift state and optionally print position so it can insert a CR/LF at the end of a line to prevent overstrike.