Easy Model Train Automation with an Arduino: Stopping and Starting a locomotive

  Рет қаралды 40,424

DIY and Digital Railroad

DIY and Digital Railroad

Күн бұрын

Пікірлер: 84
@gamepad3173
@gamepad3173 2 жыл бұрын
Hey there Jimmy this is exactly what I've been looking for my G scale garden railroad as I want my passenger and freight trains to stopping and going to and from various stations. while at the yards I'd want shunter locomotives to be moving around cars to create either long freight or long passenger trains.
@PCGuru1958
@PCGuru1958 4 жыл бұрын
Hi Jimmy this project is just what i have been looking for it works very well i run N Scale Kato i have inbeded the sensor in the rails and works well as a non DCC system it solves one of the things i have been looking . thank you i have been watching your video for almost 2 years having health issues your channel it so practical and you made things easy thanks again Greg
@Curious_Skeptic
@Curious_Skeptic 22 күн бұрын
Banging my head into the wall on how I could create a way to slow down a DC loco on isolated track vs. just coming to a quick dead stop. I'm told Capacitors won't work on DC. So, your demo brings another option. I rather an off the shelf option, but I have worked with Arduino and even some custom Microprocessors for light controllers. However, it's such a simple ask, I can't see the need for an Arduino vs some simple timer/relay PCB board off Ebay.
@olivierdamiron7279
@olivierdamiron7279 Жыл бұрын
That is so awesome. Simple, elegant automation. I was wondering what it would take to bring another level of refinement: Gradual speed up and slow down for each step. I would assume we would need different hardware to achieve this. Relay are ON/OFF devices, wondering if there is something we could use that an arduino could modulate without going full blown DCC, maybe interfacing RC speed controllers (ESCs). Super cool stuff, love your channel, this is my daily Train NetFix!👌
@davidwayneprins
@davidwayneprins 4 жыл бұрын
I think this gives me the groundwork for something I had been beating my head against the wall to try to figure out: using Arduino to control a trolley car. Think of the Lionel ones that reversed course when they hit a bumper but with a delay to simulate loading and unloaded of passengers at a station..
@railwayjade
@railwayjade 4 жыл бұрын
So cool! Love the Arduino vids!
@andymok7945
@andymok7945 Жыл бұрын
Nice stuff. For such simple project, you might consider using a smaller micro system like the ESP8266 or ESP32 and use EPSHome for the coding.
@palodurodons
@palodurodons 8 ай бұрын
hi, in this video at around 5:30, you state "we're going to put the power leads into our relay... the one coming from the track goes in the left connect". I assume you mean this is the positive current connector going to the track enabling power on and off. Then you state "the one coming from the power bus goes in the middle". I assume that is the ground (or common). Are my assumptions correct ?
@caitlainmccarren2286
@caitlainmccarren2286 4 жыл бұрын
Excellent presentation of the Arduino switch. Not certain why I'd need one, but when I do I'll know where to find the how-to.
@davidsayer354
@davidsayer354 4 жыл бұрын
Sweet Arduino case!!! Definitely interested in procuring!
@TechBuild
@TechBuild 4 жыл бұрын
Cool project! Great to see more people getting interested in #ModelRailroadAutomation.
@malnadgowda_inusa3734
@malnadgowda_inusa3734 Жыл бұрын
Instead of relay you could probably use MOSFET. It will help you stop train slowly and then start slowly.
@davidrichter5539
@davidrichter5539 Жыл бұрын
Simple and effective, couldn't someone write a program without delay and with millis? I would be very grateful.
@rodeo_cwboy
@rodeo_cwboy 3 ай бұрын
After loading the program, must you keep the laptop connected? I am planning to run multiple programs across multiple unos.
@brucewinstanley6113
@brucewinstanley6113 6 ай бұрын
I would like that Arduino holder.
@AlleghenyMTNRails
@AlleghenyMTNRails 4 жыл бұрын
Great video Jimmy. I bought a sensor/reverser to do something just like that. Very cool. Keep up the great work.
@No_no83
@No_no83 7 ай бұрын
Is this train a dcc or a standard Dc? Thank you in advance
@Kiro0ollos
@Kiro0ollos 3 жыл бұрын
This is amazing, Jimmy! 😍
@melkitson
@melkitson 3 жыл бұрын
So simple and yet it has been keeping me awake at nights trying to work out how to do something similar to this. I assume this would work equally well on dcc or analogue?
@maxlindstrom5435
@maxlindstrom5435 4 жыл бұрын
I use this to stop train rushing in to the stations. But I start trains again with a push button, when it's clear to enter :) For beginners this small projects is good, you will learn Aarduino little by little and get results at once :)
@dennisedgar3430
@dennisedgar3430 Жыл бұрын
I have a “wallwart” that delivers 6.1V DC. Will this be OK for the system?
@ngongoc7103
@ngongoc7103 4 жыл бұрын
So great, i'm running DCC, please give me wiring diagram of system.Thank you so much
@michaelcorner7938
@michaelcorner7938 2 жыл бұрын
Great video, I'm thinking of using it on a OO gauge layout where I have crossings to hold off one engine while another is passing through.
@RonsTrainsNThings
@RonsTrainsNThings 4 жыл бұрын
Hi Jimmy. I'm not big into automating trains on my own layout, but Something like this would be awesome for traction modeling, especially if you also reversed directions when you stopped.
@DIYDigitalRailroad
@DIYDigitalRailroad 4 жыл бұрын
I actually want to use this combined with a few other things to model a light rail/subway line.
@asaprocky8195
@asaprocky8195 2 жыл бұрын
The sensor is plugged into A0 (int A0), but the sketch loop is checking int valA1 .... Typo, but it ran?
@lgrfbs
@lgrfbs 4 жыл бұрын
Nice video. Next step is the relay control a ABC module for stop/star the loco.
@johnbennett6870
@johnbennett6870 2 жыл бұрын
How many feet you have use a other contract for power
@johnsneedma
@johnsneedma 3 жыл бұрын
So if a trolley had 6 stops... do the wires need their own pin on the arduino and line in program or can they be soldered into one circuit? Just planning ahead for a continuous one way loop around three city blocks. Possibly adding another track and stops in the opposite way.
@daveygivens735
@daveygivens735 Жыл бұрын
Fantastic info but TBH I'm not a coder and watching you plug in command-line entries leaves me in the dust. Is there such a thing as canned Arduino code or maybe a GUI for dumb people like me?
@johnnyrobertson5971
@johnnyrobertson5971 4 жыл бұрын
Love it and very well done on the instructional teaching. Love anything doing with Arduino. You really do some great video’s and thanks g F or sharing!!
@penem7632
@penem7632 Жыл бұрын
sooo like, where do i buy the rails??? are there special rails for this??? where do i buy the train it self??? are there special trains for it????
@peterkrause5187
@peterkrause5187 4 жыл бұрын
Hi Jimmy. Excellent tutorial! 😊 Thank you. Is there any to slow the train rather than abrubt top? I have a dc layout.
@GalenA1722
@GalenA1722 Жыл бұрын
What are those types of trains called????
@sushildamle3449
@sushildamle3449 2 жыл бұрын
Thanks for short but detailed explanation. I just wanted to know what is the voltage supplied to rail track? My HO scale model train loco needs 12VDC having two motors each. How much external power supply I will have to give to 5VDC Relay module single channel for the loco to run / stop? Will 12VDC adapter 1Amp is suitable for this? If not please give the details. Many thanks.
@DIYDigitalRailroad
@DIYDigitalRailroad 2 жыл бұрын
Without seeing your setup, I would guess your track voltage is anywhere between 12 and 16 volts. The relay just needs to be wired on your track power feeder. It interrupts your existing track power versus actually supplying it. The relay itself is powered by the arduino and is independent of track power
@TDMan-de6jv
@TDMan-de6jv Жыл бұрын
How can your solder onto the track ?
@oceancity1042
@oceancity1042 4 жыл бұрын
Hi Having this some additional thought. A signal placed to give the train a reason to stop and then on changing from red to green it would then restart would be pretty neat , is this easy to achieve with Arduino programming ?
@swyntopia
@swyntopia 3 жыл бұрын
Very simple. Best with LED. 5V-->resistor ( about 200 Ohm )-->red LED-->Arduino one digital output. Arduino digital output ( may be the same, and even the same as for the relay )-->green LED-->resistor-->Gnd. Add the new output in the scetch above, copy the logic and change the Pin Nr. into the new output for the LED-->done. Sorry, I´m no native english speaker, I can´t explain better.
@oceancity1042
@oceancity1042 4 жыл бұрын
Very informative. Have just purchased my arduino. Raring to get started. Regards Robert
@CM-ARM
@CM-ARM 4 жыл бұрын
Jimmy the wiring I can do the writing of the code my door is open for you. I just don't understand. I have never attempted before.
@amolchopade7649
@amolchopade7649 Жыл бұрын
Is it n scale model train?
@kge420
@kge420 4 жыл бұрын
I’m currently using a 2650 and motor shield running DCC++ through jmri. All is working fine. If I were to do this project will I need another arduino? Thanks for making these interesting videos.
@ariegt
@ariegt 4 жыл бұрын
No , and you can also push down DCC to zero ( in x-time ) instead of a relay
@TempoVideo
@TempoVideo 3 жыл бұрын
Yo. Literally about to buy some components for this (or a variation of it!). Did you make the Uni mount/case available to download?
@PHUCLONGHOBBYLAND
@PHUCLONGHOBBYLAND 4 жыл бұрын
So cool, please give me diagram connect to rail, thanks you so much
@1babysag
@1babysag 4 жыл бұрын
I think the idea is interesting but I am not an electrician and all of those wires and programming guarantees that I will not do it right. Can’t I just buy plug and play for all of these things?
@betsysummers2227
@betsysummers2227 4 жыл бұрын
I would be i interested in your Uno case.
@rinjk3a
@rinjk3a 4 жыл бұрын
Jimmy, How much for an Arduino case for my DCC++ basestation? Josh
@edwardaudet8367
@edwardaudet8367 4 жыл бұрын
Jimmy, can this project be used on dcc and dc. I run both types not all at once, I have dcc days and dc days. When my grandsons come over they take over the layout and love Dcc. I have looked at all your Arduino projects. I tried a few but put them on moni pros. Itest them on Uno's but build them on mini pros.
@DIYDigitalRailroad
@DIYDigitalRailroad 4 жыл бұрын
This project works simply cuts power to a section of track. So theoretically it should work just fine on DC.
@zinethar
@zinethar 4 жыл бұрын
Another cool arduino video that I'm sure I will find a use for. Any progress on that modern gas station use were working on? I want one!
@DIYDigitalRailroad
@DIYDigitalRailroad 4 жыл бұрын
Still working on it. One of my 3D printers is temporarily down so I am working a bit slowly.
@SamixPhotography
@SamixPhotography Жыл бұрын
can i make the train at home
@swyntopia
@swyntopia 3 жыл бұрын
basic for beginners, :-) Very useful for them. What´s about reed relais, and magnet below the train ? Would that not be cheaper ? Ok, I understand-->in case of more than 1 train, every train must get an own magnet, that´s a disadvantage....isn´it ?
@DIYDigitalRailroad
@DIYDigitalRailroad 3 жыл бұрын
I think a complex automation setup is going to involve a combination of several detection methods including reed switches as you said, infrared sensors, and current sensing.
@dave3301
@dave3301 4 жыл бұрын
Fantastic, Love the ideal, Thanks for sharing
@norfolksouthernblackspired8167
@norfolksouthernblackspired8167 4 жыл бұрын
Hey Jimmy! Awesome vid. I have a complete Noob question. I’m my train is running via DCC and the relay stops the train, will it start again at the same speed it stopped with?
@ariegt
@ariegt 4 жыл бұрын
just unplug the wire to the rails and reconnect to try
@DIYDigitalRailroad
@DIYDigitalRailroad 4 жыл бұрын
Yes it will. In order to control with a slowing down or a speeding up, you would have to slowly increase and decrease the resistance on the rail
@ariegt
@ariegt 4 жыл бұрын
@@DIYDigitalRailroad it is much better and more controlable to use PWM control , it goes way down to a loco crawl and with enough torque-power of the motor. Try a L298N H- bridge motor driver for Arduino it works perfect for 2 segments of rails. You can also do the DCC stuff with this module. So it wil work for normal DC and DCC mixed for 2 rails. I like this way with at least 2 sensors each the same distance from the center spot . This way it works from 2 directions and it is works better with signalling so the arduino knows the direction and travel points
@IndyMAB1964
@IndyMAB1964 3 жыл бұрын
I would be interested in the Arduino Uno case as well. It is tall enough to encase the Arduino and the Power Shell board for the DCC++ configuration? I checked the Etsy store and don't see those listed. Do you have them somewhere else?
@DIYDigitalRailroad
@DIYDigitalRailroad 3 жыл бұрын
So right now I do not have the printing capacity to print my buildings and the arduino cases. I am hoping to change that soon.
@IndyMAB1964
@IndyMAB1964 3 жыл бұрын
@@DIYDigitalRailroad Any idea how much you'll charge for those?
@canadianlocomotivelogistics
@canadianlocomotivelogistics 3 жыл бұрын
What is the IR detector you use?
@falco1379
@falco1379 4 жыл бұрын
Can you make a smooth stop / start with a motorshield?
@n-scaleunionpacificevansto6569
@n-scaleunionpacificevansto6569 4 жыл бұрын
How do you know where to plug all of those wires into the power strip and into the various components? Does all of this come with written instructions saying where to plug the wires in? And are there written instructions explaining how to program all of this? None of this seems to be very intuitive. ...Roy
@DIYDigitalRailroad
@DIYDigitalRailroad 4 жыл бұрын
Hey Roy. Luckily Arduinos and their components were designed for learning. All the positives are labeled "+", "5V", or "VCC". The negatives are labeled "-" or "GND". The inputs and output are typically labeled "IN" and "OUT" or something similar. There is a learning curve and I am considering doing a second arduino basics series.
@n-scaleunionpacificevansto6569
@n-scaleunionpacificevansto6569 4 жыл бұрын
DIY & Digital Railroad Thanks, Jimmy. Like most new things, arduinos intimidate me, but I am willing to learn. ...Roy
@TheSwitchList
@TheSwitchList 4 жыл бұрын
Jimmy - curious why you used an analog input for the sensor? I would have thought you would use a digital input (INPUT_PULLUP) and then just checked for HIGH or LOW? Either way works fine - I was just surprised to see you use an anolog input for a incoming signal that is digital. Thanks for another interesting Arduino project video. -Rick
@DIYDigitalRailroad
@DIYDigitalRailroad 4 жыл бұрын
I've just always done it that way. I've thought about changing it but I worry about the wayward 0, or 1. The analog input gives my system some room for error.
@ariegt
@ariegt 4 жыл бұрын
@@DIYDigitalRailroad hi., use a 10k resister to the 3.3v/5v positive to pull up your digital input and use if digitalRead LOW for sensing and save your analog / pwm pins for nicer usage . Good luck
@cousinvinny7990
@cousinvinny7990 4 жыл бұрын
question why are the sensors used different from the ones you have linked to?
@DIYDigitalRailroad
@DIYDigitalRailroad 4 жыл бұрын
I accidentally dumped out my entire parts bin. The only one I could find after that was the 4 pin one. It works the same.
@Peabody1929
@Peabody1929 4 жыл бұрын
@@DIYDigitalRailroad There are 3 and 4 pin versions of the sensor on Amazon. The 3 pin version has only a digital output. The 4 pin version adds analog output. The analog output can be used to adjust for ambient light falling on the IR sensor.
@sonysnapper
@sonysnapper 4 жыл бұрын
Ok, now put this in the Block Signal process to stop and start on the signal state.
@JohnAdams-su3tt
@JohnAdams-su3tt 3 жыл бұрын
You sure don’t need an Adrino to do something that simple!
@allenbarnes7202
@allenbarnes7202 4 жыл бұрын
I don't use it, still running a D.C. railroad
@DIYDigitalRailroad
@DIYDigitalRailroad 4 жыл бұрын
You can use this on a DC railroad
@IBOFSGUBK
@IBOFSGUBK 4 жыл бұрын
Is there some way to use the Arduino to slow the train down before it stops to add realism? I have a G scale train layout in the garden and it just does not look right when it skids to a halt.
@ariegt
@ariegt 4 жыл бұрын
take a look at a arduino L298N Motor driver and take 2 sensors
@IBOFSGUBK
@IBOFSGUBK 4 жыл бұрын
@@ariegt Great thank you ,I'll look into that.
@ken0272
@ken0272 3 жыл бұрын
Great, in the old days we did the same thing with a bimetallic strip....which will still work after a EMP nuclear bomb blast, bye the way. ; )
Controlling Model Railroad Switches with Arduinos!
14:11
DIY and Digital Railroad
Рет қаралды 20 М.
I Made an Automated Model Train With An Arduino!
25:20
DIY and Digital Railroad
Рет қаралды 77 М.
When u fight over the armrest
00:41
Adam W
Рет қаралды 9 МЛН
Wait… Maxim, did you just eat 8 BURGERS?!🍔😳| Free Fire Official
00:13
Garena Free Fire Global
Рет қаралды 7 МЛН
Это было очень близко...
00:10
Аришнев
Рет қаралды 7 МЛН
What is Model Train Automation - Märklin Style? (Automation Episode 1)
30:40
Model Railroad Arduino Block Signal Upgraded!
27:54
DIY and Digital Railroad
Рет қаралды 16 М.
Easy Arduino Current Sensing for Occupancy Detection
14:08
DIY and Digital Railroad
Рет қаралды 22 М.
DCC++EX: A Cheap DIY DCC System?!?! This is a Model Railroad Game Changer
17:54
DIY and Digital Railroad
Рет қаралды 86 М.
🤖Я в шоке! ChatGPT пишет Arduino проекты
28:24
S1: E5: Tracklaying, Wiring, DCC and More!
25:32
rcgrabbag
Рет қаралды 971 М.
Building a Tiny Office Pod Under My Stairs
51:47
Man Made
Рет қаралды 7 МЛН
I tried the Cheapest Arduino Alternative (that Nobody heard of)
13:31
LAYOUT WIRING for DC and DCC and all gauges at Chadwick Model Railway | 175.
35:07
Chadwick Model Railway
Рет қаралды 161 М.