# Need Transistor Circuit



## DonR (Oct 18, 2012)

I have a signal bridge. I want to use a 3 wire red/green
Led target signal to indicate clear route thru 3 turnouts.

The signal would be green unless any one of the turnouts
was set against the main in which case it would go red. 

I have done complex circuits using relays...but I have only the
1.5 to 2 vdc LED current available...so only a transistor would
accomplish this switching.

Using a relay with double throw blades, the green would be
connected to the one making contact when relay was not
energized. The red to the contact made when energized.
The relay coil would be connected thru a diode from each
turnout indicator on my panel...thus be energized when any
or all would be thrown...but I don't have the relay voltage.

I don't know transistors well enuf to select one that can
do this...either as one unit or two...

So, I beg of you guys with solid state heads...help...

Don


----------



## waltr (Aug 15, 2011)

Couldn't you just add a 12V wall wart power supply for the relay coils?


----------



## gunrunnerjohn (Nov 10, 2010)

It's not big deal to diode-OR the three LED drives into a transistor and have that switch a relay to accomplish this. I'd add a 1K resistor and assuming the on state of the diodes is positive in respect to circuit common, a 2N2222A transistor should do the trick.

Connect the diodes with the anodes to the LED's, the cathode connected to one end of the 1K resistor. The other end of the resistor goes to the base of the transistor, the emitter goes to circuit common, and the collector goes to the relay coil. The other end of the relay coil goes to your positive power supply suitable for driving the relay.


----------



## NIMT (Jan 6, 2011)

5 simple options:
(1) Use a good dual coil switch machine with extra contacts.
(2) Use a slow motion switch machine with extra contacts.
(3) Use a atlas snap relay, or a snap switch machine with the extra contacts.
(4) Use the switching circuit for a slow motion switch machine to control the LED's (this is how I have done it)
(5) Digitrax sells a SE8C signal detection control board. 

2 not so simple options:
(1) Add a cable or throw bar attached to the points to sense the direction of the points. and use that to control the contacts.
(2) Build a circuit to sense the point direction. The reason it's not so simple option is that the signal that's sent to the dual coil switch machines are only Powered for a split second, that doesn't leave much time for the circuit to sense that there was a change.


----------



## gunrunnerjohn (Nov 10, 2010)

Sean, it sounds like he has switch position indication with the LEDs, but I don't know what he's driving them with. Perhaps a better description of the actual situation is called for.


----------



## DonR (Oct 18, 2012)

*Need Transistor circuit*

...sure do appreciate the input from you guys...but does look like
I have not made clear why a switching solid state device is
what I need...

The turnouts are Pecos with Peco undertable motors...no 
added contacts...

They are close together and 'permanently' down....so can't
pull 'em...

I'm an odd ball when it comes to panels...Because I wanted the
panel to indicate turnout position...and also 'throw' the turnouts
I'm using DPDT switches for each...one side controls Straight or diversion
on the turnout...the other controls the red/green LEDs in the panel...
The turnout side also has a momentary button in the circuit for each to actually pass the capacitor discharge current to the turnout motor. 
(I have since thot of a better ideas but alas...too late...and true, if I had used the tortoise motors the problem would be solved)

There are a number of LEDs on the panel...I use one higher wattage
resister for the whole panel rather than try to crowd even more
resistors behind the panel...thus the available DC voltage on the switches
is at the LED level, appx 2v or so...(source is an old DC power pack
'throttle' set to appx 4 v dc and sent out on a buss to 3 panels...may
not be graceful but it works without protest)

So...that's what I have to work with...I'd like to avoid
any relays...which is why I am hoping for a pure solid
state device solution...in effect a transistor that would
be an equivalent of an STST relay controlled by
the appx 2v dc fed to the three turnout panel LEDs...but isolated by
diodes so as not to have back feed errors.

If only I had not stopped my electronic education with Tubes...
loved those 6L6s...that, I read, some higher fi gurus are still
using.

A very Merry rest of Christmas to y'all from Jacksonville, Fl.

Don


----------



## gunrunnerjohn (Nov 10, 2010)

So, you have multiple LED level voltages coming in, and you want a single voltage coming out to indicate if any of the switches are in the "out" position, right?

Take all the collectors of the transistors I described previously and tie them together. Note I'm using a 2-lead bi-polar red/green LED.

Try this circuit.


----------



## DonR (Oct 18, 2012)

Gunrunnerjohn

You are a man of many talents...sure glad to have your help.

Actually...the control panel LED circuits are supplied by a buss running appx 4 vdc
input thru a resister and the various switches resulting appx 2 vdc at the LEDs.
It is this voltage I would use to input the solid state circuit.

I am using a door bell transformer to supply the capacitor discharge voltage
for the turnout motors...think it is running 16 or 18 vac (rectified in cap dis ckt)
but could rectify for 12 vdc for your circuit...

I'm seeing the 12 vdc gnd for common on transitors and using
the 2 vdc from LED circuits from separate power supply...do we have
a problem with that?

What transistor are you specifying?

Don

Don


----------



## gunrunnerjohn (Nov 10, 2010)

I use the 2N2222A as my "go to" transistor, it's cheap and robust. The 12VDC common does indeed have to be the same common as supplies your switch LED's. Can you just connect the common's together if they're independent power supplies?

There could be an opto-isolator added pretty easily if you wanted to have them totally isolated, the TIL-113 is one that I use regularly.


----------



## DonR (Oct 18, 2012)

Physically, yes, the common of the LED 2 vdc can
be easily connected to the common of the turnout
supply voltage...each has its own ac transformer...
is there a sneak electrical 'short' with this connection?

My electronics knowledge has faded with the years...
but as I recollect you can do this with rectified dc voltages...
is that correct? If so, it looks like you have solved my problem.
The new circuit would physically hang on the back of the
yard control panel...thus only 2 wires to the Signal LED.

