Skip to main content

This is my first posting in this forum.  So here goes.

I have been working on a signal system for any scale/gauge model railroad.  It had to be totally isolated from running power, whether that be AC or DC.  Operated on low voltage, TTL IC's and all LED's in heads.  It had to have the capability of being interfaced with computer control.  It had to be interlock, fully automatic or CTC or both.  Rail crossing protection.  As ABS, It had to have a minimum of mechanical operations.  Inexpensive, with a minimum of components.  To meet this last requirement, I had to get away from the thinking in a box attitude. 

I have met all the above requirements.  The only mechanical operation involved is, a relay on the turnout signal boards.  That could be done with a solid state relay, rather than a mechanical relay.   Here is the out of the box thinking I mentioned above.  It uses NEGATIVE LOGIC instead of POSITIVE LOGIC. Not the industry standard.  Going this direction, means there are no dropping resistors or driving transistors required.  It also means that the led's in the system are all common anode.   With NEGATIVE LOGIC, everything is reversed!  Driven by -5VDC rather than by +5VDC.

If CTC is added, there will be inexpensive (1N4148) small signal diodes involved.

If there are any questions, please do no hesitate to ask.  I do not quarantee that this system will work for you.  I have designed it, built it, burned it in on the test bench.  I have been building electronics projects for 35 years.  I have an AAS in electronics, but I use it strictly for my hobby, for practical design and application.   I try not to get too geeky with it.

I will explain how it all works, some of you may understand, some not.  But that's okay.  I am trying to direct this tutorial to those with no electronics knowledge and those with.  If you fall into the first group, I will be showing, step by step how to build this.

Anyone with electronics experience, please feel free to critique.  I do not have a teaching degree.  Nothing or anyone, is perfect! 

First thing,"DO NOT TRY TO SUBSTITUTE WITH CMOS!"   That is, a whole 'nother' animal.

Each signal head is driven by one 74LS00 Nand IC, also known as:   A Quad two input positive NAND gate.  As you can see in the pinout diagrams.   I drive the system with a 5VDC, 4 amp supply.  This will drive a whole lotta IC's and LED's.  Lotta is a technical term... .     All my pinouts are from elektropage,  unless otherwise noted.

7400-a

7400

Turnouts, use two IC's  74LS08 and a 74LS32.  The 7408 is also known as:  A Quad two input positive AND gate

7408

The 74LS32 is also know as:  A Quad two input positive OR gate

7432

Crossing logic uses three 7432 IC's

Yes, they all  have the same in/out pin diagrams.  It's the internals that count.  I will try to find some internal diagrams and put them up here for your purusal.

Here is my breadboard test for four Eastbound blocks.    The long yellow wires coming from the bottom are the wires that would be coming from the individual block detectors.  They are connected at -5VDC.  They drive Ri for both the east and westbound signals on one/each block.   I am just manually connecting and disconnecting them here.

4319

Green board!

4320

Block 1 is occupied.  red, green, green, green

4321

Block 1 and 2 occupied.  red, red, green, green.

4322

Block 2 occupied.  1 unoccupied.  Yes, the LED's are bright in my camera.  yellow, red, green, green.

4323

Block 1 unoccupied.  2 and 3 occupied.  yellow, red, red, green.

4324

Block 3 occupied.  1 and 2 unoccupied.  green, yellow, red, green.

4325

Block 3 and 4 occupied. 1 and 2 unoccupied.  green, yellow, red, red.

4326

Block 1,2 and 3 unoccupied. Block 4 occupied.  green, green, yellow, red.

4327

Blocks 1, 2, 3 and 4 unoccupied.  The next Eastbound would be red.  green, green, green, yellow.

4328

Back to no blocks occupied.

4329

This system will work with any detector, as long as the signal system is completely isolated from the detector circuit.  This is done by various means which I will get into later.

Well, that's it for now.  Gotta go to work.  Gimmie your thoughts or questions on this.

Dave

Seattle

Edit:  I just redid the pics.  Hope they are showing up now.

Attachments

Images (15)
  • 7400
  • 7400-a
  • 7408
  • 7432
  • 4319
  • 4320
  • 4321
  • 4322
  • 4323
  • 4324
  • 4325
  • 4326
  • 4327
  • 4328
  • 4329
