Trains.com

Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!

So explain an arduino please

5708 views
40 replies
1 rating 2 rating 3 rating 4 rating 5 rating
  • Member since
    July 2009
  • From: lavale, md
  • 4,642 posts
Posted by gregc on Monday, November 30, 2020 4:44 AM

pages that popped up on my news feed, for those who are curious

Explainer: What is Arduino?

The Untold History of Arduino

1846

greg - Philadelphia & Reading / Reading

  • Member since
    September 2004
  • From: Dearborn Station
  • 24,035 posts
Posted by richhotrain on Monday, November 30, 2020 6:40 AM

Thanks for those links, greg. I read through the material that the links took me to, and I have to say, it was very interesting, if not downright exciting. But, that's me, an ex-programmer and systems analyst turned financial planner, all while attending night law school.

I think that the concept of "programming" Arduinos to operate portions or all of a layout will have appeal to a select segment of the modeling community. But, it presents its own challenges. It could take an inordinate amount of time to master the programming skills to effectively use Arduinos to operate portions or all of a layout. And, let's face it, programming code can be tedious and, sometimes, downright boring. And, tracking, finding, and correcting programming errors can be daunting.

After reading the materials that you linked to, I watched a few YouTube videos of small layouts with simple track plans to see the effect of arduino on operations - - a simple oval with a siding and two trains running simultaneously between the siding and the mainline, for example. Pretty cool.

Then, I thought about my layout with a 10-track passenger station, sidings for 13 freight houses, a multi-track coach yard and freight yard, and an engine servicing facility with a turntable and 9-stall roundhouse. And, I began to wonder how long it might take to fully automate my layout with a series of Arduinos. It has taken me nearly three years to build my current layout, and I am not done yet. So, who knows, maybe another 3 years to automate it? Six years?

I realize that, for the most part, modelers willing to dabble in electronics will most likely use Arduinos for much more simple tasks like lighting interiors of homes along the mainline or automating flashing grade crossing signals. But, for me, I would rather manually operate my layout, and let others provide the circuitry for automating certain tasks like lighting, turnout control, auto-routing, etc.

Rich

Alton Junction

  • Member since
    July 2009
  • From: lavale, md
  • 4,642 posts
Posted by gregc on Monday, November 30, 2020 9:35 AM

richhotrain
I think that the concept of "programming" Arduinos to operate portions or all of a layout will have appeal to a select segment of the modeling community.

by operate a layout, i assume you don't mean automate, which would be a significant effort.

richhotrain
It could take an inordinate amount of time to master the programming skills ...

certainly true except for the small % of modelers who are technically inclined.    the same could be said for the small % of modelers who actual design and fabricate their own circuit boards.   probably less true for the larger % of modelers who've learned to build turnouts from scratch.

i was surprised to read that Arduinos were developed with physical computing in mind, which i thought suggested animated artwork.

 

but knowing how provides the means of solving small layout problems in ways that may be uncomplicated, inexpensive and have no commercial solution

greg - Philadelphia & Reading / Reading

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Monday, November 30, 2020 10:12 AM

The Arduino processors are great!!  Like Rich I prefer to operate my trains myself, not automated by a computer.  But for accessories they are fantastic!  I have 12 Arduinos running automation all over my layout and no doubt will add more as time goes on.

I even have a pair for my diorama I’m working on, kinda stupid because the diorama is being built for taking still pictures.  I have working crossing flashers and a house with a lighting controller.

One of the neatest uses I have is the Arduino Bluetooth for controlling the 120° pan on my camera car.  The camera has WiFi video that I use to control the camera functions and as a live viewfinder to see where the camera is pointed on the control panel mounted 7” tablet view finder screen.

I have one Arduino that randomly turns on a motor operating a winch cable on my mine elevator moving the pulleys.



The only limiting factor is your imagination.

 

Mel



 
My Model Railroad   
http://melvineperry.blogspot.com/
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.

  • Member since
    September 2004
  • From: Dearborn Station
  • 24,035 posts
Posted by richhotrain on Monday, November 30, 2020 12:39 PM

gregc
 
richhotrain
I think that the concept of "programming" Arduinos to operate portions or all of a layout will have appeal to a select segment of the modeling community. 

by operate a layout, i assume you don't mean automate, which would be a significant effort.

Correct. I didn't say it very elegantly when I said "to operate portions or all of a layout". I think that Mel said it better in a reply that followed mine.

Rich

Alton Junction

  • Member since
    September 2004
  • From: Dearborn Station
  • 24,035 posts
Posted by richhotrain on Monday, November 30, 2020 12:40 PM

RR_Mel

The Arduino processors are great!!  Like Rich I prefer to operate my trains myself, not automated by a computer.  But for accessories they are fantastic!  I have 12 Arduinos running automation all over my layout and no doubt will add more as time goes on.

ahhh, you said it better than I did, Mel.   Bow

Rich

Alton Junction

  • Member since
    July 2009
  • From: lavale, md
  • 4,642 posts
Posted by gregc on Monday, November 30, 2020 5:46 PM

still a little unclear what is meant by operate: operate as in running a schedule of trains TT&TO, operate turnouts and signals on the layout or simply operate (run) a train.   far from fully automated

a significant amount of electronics and software would be needed to implement a CTC board or computer screen, relying on a dispatcher to align turnouts and set signals using CTC.    while electronically controlled, there is no intelligence in the electronics to determine how to set turnouts or signals.

however, an arduino could easily control an interlock, aligning turnouts and setting signals determined by a pairs of buttons selecting a route (see below, circles represent buttons).

at what point does operating a more complicated layout become tedious and some intelligence makes operation more enjoyable.   would you prefer cab control over DCC?

greg - Philadelphia & Reading / Reading

  • Member since
    September 2004
  • From: Dearborn Station
  • 24,035 posts