Sure sounds like a winner.

D


----------



## gunrunnerjohn (Nov 10, 2010)

As long as it's only the common, there should be no "sneak" path. I'm assuming that the rest of the circuits are separate.

Remember, those transistors are connected, one for each of the switch LED's, so there's more than two wires. The actual LED only requires 2 wires, but it's getting to that state...


----------



## DonR (Oct 18, 2012)

Gunrunnerjohn...

Just wanted to make sure that I am understanding
the circuit you have drawn...

I see that an LED voltage from to any one of
the transistors would cause it to pass ground to the LED thus light
the Red...which gets + thru the 1k resistor.

I see there is a positive voltage thru the 220 ohm resistor
that would light the Green...which then gets - thru the 1k
resistor to ground.

Does the grounding of that LED terminal by the transistors
negate the positive voltage from the 220 ohm?

I assume the 1 k resistors are dropping the voltage from 12 vdc
to LED voltage. But at 1 volt drop per 50 ohms...would it not
be negative voltage?

When I say 2 wires to the signal LED I assumed the rest of
the circuit to be at the panel...thus the 2 LED leads are
simply longer than normal...about 4 feet.

Do apologize for my density but like I said...it's been decades
since doing any serious electronic thinking...

And do appreciate your efforts to guide my shaky hand.

Don


----------



## gunrunnerjohn (Nov 10, 2010)

When the transistor conducts, the voltage on the collector will indeed be very low. Also, remember that the LED doesn't need 20MA to light nice and bright, I was thinking less for this task. If it's not bright enough, you can reduce the value of the two 1K resistors, say to 470.

Yep, you can run the LED leads as long as you like, at least within reason.


----------



## DonR (Oct 18, 2012)

John

Hope your memory hasn't faded on this project.

I've finally got around to wiring it.

Have some questions.

The Red/Green/yellow LEDs. I have the 3 wire type.
How do I connect them to this circuit for Red or Green?

The panel LEDs run on 2vdc. That will be the trigger
voltage to the base of the transistors. Is a 1k resistor
a bit high for the circuit?

Don


----------



## gunrunnerjohn (Nov 10, 2010)

You have the three-lead LED's, the circuit was made for bi-polar LED's, i.e. two-lead.

1K resistors work fine, that will give you about 5ma at 12V, plenty to light the LED. If you want them brighter, you can cut the values of all the resistors, but remember that the current will go up all around.


----------



## DonR (Oct 18, 2012)

That's what I thot, not a problem, I'll just switch to the 2 lead LEDs.

By the way, I added an additional transistor because there are now
four turnouts that are on that track run. I copied your circuit and
made it identical to your three. Don't see why that should affect
anything. If I'm wrong let me know.

Thanks again for your help.

Don


----------



## gunrunnerjohn (Nov 10, 2010)

Sounds right, all of the transistors are in parallel.


----------



## gunrunnerjohn (Nov 10, 2010)

Don, try connecting one of those LED inputs to the 12V power and seeing if the lights switch.


----------



## DonR (Oct 18, 2012)

Will try it and get back to you with results.


Don


----------



## DonR (Oct 18, 2012)

John

More tests:

First I tried a direct feed from panel LED 
to the Base bypassing the resistor. That
shorted out the Panel LED circuit, all went out
but came back when I lifted the wire from the Base.

I then bypassed the 1k with a 220 ohm to the
base. No effect.

Next, I tried the 12 vdc thru a 1k resistor to
a base (after disconnecting the panel LED feed).
That did cause the LED to burn a tad brighter. It
did not change the color.

Then the 12 vdc thru a 220 ohm That also caused
the LED to burn brighter yet, but no color change.

Finally, I hit the base with the full 12 vdc, a momentary
brightness then back to normal. Think that fried the
transistor because further tests with the 220 did not cause any
change in brightness.

I'm at a total loss.

What say thee?

Don


----------



## gunrunnerjohn (Nov 10, 2010)

I guess my quick analysis of the circuit operation was in error, it seems like it should work. Note that I didn't actually build this, perhaps I should test these before posting them? 

I'll try an experiment and see where I went wrong.


----------



## DonR (Oct 18, 2012)

John

More tests:

First I tried a direct feed from panel LED 
to the Base bypassing the resistor. That
shorted out the Panel LED circuit, all went out
but came back when I lifted the wire from the Base.

I then bypassed the 1k with a 220 ohm to the
base. No effect.

Next, I tried the 12 vdc thru a 1k resistor to
a base (after disconnecting the panel LED feed).
That did cause the LED to burn a tad brighter. It
did not change the color.

Then the 12 vdc thru a 220 ohm That also caused
the LED to burn brighter yet, but no color change.

Finally, I hit the base with the full 12 vdc, a momentary
brightness then back to normal. Think that fried the
transistor because further tests with the 220 did not cause any
change in brightness.

I'm at a total loss.

What say thee?

Don


----------



## gunrunnerjohn (Nov 10, 2010)

Yep, putting 12V directly on the base would cook it pretty quickly!


----------



## DonR (Oct 18, 2012)

I'm too old fashioned for GPS.

Where do we go from here John?

Don


----------



## gunrunnerjohn (Nov 10, 2010)

Don,

Well, I was curious what happens, as I can't see anything wrong with the logic.

I build the little circuit on a proto board and tested it. I'm using a 12VDC bench supply to power it, and another supply has 2VDC out for triggering the color change. This circuit is exactly what my schematic shows.

GUESS WHAT! It works exactly as I expected. I only used one transistor, but additional ones that aren't turned on appear as an open circuit, so they'd have no effect on the operation. If you want red when it's not triggered, just turn the LED around.