Last edited by Dacs
Original Post

Replies sorted oldest to newest

Most who work with logic, 1 is true...0 is false. I am using 1 is false, 0 is true. I am just trying to keep this as simple as possible, without getting into the algebra.

Ok, saying not industry standard was a little off, it really doesn't matter though.

Saying negative logic is the same as positive logic, only different...

Again, I am trying to keep this under the k.i.s.s. Theorem. Many who will read this, dont need all that to make the system work.

Dave

Seattle

Last edited by Dacs

Each module  monitors  4 blocks ?    How are extra modules connected to each other? What do we do with our existing MTH signals? can they be used .  We  have a number of MTH signal hooked up but right now they're just switch indicators at  controlled locations. 

Do you have an opinion on track occupancy devices without using one of the outside rails  for relays.

I think a real schematic with annotation would be really useful to see what you're doing.  What I see would be from very difficult to impossible to follow and duplicate.  I also don't understand why the emphasis on total isolation.  You mention computer control, but for what purpose, you didn't show anything that suggests where the computer comes into the picture?

Dacs posted:

Most who work with logic, 1 is true...0 is false. I am using 1 is false, 0 is true. I am just trying to keep this as simple as possible, without getting into the algebra.

....

that may be true for philosophy, and i see now you are talking about truth tables and not the physical gates, but i still think most engineers think of a 0 (ground) output is still the most common "on" state as it will sink current at the output using a standard open collector gate.

continue, please.  schematic?

 

The schematics and interconnections are coming, I just ran out of time.

The reason I mention computer interface is because a lot of model railroaders, are using computers to run their railroads. Personally, I prefer hands on. A computer is not required for the system to work.

The above represents 4 individual, east bound blocks. There is only one ic for each signal head. This will become more clear once you are able to see the schematics.

isolation is to separate it from all track power. AC or DC. Isolation also keeps troubleshooting a lot easier.

Today was an introduction of sorts.

Dave

Last edited by Dacs
Dacs posted:
...It uses NEGATIVE LOGIC instead of POSITIVE LOGIC. Not the industry standard.  Going this direction, means there are no dropping resistors or driving transistors required.

Given your explanation of negative logic, please explain you don't need current limiting resistors.

Dacs posted:
I am trying to direct this turorial to those with no electronics knowledge and those with.  If you fall into the first group, I will be showing, step by step how to build this.

Will you be fabricating printed wire boards?  I count over 2 dozen connection (solder joints) per signal head.  That's quite an assembly task for the average OGR reader with "no electronics knowledge".   I'd solicit feedback from OGR readers who might actually undertake this effort so that the tutorial is put to good use.

Dacs posted:
First thing,"DO NOT TRY TO SUBSTITUTE WITH CMOS!"   That is, a whole 'nother' animal.

HC, HCT can also be used. 

But HC and HCT are CMOS.  Do you mean 4000-series CMOS?

Do I understand it that you are powering the 5V digital chips with 0V and -5VDC...with 0V being relative to the "outer-rail" in  O-gauge?  I initially thought operating at -5VDC was what you meant by "negative logic."  Please explain the use of -5VDC.

And this is just my opinion, but I don't think any practicing engineer would use the 74LS logic chips for a NEW design.  The cost and performance of CMOS logic chips (vs. LS-TTL) makes for a compelling case. 

I said in my opening for this...no dropping resistors or driving transistors are required. It is not driven by negative voltage. It is negative logic. Input is 5v. Ground. -5vdc.

I was trying to stay away from the whyfore and where of. It isn't required to know any of it to build it.

PC boards can be made. But small experimenters perfboards can be used.

I am strictly a hobbyist. Not practicing.

If you think this thread is more than ogr readers want, or can do, it is not my intention to overwhelm. We sometimes lose sight that because its easy for us or him or her or...that it would be easy for all. Am I perhaps doing this?

I am not a teacher by any stretch of the imagination. The last thing I would want to be guilty of, is have anyone throw up their hands in frustration and give up.

I was trying to keep it simple.

Dave

Last edited by Dacs
Dacs posted:

I said in my opening for this...no dropping resistors or driving transistors are required.

