Electronics-Related.com
Forums

USB to 60mA current loop converter, version 2.3

Started by John Nagle May 25, 2017
Since there haven't been enough serious design articles
in a while, I thought I'd write one.

Some time ago I had questions about the problems I encountered building
a switching power supply to drive a 60mA current loop Teletype from
a USB port.  I wanted to power it entirely from the USB port,
and finally succeeded.  Here's the schematic:

https://image.ibb.co/mW08yF/board2_3.png

The files are all on Github, in KiCAD formats, at

https://github.com/John-Nagle/ttyloopdriver

where there's also an LTSpice simulation.

The component count is kind of high, but that
seems to be what it takes.

How it works:

   U3 is a USB to serial converter, a SILabs CP2102
on a breakout board.  I use that part because it can be
run at 45 baud.  Out of U3 we get TxD, and the +5
supply.

    Power goes through U2, which is a USB current limiter
and switch. The device turns power on when it gets
ENABLE from the USB interface. It asks for 500mA,
and if it can get it, everything turns on.
This device also limits inrush current while the
filter caps charge.

    This works like a photoflash circuit. When TxD is
low (SPACE in Teletype parlance) 2uf of capacitors are
charged up to 120V.  When TxD goes to MARK, the caps
are dumped into the output to pull in the Teletype
selector magnet, which has a huge 5.5 Henry inductance.
Once the caps discharge, a separate sustain supply
keeps the magnet on for the remainder of the
cycle.

    One bit time at 45 baud is 22ms, so we always have
at least 22ms to charge the caps.

    U1 generates a 100KHz 50% duty cycle square wave
to drive the switcher.  The switcher is T1 and U9,
with T1 being a 1:15 transformer from Coilcraft.
This charges up C11 and C2 (2uf of ceramic caps)
via D1.

    When txD goes high, U4, which is an optoisolator,
turns on and powers the output.  First the caps dump,
and then the 12V sustain supply U8 takes over.  This
provides a nominal 60mA through the whole cycle, but
with a decreasing voltage as the inductance is overcome.
Or so says LTSpice.  Actually, the inductance of the
selector electromagnet goes up sharply when the metal
plate pulls in and is close to the coils.  But that's
OK; once the magnet is pulled in, we don't need much
power to hold it.  It does take 2uf at 120V of energy
storage to make this work well in practice; I tried 1uf,
and it was just barely enough.  The Teletype had to be
carefully adjusted to make it work. 2uf works much better.

There are a lot of parts in this circuit to make it
workable.  D10, D11, R1, and C7 are all for snubbing
the huge inductive kickback when the selector magnet
turns off.  A simple diode isn't enough; that will
keep current in the magnet for too long and slow
the release of the mechanism, which causes typing
errors.  So there are two Zeners back to back and
an R/C snubber.

At power entrance to the switcher, there's
considerable filtering, with an inductor,
two resistors, and five caps. This is to keep
the switcher's input side spikes from getting into
the USB power source, typically a laptop computer.
It's also to keep the sudden drain as the switcher
starts to charge discharged caps from pulling down the
power rail.

This is almost all surface mount, except for the
opto-isolators. Those are DIP parts, which I socketed
to make them replaceable if someone plugs in an
externally powered Teletype loop.  But that's
probably not needed; the CPC1510G has current limiting
in the opto-isolater; if you overload it, it turns itself off.

There's also a keyboard side and a motor control relay output,
but that's all straightforward.

I built this partly because some old-timers said it was
impossible to power a 60mA current loop from a USB port.
It's quite possible.  The classic approach is to put a 2K
10W resistor in series with a 120VDC power supply to get
a constant 60mA, wasting 95% of the energy as heat.
That's so 1930s.

My present problem is that the AP2556W6 is out of stock
at DigiKey, Mouser, Arrow, and the manufacturer.  It's
not a rare part, but somebody apparently designed it into
some USB device and ordered all available parts.  But I have a
few extras to keep me going.

Enjoy.

			John Nagle



On a sunny day (Thu, 25 May 2017 16:50:11 -0700) it happened John Nagle
<nagle@animats.com> wrote in <og7qd6$ibj$1@dont-email.me>:

>Since there haven't been enough serious design articles >in a while, I thought I'd write one. > >Some time ago I had questions about the problems I encountered building >a switching power supply to drive a 60mA current loop Teletype from >a USB port. I wanted to power it entirely from the USB port, >and finally succeeded. Here's the schematic: > >https://image.ibb.co/mW08yF/board2_3.png
Hi, nice to see somebody post a real working physical design. Thank you. I have no teletype, but nevertheless cool!