I knew brain cells are dying at my advanced age, but I didn't think that many had died. 

The threshold voltage for the LED light change is around .7 volts, that's the junction drop of the transistor. Below that voltage, you get no change, above you get the alternative color.


Below are the pictures of the test. 

*Transistor input open (tried it grounded as well)*










*2VDC input to 1K resistor on base of transistor*


----------



## DonR (Oct 18, 2012)

John

If I had any, I'd pull out my hair.

I have no idea why my lashup failed. I'm going to try
just what you did with only one transistor and see if I
can get the same result. I couldn't make out the color
codes, but I assume you used the same 1K resistors
and the 220 ohm from the 12 vdc +.

I note that your transistor s a round metal device. The transistors
I used are a smaller black round with one flat side style. Could
there be a difference in the 2 devices? It's numbers were
what you specirfied.

My first thought is that I had reversed the emitter and
collector leads but that is not the case. It's such a simple
circuit, it's easy to trace and I've done that a hunnert times,
it seems, but obviously something is amiss.

In the meantime, I found a 1.5 vdc DPDT relay for $3.83 
at Mouser Electronics. I'm going to try using it with a diode
feed from each of the 4 panel LEDs. I think that will work also.

Don


----------



## gunrunnerjohn (Nov 10, 2010)

I followed my diagram exactly. I even printed it out as I plugged them into the proto-board to make sure I didn't change anything. The 2N2222A comes in both the TO-18 can and TO-92 plastic package, the specifications are basically the same. The metal can ones I have are leftovers from military stock.

Just to be complete, I also connected the input to the 12V supply, nothing bad happened, the color changed as expected.

I don't know what happened, as the transistor is the only thing that could be wired wrong, the LED would change colors no matter which way it was connected. You can try a simple test, use the circuit without the transistor. Where the transistor collector connects, try connecting that to ground, the light should change colors. If that works, you have something wrong in the transistor connection. Since those transistors are good for 600 milli-amps, it's hard to imagine you cooked it with overcurrent.










I think you're going to find the 1.5V relay requires a pretty healthy coil current, probably more than the LED outputs will give you. However, if you're up to a little circuitry, that can be corrected as well.  Supply the 1.5V (or a suitably current limited voltage) to the one leg of the relay, and use the same transistor circuit to trigger the relay. Collector to the other leg of the relay, emitter to common (ground), and the base with a 1k resistor to the LED supply.

Another point is many of those little relays are reed relays and require the proper polarity to activate, so make sure you have positive voltage on the correct coil terminal.


----------



## DonR (Oct 18, 2012)

John

I'm going to do another build of the circuit. I want to see
it work.

I was surprised that the relay I ordered from Mouser on Monday
arrived Wednesday afternoon. I won't have any current problems
with it tho.  The LED panel buss is actually fed by a Train power pack
set to 1.5 volts. The feed is from a switch, not an LED itself.

I'll let you know how well it goes.

Don


----------



## gunrunnerjohn (Nov 10, 2010)

1.5V should be plenty to trip the transistor circuit. It actually changes state around .7 volts, at that point the LED goes out. When you go below about .4 or above about 1.0, the LED is lit as is called for by the signal.


----------



## DonR (Oct 18, 2012)

John

I'm pulling the skin off the top of my head.

I just built the one transistor circuit, and like yours, it
worked fine. The LED turned from green to red
when a turnout is thrown. I did note a slight red glow when the LED
was green, but viewed from the end, as intended, it
was green.

So I proceeded to hook up the full 4 transistor 
circuit. I get green, and flipping any or all switches has no effect. Thot
maybe I had the emitters and collectors reversed, so
tried reconnecting. No effect. Can the transistors be
working against each other in some way?

I wonder, maybe, use only the one transistor, which we
know works, connect the
four panel LED feeds to it's base thru diodes. Thus any one turnout
would trigger the LED from green to Red and the diodes would prevent
any effect on the panel LEDs.

Since the Panel LEDs are feeding only 1.5 vdc do I need the 1000 ohm
resistors to the base?

Don


----------



## gunrunnerjohn (Nov 10, 2010)

You need to insure the other transistors have a return to ground for their inputs.

If necessary, try adding a 1K resistor to ground at the input before the 1K resistor that goes to the base of the transistor. As long as the other transistors are truly off, they shouldn't affect the operation at all.

What exactly is the characteristics of the input signal when it's not signaling for a switch, is it an open circuit, or does it return to ground?


----------



## rzw0wr (Aug 28, 2013)

Would it be about as easy to use a 3 input and gate for this?

A 74LS11 looks like it would handle the voltage, 7 volts.


----------



## gunrunnerjohn (Nov 10, 2010)

All of the inputs have to be high in order to get a state change, that's opposite to the logic he needs here.









As long as you don't have a lot of inputs, one transistor and multiple input resistors may work here.









The diodes Don mentioned are also a plan, though you still need one series resistor to limit the base current. This circuit in front of the base resistor looks good, and you can add more diodes for more inputs.


----------



## rzw0wr (Aug 28, 2013)

Sorry, I guess I misunderstood what Don was looking to do.


----------



## DonR (Oct 18, 2012)

Dale

This saga has more plot twists than a midnight mystery.
I have 3 wire red/green panel lights each controlled by a 
SPDT switch. There are four of them running on 1.5 vdc.

I want to control a red/green 2 wire LED so that it would be
green unless any one of the 4 panel LEDs was red, in which case it
would then show Red also. A lead to the base of each transistor
comes thru a 1K resistor from direct connection to the RED
LED +.

The circuit from John shown earlier in this thread works with
one transistor, but when you add 3 more it does not work.

John

I suspect that there is a feedback from within the panel LEDs
so that there is some kind of current present to the base
even when the panel LED is green. Could this be the case?
I'm not sure my cheapo Harbor freight multimeter can measure it.

