Тёмный

Routing Control for Your Model Railroad Layout with Arduino 

Подписаться
Просмотров 26 тыс.
% 725

In this video I will demonstrate a process for routing control for your model railroad layout with Arduino. I needed a means to throw multiple switches to set routes through a hidden staging yard. I built a system for this using an Arduino Uno and a relay board. Let me show you how I did it.
✅ Want to get more RTNT? Consider becoming a channel member. Click the “Join” button or use this link to learn more: ru-vid.com/show-UCDIjWTVFM8adgHWDPwjrY0Qjoin
✅ Visit our sponsor, Midwest Model Railroad: www.midwestmodelrr.com
17331 E US Highway 40, Suite 107
Independence, MO 64055
(816) 399-5226
🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽
✅ RTNT Amazon Page: www.amazon.com/shop/ronstrainsnthings
✅ Amazon Pick of the Week: Arduino: amzn.to/3UdJRqS
8 Relay Board: amzn.to/3eRFf9H
(NOTE: The above are Amazon affiliate links: I make a small commission from any purchased made through these links.)
✅ Save 10% on all regularly priced items from Micro-Mark: The Small Tool Specialists. Use promo code RTRAINS upon checkout. www.micromark.com/
(NOTE: The above link is an affiliate link. I receive a commission from all purchases made through this link. Exclusions: This offer cannot be combined with any other offers, not applicable to Pre-Orders, Digitrax, SoundTraxx, or 3D items, applicable to merchandise price only, shipping and handling fees not included, gift cards, or eGift certificates.)
✅ Find fantastic foam cutting tools and adhesives from Hot Wire Foam Factory at: hotwirefoamfactory.com/home.php?bid=4&partner=35706
(NOTE: The above link is an affiliate link. I make a small commission from any purchases made through this link.)
✅ Get RTNT merch at the RTNT Company Store: teespring.com/stores/rtnt-company-store
🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽
Contents:
0:00 Intro
1:40 Components
2:10 Concept
3:15 Wiring
13:07 Arduino Sketch
18:55 Demonstration
🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽
🔸 Contact me via email: ronstrainsnthings@gmail.com
🔸 Join the Ron's Railfans community on Facebook: groups/ronsrailfans
🔸 Follow on Instagram: RTRAINS
🔸 For more about my layout, the Texas Colorado & Western Railway, check out TCWRy
🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽🔽
Credits:
🤘 Theme Song: "Extremes" by the Lemming Shepherds
Exzel Music Publishing (freemusicpublicdomain.com)
Licensed under Creative Commons: By Attribution 3.0
creativecommons.org/licenses/by/3.0/

Хобби

Опубликовано:

 

