Newsgroups: comp.robotics
Path: cantaloupe.srv.cs.cmu.edu!das-news.harvard.edu!news2.near.net!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!agate!tcsi.tcs.com!uunet!hobbes!earth.armory.com!rstevew
From: rstevew@armory.com (Richard Steven Walz)
Subject: Re: 68HC11 and relays
Organization: The Armory
Date: Mon, 12 Sep 1994 13:01:33 GMT
Message-ID: <Cw0pIn.A79@armory.com>
References: <000C3FB8.fc@bcsmac.org>
Sender: news@armory.com (Usenet News)
Nntp-Posting-Host: deepthought.armory.com
Lines: 73

In article <000C3FB8.fc@bcsmac.org>,
Jake V. Bouvrie <Jake_V._Bouvrie@bcsmac.org> wrote:
>does anyone know how i could trigger a relay to drive a motor, or to just drive
>the motor, using the regular....say PORTC pins....theres not enough current to
>flip then and i was wondering how to get a switch like action...a NPN
>transistor?

-----------------------------------------
Dear Jake,
I realize from your question that you are coming at the use of ucontrollers
for real world control from an inexperienced background in hardware, even
though you may or may not be quite software accomplished. This is a genuine
mistake on your part, not to put too fine a point on it, really, but to
work with real world hardware applications of control to more powerful
things inevitably will require a good knowledge of how to use transistors,
at very least in their simple cut-off/saturation "switching" mode, which IS
easy to learn once you have the basics of DC electronics and a bit of AC
understanding under your belt. This sort of stuff SHOULD be in a good FAQ
or tutorial by now, but *I* haven't seen one that addresses it, probably
because the study of all types of transistors is a well visited topic in
text books and is incredibly easy to find in libraries and even in your
local Radio Shack, and in almost ANY book on electronics and electronic
device theory. It *IS* hard to give you everything you might want or need
in a FAQ file of cookbook circuits, but that's what most simple books on
the subject do anyway. *DO* take the time to learn enough that if your
transistor circuit doesn't work you will be able to quickly know why. The
use of transistors, having been mistaken for a highly elaborate
mathematical field from their use in their linear or analog region, not
used by their switching applications as in computers, has long been the
reason why some very otherwise skilled people have been TERRIFIED of even
TRYING to learn how to use them, when in fact, their use is almost as easy
as using an inverter, simply adding in some protective resistances, and
even using quite effective trial and error methods in concert with a simple
DVM and knowing Ohm's law. The critical jump to make in the first study of
transistors has to do with them being a non-linear transconductive element
that literally "TAKES WHATEVER IT CAN GET FROM COLLECTOR TO EMITTER AFTER
THE OTHER COMPONENTS HAVE BEEN CONSTRAINED BY OHM'S LAW!" I put that in
caps because it is THE most important thing to know about the way a
transistor in all modes works in a circuit with other resistances, both
current limiting protective resistances and load resistances. A transistor
"takes up the slack" to complete Ohm's law after the V=IR behavior is
performed by all other resistively "Ohmic" components. If a C to E
(collector to emitter) junction has to be 20 ohms to make the equations
work, then it will present that, if 400 ohms is required, the C-E junction
will present that as an "implied" "resistance" (incorrect language but
necessary for beginners) to the circuit, TO MAKE THE EQUATIONS WORK OUT!!!
This may sound like magic, but the transistor is a little bit of "magic"
which can be appreciated even by those who have not studied what causes
them to behave in this way! And it can be USED and understood in its
usefulness by a very few simple pieces of knowledge. I have written this
for all the beginners and the "C programmers" out there for whom hardware
is a "black art" that frightens them. It need not be so! Just RTFM, or in
the case, read the fucking book!:-) Also remember to play around with them!
Hardware phobia comes of lack of genuine childlike play with the equipment!
They only cost a few cents, explode a few of them, (wear your glasses until
you know when they might pop, and no, they don't hurt you). They just go
SNICK! and their little head comes off! Sometimes they bounce pieces off
the wall! They act like hitting a small acorn with a small hammer! But
after you have figured out that they are a very benign device, once you use
large enough resistances, then they are actually rather hard to blow up.
And what the hell, a few cents and a small puff of smoke and the resulting
smell will stand you in good stead when in future you sniff around on
boards for hot and blown up devices, which are often hard to spot! I sniff
through a straw sometimes all over the board! So! Time to read the book and
then go try something, and then read the book again. Don't be so afraid!
And if you want to drive a 120VAC motor with a computer signal, it's easy.
Look under big relays or solid state switches using thyristors: triac's and
SCR's. As for running a motor with relays, you sure can, but it's good to 
use a small transistor to run that thing's coil anyway, so might as well use
just a larger transistor! They're cheaper than relays and have no contacts
to burn out! Just learn to read the voltage and current maximums for them.
-Steve Walz   rstevew@armory.com 