I'm thinking of this solution:

1. A one Transistor circuit. The base is connected to a Buss. Each of the
panel RED LED current is fed to the buss thru a 1K resistor
and a Diode
so there are no interactions. I'm trying this this afternoon.

My plan is to connect one panel feed and determine that the target
LED does change when panel LED is RED.

Then add one at a time, the remaining 3 panel feeds and test each
time.

A shame Cecil B. DeMille is no longer with us. He could make a top
box office hit of this thread. Now let's see, Charlton Heston is no longer
available, who could star as the design engineer?

Don


----------



## gunrunnerjohn (Nov 10, 2010)

Did you try any of the other suggestions? A 1K to ground before the base resistor to see if that helps?

The other two possibilities are also good, the diodes may work, but I'd guess with 1.5V you'd probably want to use Schottky or Germanium diodes for minimal voltage drop, you need at least .7 volts to switch the transistor.

Next we'll gen up a circuit with open collector voltage comparators.


----------



## DonR (Oct 18, 2012)

John

I got already to try the various ideas and
found I had used up my stock of diodes so
had to put it off. Got 'em so I hope to get back to it
this afternoon. Be in touch.

Don


----------



## DonR (Oct 18, 2012)

John

Total failure.

Today I couldn't get a one transistor circuit to work as I
did the other day. Same connections, except that the
base current was fed thru a diode. The diode was
passing the current without big drop, getting 1.41 
on the base. 

I am concerned that the collector was getting 10.80
volts (to ground), where the other day I got 3.59.

Yet, the 220 ohm resistor in the 12V plus side is 
giving the LED only 2 vdc.

I tried 3 different transistors with no results.

Just in case of confusion I tried reversing the collector and
emitter, no change.

I'm totally confused.

Don


----------



## Hutch (Dec 19, 2012)

This has been going on since December 2012?


----------



## gunrunnerjohn (Nov 10, 2010)

I hope you did put the resistor in series with the diode, because otherwise you probably smoked the transistor! 1.41V on the base of the transistor with the emitter grounded is excessive! The diode was just to provide total isolation.



Hutch said:


> This has been going on since December 2012?


Are you planning on contributing to the issue or just part of the peanut gallery?


----------



## DonR (Oct 18, 2012)

Hutch said:


> This has been going on since December 2012?



The gift that just keeps on giving.

Don


----------



## Hutch (Dec 19, 2012)

Peanut gallery for now. If I see where I can add something I will. I'm finding this thread interesting but I'll have to read it a couple more time to be of any help.


----------



## DonR (Oct 18, 2012)

John

Oh yes, I still had that 1K resistor coming from the panel LED
then into the diode. But it still reads 1.41 at the base. Same
as before when it worked.

And, as I suspected, there is a 0.10 volt current at the base
coming in from the panel LED when it's set to green. 1.41 when
set to red. Is this why the 4 transistor circuit did not work?

I had the circuit working the other day using the same resistors
and power supply as today, and I tried 3 different transistors.

The only change was to replace the transistor itself and also
to add in the diode from only one panel LED

And why am I reading 10 + v at the collector (to common) when I had 3 + the
other day? Same wires and resistors. The 220 ohm is OK because the
voltage from it to the LED is right at 2 vdc.

It may be time to go at the relay design.

Don


----------



## gunrunnerjohn (Nov 10, 2010)

If you have 1.4V on the base and 10V on the collector, my guess is the transistor is toast. That should have turned it on and yanked that down to around a volt or a bit more.


----------



## Hutch (Dec 19, 2012)

If your not getting in the neighborhood of .7V on the base then your transistor is off and you'll read the supply voltage on the collector.


----------



## Hutch (Dec 19, 2012)

I think John is right about the toast.


DonR said:


> John
> 
> And, as I suspected, there is a 0.10 volt current at the base
> 
> Don


What do you mean by that? Is there 100 mA or .1V?


----------



## DonR (Oct 18, 2012)

Hutch

I seem to be getting 0.10 volts DC (1 tenth of a volt) on the Green Panel LED lead when
it is burning RED. These are the 3 lead RED/GREEN/YELLOW LEDs. 

This has become a huge embarrassment. Such a simple circuit and
I can't make it work every time.

Think I'll put it aside and let my brain simmer down a bit before
another trial.

How does one test a transistor to know it's still good?

Don


----------



## DonR (Oct 18, 2012)

Hutch said:


> If your not getting in the neighborhood of .7V on the base then your transistor is off and you'll read the supply voltage on the collector.


The Base is getting 1.4 volts.

Don


----------



## Hutch (Dec 19, 2012)

Like John said. It's toast. Unless you have another diode attached to the Emitter. It sure sounds like you're reading base to emitter plus a diode.


----------



## rzw0wr (Aug 28, 2013)

Sorry to interrupt again.

If an AND gate does not fill yours needs then try a NOR gate.


----------



## gunrunnerjohn (Nov 10, 2010)

Actually, he appears to want an OR gate, not a NOR gate. For any positive input, he would like a positive output to trigger the transistor and thus the light color switch. However, he has 1.5V available, so he'll need a gate that triggers at a lower voltage than most.


----------



## rzw0wr (Aug 28, 2013)

From Don R.
I want to control a red/green 2 wire LED so that it would be
green unless any one of the 4 panel LEDs was red, in which case it
would then show Red also.

If all inputs (outputs from the switches) to the gate are to be the same, then either an NOR or a NAND is needed to turn the final LED to Green.
Else the final LED is RED.

I see your point of view John.
You are wanting to turn the final LED to red if any of the inputs are low.

Seems backwards to me but, might work.

