Difference between revisions of "Optocouplers for teletype current loop"

From HeepyWiki
Jump to navigation Jump to search
Line 22: Line 22:
 
[[File:ttl-to-loop.png|800px]]
 
[[File:ttl-to-loop.png|800px]]
  
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.  
+
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
  
  

Revision as of 01:58, 6 January 2013

Old teletype machines decode serial data mechanically using a mechanism keyed by a selector magnet. It has 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.

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.

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