I am also a newbie to electronics but learning fast. I have a similar
circuit using the DTR and RTS of a serial port to turn on/off two
different load resistant type devices powered by a 12vdc source.
The first thing you need to do is completely isolate the rs232
control circuit from the power circuit. You don't want to damage the
This is done by using an optoisolator. One side of the opto will
receive the rs232 control signal. The ground will come from the
chasis ground of the serial cable (just attach a ground wire to the
outside frame or use the rs232 ground signal. Most serial cables I
use have a ground sheath to ground the plug to the chasis)
When the rs232 signal is received by the opto it will activate
internally an led. The other side of the opto will optically sense
this led (thus the electrical isolation of the control signal to the
power circuit) and complete internally the other side of the optos
circuit sending a current to the gate of a mosfet (something like an
IRLZ14). When the mosfet gets this current, the seperate 12vdc then
will flow between the source and the drain (Manifold put up a great
post on the true function of the mosfet so I would search the
archives for it) and power your device.
The components I used were a few resistors (you need to figure out
what is right for your rs232 power source), a mosfet (irlz14 oe
IRLZ34n) and an optoisolator (4n35 or if more than one control is
required a dual optoisolator, ps2501-2). You can put these all on a
small stripboard and there you go. The costs are nominal $10 -15 if
you purchase bad.
If I make it sound easy it is. With help from the gentlemen on this
forum it is.
Good luck and if you have any add'l questions I will try to chime in.
--- In Electronics_101@y..., "ridiculicity" <ridiculicity@y...> wrote:
> Hey there everyone,
> I have a very basic question but I can't figure out the answer.
> Basically, I want to use a transistor as a switch on a 12V DC motor
> and I want some kind of digital signal ( most likely a line from my
> serial port ) to control the on/off functionality. I'm not sure how
> to hook this up.
> I'm assuming that the +12V source goes on the collector of the
> transistor and the negative goes on the emitter. Then the line from
> the serial port would connect right to the base. That's where my
> question pops up. Shouldn't there be a ground for the TTL signal?
> it possible that the TTL signal just switches the transistor and
> vanishes? Shouldn't there be a way for the signal to go from
> to transistor and then back to computer?? I just don't understand..
> If anyone could help me, I'd sincerely appreciate it.