Just to make sure I understand how a 3 state LED works.
The proper voltage to the green side lights the green.
A proper voltage to the red side lights the red.
Proper voltage to both sides light the yellow.

Is this correct?

If so, or close, then you always have a high signal from the switch LEDs. Either green or red.
Either on can be used for an input signal to the gate.

I am Way off?


----------



## Hutch (Dec 19, 2012)

I'm not following what you mean by a final LED. He just want one LED to be controlled by the other 4. If any or all of the 4 are on then the state of the one would be red. It's just an OR solution as far as I can see.


----------



## gunrunnerjohn (Nov 10, 2010)

As Hutch says, it's a simple OR function. If any one of the outputs is high, I want the output of the OR gate to be high. This in turn will turn on that transistor and cause the light to change state. 

I don't understand why the diode OR didn't do the trick, it's exactly the same logic.


----------



## rzw0wr (Aug 28, 2013)

How can you have a simple OR with 4 inputs from the switches?

I must have missed something somewhere.

Final LED = the red/green LED you want on.


----------



## gunrunnerjohn (Nov 10, 2010)

Pretty easy I would imagine. All inputs default to zero volts. If any input is at a logic high, the output should be a logic high. That's a logical OR circuit.

Note that I've selected Schottky or Germanium diodes for a low voltage drop to insure reliable operation. I just need about more than .7 volts on the transistor base to insure proper operation.


----------



## rzw0wr (Aug 28, 2013)

OK John you win. :smilie_daumenpos:
I just thought of using 1 transistor while I was trying to sleep and couldn't.

I could not come up with anything after the transistor to make the LED work.

Looks like a nice, simple circuit that should work.


----------



## gunrunnerjohn (Nov 10, 2010)

You can also add more channels, just add more diodes.


----------



## DonR (Oct 18, 2012)

One more act to this play.

I've run out of N2222A transistors.
Tried an N3401, it didn't work.

Hooked up my relay circuit which essentially
is close: The four panel LEDs each thru a diode
to the 1.5 vdc relay coil with DPDT to control 2 wire
Red/green LED. You're not going to believe: Coil
open. aaarghhhh. Thank goodness I'm not suicidal.

Both John and I had the N2222A working per the
original circuit in this thread. But for some yet
unknown reason i could not get it going again and
toasted all the transistors in the attempts. 

John, you've added that 10k resistor base to
ground that wasn't there before. You think that
might have saved me?

Don


----------



## gunrunnerjohn (Nov 10, 2010)

The 10K resistor to ground was to make sure the diode-OR worked properly. Not knowing what the characteristics of the input voltages are, I protected against the OFF state being simply an open circuit. If they are positively pulled to 0 volts, that resistor would not be necessary, if they're an open circuit when not active, it would insure proper operation.

It may have helped with the transistors, again I really don't know what is coming in. When looking at the circuit, I figured that was cheap insurance.

I put this on the workbench again, worked just fine for me.


----------



## DonR (Oct 18, 2012)

John

Back in the Saddle again...out where a friend is a friend...
where the...and so on per Gene Autry.

Got a resupply of N2222A. Hooked up ONE, per original
circuit. It's working half way. When turnouts are all
green, I get NO green on the LED. When I switch any
turnout to RED I get RED LED. 

Now, here's the fun part. When I discharge the 12VDC
supply then plug it back in, I get a green LED when I
should. However, when I flip any turnout to RED and
get RED, then flip it back to green I get NO light. BUT
HERE'S A NEW VERSE...I monitored the 12 v supply. Leaving
all turnouts green, and LED not burning...the supply voltage
holds 12.5 for a few seconds then starts dieing...when it
hits 11 the green comes back on until the voltage gets
to low for it and it goes off. But, again plugging the
12 v supply back in I get Green LED again. 

So, the transistor is switching, but there is some voltage
problem that keeps the green off.

Here are my readings to ground.

LED color RED GREEN

Collector 2.15 6.06

Base .69 .64

I tried adding the 10k resistor Base to ground, made
no difference. Don't see how it could since base is
already direct to ground. 

I'm thinking that the sneak current from the panel
diode, note that is .64 vdc, may be preventing the
transistor from switching. Maybe the 10k resistor
should be on the diode side of the 1k to the base.
That way it could drain off some current, but it would
do so whether panel LED is RED or GREEN.

Apparently the difference in your working circuit and
mine limping is the source for the base. Yours is
absolutely zero on 'green' and mine is .64.

Don


----------



## Hutch (Dec 19, 2012)

Don, it would be great if you could draw your circuit and post so we can see what you're doing. If you don't have software such then a hand drawn snapshot with your phone would work. The base should not go to ground. Is this the original circuit that john drew with the diode OR ?


----------



## DonR (Oct 18, 2012)

Hutch

The circuit I have at the moment is exactly like that
in John's Post 56 in this thread. One N2222A. 

He and I both had this circuit working with one source
from my panel LED thru 1k resistor to the base. 

That was when we were then going with 4 transisters
in parallel each taking a single panel LED to base.

I reasoned that using diodes to isolate the panel LEDs
into a buss to the base should work with one transistor.
Did not, and think
I toasted a transistor in the process. So today is the
first time back to it with new transistor.

There is a .64 back voltage coming from the panel LED.
The panel LEDs are 3 wire. So when the Red is ON the
wire from the green side is getting that .64 voltage 
inside the LED. They are controlled by a DPDT switch
the other side selecting straight or diverging on the
turnout motors. 

When John has his test circuit he has zero on the base
when in a Green condition. That is the main difference
between our circuits.

Don


----------



## Hutch (Dec 19, 2012)

I see. There is no voltage at all on the base because there's nothing connected, not ground when the other LEDs are switched off.

Sent from my XT1060 using Tapatalk


----------



## Hutch (Dec 19, 2012)

