[sci.electronics] Using computer to switch high current circuit

blpike@uokmax.ecn.uoknor.edu (Brian Lee Pike) (01/02/90)

I am trying to build a circuit that allows my Commodore 64 to connect a
110,000 microfarad (that's not a typo, I mean 0.11 farad), 18 volt capacitor
across a load for a brief period of time (somewhere between about 0.1 second
and 0.75 seconds) and then disconnect the capacitor.  

The Commodore 64 has a joystick port which has a +5 volt pin and a ground.
My intention is to have the joystick signal go high, trip the circuit, and
then drop the signal when the current should be disconnected from the load.
There are a couple restrictions:

1) There must be NO WAY for the capacitor's current to reach the computer.
   I have heard of 'opto-isolators', but I do not completely understand how
   to use them, particularly in a high-current situation.

2) The switching should be as 'clean' as possible, i.e., should approximate a
   square wave.  I suspect that this cancels out using a large relay, although
   please correct me if I am wrong.

I know precious little about electronics.  Please be as specific with your
reply as you can stand to be, e.g., schematics or pinouts would be GREATLY
appreciated.

                                                   Thanks,
                                                   Brian "no signature" Pike

mark@mips.COM (Mark G. Johnson) (01/03/90)

In article <1990Jan2.005157.12780@uokmax.ecn.uoknor.edu> blpike@uokmax.UUCP (Brian Lee Pike) writes:
>I am trying to build a circuit that allows my Commodore 64 to connect a
>110,000 microfarad (that's not a typo, I mean 0.11 farad), 18 volt capacitor
>across a load for a brief period of time (somewhere between about 0.1 second
>and 0.75 seconds) and then disconnect the capacitor.  
>


Here's one approach.  Another, infinitely simpler and less elegant,
is to use a "mercury wetted" relay; its contacts don't bounce.  Or,
use 3 independent relays in parallel, which reduces the probability of
contact bounce.

The trick to any circuit is to find a way to recharge your 0.11 Farad
capacitor between firings.  The circuit below uses a resistor (R4) to
charge the cap.  Probably R4 should be large enough so the recharge time
is at least 10X the discharge time.



   +5V LOGIC                          V+ OF CAPACITOR
    SUPPLY                                 SUPPLY
      |          +----------------------------|
      |          |                            |  +----+
      |          |                            +--| R4 |---+---------+
   +-----+    +-----+                +--+     |  +----+   |         |   YOUR
   | R1  |    |  R2 |               2|  |5    |1          |       ----- BIG
   +-----+    +-----+              +-------------+     +-------+  ----- CAP
      |          |                3|             |     | YOUR  |    |
      |          +-----------------|  CMOS 4050  |     | LOAD  |    |
      |1         |5                |HEX INVERTER |     |ELEMENT|    |
   +----------------+              +-------------+     +-------+    |
   |  OPTOISOLATOR  |                |8    |4             |         |
   |      4N35      |                |     |            D |         |
   |                |                |     |          |---+         |
   +----------------+                |     |        | |  HEXFET     |
      |2   |4    |6                  |     +--------| |  IRF-Z40    |
      |    |  +-----+                |            G | |             |
      |    |  | R3  |                |                |---+         |
TTL   |    |  +-----+                |                  S |         |
------+    |     |                   |                    |         |
INPUT      +-----+-------------------+--------------------+---------+
                 |
                 |
              V- OF CAPACITOR
                SUPPLY

R1 = 1.5K  (LED current limiting resistor)
R2 = 3.0K  (collector load resistor for optoisolator)
R3 = 100K  (base bias resistor for optoisolator)
R4 = 47 ohms or more  (trickle charge path for your big cap)

All parts above are in the current Digi-Key catalog.
-- 
 -- Mark Johnson	
 	MIPS Computer Systems, 930 E. Arques, Sunnyvale, CA 94086
	(408) 991-0208    mark@mips.com  {or ...!decwrl!mips!mark}

tomb@hplsla.HP.COM (Tom Bruhns) (01/03/90)

blpike@uokmax.ecn.uoknor.edu (Brian Lee Pike) writes:
> I am trying to build a circuit that allows my Commodore 64 to connect a
> 110,000 microfarad (that's not a typo, I mean 0.11 farad), 18 volt capacitor
> across a load for a brief period of time (somewhere between about 0.1 second
> and 0.75 seconds) and then disconnect the capacitor.  
> ... 
> 1) There must be NO WAY for the capacitor's current to reach the computer.
>    I have heard of 'opto-isolators', but I do not completely understand how
>    to use them, particularly in a high-current situation.
> 
> 2) The switching should be as 'clean' as possible, i.e., should approximate a
>    square wave.  I suspect that this cancels out using a large relay, although
>    please correct me if I am wrong.

