Model Train Switch Control with an Arduino!

Поділитися
Вставка
  • Опубліковано 31 бер 2019
  • Welcome back everybody! First of all, if you haven't subscribed already, make sure you do to eligible for the 5,000 subscriber contest!
    Today we are controlling a snap switch with an arduino! Snap switches move the switch motor my powering one side or another of a motor and use magnetism to throw the switch.
    Arduino Sketch
    docs.google.com/document/d/1B...
    Here is what you will need
    Arduino UNO
    amzn.to/2FE0vL4
    Arduino Relay Shield
    amzn.to/2JUinH0
    12 volt power supply
    amzn.to/2U6kr3p
    (you will need 2 of these if you don't want to run your arduino off of USB)
    Dupont Wires
    amzn.to/2FFKHHF
    Bread Board
    amzn.to/2YHCefZ
    Button
    amzn.to/2HTfOD8
    Support the channel with some Merchandise!
    teespring.com/shop/diy-digita...
    You can contact me at diyanddigitalrr@gmail.com

КОМЕНТАРІ • 51

  • @jimhyslop
    @jimhyslop 3 роки тому +5

    As a professional C and C++ programmer, I'd like to share some feedback on your sketch.

  • @newsletterman
    @newsletterman 5 років тому

    Looking to try to implement this instead of my Atlas switch machine MOM-off-MOM buttons. I want to include some LED's into the mix to indicate point direction too... Thanks for this tutorial.

  • @JoeG-firehousewhiskey
    @JoeG-firehousewhiskey 5 років тому +1

    Very cool, thanks for the information, these are great tutorials

  • @peterwhiting6303
    @peterwhiting6303 5 років тому +1

    You can improve things with a latching push button.

  • @LZACCARO
    @LZACCARO 5 років тому

    Nice your explanation about set up Arduino !!!! Thank you :-)

  • @nesr8786
    @nesr8786 5 років тому

    Great presentation Jimmy ,i use a Mega so i get more I/O pins ,keep em coming buddy ,Much appreciated ,Take care till next time ...Mac

  • @ariegt
    @ariegt 5 років тому +1

    i do follow the wiring but maybe some people like to see a schematic. Especialy when in future there is more to wire like signalling or when sensors are added. Nothing fancy , the old pen&paper will do fine. Nice vid keep them comming thanks

  • @rinjk3a
    @rinjk3a 5 років тому +1

    Jimmy, you can do that with just one relay. the open close of a relay can change which side of the relay is being sent. So you can have up to 4 switches on one shield. Josh

  • @sebsi23
    @sebsi23 Рік тому

    Apologies in advance for a couple of dumb question from a total newbie...but here goes! My Bachmann turnout comes with a button and a wire to run it from a power supply. When connected, it does exactly what's depicted in this video but without the Arduino. What is this Arduino setup doing differently than my non-Arduino setup? Do some turnouts (such as the one in this video) not include a switch and power hookups? If that's the case, it seems like overkill to use a computer to handle this kind of task. Again, sorry for the dumb questions and thanks for the video.

  • @gamepad3173
    @gamepad3173 2 роки тому

    I've thought about that idea, but I would rather do it automatically like install an IR sensor for when a train (or trains) are coming near and the arduino throws the switch or switches. That way the trains can proceed to the next model country.

  • @oceancity1042
    @oceancity1042 3 роки тому

    Hi,

  • @MrGarthah
    @MrGarthah 4 роки тому

    Is there another relay board we can use as the one you list won't ship to Canada

  • @jmporter34
    @jmporter34 3 роки тому

    Thanks for all the good info. A question - at about

  • @ajsettlemyer3646
    @ajsettlemyer3646 5 років тому +1

    Good morning Jimmy, I enjoyed that video. I'm one for running as much "stuff" on any given Arduino as I can. I used your Track Signaling video to do my own thing and have gotten two sets of signal lights to run in the same sketch on a Nano. One is a two light tower set and the other is a three light tower set.

  • @richthomason4306
    @richthomason4306 5 років тому +1

    I'm planning to use this for my turnouts, but how many turnouts can I hook up to 1 relay shield. I was thinking 2 to 4 turnouts per shield ? Or do i have to buy 1 relay per turnout. As you can tell I'm a beginner at this.

  • @microplumb
    @microplumb 4 роки тому

    Hi anyone can answer me, if it possble to add Position LED on this project... thanks!

  • @andrewclarke406
    @andrewclarke406 3 роки тому

    I just have an 8 channel relay board can I use that instead of a relay shield?

  • @captainchaos3174
    @captainchaos3174 5 років тому +3

    Very interesting. Can you only throw one turnout? Do you need additional relay boards to control more than one turnout?

  • @IndyMAB1964
    @IndyMAB1964 3 роки тому

    Two questions:

  • @TheSwitchList
    @TheSwitchList 5 років тому

    Hi Jimmy. Another enjoyable video. Since any microcontroller, like he ATMega 328 on the Uno, has a limitied amount of program space (and memory space) I optimized your code to get the size down as low as possible (both program space and memory space). I have not tried this yet as I am still at work (don't tell the boss I was watching a DIY & Digital UA-cam video while still on the clock!). The sketch compiles without errors (checked at