My Layout... And it's problems

QuinnM Aug 6, 2018

  1. QuinnM

    QuinnM New Member

    So first off I would just like tp introduce my self... Yes I realize that there is a thread for this but I decided just to combine it into one thread. I am a 14 year old who got into trains when every Christmas my grandpa got a out a basic oval track to put around the Christmas tree. In 2012 We decided that in my basement we would build a larger layout. We built the layout stuck a train on it and hey it worked. But it was just track, we added a few accessories (A small train house with a small led, a culvert loader & an unloader). We made plans to get a few more powered accessories as well as locking into getting scale decorations (trees, gravel, etc.). Before we actually got around to this my grandpa's health started declining and without him to push me forward (I was just barely 10 at the time) The project came to a halt. The room that it was in was a multi-purpose room. It was our network room, Gift wrapping room, as well as my robotics room and so the table the train layout was on got used mainly as a storage table meaning even if I wanted to just go down to run it would have taken an hour just to get stuff cleared off the track, so the train never go used. Fast forward 4 years and I decided that I am going to start working on it again. Now with new knowledge of electronics and how things in general work I have decided that I am going to make my own, Raspberry pi based, control system. I have done most of the grunt work (Cleaning up the room, getting the track into a basic working order, and then completely disassembling the current network of power cables the provide power to the track. Now I'm starting on the fun stuff (and the stuff I need the help of this board to problem-solve) So what I am currently doing is running each section of track it's own power line back to the "control station". I am also running accessory power to each switch so it can be operated regardless of track power. Then once I have everything run back to where it is easily manageable in one location on the track I will start adding in the new component. The idea is that I will have a normal electromechanical relay control board for each switch and possibly a solid state relay for each block of track. (1) This is the first problem I hit: How do I use a relay (or some other piece of hardware) to control the "large" amount of track power with the "small" amount of power from a raspberry pi and still maintain the ability to control the voltage (speed) of the train. The next part is direction and sound. I figured out pretty quickly, confirmed by a quick google search, that direction is changed just by a drop to zero in the voltage and then bringing it back up again. (2) The part I can't figure out is how my current train transformer/controller tells the train to sounds its bell/whistle. There is no voltage fluctuation that I could see use a multimeter and it doesn't have Lionel's tmcc controller on board. (3) The last problem I face is the software I love electrical engineering/playing with the hardware but I only know the basics to coding in any language and defiantly couldn't build the software that I have in mind. I would like something that is open-source and low to no cost. And although I'm not ruling anything out because of this, It would be nice to be able to send inputs ( button presses) to the software and have it respond accordingly so that way I could use a traditional interface combined with some form of computer system. I looked into JMRI but I wasn't sure if it would be able to control the relays from the GPIO pins of the pi (just to clarify the whole software doesn't need to be run from the pi it just needs to be able to accept inputs and transmit them to say a pc based system either way works).

    So just as a short recap or for those who don't prefer reading large blocks of text here are the problems I face:
    (refer to numbers in text for more details)
    1. Using a relay/other hardware to "dim" the tracks voltage (not just ON/OFF)
    2. How to trigger the Bell/Whistle function on train using the above method
    3. Software interface for the whole project
    Attached is a photo of the train layout design for anyone interested. I appreciate any help even if they are just untested ideas as I can always research and if nothing else just try it out.

    Attached Files:

  2. YoHo

    YoHo TrainBoard Supporter

    Hi and welcome, I don't have complete answers for you, but I will say this, you're probably looking at an Arduino project more than a Pi project...Or really a combo of the 2...A brief Google search found a combo project that used the raspberry pi to drive an Arduino to control Lionel switches...separately I saw some discussion on Arduinos driving triacs. Which is what you need to control A.C.. so what I think you may want to do is start with that instructables on switches and when you understand those parts, do the research on Triacs and how to get them working.

    Sent from my SM-T377V using Tapatalk
  3. QuinnM

    QuinnM New Member

    Thanks for the advice. I saw that instructable for the switches as well as I saw a reply on how to use just one relay and I understand that part pretty well. What does the TRIAC do that a relay can't? Relays can control either AC or DC and from what I understand a TRIAC has some leak through voltage.
  4. RailMix

    RailMix TrainBoard Supporter

    Can't say as I can help with your control issues as control wise I'm still stuck in 60's with block toggles and such archaic things. However, I will say congratulations on your interest in robotics, electronics and trains when many people your age are totally glued to their phones and video games. Stay curious, keep doing your research and you will come up with an answer. In the meantime, welcome to trainboard.
    Hardcoaler likes this.
  5. BarstowRick

    BarstowRick TrainBoard Supporter

    Your asking an age old question: How does it work?

    Irregardless of the generation your are currently running with you will learn with and from experience the answers you need. One of the answers is it just does.

    Wish I knew more about the generation of trains you are operating, the transformers you are using and the buttons or activators you are using to blow the whistle or horn. It all sounds like old school Lionel and then you are talking about building your own Raspberry pi. So, if I may ask...what's up?
  6. Hardcoaler

    Hardcoaler TrainBoard Member

    You may well be pioneering the technology with O-Scale, which is kind of neat. I like that you have the railroad properly running old school style, so that it doesn't lay fallow while you experiment. Good luck with your development - it sounds like fun.

    I'm building a control panel in N with toggles, LEDs and capacitive discharge circuits for each turnout and block indicators. It's simple stuff compared to what you're working with. I find my greatest frustration is having to order everything by mail. With each learning or enhancement, I order a small batch of test parts, and then I want to improve something else and that spawns another small order, and on it goes. The shipping charges are killing me. Soon though, I hope to have the components finalized so that I can place a big order and move to completion.
  7. acptulsa

    acptulsa TrainBoard Member

    Hi, Quinn! I'm glad your grandfather got you into his old school trains, and I'm glad you still have an interest in them. They are definitely a cool thing. The center third rail may not be something you see on prototypes, but it makes things possible. For example, your layout has two wye tracks. Like reversing loops, wyes are something that requires special handling of the polarity on two rail electric trains. Like a reversing loop, a wye is not an issue with three rail O, because the two outside rails are the same side of the circuit, and the center rail is always in the center.

    If you'll allow me to start a new paragraph so this doesn't turn into a scary block of text, reversing is indeed accomplished by interrupting power. The E Unit has to be engaged for that to happen; the control switch is generally on the top of steamers and underbelly on diesels. The E Unit is a solenoid with a sort of a bucket loader-type attachment that turns a gearwheel. The gearwheel connects or disconnects the power to the motor through brass brushes or wipers, or whatever you want to call that type of contact. It's tricky to turn the E Unit off in the mode you want. If the E unit switch gets thrown while the locomotive is in reverse, it'll stay in reverse. If you turn it off in neutral, the lights will come on but it won't go. It won't even growl. Setting a computer up to work the E Unit is an iffy proposition at best because the things were never 100% reliable. They are supposed to cycle forward-neutral-reverse-neutral-forward, but sometimes they don't, and sometimes they skip a step--straight from forward to reverse, for example, with no neutral in between. They were designed to be operated by something one hell of a lot smarter than a computer--namely, a human being like you, who can see if the locomotive is doing what he wants it to and can push the button again if it isn't.

    If you want to have a computer control train speed, you need to either install something in the locomotive that will vary the amount of power getting to the motor, or something that will vary the transformer output. If you do the former, you need to modify your classic locomotives. They may or may not have much collector value, and any modification will affect what collector value they may have. Since you don't code, you'll have to buy all of that, and it'll have to be specially designed for Lionel's AC power and their hefty amperage. The locomotive controls probably replace the original E Unit, but I don't know that for certain. To do the latter could involve some kind of robotic arm physically moving the transformer's control lever. The advantage there is your grandfather's stuff could serve with few or no modifications.

    The bell and whistle controls do not affect the total amount of power in the tracks. They are specially designed not to, so using them will not slow the train. They overlay enough DC power to operate a relay, and use a diode to reduce either the positive (bell) or negative (whistle) nodes of the AC current. Since you don't code, again the easiest way may be a robotic arm to operate a vintage controller.

    What do you want a computer to do for you? You don't need one to reverse polarity so the train can go different directions. If your switches are Lionel remote control units, you don't need a computer to send the train over different parts of the layout. Those switches can be wired together so when one operates, another operates too. This is another advantage to the three rail system. One rail on each of the two legs of the switch is insulated from the rest of the track (you'll need to use a vintage fiber pin or a modern plastic pin when attaching track to it to keep it insulated). When a train approaches the switch and the switch is not properly aligned, these switches operate automatically. When that switch which is operating automatically, triggered by the approach of the train, is wired to another switch, they both operate. The rest of us pay through the nose and go to a lot of trouble to install optical detectors and wire in computers large or small to get that, and here's Lionel doing it with 1940s technology. With that, you can skip the darned fool computer and get a lot of interesting action just by rolling the train. With the layout in your OP, the train could go around one loop, then the other loop, doing the right hand loop clockwise then counterclockwise, and doing the left hand loop clockwise twice and counterclockwise twice, without you lifting a finger. The train will go around most or all of each loop four times before the pattern repeats. No computer is required to do that.

    You've been busy thinking of ways to teach Grandpop's trains new tricks. But you should stop to consider the old tricks Grandpop's trains have been able to learn for sixty years!

    I strongly believe in wiring each pair of those switches together through a double pole, single throw switch (or, if you can find one, wire both pairs through a four pole, single throw switch). That way, if you want normal operation where you are in complete control, you just turn those switches off and you have it.

    Hope this helps!
    Last edited: Aug 13, 2018 at 1:18 AM

Share This Page