Decoder outputs and transistors

 
  CLF6 Station Master

Hey all

While on a mission to work out how I can switch the marker lights separately from the headlights on my Auscision GT46s, using DCC rather than the manual switches (which are on the common positive side of the circuit) I came across this page.
http://s374444733.websitehome.co.uk/neg-ground/index.htm


I decided to test the circuit shown above out on a breadboard, using a basic 4 function NCE decoder, a PNP 2N3906 transistor and a 3mm LED with 1k resistor as the load. (I soldered the “common negative” lead directly to the decoder's bridge rectifier) Unfortunately, the LED lit as soon as power was supplied to the decoder, rather than remaining dark, and the only effect turning on the function output had was to make the LED shine a little brighter.

When the same circuit is connected to a 12v source or a 9v battery in lieu of the decoder, it works perfectly with the LED only lighting when the base is touched to the negative.

I know a few on here are pretty sharp with electronics and I'm very much a novice, so if someone help me with some pointers with what I need to check and change to get this to work I'd much appreciate.

Thanks

John

Sponsored advertisement

  comtrain Chief Commissioner

Location: Near Albury Wodonga
Hey all

While on a mission to work out how I can switch the marker lights separately from the headlights on my Auscision GT46s, using DCC rather than the manual switches (which are on the common positive side of the circuit) I came across this page.
http://s374444733.websitehome.co.uk/neg-ground/index.htm


I decided to test the circuit shown above out on a breadboard, using a basic 4 function NCE decoder, a PNP 2N3906 transistor and a 3mm LED with 1k resistor as the load. (I soldered the “common negative” lead directly to the decoder's bridge rectifier) Unfortunately, the LED lit as soon as power was supplied to the decoder, rather than remaining dark, and the only effect turning on the function output had was to make the LED shine a little brighter.

When the same circuit is connected to a 12v source or a 9v battery in lieu of the decoder, it works perfectly with the LED only lighting when the base is touched to the negative.

I know a few on here are pretty sharp with electronics and I'm very much a novice, so if someone help me with some pointers with what I need to check and change to get this to work I'd much appreciate.

Thanks

John
CLF6
I am probably less informed than you claim to be Very Happy
However I do notice the circuit gives a common negative on the Hornby light board In fact DCC standards actually have a positive common. This appears to convert Hornby function common negative to common positive. In that case one of these devices would only convert one function?
The blue wire is positive on decoders and the lights are switched by the negative terminals.
If that is all this device does, it would be far simpler to trash the light board and wire in compatible led's using available functions and common positive wiring.
Cheers
Rod
  CLF6 Station Master

I am probably less informed than you claim to be Very Happy
However I do notice the circuit gives a common negative on the Hornby light board In fact DCC standards actually have a positive common. This appears to convert Hornby function common negative to common positive. In that case one of these devices would only convert one function?
The blue wire is positive on decoders and the lights are switched by the negative terminals.
If that is all this device does, it would be far simpler to trash the light board and wire in compatible led's using available functions and common positive wiring.
Cheers
Rod
comtrain
I'm not aware of a decoder that does have a common negative lead supplied, as you say the function common is always positive but soldering a lead to the negative side of the bridge rectifier effectively does that. Another diagram on that page I linked shows the same circuit but the "common negative" is just tapped into the function output, which is also an option. What I'm doing effectively is using transistors to allow the -ve function outputs to switch on and off the +ve common to each lighting feature.
I could do the same thing with micro relays, but a transistor seems like a much more elegant solution, just stumped as to why the circuit will not completely open (turn off) when the function is not on, but works when I use a battery. Must be a voltage or current issue?
Tried removing the lighting boards, I'm normally pretty good at disassembling stuff but those buggers aren't gonna budge! Too much glue!
Thanks
John
  apw5910 Deputy Commissioner

Location: Location: Location.
Can you measure the voltage at the base of the transistor? Both ON and OFF states. Looks like the OFF state voltage doesn't turn the transistor completely off.
  CLF6 Station Master

Can you measure the voltage at the base of the transistor? Both ON and OFF states. Looks like the OFF state voltage doesn't turn the transistor completely off.
apw5910
Off is 0.58v
On is 0.65v
To clarify that is measured between the positive common output and the transistor base.
  apw5910 Deputy Commissioner

Location: Location: Location.
Can you measure the voltage at the base of the transistor? Both ON and OFF states. Looks like the OFF state voltage doesn't turn the transistor completely off.
Off is 0.58v
On is 0.65v
To clarify that is measured between the positive common output and the transistor base.
CLF6
Well without bothering to do the proper calculations, I'd say that 10k pull-up resistor is too low in value. Especially if the decoder board's function output is truly at 0V in the OFF state. 0.58V at the base won't turn off the transistor. Try increasing its value to say 47k or more. In fact, I'd swap the 10k and 47k resistors in that diagram, I think they're the wrong way around.
  comtrain Chief Commissioner

Location: Near Albury Wodonga
If this circuit works, it might be used to split the different lights on Austrains G and 81 Class Locomotives

They have separate leds for headlight and number board on one light board and marker lights and ditch lights on another board. When you try to give each light a function switch you find some leds are negative common.
This appears to be similar to the light board on the hornby engines. I think they came from China anyway so not so strange.
Cheers
Rod
  Parkeston Station Staff

Hello John,

Can you measure the voltage of the function output, relative to the common positive, when it's on and off?  My guess is that there's not enough load on the output and it's not returning to zero (relative to positive) when off.

You could try adding a resistor directly between the function output and the common positive to provide some load and then taking the measurement again.  Keep reducing the value of the resistor and measuring to see what happens to the output as you do but don't go too low or you'll let the smoke out.  I suggest that you don't go below about 600 ohms.

Also, it may be worthwhile trying a different output just in case you have a dud one.

Good luck.

Ian
  CLF6 Station Master

Thanks for the pointers guys, unfortunately haven't come up with a solution.

I've tried several combinations of resistors between the 56k and 1k values between in place of the base and pull-up resistors and while the ON voltage at the base varies a little (~0.1-0.2V) the OFF voltage hadn't moved from 0.58V.

Also, Ian, perhaps I miss understood what you were suggesting but I tried putting a resistor in between the common positive and the function output I've been using but it didn't have any effect on the voltage or how the circuit operates. The highest value resistor I tried was 75k.

I tried renewing the circuit completely with fresh components but still no difference. I also wondered what would happen if I removed the pull-up resistor (no change) and then the function lead to completely isolate the base and the damn thing still lit. I thought it might have been a dud transistor but everything works fine when it's connected to a 12V source instead of the 14.9V output on the decoder. Stumped.

Thanks
John
  Aaron The Ghost of George Stephenson

Location: University of Adelaide SA
Are you sure you have the cathode side of the bridge?
  CLF6 Station Master

Are you sure you have the cathode side of the bridge?
Aaron
Pardon my ignorance, but you mean where did I wire the "common negative" (as the diagram calls it) to, on the decoder? I wired it to the negative side of the bridge, the anode or whatever? Otherwise it'd have short the circuit?
  Aaron The Ghost of George Stephenson

Location: University of Adelaide SA
Set your multimeter to read AC volts and measure between what you have labelled common negative and common positive.
  CLF6 Station Master

Set to AC, I can't get a reliable reading, it jumps all over the place. Set to DC it reads a steady 14.63V.

FYI I didn't draw the diagram, just posted it from another page that I stole the idea from.
  Aaron The Ghost of George Stephenson

Location: University of Adelaide SA
What sort of numbers do you see? (Vaguely)

If you have managed to pick the right spot on the rectifiing bridge you should be seeing pretty close to 0 volts AC.

I am pretty sure apw5910 is wrong, firstly, no decoder has 0 volts on the function wire when it is off, the function wire carries 0 volts when the function is ON, in the off state the function wire should closely match the blue wire in volts. Secondly, the pull up resistor, it's a basic voltage divider and I can see he didn't bother to make the calculations or think about the problem. Making the pull-up value larger will INCREASE the voltage between the base and collector of the transistor, if anything you'd make the pull-up value smaller, but I don't think this is the problem.

I am on barely double digits of sleep in three days, I also don't have a computer, decent internets, or even a decent piece of paper to go with my pen. NPN and PNP transistors are current controlled devices, voltages don't really tell us much about them. The voltage between the base and the emitter will either be close to 0v with the device turned off, sometimes it will even be negative to be sure, but the PN junction means that whenever it's doing much interesting the voltage at the base will always be about 0.6v from the emitter voltage (for PNP). Perhaps unsurprisingly this is what you see, volts always about 0.6v and the transistor always doing something.

I am still thinking you've not found the common ground as you call it. If you had, and the transistor is alive (as your battery tests suggest) and your decoder is not dead, then from what I can see everything checks out.
  Parkeston Station Staff

Also, Ian, perhaps I miss understood what you were suggesting but I tried putting a resistor in between the common positive and the function output I've been using but it didn't have any effect on the voltage or how the circuit operates. The highest value resistor I tried was 75k.
CLF6
John, what I meant was to measure between the decoder output and the common positive and confirm that it is working correctly.  That is, it reads 0v when it's off and some voltage approaching 14.9v when it's on.

I suggest you disconnect the transistor circuit while you are doing this.

Judging from what else you have written I don't think this will be the problem but we must first establish that the decoder output is working correctly.

Ian
  CLF6 Station Master

Aaron, I managed to get a reliable AC reading from the bridge of around 0.02V.

I'd post a photo showing where the lead is soldered to, but it won't upload from either Google photos or imgur for some reason.

I've also measured the voltage from all the function outputs, they all read 14.6V when ON and between -2.0V to -3.5V depending which output, when OFF. I also measured a new decoder of the same type and had the same results.

I might try uploading a photo of the actual circuit I've made, once I have a minute to find a decent image hosting service. Maybe I've done something incorrect, but I've pretty much triple checked everything a dozen times already.

Thanks
John
  Parkeston Station Staff

Aaron, I managed to get a reliable AC reading from the bridge of around 0.02V.

I'd post a photo showing where the lead is soldered to, but it won't upload from either Google photos or imgur for some reason.

I've also measured the voltage from all the function outputs, they all read 14.6V when ON and between -2.0V to -3.5V depending which output, when OFF. I also measured a new decoder of the same type and had the same results.

I might try uploading a photo of the actual circuit I've made, once I have a minute to find a decent image hosting service. Maybe I've done something incorrect, but I've pretty much triple checked everything a dozen times already.

Thanks
John
CLF6
John,

OK, as I suspected there's nothing wrong with the decoder.  I just wanted to eliminate that first because it was easy to check.

The voltages on the base of the transistor don't seem to be right.  Are you sure you have the transistor wired correctly?

Ian
  CLF6 Station Master


The red arrow above is where the 'common negative' lead is soldered. I really only have started learning about circuits in the last couple weeks in result of this project, but I figured given it's directly opposite the blue common output in correlation to the four diodes of the bridge that I've got it right. Please prove me wrong though.



Here is what I've come up with, it's a bit rough but it works (with a battery). I've highlighted the component leads to hopefully make it easier to see whats going on. The base and pull-up resistors are a 47k and 56k respectively, that was just the last combination I tried in frustration to get some sort of result (still works with a battery).

Ian, I did try reversing the transistor at one point, to see if I had the emitter and collector the wrong way around but when I tested it with a battery nothing happened. Wasn't game enough to test with the decoder in case it damaged it.

Might leave this project until next week, unless I get bored over the weekend.

Appreciate the help
John

edit: I noticed those pictures didn't load when I opened this thread on my phone, if it didn't work for others I'll try reloading later.
  Parkeston Station Staff

The red arrow above is where the 'common negative' lead is soldered. I really only have started learning about circuits in the last couple weeks in result of this project, but I figured given it's directly opposite the blue common output in correlation to the four diodes of the bridge that I've got it right. Please prove me wrong though.



Here is what I've come up with, it's a bit rough but it works (with a battery). I've highlighted the component leads to hopefully make it easier to see whats going on. The base and pull-up resistors are a 47k and 56k respectively, that was just the last combination I tried in frustration to get some sort of result (still works with a battery).
CLF6
Hello John,

First of all the common negative looks to be spot on, so that's not the problem.

According to the data sheets I can find for the 2N3906 you have the emitter and collector the wrong way around.  In the picture above the pins are (from left to right) emitter, base, collector.  The emitter should be connected to common positive and the collector to the LED.

Try connecting a new transistor the other way around and see if that works.  The existing transistors you've tried may have been toasted.

Ian
  CLF6 Station Master

Looking at those PDFs, it looks like you're right Ian, the positive should be connected to the emitter and I've got it back-to-front. I'll try a new transistor tomorrow. No idea how any of my battery testing worked.

John
  Aaron The Ghost of George Stephenson

Location: University of Adelaide SA
Transistor is back to front...
  CLF6 Station Master

Well, that's was all that was wrong. The circuit works correctly with a new transistor in the correct way. A little embarrassing but glad to get a result, thanks for your help guys. Will work on wiring up a loco this week.

John
  apw5910 Deputy Commissioner

Location: Location: Location.
Glad you got it to work. Hate it when I do something like that. But as I used to tell my students, "the engineer who never made a mistake never made anything."

Btw, you may like to read http://www.rason.org/Projects/transwit/transwit.htm about using transistors as switches.
  CLF6 Station Master

Hi guys. Just an update on how I went.

I've successfully modified a couple GT46s, very happy with the result. I completely removed the factory circuit board as there was no easy way I was going to be able to use it with the transistor circuit, mainly due to a lack of space. I am also using very basic 4 function NCE D13SR decoders for all my locos, they're very well priced and I've been quite happy with their performance. I personally don't have much interest in sound, but there is no reason a sound decoder couldn't be used.

What I've done is used two outputs to provide a common ground for each end. When the headlight function is activated (NCE call it F0, I don't know what's normal) the marker lights/number board lights, which are wired directly to the common positive output, light up in the direction the loco is set. This then provides the ground for the head and ditch lights which are powered through the two transistors and can then be switched on independently with outputs 3 and 4. Because F0 is providing the ground for all the lighting at each end, the head and ditch lights will switch directions with the marker lights. As a result they cannot operate without the marker lights being on. For me, that seems ideal as under normal circumstances they would be the first to be switched on. I've provided dropping resistors (2k7) to each pair of lights as the factory board had the resistors.

I've left the red markers out as I think it looks silly to have them operational when the loco is at the head of a train. It would be easy to wire them up, and I could even use one of the original switches to be able to manually turn them on and off independently to the white markers, but for the effort I'd never use them anyway.

The ditch lights are also fixed to one output, so they cannot be programmed to flash. This didn't bother me either, although with a six function decoder it could be possible.



I've also modified a couple AN class. Far easier as the wiring positive and ground wiring to each light is separate and easily accessible, so a six function decoder is all that would be necessary, but I decided to again remove the factory board, and with a single transistor and a D13SR had directional and independent marker, head and ditch lights.

I know it seems unnecessarily complicated, but independent lighting was what I was after and I'm really happy with the outcome, and it wasn't all that difficult in the end, just a bit time consuming. It also would not be very difficult to put back to factory condition, a bit of solder and heat shrink and it should be good as new!

John

Sponsored advertisement

Subscribers: Boss, comtrain, qredge

Display from:   

Quick Reply

We've disabled Quick Reply for this thread as it was last updated more than six months ago.