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

Поделиться
HTML-код
  • Опубликовано: 17 сен 2024

Комментарии • 83

  • @gamepad3173
    @gamepad3173 2 года назад +5

    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 года назад +2

    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

  • @davidwayneprins
    @davidwayneprins 4 года назад +1

    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..

  • @davidsayer354
    @davidsayer354 3 года назад +1

    Sweet Arduino case!!! Definitely interested in procuring!

  • @railwayjade
    @railwayjade 4 года назад +3

    So cool! Love the Arduino vids!

  • @TechBuild
    @TechBuild 4 года назад +2

    Cool project! Great to see more people getting interested in #ModelRailroadAutomation.

  • @olivierdamiron7279
    @olivierdamiron7279 Год назад +1

    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!👌

  • @RonsTrainsNThings
    @RonsTrainsNThings 4 года назад +1

    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 года назад +1

      I actually want to use this combined with a few other things to model a light rail/subway line.

  • @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.

  • @andymok7945
    @andymok7945 Год назад +1

    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.

  • @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 :)

  • @AlleghenyMTNRails
    @AlleghenyMTNRails 4 года назад

    Great video Jimmy. I bought a sensor/reverser to do something just like that. Very cool. Keep up the great work.

  • @lgrfbs
    @lgrfbs 4 года назад

    Nice video.
    Next step is the relay control a ABC module for stop/star the loco.

  • @brucewinstanley6113
    @brucewinstanley6113 5 месяцев назад

    I would like that Arduino holder.

  • @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.

  • @melkitson
    @melkitson 2 года назад

    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?

  • @Kiro0ollos
    @Kiro0ollos 3 года назад

    This is amazing, Jimmy! 😍

  • @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.

  • @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!!

  • @palodurodons
    @palodurodons 7 месяцев назад

    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 ?

  • @oceancity1042
    @oceancity1042 4 года назад

    Very informative. Have just purchased my arduino. Raring to get started. Regards Robert

  • @betsysummers2227
    @betsysummers2227 4 года назад +2

    I would be i interested in your Uno case.

  • @dave3301
    @dave3301 4 года назад

    Fantastic, Love the ideal, Thanks for sharing

  • @ngongoc7103
    @ngongoc7103 4 года назад +1

    So great, i'm running DCC, please give me wiring diagram of system.Thank you so much

  • @PHUCLONGHOBBYLAND
    @PHUCLONGHOBBYLAND 4 года назад +1

    So cool, please give me diagram connect to rail, thanks you so much

  • @asaprocky8195
    @asaprocky8195 Год назад

    The sensor is plugged into A0 (int A0), but the sketch loop is checking int valA1 .... Typo, but it ran?

  • @rodeo_cwboy
    @rodeo_cwboy 2 месяца назад

    After loading the program, must you keep the laptop connected? I am planning to run multiple programs across multiple unos.

  • @penem7632
    @penem7632 10 месяцев назад

    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????

  • @dennisedgar3430
    @dennisedgar3430 Год назад

    I have a “wallwart” that delivers 6.1V DC. Will this be OK for the system?

  • @No_no83
    @No_no83 5 месяцев назад

    Is this train a dcc or a standard Dc?
    Thank you in advance

  • @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????

  • @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.

  • @oceancity1042
    @oceancity1042 4 года назад +1

    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 2 года назад +1

      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.

  • @TDMan-de6jv
    @TDMan-de6jv Год назад

    How can your solder onto the track ?

  • @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.

  • @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?

  • @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?

  • @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.

  • @swyntopia
    @swyntopia 2 года назад

    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  2 года назад

      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.

  • @falco1379
    @falco1379 4 года назад

    Can you make a smooth stop / start with a motorshield?

  • @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?

  • @johnbennett6870
    @johnbennett6870 2 года назад

    How many feet you have use a other contract for power

  • @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

  • @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

  • @amolchopade7649
    @amolchopade7649 Год назад

    Is it n scale model train?

  • @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 года назад +1

      @@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

  • @zikusuniverse6548
    @zikusuniverse6548 Год назад

    can i make the train at home

  • @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 года назад +2

      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

  • @canadianlocomotivelogistics
    @canadianlocomotivelogistics 3 года назад

    What is the IR detector you use?

  • @rinjk3a
    @rinjk3a 4 года назад

    Jimmy, How much for an Arduino case for my DCC++ basestation? Josh

  • @JohnAdams-su3tt
    @JohnAdams-su3tt 3 года назад

    You sure don’t need an Adrino to do something that simple!

  • @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

  • @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 года назад +1

      This project works simply cuts power to a section of track. So theoretically it should work just fine on DC.

  • @sonysnapper
    @sonysnapper 4 года назад

    Ok, now put this in the Block Signal process to stop and start on the signal state.

  • @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 года назад +1

      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?

  • @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.

  • @allenbarnes7202
    @allenbarnes7202 4 года назад

    I don't use it, still running a D.C. 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 года назад +1

      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 2 года назад

    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. ; )