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!

Arduino uses and wondering why there aren't more articles here

19273 views
82 replies
1 rating 2 rating 3 rating 4 rating 5 rating
  • Member since
    January 2001
  • From: Upstate New York USA
  • 24 posts
Posted by dstark on Monday, February 5, 2018 10:07 PM

Everyone just assumes everyone knows what goes where and writes and shows sketches.......some of us need to see the hardware too.

Eagle Pass & Moose Lake Railroad
  • Member since
    May 2010
  • From: SE. WI.
  • 8,253 posts
Posted by mbinsewi on Monday, February 5, 2018 10:47 PM

WOW !  what were those 3 pages about?  We need a emoticon in here that shows something flying over your head, for guys like me.

Maybe we need a special forum for electrical engineers, so they can swap code stories.

Never mind, my little layout works just great with hand thrown turnouts, and signals powered and controled by rotary switches.

I thought they were just little motor controls.

Mike.

EDIT:  It seems like Dave H. is out there swinging for rest of us.  I'll never need anything like this anyway.  I'll just move on. Smile, Wink & Grin

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Tuesday, February 6, 2018 7:01 AM

 Bit by Photobucket. Those missing pictures WERE the hardware diagrams.

Read Geoff Bunza's articles - it really IS that simple to do this.

                                --Randy

 

 


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    May 2010
  • From: SE. WI.
  • 8,253 posts
Posted by mbinsewi on Tuesday, February 6, 2018 7:23 AM

OK, I'm gonna look up Geoff's articles and see what I can learn.  Right now, well, later today, I'm going to jump into JMRI for the first time.  Been working on a loco, and I want try it all out.

Mike.

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Tuesday, February 6, 2018 8:36 AM

dstark
Mel...where can I get a hardware picture or drawing of that arduino random lighting generator? So very sorry to read of your daughters passing. Such a terrible thing, my thoughts and prayers are with you. God bless
 

I have a post on my blog about my Arduino Random Lighting Controller.  I have made a lot of changes with the help from the Forum since I started that project.  Scroll down to near the end of the post for the latest version.  The final sketch is there along with pictures of the last revision of the driver board.  I ended up with 20 outputs using an Arduino UNO.
 
 
I have four of them driving four scratch built houses, the scratch built last being the Hickory House.  It includes the detached garage lighting too.
 
 
If you have questions message me.
 
Have fun!
 
 
 
 
Mel
 
Modeling the early to mid 1950s SP in HO scale since 1951
  
 
My Model Railroad   
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.
 
  • Member since
    December 2004
  • From: Pa.
  • 3,354 posts
Posted by DigitalGriffin on Tuesday, February 6, 2018 9:38 AM

While Raspberry Pis and Arduinos are very useful and powerful little devices, they are more of an advanced application for larger layouts, and an additional cost.  99% of people here some days have a problem just getting their DCC loco to work right. 

For me I have the old Walthers "Analog" turntable with the left and right buttons.  I replaced the left and right buttons and hotwired in a sensor that detects when the table is moving  (Signal High Pin) on the GPIO.  When it sees the motor going it starts up a turntable sound.  When it goes low it plays the turntable stop sound.  It's a little laggy but works mostly well.  I also replaced the wiper conductors with slip ring.  It's much more reliable and no electrical cutout on the tracks when you "flip" polarities

https://www.amazon.com/s/ref=nb_sb_noss/134-0879825-8864010?url=search-alias%3Daps&field-keywords=slip+ring

 

I agree with you that they are highly useful.  But for most, out of practical reach.  I'm sure someone could make a small business of making turnkey Raspberry Pi JMRI servers and Arduino devices.

But me, I freely share knowledge and let people explore it on their own.

Don - Specializing in layout DC->DCC conversions