You suggest it is because you are using "negative logic" that you consequently don't need resistors (presumably for driving the LEDs).  I'm simply asking you to explain this.
 
There is a wide skill/knowledge range in these matters on OGR.  I think with some forethought you can write your project up in a way that suits different levels.  It has little to do with whether you're a trained teacher; as I see it it's just knowing your audience.

If you want to make this easy for a novice, consider a PCB layout.  You can use the free version of DipTrace PCB and offer inexpensive circuit boards.  If you stick to all thru-hole components, you can do a PCB that many inexperienced folks could assemble.  You can get about 15 sq/in of PCB made with silkscreen and solder mask both sides for $36.

No offense, but if I were going to go to all that trouble, I'd consider an Arduino or PIC processor and have much more flexibility in the operation.  A 20-pin PIC processor is a couple of bucks, and you can make the light sing and dance if you want to.  The Arduino Nano clones are only a couple of bucks, they make a nice platform for stuff like this as well.

First off, I want to thank you for being a good editor.  The statement above: "HC/HCT can also be used,"  was an error on my part.

It was supposed to be typed as: "HC/HCT can't be used."  The reason I suppose was because I was looking at the pin outs and did it without realizing the error.  Or some excuse or another other.  Being 70 does have some disadvantages.  I edited it out.   That is why I welcome critique.  I used to believe I was infallible...that was before I lost my hair, eyesight, hearing, six pack abs.

Here is a schematic of the circuit showing the gates and another showing the LED's.  Knowing the gates and how they work is not necessary to build this.  The pin numbers are what is important.  I have numbered the connections, showing what goes where.  Pardon the crude drawings.

4331

1..Ground (-5VDC)

2..Ye (Yellow enable)  This comes from the next signal.  When it is red, it will drive the following signal yellow.

3..Yo (Yellow out) This goes to the preceding signal.  It drives the last signal yellow.

4..Re (Red enable) This comes from the detector.  It drives an east and westbound signal at either end of the block.

5..Rc (Red cathode)

6..Cc (Common anode)

7..Gc (Green cathode)

8..Yc (Yellow cathode)

9..+5VDC

This is, of course, the way the LED's are connected to the signal board.  From the signal to the board, there are just four wires.

4332

As I do not have my pc boards yet, I am going to build some of these on perfboard.   I always use dip sockets.  This is something you do not have to do.  I do it because it keeps the heat from the pins on the IC's.  They are hardy things, but they have limits on tolerating high heat.-  I do actually, not even have the IC's in the sockets when I start soldering.  I am showing this pic for the chip orientation.  Pin 1 is always on the left top of the IC, next to the indentation you see in the center top of the chip.  Keep this oriented to the top of your board. 

Again, I am not responsible of the operation or non-operation of these circuits if you choose to build.  I do this strictly as a hobby and not in any way professionally.  Though these circuits are functional as are, they can be adapted for use by others.  If you are new to this, you can find data sheets online or ask the manufacturer.  This can save you time and possible damage to components.

 

4333

4334

Chips removed and boards separated.

4335

The first connection on the board, is to jumper from pin 1, to pin 2.

4336

Next.  Pin 3 to pin 4

4337

Pin 9 to pin 10

4338

Pin 7 to pin 9/10

4339

Pin 6 to pin 12

4340

Pin 5 to pin 13

4341

That's it for the onboard connections.  All else is off board.  Again, PCB's will make this so much easier.

PIC_4673

I made the small PCB's to mount the LED's.  They are 1/4" x 3/4".  The LED's are mounted with a 1/4" center to center distance.  This works out to 12 scale inches.  I got all 30 of my boards from a single piece of 4" x 6" one sided PCB material.  Mount the LED's with the anodes to the left front side of the board.  They can be attached to the board face with just a drop of CA.   Or you can make a jig.  Then flip them over and solder all into place.  Snip the leads and voila'!

PIC_4400

To make the boards, I used dry transfer sheets and etch resist ink.  These can be purchased but I just use a sharpie permanent marker, with a fine point. 

 

PIC_4520

PIC_4521

Here is one of the boards before etching.

4354

Once I have all the boards done, I drop into the ferric chloride and etch.

Here is a test sample of three boards.  Little rough around the edges, but they work fine.

