Skip to main content

stan2004 posted:

Of the 3 options, I'd go with #2 if you are going to make an OSH Park (or whatever) PCB design.  Circuit #1 is limited by the drive capability of the LM339.  If you are driving more than one signal head in parallel, or if using high-power LEDs (100 mA instead of 20 mA nominal operating current), or even miniature incandescent bulbs then you're out of luck.  Circuit #3 depends on the different in drive voltage for different color LEDs.  This works of course of the Red-Yellow-Green LEDs but what about incandescent bulbs or a PRR style 7-LED signal head which uses all the same color LEDs?

what about PRR

Did you guys actually prototype circuit #2?  I think the "OR" circuit which turns off the Green LED when Red OR Yellow is on is skating on thin ice.

555 high is not full scale

The Yellow and Red LEDs are turned on when one or the other 555 chip is ON (at pin 3 output).  This ON signal does NOT go to the positive supply voltage because there's an output transistor as shown in the 555 internal schematic above.  As the curve shows on the right, the "ON" voltage might be about 1V below the DC+ supply voltage.  Then each Yellow/Red output goes thru a diode which further lowers the voltage.

So this transistor + diode voltage drop now tries to turn off the 2N3906.  While a diode appears to have been added above the 2N3906, it's not clear to me that either the Yellow or Red output generates a high enough voltage to turn OFF the 2N3906.

 

Good point you make Stan, think you nailed it. I was breadboarding this crcuit over the last day or two. While it does seem to work fine, I noticed that when either the red or yellow leds are lit, the green is VERY dimly lit. I did not even notice it until I turned the shop lights mostly off. I think it might be noticeable though if you were running trains in subdued lighting.

Then I tried the 3 x 555 circuit that Rob (Circuitous) has also published. It seems to work quite well, and there is no false triggered green lighting at all. I had to drop the base drive resistor on the green led 3904 to 2.2K to get full ma to the led, but good after that. 

All consiidered though I am leaning towards our relatively simple circuit R5.4 published earlier in this thread. It works quite well, has the option of a voltage reg, can be triggered by an independent opto circuit, and with fewer components the board size is smaller, not to mention less expensive. Just waiting for my board order to arrive so aas to do a test build and make sure all goes as planned. 

Rod

Stan, Today's project is the Circuit #2 you posted a pic of above, that Rod has already tried. The one with 4 transistors.

And FWIW, I tried the circuit with the LM339 and was unable to make it work. I checked and re-checked all my connections and they seemed to be correct. Even tried a couple of things I thought might make a difference and they did not, still didn't work. I don't think it was due to a mistake on my part? I set it aside and am going to check it one more time in a day or two before giving up? 

Rod is ahead of me in trying some of the others. I have to agree with him that the first circuit we came up with (R5.4 posted here) earlier in the thread seems to be the one we are leaning toward. 

I also broke down and got some 7808 & 7809 voltage regulators to add to my 5 & 12 volt versions. I went all out and used a US seller (about 30 cents each, still free shipping). And they are already here! So I can now experiment with those too.   

Also, for anyone else having trouble with the link to Rob Paisley's site, my earlier problem was Chrome and the website being http: instead of https:  Chrome wasn't allowing everything to come through until I told it the site was safe as it wanted the site to be https:  There are settings in Chrome to allow an http: site, but they are apparently turned off by default.

I hadn't run into this previously? Thought I would post in case others had problems. Also, the http: site worked just fine with IE 11, no special settings needed. 

rtr12 posted:

… And FWIW, I tried the circuit with the LM339 and was unable to make it work. I checked and re-checked all my connections and they seemed to be correct. Even tried a couple of things I thought might make a difference and they did not, still didn't work. I don't think it was due to a mistake on my part? I set it aside and am going to check it one more time in a day or two before giving up? 

Perhaps moot now if you've moved on.  But when you say it didn't work, in what way did it not work? 

Did you have the 3-LED signal hooked up to the LM339 outputs?  It's a longshot but the LM339 needs a load hooked up to it for the output voltage to change as intended.  If no LEDs were hooked up and you just used a meter to see if the LM339 outputs changed, you would likely have read 0 or near 0V on all the outputs.  

rtr12 posted:

… I have to agree with him that the first circuit we came up with (R5.4 posted here) earlier in the thread seems to be the one we are leaning toward..

Not my circus, not my monkeys!    But if trying to cover as many bases as possible with one circuit, I'd consider the PRR style signal head as I diagrammed above.  You cannot use the voltage-starving technique depending on the Red-Green LED voltage difference.  Though I think you've seen that the circuit difference is maybe a transistor instead of a diode and a resistor or whatever.  In other words a few pennies to make the circuit independent of color.