Modeling C&O transition era and steel industries There's Nothing Like Big Steam!

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Tuesday, February 6, 2018 12:19 PM

 If you can do all that to the Walthers turntable, you can wire an Arduino to make some lights turn on and off randomly in structures. Or, look again at Geoff Bunza's articls, simulate someone watching a TV. Or flicker like oil lamps, if you model an earlier era.

 It's much like DCC. Do you need to knwo what goes on under the decoder's shrink wrap to make effective use of DCC? Absolutely not. You just need to know which wires go to the track, which go to the motor, and which go to the lights.

 Raspberry Pi is a whole different ballgame compared to Arduino. They were definitely not designed with the electronics novice in mind. Arduino, as I mentioned, was developed originally for artists and designers, not computer programmers. There's even one that is designed to be sewn into clothing.

                               --Randy

 


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    November 2005
  • From: Phoenix, AZ
  • 693 posts
Posted by woodone on Tuesday, February 6, 2018 12:42 PM
Maybe it would be better if we had a seperate place for this- I know that when I see the word Arduino I don’t usually read it. All of the acurmes drive up the Wall has I don’t understand what is being said.
  • Member since
    December 2004
  • From: Pa.
  • 3,354 posts
Posted by DigitalGriffin on Tuesday, February 6, 2018 1:28 PM

rrinker

 If you can do all that to the Walthers turntable, you can wire an Arduino to make some lights turn on and off randomly in structures. Or, look again at Geoff Bunza's articls, simulate someone watching a TV. Or flicker like oil lamps, if you model an earlier era.

 It's much like DCC. Do you need to knwo what goes on under the decoder's shrink wrap to make effective use of DCC? Absolutely not. You just need to know which wires go to the track, which go to the motor, and which go to the lights.

 Raspberry Pi is a whole different ballgame compared to Arduino. They were definitely not designed with the electronics novice in mind. Arduino, as I mentioned, was developed originally for artists and designers, not computer programmers. There's even one that is designed to be sewn into clothing.

                               --Randy

 

 

If I can't do it Randy, I'll have to hand by my astrospace and computer science credentials. :)

I'm not going to argue which is better on Raspberry Pi Zero versus Arduino.  It's a right tool for the right function.  But the Pi can do more with more languages and more io options.  My favorite is hosting a low power JMRI server (and turntable sounds)

The point being <5% are likely to use such implementations and they are highly customized.

Don - Specializing in layout DC->DCC conversions

Modeling C&O transition era and steel industries There's Nothing Like Big Steam!

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Tuesday, February 6, 2018 5:14 PM

 That's why I said the Pi is a coompletely different animal. It's a general purpose computer (proof how powerful 'cell phone' CPUs have gotten) that happens to have some GPIO pins to control things. An Arduino is about as opposite as you can get.

There seems to be a lot more interest in animation, even the simple sort of thing like turning lights on and off. Some people are out to change that <5% figure. It's not difficult to do, and the results can be pretty eye-catching..

                                   --Randy

 


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    January 2009
  • From: Bakersfield, CA 93308
  • 6,526 posts
Posted by RR_Mel on Tuesday, February 6, 2018 6:22 PM

Randy
 
You are correct about the Arduino, the random lighting controllers are very eye-catching.  I have four houses driven with separate Arduino UNO drivers that really get the wows from visitors.  I lengthened the on off timing on all four Arduinos and that made them even more so when placed close together.
 
There is a learning curve to get the hang of working with an Arduino but I feel it can be accomplished by anyone that can use a multimeter and a soldering iron.  I had never written any programming code in my 50 year career but with help from the Forum I succeeded in perfecting my lighting controller as well as building my own 14 block signaling controller without help, I went with a simple truth table and it worked first try.
 
If the model railroaders on this Forum want to get into the Arduino World all they need to do is do it to it and ask for help when they need it.
 
If I can shake this current Arthritis flare up I’ll finish installing my roundhouse door servos and a couple of turnouts using the S90g servos all controlled with an Arduino.  It seems like everything I do lately is under my layout and crawling around ain’t easy at 80.    
 
 
 
 
 
Mel
 
Modeling the early to mid 1950s SP in HO scale since 1951
  
 
My Model Railroad   
 