PIC_4330

So far the cost is:

74LS00...   .18

Socket...    .26

Perfboard... .75  (mass produced PCB's would cut this a little, but not much.  The time savings would be a lot greater)

LED's...      .06 each

wire...       .05 maybe

Paid $3.65 for it.  That is less than .10 each.  The reason I made my boards instead of using perfboard, is because the spacing cannot be made correct between the led's with perfboard.

total for one signal control board/LED's so far.  Roughly $1.40

Gotta run, Will pick this up later with the diagrams of how all this is interconnected.  Will also be showing the turnout control boards at a later time.

Dave

Attachments

Images (18)
  • 4331
  • 4332
  • 4334
  • 4333
  • 4335
  • 4336
  • 4337
  • 4338
  • 4339
  • 4340
  • 4341
  • PIC_4673
  • PIC_4400
  • 4332
  • PIC_4520
  • PIC_4521
  • PIC_4330
  • 4354
Dacs posted:

I said in my opening for this...no dropping resistors or driving transistors are required. It is not driven by negative voltage. It is negative logic. Input is 5v. Ground. -5vdc.

I'm still trying to clarify your use of the "-5VDC" which you use more than once.  Is -5VDC the same potential as "Ground"?  It's a bit confusing to me as depending on which post, one might conclude there are 3 potentials (voltages) involved, that is +5VDC, 0V (aka Ground), -5VDC.  I'm pretty sure this is not the case - and you just have +5VDC and Ground?

gunrunnerjohn posted:

How does this eliminate the need for current limiting to the LED indicators?  I'm missing something...

Well, now that he has clarified that you can't use HC or HCT logic, I'm thinking he is "using" the internal ~100 ohm hi-side resistor in TTL totem-pole outputs.  Now we're getting into the geeky stuff.   I would not recommend this for an engineered-design, but for a hobbyist application who am I to say!  Additionally, given the amount of assembly/wiring effort, the addition of a 1 cent resistor seems a small price to pay to increase options such as adjusting brightness, choice of logic chips including the use of CMOS technology, and so on. 

I still don't understand his claim that is it the use of "negative logic" that eliminates the need for the current limiting resistor...but I clearly need to let that go.

Last edited by stan2004

I have apparently left the impression that i am using a dual regulated +5vdc ground -5vdc power supply. This is not the case. A +/ground regulated 5vdc supply is used.

perhaps I should leave this alone. All I was trying to do was to show how to build a simple,inexpensive signal system. I was attempting to do it in a brick by brick fashion, one at a time. One brick after another and you get a structure. All the headwork was done and is not required to build this.

I will be happy to just continue using this on my layout. Day after trouble free day. Enjoying it immensely, as the trains travel down the track. Watching the greens turn to red, then to yellow. The interlockings working fully auto or ctc if I so desire. All trains operating as they should.

I wanted to keep this simple! So anyone could do it. Like laying sectional track! Things are best when kept simple.

Dave

Last edited by Dacs

A 74LSxx output swings between about .25 and 3.5V. Looks like he is working  the LEDs against an output forced high, rather than either power rail, so the LED voltage is only about 3 volts or so. The rated output current of the 74LSxx is very low, so there is probably some incidental current limiting taking place.

gunrunnerjohn posted:

You get possibly 3V at .4ma with a high output or 8ma with a low output.  However, running the chip that way isn't the best idea I've ever seen.  Sorry to say I don't think this is a very well thought out design.  You could end up with less than necessary to light the LED.

I saw that .4 mA spec too, but I am not sure whether that is a hard current limit or a design maximum to keep the HIGH output voltage in spec. I"ll breadboard it in the morning to see what happens.

Hello Dave, Welcome aboard.  

Being busy in life, I've missed this topic over the last couple of days.  I'm also curious about using the logic gates to drive LED's, as this seems an unnecessary step that just makes things confusing.  

Over all, I think you have an interesting setup that is likely to work just fine, and it is probably a really great way to handle block signals even 10 years ago, however with the advent of very low cost micro controllers on the market these days, it seems like an awful lot of unnecessary work.  Going the microcontroler route you're looking at about $2.25 for an easy to use Arduino Nano clone board which you need only one of, no matter the size of the layout.  ( Within reason, lets say 100 signal heads, I'd have to do my homework to find the real limit, but it is some stupid high number.)  In addition you'll need a 74595 ($0.10 apx.), or similar, shift register, Lets say you need one for every 2 signal heads.  You also need something like a 74165 ($0.25 apx.)  shift register on the input side... if you have a large number of blocks.  You'll nee one of these 74165's for every 8 blocks.  You've also got a resistor to limit current on the LED's, but if you want to go cheap here, you can, and just use one resistor on the common side of all 3 LEDs, as only one will be on at a time.  