Unless you have the 10k connected.

Sent from my XT1060 using Tapatalk


----------



## gunrunnerjohn (Nov 10, 2010)

I think you hit the nail on the head Don. If you have a diode drop from ground to the base of the transistor, you're right on the edge of switching. For that scenario, I'd probably have used an open-collector comparator like the LM339 for the first stage instead of the transistor. This would allow you to set the trigger threshold.

If you remember, I was asking about the specifics of the input signal early on, it's kinda' important when you're doing something like this.


----------



## DonR (Oct 18, 2012)

I just went in and tested my theory that the sneak voltage coming
THRU the panel LED was preventing the circuit from switching to green
after switching to Red. My test showed negative to that. There is
apparently no such sneak current.

Here is the scenario:

1. Turned on both 12 Vdc supply and Panel supply. 

2. All turnouts to Green. No light on the circuit LED

3. I measure .64 on the base.

4. I turn one turnout to red, circuit LED glows Red. .69 on base.

5. I turn the turnout back to green. LED goes out. .64 on the base.

5. I turn off the 12 v dc supply, leaving the panel LED
supply on, base voltage goes to 0. But when any
turnout is switched to RED base voltage goes to. .51
It apparently is enuf to trigger the transistor to turn
to RED. So why no green?

6. When the 12 vdc is turned off the circuit LED stays off
until the voltage drops to 11 then the LED glows green 
a few seconds and then fades to dark.

Apparently the .64 and .69 voltages are coming from the transistor not
the panel. Is that supposed to be?

Don


----------



## gunrunnerjohn (Nov 10, 2010)

I don't know what is going on there, the transistor clearly does not put voltage on the base, especially with a 10k to ground. I tested the diode OR circuit and it works fine here. However, I'm putting ground and 3V on the inputs for off and on voltages. Again, the transistor switches at around .6-.7 volts, and there is an uncertainty there for the output state.


----------



## Hutch (Dec 19, 2012)

It takes about 170mV more to turn on a green LED according to my measurements just now. That could be the issue.


----------



## gunrunnerjohn (Nov 10, 2010)

I can't imagine that the LED voltage has any bearing here, as when the transistor switches, you should get plenty of differential. I think the issue is at the first stage, the voltage readings only a fraction apart are a red flag. When I measure the voltage with all inputs zero, I get zero at the transistor base.


----------



## Hutch (Dec 19, 2012)

I hate to say it but I just built this circuit and it works fine for me so I don't know what you're doing different.


----------



## Hutch (Dec 19, 2012)

Hutch said:


> I hate to say it but I just built this circuit and it works fine for me so I don't know what you're doing different.


 Actually I have the LEDs hooked up where John show diodes.


----------



## gunrunnerjohn (Nov 10, 2010)

It has to be the input voltage. I'm guessing he has a diode drop from ground that is causing uncertainty with the switching.

I'd probably either go with the comparator or perhaps go with a bi-polar power supply to allow more flexibility in the transistor threshold switchover.


----------



## gunrunnerjohn (Nov 10, 2010)

Hutch said:


> Actually I have the LEDs hooked up where John show diodes.


There's only one LED in this circuit, so I'm not sure what you're doing!  The diodes are to implement the OR function.


----------



## Hutch (Dec 19, 2012)

I'm implimenting the OR function with LEDs.


----------



## Hutch (Dec 19, 2012)

I inserted the Schotkey diodes and it still works great.


----------



## Hutch (Dec 19, 2012)

Here's the complete schematic of my present working bench setup. Is this what you're trying to do Don?


----------



## gunrunnerjohn (Nov 10, 2010)

I think Don't issue really is the fact that the *low *input signal is probably not really zero volts. That's the only thing that makes sense to me.


----------



## Hutch (Dec 19, 2012)

Sure, if that transistor is off, 0 on the base, the green LED has to light. Something has got to be miswired. I'm trying to figure out a way to get the same results as Don so I can be of more help.

BTW, I don't know what that little red arrow on the base is doing there. OOPs


----------



## DonR (Oct 18, 2012)

What can I say. I messed up big time. It embarases me
because I know I've wasted the time of John and Hutch
and I do apologize. I had the collector and emitter connections
reversed. The transistor package showed the pinouts as a bottom view.
I was looking down at the TOP. 

So, after correcting pinouts,
it is working, so to speak. With the turnouts all set for green the
LED is Green. 

When any or all turnouts are set for red, the LED is ORANGE (both red
and green on).

Hutch: The major difference in your circuit and that of John and Me is that
you are feeding the 12 v dc to the base. I am feeding my PANEL RED LED
current thru a 1K resistor and the diode. It feeds .55 vdc when RED.

First thing after correcting the wiring, I removed the 10K resistor Base to ground.
I found it had no effect, connected or not.

Now I have new voltage readings from my corrected circuit.

LED glow color: Green Red 

Collector 9.36 2.90
Base .02 .55
Emitter always 0

Voltage on each LED wire (to ground):

When glowing Green 7.45 9.36
When glowing Red/Green 3.55 2.90

I have 1.41 volts available from the panel RED LED.
the 1k resistor is dropping it to .55. Would there
be value in reducing the lk to a lower resistance and
thus increase the base voltage?

All of which brings up the Main question:

Why is the Green not turning off when Red is on?

Don


----------



## Hutch (Dec 19, 2012)

I don't have 12V going to the base. I'm feeding the base through an LED and a diode. I'm missing something.
Plus, I get .758 on the base when the feed LEDs are lit and zero when they're off.


----------



## DonR (Oct 18, 2012)

Hutch

Yes, I see your point. I just saw your 12 V feed to the
base circuit thru those devices, and jumped on it.

Don


----------



## Hutch (Dec 19, 2012)