Bakersfield, California
 
I'm beginning to realize that aging is not for wimps.
 
  • Member since
    April 2017
  • 127 posts
Posted by graymatter on Thursday, February 8, 2018 7:01 AM

I bought a $27 kit that has motors, leds, breadboards, wires etc

and the arduino. Oh and another Dummies book for the library.

Arduino For Dummies

  • Member since
    May 2010
  • From: SE. WI.
  • 8,253 posts
Posted by mbinsewi on Thursday, February 8, 2018 7:46 AM

graymatter
Oh and another Dummies book for the library.

Maybe that's where I should start.  Laugh

I do have another situation, in the not too distance future, the lay out I have in this house will more than likely be my last lay out in this house.

Cap Cod style, to many stairs.  So, I'm not sure what I need to know about Arduinos, except things I don't understand, interest me.

Mike.

  • Member since
    December 2004
  • From: Pa.
  • 3,354 posts
Posted by DigitalGriffin on Thursday, February 8, 2018 9:35 AM

mbinsewi
 
graymatter
Oh and another Dummies book for the library.

 

Maybe that's where I should start.  Laugh

I do have another situation, in the not too distance future, the lay out I have in this house will more than likely be my last lay out in this house.

Cap Cod style, to many stairs.  So, I'm not sure what I need to know about Arduinos, except things I don't understand, interest me.

Mike.

 



I'm sure if you ask nice enough one of us might put together a program for you and show you how to hook it up.

Don - Specializing in layout DC->DCC conversions

Modeling C&O transition era and steel industries There's Nothing Like Big Steam!

  • Member since
    January 2010
  • 168 posts
Posted by nycmodel on Thursday, February 8, 2018 11:04 AM

Perhaps my description of using an Arduino to control my crossing gates and flashers was a case of jumping off of the deep end and it may have scared some people off. Since I had experience with programming and electronics I was comfortable with the complexity of the project as a starting point to Arduino applications. Having said that, I too started out initially with a beginners kit produced by the Arduino folks. https://store.arduino.cc/usa/arduino-starter-kit

BTW, shop around as you can find these kits at a cheaper price. Besides containing an Arduino Uno, breadboard and loads of parts it includes a corresponding "Arduino Projects Book". This book starts from the ground up and describes how to connect and code for all of the parts included.

Yeah, the Photobucket debacle has rendered my project images and diagrams unreachable. I need to set up a Flickr account.

  • Member since
    February 2017
  • From: Ayer, MA by way of Queens, NY
  • 84 posts
Posted by TheGamp on Thursday, February 8, 2018 12:23 PM

There are many different microcontrollers or other programmable devices that could be used for MRR applications. The Arduino Uno and similar products were designed to lower the barriers to entry for people without an electrical engineering background.  The boards are relatively inexpensive and already set up with the interface circuitry needed for quick and easy prototyping with different LEDs, motors, sensors, etc.

Programming one doesn't require special hardware other than a computer and a USB cable. The language syntax is relatively simple to learn and there are many free libraries available that make specific tasks easier.

There are certainly less expensive and more powerful/versatile microcontrollers to be had, but not without added complexity. It's not as compact as other microcontrollers and it's set up for breadboarding rather than for deployment.

Not MRR-related (still no room for a layout at my place) but I used one in an art project with speed-controllable motorized elements and selectable multi-colored and patterned LED lighting controlled via smartphone over Bluetooth. Assembling and painting the wooden frame for the artwork took longer to finish than wiring up the circuitry and programming the computer did. 

Bob



  • Member since
    May 2010
  • From: SE. WI.
  • 8,253 posts
Posted by mbinsewi on Thursday, February 8, 2018 12:33 PM

DigitalGriffin
I'm sure if you ask nice enough one of us might put together a program for you and show you how to hook it up.

Thanks Don.  I need to find out about it first, so maybe I'll check out what NYCModel has posted.  Once I figure out what type of a project to use it on, I'll have things narrowed down a little.

I have no road crossings, to need crossing signals, and the 8 track signals I have are powered with an MRC power pack, and control with rotary switches, so I'm not sure what I would even do with Arduinos.

Mike.

  • Member since
    January 2014
  • From: Chicago area
  • 335 posts
Posted by Arto on Friday, February 9, 2018 6:16 PM

dehusman
 
fieryturbo
There is no configuration on WiThrottle. You connect to the wireless network the railroad is on, and it broadcasts what locomotives are configured in JMRI. You can also store your personal locomotive IDs in the application - i.e. you can take your phone to any layout that has JMRI and use it. the SRCP based controller is the same, without the convenient broadcast of what locos are part of the layout.

 

The rub is that for me to operate on YOUR railroad, I have to put WiThrottle on MY phone.  If I don't have WiThrottle on my phone I can't operate on your layout.  The interchangeability assumes that everybody will have WiThrottle as an app on their phone.  If your guests don't have a smart phone, don't wish to put the app on their phone or don't have enough battery on their phone then you would have to provide phones for them to use. 

For example I don't have WiThrottle on my phone so if I came to your layout, I would not be able to operate using my phone.

 

 I went the WiThrottle/cell phone route for guests to use. They use mine, cost me $7.50 each from WalMart, delivered. If someone drops it & breaks it no big deal.

Just don't activate the phone service. Any incoming calls (such as a wrong number calling you) will most likely disconnect the phone from WiThrottle.

  • Member since
    May 2017
  • 382 posts
Posted by xboxtravis7992 on Friday, February 9, 2018 7:51 PM

I have been given an Arduino Genuino Uno/Romeo board from a university class to use in my school work. I have been wondering were I will use it in the model railroad after the class is done, and this thread is giving me some ideas. ;) 

I am not a fan though of the C based language the Arduino uses, since it is a bit more complex than some other languages. Still, I can't see anything more than some loops and if/else statements really needed for any model railroad application. The real trick will be wiring it to what ever it is going to be used for!

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Friday, February 9, 2018 7:51 PM

 The whole point is it's far cheaper than a throttle. If you run trains, why would you be so opposed to installing a perfectly safe and tested app on your phone?

 And generally it's an alternative option, not the ONLY way to run trains. But visitors are more likely to have a smartphone than a particualr brand DCC throttle.

                                       --Randy

 


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    January 2010
  • 168 posts
Posted by nycmodel on Wednesday, February 14, 2018 12:30 PM

Set up a FLICKR account. Not straight forward about how to post URL in a forum but I think this may work. Reposting the missing circuit diagram from my crossing logic application.

  • Member since
    January 2010
  • 168 posts
Posted by nycmodel on Wednesday, February 14, 2018 12:33 PM

Ok, That works! Working on a new Arduino application. Hope to share it soon. At least I know I can post images from FLICKR and not have to pay the Photobucket "ransom".

  • Member since
    August 2014
  • From: CO
  • 265 posts
Posted by pt714 on Thursday, February 15, 2018 8:29 AM

xboxtravis7992

I have been given an Arduino Genuino Uno/Romeo board from a university class to use in my school work. I have been wondering were I will use it in the model railroad after the class is done, and this thread is giving me some ideas. ;) 

I am not a fan though of the C based language the Arduino uses, since it is a bit more complex than some other languages. Still, I can't see anything more than some loops and if/else statements really needed for any model railroad application. The real trick will be wiring it to what ever it is going to be used for!

 

I received one a few years ago the same way, and it's awesome to see so many imaginative uses for this thing in the model railroading community. My layout has relatively few electrical needs in its current form (DC wiring, a few LEDs) and this is certainly not using the Arduino anywhere near its full potential, but as someone rather sensitive to buzzing sounds, one of the pleasant surprises for me was discovering the PWM output frequency could be set above hearing range, at about 30kHz. This eliminated electrical hum that I've encountered with every other throttle I've used. There may be systems that do this automatically, I'm not sure, but there was something very satisfying about figuring that out for myself and enacting it.

Phil

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

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!