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
As a professional C and C++ programmer, I'd like to share some feedback on your sketch.
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.
Very cool, thanks for the information, these are great tutorials
You can improve things with a latching push button.
Nice your explanation about set up Arduino !!!! Thank you :-)
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
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
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
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.
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.
Hi,
Is there another relay board we can use as the one you list won't ship to Canada
Thanks for all the good info. A question - at about
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.
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.
Hi anyone can answer me, if it possble to add Position LED on this project... thanks!
I just have an 8 channel relay board can I use that instead of a relay shield?
Very interesting. Can you only throw one turnout? Do you need additional relay boards to control more than one turnout?
Two questions:
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