For the life of me I can't figure out how you're getting base readings of .5.


----------



## Hutch (Dec 19, 2012)

BTW, I'm doing this because I find it fun and interesting. You're not wasting my time. Are you sure you have the pinout right? I've wired this thing in every wrong way I can except mixing up the transistor leads and it still works.


----------



## Hutch (Dec 19, 2012)

The input diodes get dim as you add more. I think you're multi transistor circuit would be a better option for more than a few LEDs.



gunrunnerjohn said:


> You can also add more channels, just add more diodes.


----------



## gunrunnerjohn (Nov 10, 2010)

The issue here is you have a higher voltage than really useful for the task.

The green is not turning off because you have the transistor in partial conduction, but not fully on. You'd have to go lower in voltage to insure it's totally off.

As I recall, you have about 1.4V when you want the circuit energized and .7 volts when you want it off. That's a pretty narrow range, and I think the solution is probably a comparator to replace the transistor.


----------



## gunrunnerjohn (Nov 10, 2010)

Hutch said:


> The input diodes get dim as you add more. I think you're multi transistor circuit would be a better option for more than a few LEDs.


He doesn't want input LED's as I see it, just one LED to indicate the status of all of them. The input LED's were your addition.


----------



## Hutch (Dec 19, 2012)

What I don't understand is where is the 1.4V coming from. If I take the voltage from the Anode side of an LED with resistor on top and cathode to ground, I get 1.8V. 1.4V indicates 2 diodes in series. If I apply 1.4V to the diode instead of the LED feed, red turns on and green turns off.


----------



## gunrunnerjohn (Nov 10, 2010)

The transistor switches at the .6-.7 volt range. Any voltage well below that threshold will hold the transistor off, by the time the voltage on the other side of the 1K resistor gets to 1 volt, the transistor will be fully on. The 1K resistor is to limit the base current, which will destroy the transistor if it's excessive.


----------



## Hutch (Dec 19, 2012)

I understand how a transistor works, I'm just not seeing the circuit that is supplying the base current. From the switch panel to the diode OR. This must be the problem because the circuit you've drawn works perfectly.


----------



## Hutch (Dec 19, 2012)

Is this the circuit? This works fine on my bench also.


----------



## DonR (Oct 18, 2012)

Hutch said:


> I understand how a transistor works, I'm just not seeing the circuit that is supplying the base current. From the switch panel to the diode OR. This must be the problem because the circuit you've drawn works perfectly.


Hutch & John

I have a DPDT switch on my panel. One side switches the turnout motor
coil current. The other side has the 1.4 vdc + of my LED power supply on the
center tab and the red or green panel LED leads on the outer tabs. 

I have my circuit to base lead soldered on the RED tab. That gives me
1.4 vdc to the circuit thru a 1k resistor and the diode which is there only
to avoid interaction with the other panel LEDs. When the panel Red
is switched I get .55 feed to the base. 

When the switch is set to Green there is 0 vdc going to the base
from the panel LED. There 
seems to be a transient .02 vdc on the base with the panel LED supply 
completely turned off. I assume that is internal in the transistor.

So I can adjust the resistor values if needed: What voltage do I need
from the panel LED to cause the transistor to switch? 
And how about
a list of the voltages you guys are getting on the Base Red and Green,
and the collector Red and Green so I can try to match them.

As I noted, Green is on when all turnouts are clear. Right now, when
any are RED, I get both Red and green lighted.

What is confusing is that, as with both of you, I had this circuit
working properly early on using the same voltages and
resistances as now.

Don't know how such a nice clear simple circuit can be this
much trouble but I sure do appreciate your patience.

I can't believe that there have been so many of our members
who have viewed this thread. Guess they are sitting back and
guffawing at my fumbling work.

Don


----------



## Hutch (Dec 19, 2012)

:smilie_auslachen::hah::cheeky4:



Just kidding. It's been fun.


----------



## rzw0wr (Aug 28, 2013)

I find this very interesting.
I wish I knew more so I could help.


----------



## Hutch (Dec 19, 2012)

So this is the circuit. Am I missing anything. Appearantly my reading comprihension needs some work.


----------



## DonR (Oct 18, 2012)

Hutch

You get a B on comprehension. Gasp.

I am using DPDT SWITCHES on the panel not relays. But, yes,
considering that, your routing of the 1.4 vdc panel LED current
is exactly what I am doing. So you get an A+ on circuitry and
support for the aged and feeble minded.

I put it aside today just to let my mind unbend. Sat and watched
my trains run. Gee that can be fun. I like to get down at
closeup eye level and watch the wheels click over the rails. 
Except when the %#%$
switchman falls down on the job. He does have a lot of work. I had
2 passenger trains going clockwise, and a long freight running
counterclockwise on my single track main. Those DPDT switches
get quite a workout routing the passenger trains into the
three passing sidings where the stations are
and trying to keep the freight on schedule. 

Don


----------



## Hutch (Dec 19, 2012)

You're too kind giving me a B.


----------



## gunrunnerjohn (Nov 10, 2010)

The 1.4 volts and the diode are conspiring to make this not work.

There is an easy solution. Put any dropping resistor on the other side of the LED so that there is a greater than 1.4 volt swing. You can put 10-12 VDC on the input to the transistor with the 1K resistor, and if that results in too much base current, just make the resistor 4.7k for lower base current.


----------



## Hutch (Dec 19, 2012)

John, 1.4V works just fine for in my latest schematic. I must still be missing something.


----------



## gunrunnerjohn (Nov 10, 2010)

If you have 1.4V at the transistor base, it'll work fine. If you're using diodes, it will work OK if they're Schottky or Germanium diodes with a low forward drop, but with silicon diodes, it would be very marginal. It might work as the diode drop is lower at low currents, but you're running pretty close to the edge.