20 сен 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 66   
@RonsTrainsNThings
@RonsTrainsNThings Год назад
See the entire project of building and controlling this staging yard here: tinyurl.com/yc62dc88
@JumbleLane
@JumbleLane 4 месяца назад
Hi Ron, I appreciate that it has been a year since making this video. However, have you considered making the relay boards yourself. There is more than one reason why I suggest this. Firstly, your schematic while correct works ok, if a relay does not switch there is a situation where there would be a short. Your system relies on BOTH relays for each pair to operate together. If you replaced the relays for DPDT you would have one relay switching two lines and also you would only use half the relays. The common terminal of each pole would connect to + & - respectively and the motor to the NC of each pole. You would connect NC of one pole to the NO of the other pole on both poles. This way of doing things would also eliminate any problems in mis-coding an output and not firing both relays at the same time. Regards, Geoff.
@IMRROcom
@IMRROcom Год назад
I'm fully enjoying your time back with us and your latest project.
@MrDksmall
@MrDksmall Год назад
Your use of the term “normally on” could be confusing to some. The relay contacts are “normally open” (NO) and “normally closed” (NC). Normally open is not the same as normally on.
@jeffharbin3221
@jeffharbin3221 Год назад
Really enjoyed your video describing relay controls. I am an electronic repairman working for the local steel mill now for 31 years. Your hard work describing how relay control and wiring them to match the design was amazingly simple to follow. Most instructional material start with the blue print side of the whole picture and move into the actual wiring content later. I was really amazed how clear you kept your message to us the viewer and not confuse yourself ! Outstanding job sir ! Looking forward to more of your videos
@RonsTrainsNThings
@RonsTrainsNThings 4 месяца назад
Thank you. That is a real compliment since I am NO electronics expert and have to seriously think through the process myself.
@modelmantstewart1292
@modelmantstewart1292 Год назад
Hey Ron your right it's about as clear as mud it's amazing to me how much you go through now day to run a train layouts great video and thank you for sharing
@TTownTrainFan
@TTownTrainFan 9 месяцев назад
Great to meet you in person at the Texas Express Ron! This was a very informative video - I am working on EXACTLY this (lining routes into my staging and classification yards via direct Arduino control rather than sending DCC commands). SUBBED! 🙂
@RonsTrainsNThings
@RonsTrainsNThings 9 месяцев назад
Yes, was good to meet you too. I need to get down and operate on your layout sometime.
@gvet47
@gvet47 Год назад
I have used the Arduino to control multiple servos. Actually seen a 3D printed mounting to use a servo for throwing rail switches that looked to be a cheap alternative. That relay bank looks like a solution to controlling my small metal mill.
@RonsTrainsNThings
@RonsTrainsNThings Год назад
I designed such a bracket, which will be the subject of a future video.
@tomt9543
@tomt9543 4 месяца назад
Great video! Massive amount of info to convey here. Always enjoy your vids, and this one is no different, but I was out when the sketch thing appeared! Too much for this 64 yo brain to follow! But it will be massively helpful to many modelers! Keep up the great work!
@westwonic
@westwonic Год назад
I bought an arduino starter set over a year ago for exactly this purpose, but have not had time to start. I am familiar with wiring of relays as my turnout frogs are controlled that way. Great to see your method, and I would really appreciate a look at your sketch. Thanks from the UK, and well done, a really good presentation.
@alessandrovignato7772
@alessandrovignato7772 Год назад
Hi Ron, just a suggestion: by wiring the relays as you did, short circuits can happen. For example, if R1 is on and R2 off the green wire will be connected to both red and black, and blue will short circuit aswell. This can be dangerous and can happen if, for example, you make a small coding mistake. I suggest you to rewire the relays, so that every relay controls the polarity of one wire. It is really easy to do: connect black and red to the outer connectors (NC and NO) and keep the green wire in the middle. This way, the green wire can either be connected to the black or blue one but not both at the same time. Then use the next relay to do the same for the blue wire. In the end it will look like this: red/green/black and red/blue/black. This way no short circuit can happen and I think it is much safer. If there is any error in the coding, both switch leads will have the same polarization and nothing will happen. It is much safer! Cheers
@peterwhiting6303
@peterwhiting6303 Год назад
He's correct. Infact, your code shorts out the signals every time you make a change. The relays are switched sequentially so for a few microseconds the red and black are shorted together. Having said that, arduino's ( and newer ESP32s etc ) are a great resource. I use them to switch points, signal between sections, control decoupling ramps, drive crossing gates, lights, drive semaphor signals and at the heart of my PCM power supplies.
@galenerickson7380
@galenerickson7380 Год назад
@@peterwhiting6303 Use dpdt relay to avoid problem and half of the logic.
@peterwhiting6303
@peterwhiting6303 Год назад
@@galenerickson7380 I use 2 i/o lines and mosfets with solenoid switches, so no relays.
@phyzzip
@phyzzip Год назад
I'm not even done the video and that issue is making me twitchy. Regarding someone else saying use DPDT (double post, double throw) relays. Yes, but keep in mind the relay module he's using (should) have the appropriate protection to keep the relays from frying the Arduino. So replacement relays need that as well, one can't just drop in a relay on its own.
@alessandrovignato7772
@alessandrovignato7772 Год назад
@@phyzzip yeah, I am disappointed he did not address this issue at all. It is outright dangerous if other people try this and do not have much experience with electronics.
@jhoodfysh
@jhoodfysh Год назад
Very interesting build Ron. I am looking forward to seeing the finalized build.
@kevinheard8364
@kevinheard8364 Год назад
Very informative; and so glad it is working for you
@williamflowersrailfannerpr3808
Awesome Ron 👌 👏 👍
@542643131
@542643131 Год назад
Good Job Very informative Ron thank you.
@rjl110919581
@rjl110919581 Год назад
thank you for sharing a great detailed video all great watching
@manshedrailroad
@manshedrailroad Год назад
Great job Ron! The Train Freak has some led turnout buttons that might be of interest to you.
@ronaldrondeau7870
@ronaldrondeau7870 Год назад
That is a great project very interesting
@bobmay1515
@bobmay1515 Год назад
Ron, NO is "normally open" and NC is "normally closed" in relay terminology
@ModularRailroading
@ModularRailroading Год назад
Depending on the current draw of the tortoise switch machines you could also use a ULN2803A integrated circuit to control them from the Arduino. If you really wanted you could design a PCB in Kicad or a similar program that fits onto the Arduino directly and get a really compact setup. The IC mentioned above is also good for driving LEDs for building lights an similar use cases.
@DIYDigitalRailroad
@DIYDigitalRailroad Год назад
That's a fine looking arduino project!
@RonsTrainsNThings
@RonsTrainsNThings Год назад
Thanks, Jimmy.
@music100vid
@music100vid Год назад
Thanks Ron for good ideas for making the control panel and using Ardurino to control the turnouts. I didn't see a button for the first turnout in the ladder, the one leading to the passing siding. It seems like you'd need a push button for that AND a separate one for the passing siding turnouts. Maybe I'm missing something. Anyway, thanks for showing us this cool project.
@craiginboro679
@craiginboro679 6 месяцев назад
Surely if you used the common of the relay as your output and you supplied the (NO) with+12v and the (NC) -12v from the ATX power supply then you would only need 1 relay instead of 2, you would need to control the voltage level after the output to control power levels.
@erniepike3902
@erniepike3902 Месяц назад
Im workingon Arduino code for crossover and wye interlockings and pannel board lights. I have yet to find a purpose build control that will control multiple switches in relation to each other.
@terrymann9723
@terrymann9723 8 месяцев назад
Awesome Video Ron! Where did you purchase the Ribbon Cable, and the buttons you used on the bread board?
@RonsTrainsNThings
@RonsTrainsNThings 8 месяцев назад
All of the parts are available on Amazon.
@terrymann9723
@terrymann9723 7 месяцев назад
@@RonsTrainsNThings Is there a particular type? Do they come with clips? Do you happen to have links? This is all new to me, Thanks for the help
@randydobson1863
@randydobson1863 Год назад
HELLO RON ITS IS RANDY AND I LIKE U VIDEO IS COOL RON THANKS FRIENDS RANDY
@kurtstrains
@kurtstrains Год назад
You can run both relays for a turnout with one arduino pin
@rf64
@rf64 4 месяца назад
Very Good . But where I can get a copy of the Arduino Sketch . I not in programming with Arduino but I start to try. So is it possible get the sketch ? Thank You for the help.
@terrymann9723
@terrymann9723 8 месяцев назад
Awesome Video! Where did you purchase the ribbon cable and temporary buttons?
@ethanmcswain2700
@ethanmcswain2700 6 месяцев назад
Is it possible to automate the shunting process too?
@charleskreienheder4908
@charleskreienheder4908 Год назад
Nugget has the exact same relay board set up to control the heaters/lights/fogger on his 🐍 tank. You remember Nugget right?
@trainfan92756
@trainfan92756 Год назад
Speaking of which how do i find a good switcher engine for my Layout cause I've looked on the Midwest model railroad website multiple times and i haven't been able to find anything
@malparks6263
@malparks6263 Год назад
Hi Ron , Enjoy all your videos, where can I download the sketch for my Arduino.
@larrytaylor7753
@larrytaylor7753 Год назад
Very interesting. I’ve written some Arduino Sketches. You got that one very clean. If a viewer wants to build a similar set of switches, can the sketch be downloaded?
@RonsTrainsNThings
@RonsTrainsNThings Год назад
I am building a new website that will include free resources including this sketch. Coming very soon.
@jerrysmith1929
@jerrysmith1929 Год назад
No doubt I'm showing my ignorance, but why not use LCC to do this?
@AbelG8781
@AbelG8781 Год назад
Dang Ron, too technical for this 27 year old lol I'll stick with Walthers Layout control until my brain can process what I just watched 🤣🤣
@RonsTrainsNThings
@RonsTrainsNThings Год назад
🤣🤣🤣 It is easier than you think.
@jimmain2014
@jimmain2014 Год назад
There is another way which will eliminate the second relay. What you need is the 12 supply and 2 1000 ohm 1/4 watt resistors for each tortoise. I can't draw pictures so use visualization. Draw a horizontal line for +12 volts. From that line attach one end of the 1000 ohm resistor to +12 and the other end to one of the motor leads on the tortoise and repeat for the other motor lead. Now run your wires from the tortoise to the outer leads of the relay. Finally run the return lead from the 12 volt power supply to the common or center lead of the relay. Now what happens is you are switching the +12 volt power from one tortoise motor lead to the other and the opposite lead is pulled to the +12 return. Energize the relay and it reverses the connections. The resistors limit the current to about 12 milliamps which is sufficient to run the motor . You can use the same circuit with a SPDT toggle switch.
@jimmain2014
@jimmain2014 Год назад
One more thing, there is no chance of a short circuit happening since you are using only one relay. The resistors limit the current.
@rickmiller595
@rickmiller595 Год назад
Form C relays, NC/C/NO
@Conrail1731
@Conrail1731 Год назад
Thanks for sharing the information but I think I hurt my brain ( just a small sprain but i'll recover) 🤣🤣😂😂🤷‍♂🤷‍♂
@HumancityJunction
@HumancityJunction Год назад
Oh no, you said Arduino. :) Why Arduino over using Digitrax, NCE, DCC Concepts, etc... solutions?
@RonsTrainsNThings
@RonsTrainsNThings Год назад
A, because I don't have any of those systems. B, because I do NOT want to control them through my DCC system. C, because Arduino is a TON cheaper.
@HumancityJunction
@HumancityJunction Год назад
@@RonsTrainsNThings thanks for the response. I didn’t realize you were not using one of the main commercial products for locomotion control.
@RonsTrainsNThings
@RonsTrainsNThings Год назад
@@HumancityJunction No, I have an old MRC Prodigy Advanced² that has been upgraded a few times.
@dgt42666
@dgt42666 Год назад
likehow you did it any chance of downloading code
@RonsTrainsNThings
@RonsTrainsNThings Год назад
I am working on a new website which will include some free resources including this sketch. Coming very soon.
@milkymoocowmoo
@milkymoocowmoo Год назад
Ron, what is your thought process behind reading for a button press and then release? I think you are overcomplicating things! All you need is something like "if (digitalRead(button1) == LOW)" followed by your relay code, because even the briefest of presses is going to seem like eons to the Arduino (which is running such a simple loop many thousands of times/sec). Once the if statement condition has triggered (button1 has gone LOW) the Arduino is going to run the relay code to completion before it moves on, regardless of whether the button stops being pressed or not (which it won't be checking for anyway, it's busy executing the relay code). Whether the button *isn't* being pushed is irrelevant anyway, because the code isn't checking for that. All the Arduino knows is- button pushed -> put relays in x state. Additionally, there's no need for debounce here because each button is linked to a single state. If for example you had a turnout that flipped its position when a button was pushed, *that* would need debounce, because it's a toggle. Yes, the simplified if statement I described above would run several times each push owing to the Arduino's clock speed...but so what? On the first loop it sets your relays to the desired state, on the second loop it effectively does nothing because your relays are already in the desired state, and so on.
@mikehowey4869
@mikehowey4869 Год назад
Way to technical for me.It's interesting watching and listening to how you accomplished all of it though.
@TekgraFX101
@TekgraFX101 5 месяцев назад
Normal on is not the proper phrase