Also, have you guys considered 2-aspect signals?  The time-delay and inherent flicker suppression is a nice feature that few (if any?) off-the-shelf 2-aspect signals (e.g., dwarf) have.  I haven't reviewed your circuits to see if this is a no-cost / just a jumper change.

Last edited by stan2004

For the 339 circuit, I didn't have the actual signal connected, but was using individual LEDs, red, yel, grn. as they show in the schematic. I did have the 2.2k resistor feeding all 3 LEDs as in the schematic, but I didn't try any different values there. I did try shuffling a few things around and a couple of different resistor values in the wire feeding the positive side of the 339 inputs. I got differing results which I didn't document, but I will re-try the circuit as shown and report back with more details.

One thing that caused me some confusion was the 'A' (top) comparator of the 339. It's shown with the positive wire going to the negative input, which doesn't match the other two comparators B & C. Then an 'H' has been added to that connection of the A comparator and just the opposite is shown for the other A comparator input? I tried swapping them around  still didn't get the expected operation of the LEDs. 

I think I may have really butchered the above description? The picture of the schematic explains it much better. Not sure I could have done it in 1,000 words either?

I am not all that familiar with the PRR signals and we have not tried anything with those. We started out with just the common cathode version that Rod found on Rob PAisley's website and it kind of went from there. the PRR signals look like an interesting thing to maybe try and accommodate though. I will look at your schematic above some more. 

As for the 2 aspect signals, we haven't talked about those either, but I do actually have some we_honest dwarf signals and it might be nice to be able to operate them from the same circuit/PCB. I guess I was thinking of those as a separate project some day, was probably going to use them for switch position indication, but nothing definite there. I hadn't really considered adapting what ever we end up with here to also operate those. Good thoughts, more to think about!

gunrunnerjohn posted:

Is it time to post the uP solution?

I have the PicKit here in the laboratory! It's still on the need-to-learn list! I keep getting these other projects that start out appearing to be much simpler than they really are that derail me. Then comes that 'feature creep' you mention around here every so often. Not to mention the fuzzy lines... I'm gonna have to live to be 150 to ever have a chance of catching up... Good excuse for longevity? 

If I understand your question about the top "A" LM339 comparator that drives GRN, that comparator operates opposite the YLW and RED comparators.  That is, when RED is high, the RED comparator turns on the RED LED.  When YLW is high, the YLW comparator turns on the YLW LED.  OTOH, GRN operates differently.  When either YLW or RED are high (the "or" being implemented by the two diodes) then GRN is turned OFF (rather than ON).  This is opposite so that's why the top comparator is different in polarity.

As for making it compatible with the PRR-style, it was just a casual comment.  I don't think it is a big demand item amongst the DIY crowd - if for no other reason than I don't think we_honest sells a low-cost PRR signal head!  The center LED is always ON.  Each R,Y,G output drives 3 LEDs when active...two of the three are unique but the center LED is common.   In any case I found this video of a common-anode 7-LED PRR signal with time delay implemented using eBay relay modules. 

Last edited by stan2004
rtr12 posted:
gunrunnerjohn posted:

Is it time to post the uP solution?

I have the PicKit here in the laboratory! It's still on the need-to-learn list! I keep getting these other projects that start out appearing to be much simpler than they really are that derail me. Then comes that 'feature creep' you mention around here every so often. Not to mention the fuzzy lines... I'm gonna have to live to be 150 to ever have a chance of catching up... Good excuse for longevity? 

The one thing about the PIC solution is that you build a board with the PIC processor and some lamp drivers and a sensing circuit.  Then you just fiddle the software to achieve the desired result, you don't have to keep laying out boards to make a change.  You can test changes as fast as you can modify the software.

Stan, Your description of the "A" comparator of the 339 got me on the right track! I re-read the datasheet on the operation of the inputs and with the help of your description, swapped a couple of wires around on the BB and the circuit is now working! Thank you for the explanation, that is exactly where I was getting confused. 