It doesn't matter much how big the capacitor is; what we really need to know
is how much current you expect to switch:  maximum "on" current; maximum
allowed "off" current.  From the looks of it, the maximum voltage across
the switch when it is "off" is 18 volts; what is the maximum you can allow
in the "on" state across the switch?  Also, "as clean as possible" is
awfully open-ended!  I can get all carried away providing nanosecond
switching times for something that really doesn't require them.  Can you
be more specific?  (A relay just _might_ be the best solution, but an
optoisolator is indeed another way to get good electrical isolation, and
a power transistor or FET, driven via an optoisolator, could handle 10's
of amps.)  If you don't know the numbers for sure, let us know just what 
you are trying to do...

crisp@mips.COM (Richard Crisp) (01/05/90)

In Mark Johnson's suggested technique for switching large currents using
a computer to control three relays one important point was not made.
Be sure to include shunting diodes across the solenoids of the relays.
They need to be wired in such a way that they are reverse biased when the relay
is energized (assuming you use DC controlled relays). If you fail to put these
devices in, when the relay is turned off you will get a large inductive "kick"
which will stress the hell out of the device driving the relay possibly 
catastrophically. With the diodes in place, when this inductive "kick" starts,
the polarity of the voltage across the relay's solenoid changes (remember
Lenz's law?) and forward biases the diode thereby limiting the magnitude of the
reverse voltage. You might need a resistor in series if the diode can't handle
the current, the tradeoff is that the reverse voltage gets larger due to 
the IR drop of the resistor. 

This oversight has wasted many transistors used for driving relays.

-- 
Just the facts Ma'am

johnson@ncrons.StPaul.NCR.COM (Wayne D. Johnson) (01/06/90)

In article <1990Jan2.005157.12780@uokmax.ecn.uoknor.edu> blpike@uokmax.UUCP (Brian Lee Pike) writes:
>I am trying to build a circuit that allows my Commodore 64 to connect a
>110,000 microfarad (that's not a typo, I mean 0.11 farad), 18 volt capacitor
>across a load for a brief period of time (somewhere between about 0.1 second
>and 0.75 seconds) and then disconnect the capacitor.  

Hmmm thats going to make quite a zap if you short the cap out.  We built a
.25 farad cap in high school, charged it to 25 volts and discharged it with
a VERY large screwdriver.  

Not very much remained if the screwdriver...

-- 
Wayne Johnson         |  Is a baby's life worth more than the right to 
NCR Comten, Inc.      |  make a choice?  Babies are people too.
Roseville MN 55113    +-----------------------------------------------------
(Voice) 612-638-7665   (E-MAIL) W.Johnson@StPaul.NCR.COM

johnson@ncrons.StPaul.NCR.COM (Wayne D. Johnson) (01/06/90)

In article <1990Jan2.005157.12780@uokmax.ecn.uoknor.edu> blpike@uokmax.UUCP (Brian Lee Pike) writes:
>I am trying to build a circuit that allows my Commodore 64 to connect a
>110,000 microfarad (that's not a typo, I mean 0.11 farad), 18 volt capacitor

There is a device known as a solid state relay.  It consists of a LED optically
coupled to a triac or transistor.  When the LED lights, it triggers the 
triac.  I have used these on circuits as heafty as 400 Amps (with a 4' x 1'
heat sink of course).

I'm not sure how these would work with DC, with a triac, you have to bring
the voltage across the power terminals to almost 0 to turn them off.  There
may be a version that will turn on and off with the light (as the name implies).

The Opto triacs I've seen are too fast, they tend to generate RF noise on
the line because the signal is so square.

I've seen Solid State Relays at our local Electronics Surplus for $3 to $10.

-- 
Wayne Johnson         |  Is a baby's life worth more than the right to 
NCR Comten, Inc.      |  make a choice?  Babies are people too.
Roseville MN 55113    +-----------------------------------------------------
(Voice) 612-638-7665   (E-MAIL) W.Johnson@StPaul.NCR.COM