Posted by richhotrain on Monday, November 30, 2020 6:02 PM

Let me put it this way. I am fascinated with the apparent capabilities of Arduino, especially after watching some YouTube videos. As an aside, someone in another thread mentioned using JMRI to move freight cars between the yard and the sidings. This all sounds so very cool.

So, I was thinking big when I mused about my own 25' x 42' layout, wondering what it would take to partially automate it or to fully automate it. In other words, to operate signals, and turnouts, and routes, and waybills, and whatever. But, in the end, I concluded that it would be a whole lot easier and a lot more fun to runs trains on my layout manually with as little automation as possible.

Rich

Alton Junction

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Monday, November 30, 2020 6:11 PM

My signal system uses a MEGA, 8 blocks bidirectional on my mainline. It only controls the LED signal heads by track occupation.  
 
I operate (run) my trains by using the throttle on my DC power pack or when in DCC mode the Prodigy hand held, I would never use a processor of any type to operate (run) my layout.  That would take away the fun of having a layout.

I only use the Arduinos to control the accessories on my layout.

I have toggle switches on my control panel to operate my turnouts, regular DPDT for the Tortoise that operates my double crossover and SPDT center off momentary for solenoid operated switch machines. Turnout position indication on my control panel is done with latching relays.

I'm working on using servos as switch machines and if I do decide to use servos they will be operated using an Arduino but sill using toggle switches on my control panel, not automated.

Again I would never automate any portion of running the trains on my layout.


Mel



 
My Model Railroad   
http://melvineperry.blogspot.com/
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.

  • Member since
    June 2009
  • From: QLD, Australia
  • 1,111 posts
Posted by tbdanny on Monday, November 30, 2020 10:47 PM

I've used a few Arduinos on my layout, mainly to enhance the operation of it and automate some aspects that are not directly related to running trains.  These include:

  • A wireless hand-held controller and base station.
  • Automatic indexing and selection of turntable tracks.  The base station talks to the turntable controller, and tells it which loco has been selected.  The turntable controller then handles the rest.
  • Dispatching. The Arduino Mega in the base station drives an LCD screen on the fascia, and the turntable controller tells it when a locomotive has left and returned.  Scheduled trains are read from a file on an SD card, and extra trains are generated at random within a set of rules.
  • Animations.  With a bit of hardware (optical decoupler) and some code, I was able to implement a packet sniffer that could read the functions being sent to the locomotives. I've used this to automate animations on the layout.  For example, lowering the spout on a water tower when the locomotive 'water stop' sound effects are playing.
  • Sound effects.  Sensors in the tracks determine when a locomotive has passed from one part of the layout to another, and plays the appropriate ambient sounds (e.g. town or forest).
  • Train elevator.  I added an upper deck to my layout during the pandemic.  (I'd been considering it for a while.)  Only had space for a train elevator, so had an Arudino control it via a linear actuator and a couple of sensors.

They're quite flexible, and seem to have hardware modules and software libraries available for almost anything.

The Location: Forests of the Pacific Northwest, Oregon
The Year: 1948
The Scale: On30
The Blog: http://bvlcorr.tumblr.com

  • Member since
    September 2003
  • 21,357 posts
Posted by Overmod on Monday, November 30, 2020 11:36 PM

Some of these would be interesting to see documented in 'implementation detail'.

[Incidentally, for those wondering about the BASIC Stamp alternative, brought up earlier in this thread:

https://www.egr.msu.edu/classes/me456/radcliff/homework/BSM-v2.2.pdf

(Other versions are available)]

Personally, I've always favored the idea of having 'automation' do the operating tasks on a layout that aren't "fun" for the thing I'm doing.  One example we've covered is having a locomotive consist react prototypically to control inputs.  Manufacturers like ESU are then faced with a wretched dilemma: make DCC interfaces that only imperfectly simulate 'the real thing' while keeping that turn-up-the-volume-to-go-faster interface that so many modelers prefer.  A solution is to offload the many calculations needed to 'emulate the prototype' into a simulation system that can recreate any 'compressed representation' of real behavior and then send the appropriate signals over DCC to have a given decoder respond correctly.  In fact, for people like me who have yearned many decades to have proportional valve gear on model steam locomotives, it is almost trivial to arrange a signal to keep the motion proportional whether or not a tweak guy like me wants separate prototype throttle and cutoff.


Again personally, I find it almost inconceivable that we'd want to go back to the 1860s and hand-throw every switch to line a complicated plant for a through move ... let alone that the train engineer be the one to do it.  Most remote switches are power switches; physical implementation of interlocking is a complex pain; recreating signal operation 'prototypically' with relays gets complicated, expensive, and perhaps unreliable fast... just like the prototype.  I can easily see the desirability of being able to call for a route, or act as dispatcher, and have all the switches and equipment move correctly and unerringly so when I see green I can go.  (Note I can still flip switches by hand if I want to...)

I don't know how many modelers like the idea of implementing 'simulation' on their railroad, but computer assist greatly facilitates this in other than the Train Sim method.  One classical thing that older simulators did was simulate complex or emergent failures -- weather or turbulence, component failure, a progressing fire or hydraulic leak, battle damage -- and this might add immeasurably to the realism of an operating session (imagine the fun in strategically putting sonething with a little pentane in a GE model, complete with appropriate sounds Devil) -- but more seriously, mimic the effect of temperature, of flooding, of flat wheels from mishandled cars.  That is a different kind of fun (and not fun at all to many people, truth to tell myself included) but I'd bet there are many who'd enjoy it if they could have it...

Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!

Users Online

There are no community member online

Search the Community

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
Model Railroader Newsletter See all
Sign up for our FREE e-newsletter and get model railroad news in your inbox!