T
The Real Andy
Guest
On Mon, 14 Nov 2005 14:46:04 +0800, Alan <me@somewhere.com.au.invalid>
wrote:
understand the problem.
First you need to know how how much current the relay draws. Take note
that there will be a surge current as the realy energises.
Second, you need to understand that your transistor has a limited
current gain.
The resistor on the base of your transistor should limit the amount of
current being drawn from the CPU. Try doing a test using the original
circuit. Add a 10k pulldown resistor to the base of the transistor to
ensure that it stays off (you should always do this anyway). Then use
a multimeter to measure the current between the 2k2 resistor and 5V.
How much current? Does the relay turn on?
IF you can get hold of 2 meters, measure the current throught the
relay coil too.
If the relay does not turn on, then lower the value of the 2k2
resistor. My initial guess is that 2k2 is probably an overkill and
that several hundred ohms is going to be closer to the ball park, but
in saying that, i do not know the specs of your CPU.
Most modern CPU's can source quite a bit of current. Read the
datasheet on the micro to find out how much current it can source
through the pin. If it cant supply enought current, you can use a
darlington transistor, or 2 transistors in a darlington pair. This
will provide more gain. More gain means a smaller base current can
drive a larger source current.
wrote:
After reading this thread I am beggining to think that neitherOn Mon, 14 Nov 2005 17:22:50 +1100, "Michael C" <me@nospam.com> wrote:
"Alan" <me@somewhere.com.au.invalid> wrote in message
news:un8gn1hs9gavds6puthafm3b72tuvv222e@4ax.com...
The complicated circuit on the input is acutally part of a TTL gate
output circuit! It's shown for reference only.
hmmm, I thought most of that circuit shown probably wasn't needed but didn't
know why. Usually datasheets are quite clear and easy for a hobbiest like
myself to understand.
Using a ULN2003 all you need to do is:
1) connect micro output to (say) pin 1 and pull up to +5v with say a
2k2 resistor
2) connect pin 16 to (say) pin 2 and pull up to +5v with say a 2k2
resistor.
3) connect pin 15 to one side of your relay
4) connect other side of relay to +12v (or whatever)
5) connect pin 8 to ground
6) connect pin 9 to relay power supply +12v (or whatever)
You have to use the pull up resistors because all the inputs are
basically open collector/drain.
I'll see if I can get away with the pullup that's inside the cpu so I'll
only need the one pullup, although I might just go with the transistors.
Using pin 9 of the ULN2003 connects the internal back EMF diodes as
per fig 19 of the datasheet and therefor you don't need external
protection diodes.
That makes sense, I was a bit confused as to whether this was the power for
the chip or not and whether that voltage was going to appear on the outputs
or not.
HTH
It certainly has, many thanks.
Michael
If you use transistors you only need two resistors and two transistor
(plus a diode for the relay).
1) connect o/p of micro to base of transistor A and pull up to +5 with
say 2k2
2) connect collector of transistor A to base of transistor B and pull
up to +5 (or +12) with say a 2k2
3) connect collector or transistor B to one side of relay
4) connect other side of relay to +12
5) don't forget to connect both emitters to ground and put diode
across the relay (the right way round!)
Alan
understand the problem.
First you need to know how how much current the relay draws. Take note
that there will be a surge current as the realy energises.
Second, you need to understand that your transistor has a limited
current gain.
The resistor on the base of your transistor should limit the amount of
current being drawn from the CPU. Try doing a test using the original
circuit. Add a 10k pulldown resistor to the base of the transistor to
ensure that it stays off (you should always do this anyway). Then use
a multimeter to measure the current between the 2k2 resistor and 5V.
How much current? Does the relay turn on?
IF you can get hold of 2 meters, measure the current throught the
relay coil too.
If the relay does not turn on, then lower the value of the 2k2
resistor. My initial guess is that 2k2 is probably an overkill and
that several hundred ohms is going to be closer to the ball park, but
in saying that, i do not know the specs of your CPU.
Most modern CPU's can source quite a bit of current. Read the
datasheet on the micro to find out how much current it can source
through the pin. If it cant supply enought current, you can use a
darlington transistor, or 2 transistors in a darlington pair. This
will provide more gain. More gain means a smaller base current can
drive a larger source current.