----------



## Hutch (Dec 19, 2012)

Don, why do you have such a low power supply in the first place? What exactly is it?

I used Schotkey diodes in my circuit as John suggested. Tomorrow, I'm going to try silicon diodes to see if I can get it to stop working. I doubt it.


----------



## DonR (Oct 18, 2012)

My source for the LEDs on my 3 panels is an old DC power pack. I'm
using the DC track connections because I could lower the voltage to LED
level and not need so many resistors on the panels. It is not connected
to anything else.

If more voltage would help I can run it up a notch, the LEDs are not
at full brightness with the 1.4 vdc.

I thought today I might try dropping the base resistor from the panel
LED from 1k to 470 ohms and see what effect that has.

Then if that doesn't work I'll throw the whole 1.4 vdc thru a diode 
at it and see if that does anything.

I haven't detected much drop thru the diode. But I'll recheck that.

Don


----------



## DonR (Oct 18, 2012)

Well guys, It's time to declare that we won the war.

It's working. There is still a small green glow, but the LED
is Red enuf to work in the signal.

Here's what I've been doing:

First, as you thought, the diode is knocking off about .50 
of a volt. So one by one I reduced the resistance to the
base. I finally ended up with a 15 ohm resistor to replace
the 1k. As a result, I am now getting .70 on the base
through it and the diode.

I tried the full 1.40 vdc thru the diode to base
but that somehow was too heavy load and it dimmed all of
the panel LEDs dramatically. I made sure there was no short. 
I didn't expect a transistor to load the circuit like that. Tried
several times, always big dim on the panel.

So with the fat lady bellowing out her tune, and our ship
sinking slowly in the West, we bid a fond adieu to this island of 
wonder and excitement.

Aloha

I really do thank you guys for your help and your patience.

Don


----------



## gunrunnerjohn (Nov 10, 2010)

You are beating the crap out of the transistor if you're putting high currents on the base-emitter junction. That's the purpose of the resistor.

Like I said, try just raising the ground reference for the output signal and all of this will work properly without cooking the transistor.


----------



## DonR (Oct 18, 2012)

gunrunnerjohn said:


> You are beating the crap out of the transistor if you're putting high currents on the base-emitter junction. That's the purpose of the resistor.
> 
> Like I said, try just raising the ground reference for the output signal and all of this will work properly without cooking the transistor.


Not sure what you mean 'raise the ground reference for the output signal'.

Without the resistor in the base feed, it only got about .90 vdc through
the diode. The diode is dropping appx. .50 vdc. But when I tried it really pulled the
panel LEDs down big time. What caused that load?

Anyway, it's working enuf to 'get by' with the 15 ohm resistor to base.
I don't expect any tint counters to visit any time soon.

Don


----------



## Hutch (Dec 19, 2012)

I still think you have some bad components or something somewhere. I have this circuit working with 1.4V and absolutely no issues. All this talk of tweeking resistors and raising ground seems like a bandaid fix for some other problem you're having. I wish I could help but I'm out of ideas and John seems to be the better man to get answers from anyway. I hope to see a real fix soon.


----------



## DonR (Oct 18, 2012)

Hutch

I would agree, something is different.
It is such a simple circuit. 4 resistors, 4 diodes, one LED and
one transistor. Voltage readings indicate the resistors and
diodes are functioning as expected, the LED changes colors
and the transistor is switching. The only negative at this
point is that the LED green lobe does not go all the way off.
The 12 vdc source is reading 12. vdc. We know the panel
LED source is 1.4 vdc. So where is it? I don't know how
many times I have rechecked to see that the few wires
are where they belong.

While I have the circuit passable now, I still wonder why I got such a heavy
loading of the panel LED l.4 vdc circuit when I removed
the resistor and let the whole 1.4 go thru a diode to
the base. The base only got .90 vdc since the diode drops
.50 vdc.

I don't know what John means by the 'ground reference'.

Don


----------



## gunrunnerjohn (Nov 10, 2010)

Hutch said:


> I still think you have some bad components or something somewhere. I have this circuit working with 1.4V and absolutely no issues. All this talk of tweeking resistors and raising ground seems like a bandaid fix for some other problem you're having. I wish I could help but I'm out of ideas and John seems to be the better man to get answers from anyway. I hope to see a real fix soon.


It's NOT a band aid, it's simply a simple way to insure enough voltage to properly trigger the transistor without cooking it with excessive base current.


----------



## DonR (Oct 18, 2012)

*It's alive!*

After a long pause for family visit to Illinois then
some badly needed yard work, I finally got back
to completing the signal bridge using the
transistor circuit from Gunrunner John, and
help from Hutch. Thank you guys, I do appreciate
your help.

I hope you think the end result is worth all the trouble trying
to make it work.

To summarize: 

I have a passing siding that has four turnouts in the
route to the main. I wanted a transistor circuit that
would light a Green LED when all turnouts were set
to clear, Red if any were set to diverting. The bridge
also has a target showing green when the route to
the central station and wye is clear, red other times.

So here it is:

First pic has the right target showing green for clear
route to the main that crosses along the wall. The left
target shows red. Not clear to central station.

Second pic has the right target showing red. One of the
turnouts is set to diverting. Not clear to the main.

Third pic has the right target showing red. Not clear to 
main. Left target is showing green. Clear route to
the central station and wye.


























The bridge originally came from
an odd parts package bought from an estate. The LEDs
are bi color and show through drilled out dummy targets
so the size of the light is scale.

Though frustrating along the way, this is the type of
project that makes model railroading fun. 

Don


----------



## Hutch (Dec 19, 2012)

:appl::appl: Awesome. 


I can't wait to get something like that on my railroad. I still don't have all my switch machines installed. This railroad building takes a long time for some of us.


----------