The PRR signal with just a couple of relays is looking nice! I'm sure there is a little more to it, but using only 2 relays looks a bit more appealing than getting all those little jumpers and components in the correct holes going to the correct IC pins on the BBs. But then you don't get all the excitement of trying to get all the little wires in the incorrect holes to the IC pins and related head scratching (maybe excitement isn't exactly the correct word...).

GRJ, I'm working toward that, one of these days! It does sound quite interesting to be able to do what you describe. I got the MPLAB X IDE loaded as well, just haven't gotten around to trying the programming part yet. I also have some of the PIC chips you listed in traffic light  thread, I think it was that one anyway. If memory serves, I think I even found the PIC chips in DipTrace right after I got them.  

Those darn IC circuits keep de-railing me...but pretty good learning experience there too. It's all quite enjoyable to me as well.

stan2004 posted:

Also, have you guys considered 2-aspect signals?  The time-delay and inherent flicker suppression is a nice feature that few (if any?) off-the-shelf 2-aspect signals (e.g., dwarf) have.  I haven't reviewed your circuits to see if this is a no-cost / just a jumper change.

Stan;

Well our simple circuit R5.4 (2 transistors, 2 diodes) version works well as a 2 aspect signal timer also. All you do is replace the R6 270K resistor (yellow release timer) with a 1N4148 diode, and presto. When tripped the signal goes red as it should, then after the prescribed release time it goes straight to green.

Actually there is a split second flicker of yellow, but as long as there is no yellow diode in use, you don’t even notice it. In my testing it made no difference whether an led was attached to the yellow output or not. 

You would not be able to use this circuit to run both 2 and 3 aspect signals together however. There would be a long gap of no light on the 2 aspect head when the yellow is lit on the 3 aspect head.

I plan to document all this in the User Notes.

Rod

Last edited by Rod Stewart

Stan; noted your comment about the PRR style signal head. I actually have the RK 2 track version of this signal on the layout, but it comes with all the timing etc built in of course. I just use two Z-Stuff actuators to sense train presence and trigger it. Looks nice though.

Guess you would have to use maybe the 339 comparator version, or the 3 x 555 version to run one that had just bare leds, and the center led could just be left on full time probably. I'm sure it could be done, but unless there are premade signal heads somewhere that don't have built in timing, there is likely no demand.

Rod

rtr12 posted:
GRJ, I'm working toward that, one of these days! It does sound quite interesting to be able to do what you describe. I got the MPLAB X IDE loaded as well, just haven't gotten around to trying the programming part yet. I also have some of the PIC chips you listed in traffic light  thread, I think it was that one anyway. If memory serves, I think I even found the PIC chips in DipTrace right after I got them.  

 

Those darn IC circuits keep de-railing me...but pretty good learning experience there too. It's all quite enjoyable to me as well.

The skills picked up there are still useful, you still have to add some circuitry around the uP for most tasks.

stan2004 posted:

Did you guys actually prototype circuit #2?  I think the "OR" circuit which turns off the Green LED when Red OR Yellow is on is skating on thin ice.

555 high is not full scale

The Yellow and Red LEDs are turned on when one or the other 555 chip is ON (at pin 3 output).  This ON signal does NOT go to the positive supply voltage because there's an output transistor as shown in the 555 internal schematic above.  As the curve shows on the right, the "ON" voltage might be about 1V below the DC+ supply voltage.  Then each Yellow/Red output goes thru a diode which further lowers the voltage.

So this transistor + diode voltage drop now tries to turn off the 2N3906.  While a diode appears to have been added above the 2N3906, it's not clear to me that either the Yellow or Red output generates a high enough voltage to turn OFF the 2N3906.

 

I am a little behind Rod in trying these. He has this circuit working, but I am having what I believe is the exact problem you describe here with this circuit and it does not work properly for me. We are both using 556s instead of 2 555s, but I am using an NE556 and I think Rod may be using a TS556CN (not exactly sure on the exact part he has?).  I plan to try it with a couple of 555s next. I have 3 different types of those, NE555, LM555 and a TLC555CP. There might even be one other variety around here after I start hunting them down.

As you describe above, the Base voltage on the PNP transistor (circled) is always about 0.6 to 0.8 volts or so below the voltage coming from the DC supply through the diode. Base voltage never quite gets high enough to turn off the green LED when it's supposed to be the the red's or yellow's solo performances. The red and yellow operate, but the green stays on all the time no matter what. 

Rod is using S8050 (3) and S8550 (1) transistors. I have tried those but was mainly using BC547 (3) & BC557 (1), I have a bunch of those and only a few of the others. Also tried a 3906 for the PNP. I don't really think this matters much though? I think it's the shortage of voltage output on pins 3 & 9 of the 556 exactly as you suspected.

You are going to get me converted to those PICs yet!   But, I think I just learned something here too! Rod has this working, it doesn't work here no matter what I do. I didn't think there would be that much difference in the 556s, but now I'm not so sure. At least I am learning about how transistors work, or maybe that should be how they don't work! I happened to remember Stan saying something about one of these circuits, and when I came back to look it just happened to be this one.

The PICs really do have my interests up, but the data sheet on just that one chip you suggested is 436 pages long! I was just looking at the new Atlas signal stuff they are doing and the board they have now looks like it may have a microprocessor on it. Couldn't tell for sure, but maybe could have even been a PIC? And as you have pointed out, there didn't appear to be a whole lot of other stuff on the board, but sounded like it did quite a bit functionally. 

There are a ton of embedded processors, but the PIC is a very popular chip family.  They have literally hundreds of variations, so you can usually find anything you need.

Don't be too daunted by the huge datasheet, you don't need to know most of that stuff to effectively use the chip in this application.  The latest MPLAB X has all sorts of plug-ins that make creating code easier.

My usage of the PIC has just scratched the surface, I used other microprocessors when I was gainfully employed and did a ton of processing with them. 

Rubbing elbows with the analog side is all good, you need to have some background in that to avoid pitfalls, even in digital circuits.

rtr12 posted:
...Also tried a 3906 for the PNP. I don't really think this matters much though? I think it's the shortage of voltage output on pins 3 & 9 of the 556 exactly as you suspected.

Right.  Well, if you're still determined to get circuit 2 working, try the following simple change:

2n3904 inverter

Ditch the 2N3906 and use a 4th 2N3904.  The objective is to turn OFF the Green 2N3904 when either Red or Yellow is high.  In the circuit on the right, the "new" 2N3904 turns "on" when either Red or Yellow is high.  When this 2N3904 turn on, its collector voltage (which drives the Green 2N3904) drops to 0.2V (or less).  This 0.2V (or less) is insufficient to turn  on the Green 2N3904 and hence it turns off.  The relevant datasheet info is the so-called "Collector Saturation Region" which we can get into if you really have nothing better to do with your time but it does get a bit nerdy - I figure you ought to be able to prototype this with actual hardware in a couple minutes which would be more expedient!

2n3904 collector saturation

 

Attachments

Images (2)
  • 2n3904 inverter
  • 2n3904 collector saturation
stan2004 posted:
rtr12 posted:
...Also tried a 3906 for the PNP. I don't really think this matters much though? I think it's the shortage of voltage output on pins 3 & 9 of the 556 exactly as you suspected.

Right.  Well, if you're still determined to get circuit 2 working, try the following simple change:

2n3904 inverter

Ditch the 2N3906 and use a 4th 2N3904.  The objective is to turn OFF the Green 2N3904 when either Red or Yellow is high.  In the circuit on the right, the "new" 2N3904 turns "on" when either Red or Yellow is high.  When this 2N3904 turn on, its collector voltage (which drives the Green 2N3904) drops to 0.2V (or less).  This 0.2V (or less) is insufficient to turn  on the Green 2N3904 and hence it turns off.  The relevant datasheet info is the so-called "Collector Saturation Region" which we can get into if you really have nothing better to do with your time but it does get a bit nerdy - I figure you ought to be able to prototype this with actual hardware in a couple minutes which would be more expedient!

2n3904 collector saturation

 

Well I couldn't stand the suspense so I tried this out after supper. Works like a charm Stan. And now the green led is either on at full current, or completely off. No dim flickering when red or yellow is on, or anything foolish.  So thanks to your help Stan we can now call this variation a win!

Rod

If I could interrupt here for a second?

OK, so I'm following along the best I can. I wish this was in simple English!

Anyways is this going to be made into a kit for purchase? Is there a list of parts I could buy to build my own?

Seems like a simple list but I'd probably get it wrong somewhere. A couple of LM555, resistors, diodes?, 2N3904 x 4? etc.

Notes: I'm running 2 rail and would probably need optical like in Stan's video above? I've read old posts about 2 rail using resistors on wheel sets of rolling stock to trip circuits? I think I'd like to keep it simple and just get something going.

What is that optical sensor you used Stan? or what is meant for the occupancy detector?

I'm modeling the (modern) Northeast area and think maybe I should go with the newest style PTC masts? I see they were installed in our Niagara Falls yard.

I might build my own??

Engineer-Joe posted:

...

Notes: I'm running 2 rail and would probably need optical like in Stan's video above? I've read old posts about 2 rail using resistors on wheel sets of rolling stock to trip circuits? I think I'd like to keep it simple and just get something going.

What is that optical sensor you used Stan? or what is meant for the occupancy detector?

Untitled

The module on the left of the video is just a photoresistor relay for less than $2 (free shipping from Asia).  It has a CdS sensor as used in night-lights and similar widgets that turn on a light or whatever when it gets dark.  It was just to demonstrate how a switch closure (the relay) as an occupancy sensor.  So I put my hand in front of the sensor (which was in some black heat-shrink to give it "tunnel vision") and it gets dark and the relay triggers.  

To your point, to keep it simple you definitely don't want to go with the resistor wheel-sets for 2-rail operation.  These require a current-sensor to detects power beings drawn by the consist in the block.  Obviously the engine is no problem as it is drawing power.  But your rolling stock would need a special wheel-set every so-many cars.

I'd say your best bet is something like an MTH ITAD or Lionel 153IR optical detector.  These are kind of spendy in my opinion ($20-$40).  So if you're willing to do some DIY with IR LEDs and phototransistors, or IR modules from eBay, you can get the cost down to a couple bucks each.  I've shown many ways to do this in previous OGR threads which I can dig up if there's interest.

Attachments

Images (1)
  • Untitled

Stan, I tried these changes this morning and as Rod posted above it worked perfectly, just as I expected it would!  Thank you for the revisions needed to finally get this thing working correctly! As an aside, I think I learned a thing or two as well! Also, I seem to remember the things that cause a fair amount of head scratching much better than the things that just work right away. As Carl Spackler once said "So I got that going for me, which is nice"

As for dessert, both types are a bit crunchy for my tastes. But if given a choice I think I'd prefer the NPNs over the PNPs, they seem to be a little more satisfying. 

Engineer-Joe, I think Stan's video above using the ready made timers & relays would be the easiest and probably even the most reliable. Stan also knows a LOT more than I ever will, so I am sure everything Stan posts will work without a hitch. 

But, if you are ever interested in any of the 3 aspect signal controller boards Rod and I have been experimenting with, I would be happy to help you get going with them. There are also some other circuits from the same source with the same functions that might be a little simpler and would use fewer parts.

I can't design anything from scratch, but I have learned how to cobble together a schematic in Diptrace, get some PCBs made from it, and get some parts, etc. (Diptrace does the heavy lifting, along with the original circuit designer). I would be happy to help others learn to do the same with that part of the process.

These experiments are a lot of fun for me, whether I ever use the circuits or not. I also learn something along the way. It's also extremely nice to have good folks like Stan and GRJ to help when one gets stuck. I'd never make it without them! Probably would have never started experimenting with these things without their help either. 

Engineer-Joe posted:

Thanks Stan. I found that exact listing and there were 5 left, so I bought the 5 for now. Not sure what I need but I thought I'd start. I will search for your posts. I probably saw them back in time and forgot.

They have more. They just show a limited number so you buy them all. 😀

rtr12 posted:

...

But, if you are ever interested in any of the 3 aspect signal controller boards Rod and I have been experimenting with, I would be happy to help you get going with them. There are also some other circuits from the same source with the same functions that might be a little simpler and would use fewer parts.

….

Yeap! I am interested. I have to study the new PTC CSX lights near me in the Niagara Falls yard limits.

Engineer-Joe posted:

If I could interrupt here for a second?

OK, so I'm following along the best I can. I wish this was in simple English!

Anyways is this going to be made into a kit for purchase? Is there a list of parts I could buy to build my own?

Seems like a simple list but I'd probably get it wrong somewhere. A couple of LM555, resistors, diodes?, 2N3904 x 4? etc.

Notes: I'm running 2 rail and would probably need optical like in Stan's video above? I've read old posts about 2 rail using resistors on wheel sets of rolling stock to trip circuits? I think I'd like to keep it simple and just get something going.

What is that optical sensor you used Stan? or what is meant for the occupancy detector?

I'm modeling the (modern) Northeast area and think maybe I should go with the newest style PTC masts? I see they were installed in our Niagara Falls yard.

I might build my own??

Joe, its been a bit of a process getting this to fruition, but we are just about there. The plan is to put the schematic, the board layout, the gerber files, the BOM, and some User Notes here on the forum, very soon now. RTR12 and I are just finalizing the board layout, now that we have a circuit that seems to work well. This is thanks in no small part to Stan2004!

One nice feature of the current design is that it can be activated by any 2-12 volt ac or dc trigger by means of an opto-isolator. So there is no direct connection to the board circuitry. This would lend itself well to the phototransistor that Stan has shown you.

The board itself can be ordered by anyone using the gerber zip file that will be included. Its all thru-hole construction so most anyone with a soldering station can build it. This particular version will be good for signals using common anode wiring. We have no plans to assemble and sell kits so far as I know.

Let me know if you need any more info.

Rod

 

Add Reply

Post

OGR Publishing, Inc., 1310 Eastside Centre Ct, Suite 6, Mountain Home, AR 72653
800-980-OGRR (6477)
www.ogaugerr.com

×
×
×
×
Link copied to your clipboard.
×
×