Over all you're looking at a one time investment of $2.25 for the micro-controller and say, 5 bucks for a solder-less breadboard and wire.  Then about a quarter per signal head. I'm assuming all other costs to be the same for power supply and whatever detecting method you use.  

As another note, it seems a lot more thought was put into isolation than is really needed here.  If your circuit is capable of driving LEDs, it can equally well drive opto-isolators that do the job of decoupling logic from track power quite well, and are very inexpensive these days.  With the Arduino method you can also connect to a computer directly over USB with no additional parts needed.    

JGL

OK, just for the "science project" of it, I ran a few tests on a 74LS10.

My supply was a little high, about 5.11 VDC.

Available short-circuit current from a HIGH output to ground, no external resistor, was about 20 mA.

With a generic 5mm red LED between a HIGH and a LOW output, LED current was about 9 mA. LOW output was about .35 V, HIGH output was about 2.3V for an LED voltage of about 2. It appears that this method will indeed provide a reasonable current to the LED, but the HIGH output falls below levels usable for logic purposes, and this does not appear to be a documented mode of operation for the IC.

FWIW, in a separate test, I was able to get a readily discernible glow from the LED down to around 20 uA. 

Sounds about right.  If you look at the output-current curves for the LS-TTL family:

ls hc output curves

For 9 mA, the HIGH voltage would be about 3V and LOW voltage about 0.25V.  That nets about 2.75V across the LED which is a bit higher than what you measured but then again you got a short-circuit current (to GROUND) of "only" 20mA.  And the datasheet suggests a rather large short-circuit range of 20 to 100mA.

blobid0

Attachments

Images (2)
  • blobid0
  • ls hc output curves

Yup-

If you re-construct the line on the "high" curve to intersect 0 volts at the 20 mA point, per my short-circuit test, it agrees with my measurements almost exactly.

Just to talk worst likely case, let's say you had a device with the 100 mA short circuit capability, looks like you would hit almost exactly 20 mA at 2.3V across the LED. So that would give .02 x 2.7 =  54mW per gate, 216 mW per package. Doesn't sound too bad to me.

Last edited by PLCProf

While eliminating current-limiting resistors seems novel, I don't see the advantage in this situation.  Given the amount of wiring involved and the cost of resistors (1 penny), replacing a wire with a resistor brings several benefits.  For example with the proposed method, the current flowing thru Red, Yellow, and Green will NOT be the same due to the different voltage-current characteristics...and be somewhat unpredictable as discussed above.  For a hobbyist application it could be a so-what who-cares situation in which case so be it.  But speaking for myself I'd want my signal lights to have roughly the same brightness for each color without having to depend on the luck-of-the-draw in matching 3 different LED brightnesses.

Also a pet peeve of mine is the color of many lower cost red and green LEDs.  Just as there's been much discussion on the color of "warm" vs. "cold" white LEDs in passenger cars, deep Red and deep Green LEDs are more appealing to me for signals.  The LED color in the OP's pictures come out (on my screen anyway) as being more "pinkish" for Red and "lime" for Green.  Deep (the wavelength parameter) Red and Green LEDs tend to be more costly but IMO more appealing and possibly more prototypical too - but may have slightly different voltage-current requirements which is another reason why I'd want the ability to tune the LED currents.

Bottom line.  Since this is a "new" design, I'd go with more readily available CMOS logic chips and cough up the few extra pennies for resistors.

No argument. Just pointing out that the OP's scheme appears functional at a basic level.

To your point on LEDs, my 74LS stuff was in the "prehistoric" department, along with some similarly aged LEDs and displays. I was astonished at how much more light output per mA new LEDs provide than some of the ones from the 1970s. And, the colors are indeed different.

 

