LED controller for momentary switched modelrailroad turnouts

Since a few months, I (and Christel) became proud members of MAG (Modelrailroad Club Agfa Gevaert). For the current modelrailroad project, they were looking for a way to have “control LEDs” on a synopic board, to indicate the position of the turnouts. Since the turnouts are “momentary switched” with on-off-on tumbleswitches, the solution is a bit more “complicated” then just connecting a few wires/resistors/LEDs. Normally one would solve this with solid-state relays. But when looking at the prices of these relays, and knowing that we have more then 30 turnouts in the fiddle yard, “Selfmade” and “homebrewn” came to mind 🙂 All we needed was a way to turn a “pulse” of the switch in upwards position, into LED 1 that lits up, and LED 2 than turns off, and giving a “pulse” of the switch in the downwards position, into LED 1 turning off, and LED 2 litting up.
Instead of using single pole/single thrown switches, we use double pole/double thrown switches. One pole for the turnout itself, and another pole for the pulses for the LEDs.

I fired up Eagle, and instead of using a bunch of logic IC’s, transistors etc …, I came up with a pretty cheap/simple schematic, controlled by a PIC 16F877A. (which give us some other extra possibilities at no additional cost (just some more programming), like having ALL LEDs lit up for 5 seconds at startup, and putting states of the turnouts into EEPROM, so we have the same state shown on the synoptic board, after power is taken “off” for (a long) period …

Note to myself:
Today was definitely *not* my day !  I milled a PCB mirrored (read unusable), my digital soldering station got broken, my arm got “scratched” (4 hours later, it was still bleeding), and I did take a lot of pictures … WITHOUT THE SD CARD IN THE CAMERA ! (So, I need to redo all pictures, *duh* !) So, this will be the last time that I do such a job on a date with 13 in it 🙂

Click here to download the Eagle / PicBasic / Coliliner file (ZIP) package

This entry was posted in Blog, Electronics, Railroading. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *