Skip to main content

Eight years ago I completed an outdoor O / on the ground setup using Atlas Track.  It held up very well, but there were lessons learned, assumptions made, etc.  Some parts didn't quite do what I expected while other parts exceeded expectations.  For example: the Atlas track is UV stabilized.  Except for the drawbars on the switch tracks.  Those rotted out.  Very strange, indeed.

I didn't use their switch motors (solenoids).  In no way would those work with dirt / bugs / grime getting in them.  I did construct specialized circuitry that listened to the TMCC serial data and controls servos (R/C cars or planes).  These are sealed and lasted wonderfully.  The circuits I built 8 years ago were bulky but reliable.  I came up with a new design based on the Arduino micro-controller and wrote all the software for TMCC command control as well as anti-derail using outer-rail dead sections that the train can provide connectivity.  The micro-controllers will move the switches in the direction of an on-coming train without operator interaction.  The whole thing is quite small / tidy and works perfectly.  This greatly reduced the wiring complexity of my setup as one nano Arduino can control 6 switches and receive 8 block detections!

I just went through and updated the entire setup from physical track layout, ballasting, switch control, and even un-coupler controls (don't need SC-2s or Accessory Track Controllers with the Arduino--it does everything better and cheaper).

I am thinking about writing a short e-Book and/or maybe some articles on how all this works.  It was a lot of development, and I don't really want to keep it to myself.  At the same time, most people have no interest in going outside (but I do think the servo controlled switches are far less obtrusive than the large solenoids).  They look way better as the servo can be placed 1 inch away or several feet away hiding the machinery behind the magic.

If there is interest here, I'll be happy to contribute.  If not, well, no hard feelings: it was a fun project (and more yet to come--thinking of an outdoor roundhouse using an Arduino controlled stepper motor tied in to TMCC control)....

I love the resource here.  Although I have posted very little, this place has been a great source of ideas and help.

Thanks

-Randy

Last edited by OGR CEO-PUBLISHER
Original Post

Replies sorted oldest to newest

I would be interested in hearing from you (as well as others) regarding one or more articles about using O gauge outdoors. Not something I would do in the climate I am living in, but I know O gauge outdoors has been a success for others and it would be great to see some nicely illustrated layout features, how-to articles, and "lessons learned" essays.

In my view, there is an inherent resistance to micro-controller DIY among the train collector community. I'm not sure why that is. Most would rather buy than solder. But when I see the amount of money that you can save with just a basic understanding of what is possible, it makes me wonder.

The Arduino is a solid, stable development platform that makes it as easy to do electronic development as it's ever going to get. I love the Nano. It fits on a breadboard, has all of the capabilities of the larger Uno, interfaces directly to the software development computer, has a broad base of support, and is very affordable.

I've done some experiments with the Arduino and model railroading; mostly for block detection and signaling. Along with very reasonably priced circuit boards for relays, voltage regulators, and other modules, project costs are incredibly compelling.

Servo driven switch machines are one of the things I thought of immediately when I saw some Arduino videos about pulse width modulation (PWM).

There are some who have jumped in whole hog and a number who are waiting in the weeds. Let's provide the blueprints and maybe we could generate some interest beyond what I've seen so far.

I've spruced up some Arduino source code for a test I was doing a few months ago. I haven't tested this updated version yet but I'm pretty sure it is viable.

It's a simple setup that uses a relay module and a block detection circuit to run a train in conventional mode. The loop of track includes an isolated block section that the microprocessor checks to see if it is occupied or clear. The relay is used to toggle power to the track with the engine's E-unit changing to stop the train inside the control block. It waits there in neutral for a few seconds and then proceeds once again. It does this repeatedly until you turn off the transformer. Proof of concept kind of thing.

Anyway, for those who are interested, it's self-contained in the attached file. Perhaps I will include a video of the setup and operation if I get the chance.

Attachments

Last edited by Consolidated Leo

I don't mean to sound stupid, but I would like a Arduino beginners book (order these parts, hook it up like this, type this code, watch the light blink mentality).  I look in Barnes & Noble etc and whole fire hose shelves of Arduino etc how to A to Z.  I am retired EE (cut my teeth on hand entering PDP8 code, then 8008 code, fortran, C coding) and would like to get into it for fun.  Just bought a book on programming Raspberry controller. Is this same, better, worst than Arduino? 

Suggestions?

rrman posted:

I don't mean to sound stupid, but I would like a Arduino beginners book (order these parts, hook it up like this, type this code, watch the light blink mentality).  I look in Barnes & Noble etc and whole fire hose shelves of Arduino etc how to A to Z.  I am retired EE (cut my teeth on hand entering PDP8 code, then 8008 code, fortran, C coding) and would like to get into it for fun.  Just bought a book on programming Raspberry controller. Is this same, better, worst than Arduino? 

Suggestions?

Sparkfun, Adafruit, Nuts & Volts magazine, ebay and other sites have beginning Arduino kits that are not too expensive. They include an Arduino Uno (usually) and basic sensors for making several experiments/projects. They have an instruction book that includes sample code. Sparkfun and Adafruit have downloadable code for these projects and also a bunch of additional tutorial info and Arduino libraries on their websites.

Might be a good place to get started or at least go look around and see what you can learn. Arduino is like C code, which I am not good with, but I can stumble through some of the more elementary stuff without too much trouble.

Randy;This has really peeked my interest.   I was an electrican for 40 yrs & circuitry comes pretty easy to me. However I know nothing about electronic or computer circuitry.  I went on ebay to look for ardunio starter kits & came up with the ones below but really have no idea where to start or for that matter what I'm doing. But at age 77  I am determined to learn about this teck knowledgeably.  Could I start with one of the below.

   R3 UNO Learning Kit for Arduino With Stepper Motor 1602LCD Sensors Servo J1U

 
OR

[Sintron] UNO R3 Upgrade Kit with Motor LCD Servo Remote for Arduino AVR Starter

OR

Ultimate Starter Kit Pack Set For Arduino UNO R3 1602 LCD Servo Motor Relay RTC

Would any of these give me a beginners knowledge of what it is all about & what beginners books would help. 

I guess I should tell you that I would be looking to integrate this into the new layout I am starting to build.

Thanks For Your Help

 

 

Last edited by Jerry Del

It looks like the Sintron kit comes with some pdf instruction files you can request to download after you purchase the kit. I didn't see anything like that with the other two you listed? Sometimes the written documentation from the Asian ebay sellers is almost unreadable and makes very little sense if you can read it. I can't say about these as you can't look at them first?

I got a starter kit form Sparkfun a few years ago. It came with a pretty good instruction manual showing the wiring diagrams and explaining the operation of the experiments. As I recall they also had downloadable files with the code so you didn't have to type it all in. And also had any needed extra Arduino libraries available for download for the projects. Seems like it was $49 or $59 for that kit when I got it. Could have been on sale too, I forget exactly, it's been a while.

Anyway, you might look at Sparkfun, Adafruit and the Arduino websites for their kits. The documentation might be worth the extra $$ that they cost, especially when just beginning. There are other books out there, but these vendors have written the book to match the projects in the kit which might also be of assistance. Adafruit also has downloadable files for their projects and Arduino may also have them, I am not sure on that one. There is a lot of good information on the Arduino site and als the others as well. All geared for the electronics hobbyist. They want you to learn so they can sell you more stuff, just like the train manufacturers. 

Thanks RTR12 great info & I have already looked at Sparkfun.  The problem is I don't know what I should be looking for. Obviously I would want something to build that would help me incorporate some kind of control into a layout, but what?   I am thinking iT won't have anything to do with Legacy or DCS control  but maybe something to throw switch machines or auto block control or signaling. Am I right or should I be looking at something other then that? 

I think of myself as being an 1860's farmer who just met Tom Edison in 1900 & Edison tells me to go over & throw that switch & the electric will run thru those wires to that light bulb & light it up.  Meanwhile I have no idea  what a switch is or electric or wires or a light bulb.  And when old Tom brings me to the switch & tells me to push it I still have no idea why the room just got bright.

BUT I WANT TO KNOW (HAVE TO KNOW)

 

 

  

The best place to start is with the official Arduino web site. There's plenty there to read and to ponder. I recommend the getting started guide. I never bought any of the starter kits so I can't recommend one over another. But I found plenty of videos on YouTube that give you some idea of what's possible. LEDs, servos, stepper motors, sensors, relays, etc. are all demonstrated thoroughly. Once you know what's possible, you can follow through with some research to find out how to do things. If you need help, I hang out around the electrical forum. There are no wrong questions.

Last edited by OGR CEO-PUBLISHER
Jerry Del posted:

 ... maybe something to throw switch machines or auto block control or signaling. Am I right or should I be looking at something other then that?

Jerry: All of what you mention here are good targets for projects using a microprocessor. I have been looking into all of these and more. The Arduino platform will get you there. Read, observe, research, and dream.

One question I have is already is, it looks like I am going to need a regular computer with an operating system? Right now all I use is a Google Chrome Laptop it doesn't have an operating system it has no hard drive. I guess I will need a Windows 10 operating system is that right? That's what I;m familiar with or how about Apple?  

WOW!

I really wasn't expecting this much traffic on the topic, but this is very encouraging.

The topic is very broad, and I struggled a bit with where to post the initial query about interest.  The Arduino is just one integral piece of the overall puzzle for me, but it is the most fun and compelling.

There have been some wonderful replies about getting started with the Arduino here, but I will just add a bit of advice to get started and describe where I am.

If you have a little programming background or have an interest to learn, that's all you need.  Go to eBay and look for "Arduino Nano."  There are US Sellers (shipping time) that will sell you a nano and a USB cable for less than $10.  That's ALL you need to play and get started (assuming you have a PC that can run the Arduino development tool--available online).

I suggest that you start there and look at the "Blink" example.  It is the code needed to flash the built in LED.  This is the Arduino equivalent of "Hello World!" in my book.  From there, you can learn to control relays, servos, stepper motors and more.  Start small and just give it a go if you are interested.

A bit about me: I've been a professional "computer guy" for 30+ years.  I've worked all the way from maintenance programming and documentation to upper management.  I am currently a Principal Software Architect which is a fancy way of saying that I design and build software that solves hard problems.  I've also been a "tinkerer" since I was a kid and always enjoyed building things.

The software I developed and am running in the Arduino is about 800 lines of code. 

I've decoded the TMCC commands for switch throws and accessory firing.  The documentation is all online on the Lionel site, so it's nothing secret that I've done.  The Arduino uses TTL level signals and the RS-232 signals from the command base need to be converted.  A piece of hardware costing about $10 will do that.

I have an array of opto-couplers interfacing between isolated track sections and the Arduino.  The AC track voltage triggers completing the 5V DC circuit for the Arduino.  The software looks at the incoming lines as block detectors.  If a train is coming toward a switch in the 'wrong' direction, the switch is automatically thrown in the good direction.

The software is setup to allow an array of switches to be defined, an array of triggers to be defined, and an array of accessories to be defined.  The core of the Arduino code is an engine that looks at these definitions and does stuff based on TMCC commands and block sensing.

Any TMCC id can be used for switches or accessories.  Triggers are assigned to block detection and cause an action in a switch (through or curve).  A trigger can cascade and cause other triggers to fire.  So, if you have a switch ladder setup, one block detection can cause multiple servos to fire.  I also have switches setup such that servos can work as teams, so if you have a multiple switches that always need to work together, they will (double-slip).

The definitions allow the setting of default (power-on) switch positions for each switch and each switch can have it's own servo positions (e.g. 80 degrees for straight and 135 degrees for curve).  

It's all setup so that the definitions are pretty easy to configure and the core software just works from the definitions.

I'll get some nice pictures to post of the garden setup and try to put together something more cohesive on how all this works.  Hopefully, this helps with some of the questions about what I've done.

One last thing, I think the physical implementation of the servos to cables to Atlas Switches was every bit as difficult as the code and electronics.  I played around with a few different ideas before I final nailed what I think is the perfect setup.  Again, my environment outside is a little rougher than most, but man, it works!

Thanks for the interest.  I'm encouraged to put something together!

 

-Randy

Thanks  AMEENTRAINGUY for getting back. What you say makes some sense to me but I think I would be better off buying a  Dell or HP with Windows 10.  Proly get one for a few hundred. I have been kicking it around anyway. Don't like taking money away from the trains but this Ardunio stuff is fascinating especially since watching the youtube video. 

Maybe you could recommend a half way decent laptop W/windows 10.

Thanks 

 

I just joined the Arduino web page & there forum this is what I posted

I am totally new here & no nothing about Arduino except what I have learned from Mossimo on Youtube.
I have read the Arduino beginners page & other things on the Arduino web sight but I can't find if I can use my GoogleChrome Book as an OS for Arduino? I also have looked around for info on the subject but I am not really sure what I am looking for. Like I said this is literally my third day after finding out about Arduino but I am totally hooked. I am 77 yrs old but don't let the age throw you I am as sharp as a bowling ball.
I am also a model railroader & that is where I am hoping to eventually put what I learn here to work.

Thanks Alot
choo choo Jerry

I do a lot of browsing & stuff like that emails and searches but not much else. Thats why I cot the Chrome It is my second one & only a few weeks old but it gets me where I want to be until now that is. Price wise I'd like to stay around $400. Either Costco or Bestbuy or online.

Thanks for your help TRAINGUY 

Jerry Del posted:

Thanks RTR12 great info & I have already looked at Sparkfun.  The problem is I don't know what I should be looking for. Obviously I would want something to build that would help me incorporate some kind of control into a layout, but what?   I am thinking iT won't have anything to do with Legacy or DCS control  but maybe something to throw switch machines or auto block control or signaling. Am I right or should I be looking at something other then that? 

I think of myself as being an 1860's farmer who just met Tom Edison in 1900 & Edison tells me to go over & throw that switch & the electric will run thru those wires to that light bulb & light it up.  Meanwhile I have no idea  what a switch is or electric or wires or a light bulb.  And when old Tom brings me to the switch & tells me to push it I still have no idea why the room just got bright.

BUT I WANT TO KNOW (HAVE TO KNOW)  

Lots of good comments and advice here. The Starter kit will allow you to learn a bit about the arduino and it's capabilities. How to use different sensors, LEDs, etc. with it and the better kits will have code examples. The book included with the Sparkfun kit I have pretty much walks you through all the projects in it and even tries to explain their operation, as I recall. As you learn through the kit I think you will see and learn things that you could adapt to model railroading. That will prompt more ideas for uses of the arduinos. I think the Sparkfun and Adafruit websites and kits will possibly provide a little more help for the beginner, at least that was my experience a few years ago. The Arduino website is full of a lot of info as well.

The kit is just one starting place, as others have said the arduino website, youtube, etc are all good placed to learn.  I have a Windows computer, it's really all I have had since DOS was obsoleted many years ago. I don't have experience with any of the others like Linux, Chrome books, etc. The Arduino website should tell you what is needed to run their arduino code editor/compiler, what it will run on, etc. 

Last edited by rtr12

Thanks RTR I went on to the Sparkfun site but between it & Ardunio site just to much info for me to absorb so for now going to stay with Ardunio. I like there youtube Tutorials.  

Trainman how about this one about $ 270 shipped

New HP 15-bs020WM, 15.6" Touch Laptop, Windows 10, Intel Pentium N3710 Quad Core.

Maybe communication between us at lease about the computer should to to emails mine is in my profile.  

Jerry Del posted:

Thanks RTR I went on to the Sparkfun site but between it & Ardunio site just to much info for me to absorb so for now going to stay with Ardunio. I like there youtube Tutorials.  

 

That's fine, what's important is what you are most comfortable with and can learn with. 

Looks like you have the computer problem solved as well. Good Luck with it all!! 

I have never used emoticons but maybe I need to. There are always alternatives. The Lenovo will be great for Arduino development. It does have a USB port or two I would think. And it runs windows. I'm glad you didn't pick Apple. I'm lost when it comes to systems that may get down-graded so that you'll buy a newer one.  (Hey that's not hard). Seriously, the Lenovo looks like it's pretty sweet. Good choice, Jerry! 

Ameen:

No problem. I quit measuring things back when I was in the school yard. 

How's your project coming with the microprocessor in a TMCC diesel? I have not seen you start a new topic on this (in the Electrical Forum). I have seen something about it in a different forum. I can only speculate about what you're trying to do. Has it got it's own microprocessor or are you trying to decide what to use?

Anyway, I hope that Randy can put things together to show us what he has done in his O-gauge outdoor layout with switch machines and such. If he's anything like me, his code may not be ready for public consumption. Mine always turns into a mess by the time I get through with it; spotty comments and twisted logic. But that's what happens. And as I've already admitted; I've been programming for a long time.

 

Add Reply

Post

OGR Publishing, Inc., 1310 Eastside Centre Ct, Ste 6, Mountain Home, AR 72653
800-980-OGRR (6477)
www.ogaugerr.com

×
×
×
×
Link copied to your clipboard.
×
×