Stan,

I also like the deeper colored LEDs. I have noticed the off colors with some I have, some are even from the same place and came from the same package or were same part number (like from Radio Shack). I don't suppose you would happen to have a source for the good, deeply colored ones? Or how to tell you are getting the deeply colored ones when ordering?

Look for the optical wavelength in nm (nanometers) - often specified as dominant or peak wavelength.  DigiKey, Mouser, etc. will have this spec for every LED they carry.  Hit or miss with eBay; I've ordered some that specified wavelength and received the wrong color (of course always erroring toward the "cheaper" color).  Anyway, deep Red is ~660 nm, deep Green is ~523 nm.  The market is flooded with so-called High-Efficiency Red at ~635 nm and Green at ~567 nm; these indeed generate more lumens per Watt so are "brighter" but not what I like in terms of color.  So as a rule of thumb, given a choice, look for the higher wavelength for Red, look for the lower wavelength for Green.

I've never looked it up but I've got to believe there are standards, maybe not FRS but surely for street traffic signals that specify wavelengths of the Red, Yellow, Green....particularly now that traffic signals are converting to LEDs.

Dacs posted:

I will be happy to just continue using this on my layout. Day after trouble free day.

Since this is apparently all hooked up and operating, several of the guys have asked exactly how you're doing block-occupancy detection.  And in your original post you stated this works with "any scale/gauge."  I too would like to understand what you've come up with for O-gauge 3-rail (presumably isolated outer-rail)...as well as for 2-rail, DC, etc..

 

Stan,

Once again, thanks for the info about the LEDs. I saved it all and I'll be getting some to try out. I don't know much about the wavelengths, but the differences between the good and bad ones seems small (not a large range). Must be a little goes a long way thing? Anyway I appreciate the information you always provide when someone asks (especially me ).

Dacs,

I am still interested in your project and seeing schematics and also knowing how you are doing block occupancy detection. I am pretty much a novice and I like to try to learn all I can about electronics and their uses with our trains. I don't know a lot about the workings of all this stuff (although some of it is finally starting to stick, I think), but I can follow some schematics and I do enjoy experimenting and trying to learn more about it all.

rtr12 posted:
 I don't know much about the wavelengths, but the differences between the good and bad ones seems small (not a large range). Must be a little goes a long way thing?

I don't know if that's a rhetorical question but perhaps this sheds some additional light on the matter...

daylight-high-cri

If you look at the color and move a few tens of nm, it does not seem like much change.  But as I did above, if isolating a chunk of the color, the difference between the deep red/green combo compared to the so-called "high-efficiency" red/green combo becomes more apparent.  Also, the technology of today's LEDs is such that it takes a higher voltage to generate the shorter wavelengths.  So that's why green LEDs run closer to 3V while red LEDs run closer to 2V.  And white LEDs which generally use underlying blue light are just over 3V (going left on the chart)...and the invisible Infra-Red LEDs used in block detectors run closer to 1V (going right and off the chart).

Getting back on point, this is why I suggest provisioning for current adjustment resistors if using this signal logic scheme.  With voltage variations based on color, variations in voltage-current performance between manufacturers (both in the logic gates and LEDs), resistors allow you to balance these factors at negligible added cost.

Also, while we wait for the OP to provide details on his occupancy detection hookup, I suggest that a "no resistor" approach on the input side of the logic gates needs thought.  A few pennies on resistors is money well spent when connecting sensitive digital electronics between power systems (i.e., between AC track power and a separate 5V DC logic supply).   And not just a resistor, but adding a capacitor on the input side can eliminate chatter so you don't get that brief flickering on the signal LEDs as a consist enters/leaves a block when only a few axles intermittently bridge the outer-rails.

Attachments

Images (1)
  • daylight-high-cri

I only meant the change in number values (wavelength) seemed small for the difference in colors. The chart and your further explanation here has cleared it all up and it makes sense now. I also get the voltage differences too, thanks to your further explanation on that as well. I knew the LED voltages (specs) were slightly different, but had no idea why. I can see where the resistor values could be useful, never realized it would make much of a difference. Thanks again for the explanation.

Add Reply

Post

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

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