Are there any Arduino applications for model trains? If so where can info be found?
Al
W.
|
Are there any Arduino applications for model trains? If so where can info be found?
Al
W.
Replies sorted oldest to newest
Please forgive my ignorance, but what is Arduino?
N.O.D.Y. You belong on the rung just behind me. I bought one ($11) first try at progamming a few minutes ago no success yet. An Arduino is a microproccessor
board with memory, ports and other things.
David: Thanks for the suggestion. Too new at this to know the ropes.
Al
W.
Please forgive my ignorance, but what is Arduino?
Sort of a programmable electronics design platform. I think it is open source. Many different boards exist and I think you can make your own. I don't know a lot about it, but am going to be learning more in the near future.
I posted asking for a timer that I could use on a proposed layout build. My intention is to have a button on the side of the layout that when pushed will operate a train, I will be running two trains on two simple loops, so preferably will run two trains with a pushbutton for each, on a timer for two minutes. Simply, A kid comes up to the layout, pushes the button, a train runs for two minutes on a simple loop. Two buttons, two loops. An 'interactive' layout. I was advised to check out the arduino by forum members. I haven't yet, but am getting back to it. Is that an application the arduino could handle?
The use for Arduino really all depends on what kind of hardware you are working with. Because there is no standard hardware, "off-the-shelf" applications are rare.
For example, I have a complete Arduino-based automated control system that interfaces with:
Except of course for the Legacy and DCS bases, all of it is home-brew.
My code is probably too specialized and convoluted to be applicable to anyone else's setup, but I'm happy to share it with anyone who is interested.
William: yes, the Arduino could easily handle your application - once you have the hardware designed.
You would probably use relays to turn the track power on and off (assuming conventional control). The Arduino would read the pushbuttons and activate the relays using a transistor.
Interesting platform. Not very expensive, either. Haven't had time to play with one, but it looks interesting. Here are a couple of links:
http://www.siliconvalleylines....adingWithArduino.pdf
I posted asking for a timer that I could use on a proposed layout build. My intention is to have a button on the side of the layout that when pushed will operate a train, I will be running two trains on two simple loops, so preferably will run two trains with a pushbutton for each, on a timer for two minutes. Simply, A kid comes up to the layout, pushes the button, a train runs for two minutes on a simple loop. Two buttons, two loops. An 'interactive' layout. I was advised to check out the arduino by forum members. I haven't yet, but am getting back to it. Is that an application the arduino could handle?
If you are interested (or for anyone else that might be) another thing you might look into along these lines are the PICAXE programmable chips. Chips are fairly inexpensive and programming software is free. There is fellow railroader (garden scale, I think) that has a website that might be a good starting point for these.
http://www.trainelectronics.com/
Info on PICAXE chips here:
I don't know much about these either, but is also on my "to learn more about one of these days" list.
Depending on your requirements, may want to Google search for courses using "embedded systems" and "syllabus" as keywords.
Nicole:
The fellows here have given us plenty of answers. WOW!
Al W.
My code is probably too specialized and convoluted to be applicable to anyone else's setup, but I'm happy to share it with anyone who is interested.
I'd love to have your code. I am working with the Arduino, and I'd like to interface to the RailSounds serial stream that has a command structure like the base commands. It would be interesting to see your code.
Nicole:
The fellows here have given us plenty of answers. WOW!
Al W.
They have indeed Al.
I may be a little bit behind the times on some of these gadgets.
In fact I think that I'll go and write a letter to Charles and Ada, as I'm still having trouble connecting Mr Jacquard's program input device to my analytical engine.
There are lots of thngs that you can do with the Arduino. While there are public programs out there, you would probably have to know how to program to modify some of them to suit your needs. They are great for IR detection to activate things. They can be used to manage lighting leds. They are actually pretty powerful and any of the usual components you might use like resistors, leds, relays are very cheap. My nephew and I have done some work using IR detectors and such. If you do decide to get more involved with it there is a book titled Arduino Cookbook. It is about $25 but has a wealth of information and example programs you can download. I think we started out using a number of their programs to learn how its done and then modifying them to suit our needs.
i bought the Arduino more out of curiosity to see what they could do and to just learn something new. I am not at the point to use any of it yet but it is another useful way to make the train layout more interesting.
ed
You can do this with a 555 timer driving a relay. There are 1000s of these timer circuits online. Here is one that drives a relay. You would need to increase c1 (try 220uf) and maybe a 1 meg resistor in series with R1 to lengthen the delay to 10 minutes. No programming needed.
http://www.aaroncake.net/circuits/relaytim.asp
Or you can buy this timer as a $12 kit or $15 assembled. Just add a relay to handle the transformer output.
http://electronickits.com/kit/.../timers/canck002.htm
and the simplest of all is to wire an electronic light timer in your AC circuit to power off/on your transformer. Make sure that you don't exceed the load capacity of the timer. If you are not experienced with AC house wiring, find someone that is.
Here is a heavy duty one:
http://m.globalindustrial.com/...th-hold-light-almond
bob
Hey, thanks a lot RRDOC.
I agree, John.
The Arduino is much more versatile, especially for complex tasks.
TI has a competing microcontroller, the Launchpad. They were selling the development kit/board/chip etc for $5. Customers were ordering them by the dozens, so TI got wise and raised the price to $10.
Terry Terrance has posted his code for a variety of Model Railroad applications, including a signaling system. See this link:
http://freemodelrrclinics.blogspot.com/
BTW John, I have enjoyed reading your posts over the last year or so. Thanks for taking the time to provide circuits and great advice for all of us.
Bob
I bought the PIC starter kit when it was on a special. I could never get the IDE to recognize the development board, even with the help of the folks at Microchip. It's still in the closet, and I moved to the Arduino and never looked back. I love the fact that there are a ton of compatible products for cheap on eBay for the Arduino!
Not sure this is the right place for this question, but, new guy...
Has anyone used an arduino to control o22 switches? If so, I would appreciate some info or some link to the details.
Well, I've never done it, but getting the Arduino to control the switches with a relay board would be easy. The real question is, what is the input to actually tell the Arduino when to switch?
Yep, my query was to see what kind of logic was being considered that would require the uP for the task. First step here is a clear definition of the problem, then a solution can be considered.
The idea of using the ARDUINO is to set up routes and be able to control them with a push button. Each push would cause the o22 to change direction. I am not sure about the type of hardware that the ARDUINO talks to control the actual voltage to the switch. I have looked at a 4 and 8 relay shield for this. Is this a good way to go or is there another sield (or buikd your own) that I can use. I am looking for suggestions.
The code is not the problem, it is what hardware to interface to control the voltage, mainly the current, to the individual switches. I plan on about 20 for the layout.
Steve,
I don't know if you are locked in to the pushbutton method but you might look at some of the touchscreen shields. I was looking at using one a while back and it had 12 pressure points on the pad. That could easily be used to trigger your relays with a bit more programming.
Ed
You can buy an 8 port relay board for $8.95 with free shipping, no possible reason to roll your own if you need relays. You can't buy the parts for the cost of the completed board.
John,
Oh how I wish I had found these relay modules a while back!
You see, I have been making relay modules (6 relays per) to control track blocks on my layout, and used the inexpensive (about $2 each) automotive relays with 12VDC coils, higher than necessary contact ratings, and they work fine.
At the same time, I have been playing with the Arduino and finding all sorts of neat gadgets such as the relays you just mentioned.
Well, there is no need for the Arduino or any other such device to control these relays. They run on 5VDC, and simple toggle switches will operate them just fine!
I could have saved a lot of $$ and a LOT OF TIME using these relays modules instead of the ones I made. Besides, they take up less space and look a lot neater.
Now I am tempted to replace the home-made modules I have already installed, change my DC power supply from 12V to 5V, and use the existing wiring and toggle switches.
It seems that there always is a better way of doing something, and we usually find out after we are done with the more difficult approach.
Alex
John, thanks for the tip. I agree at that price I just ordered it. Thanks again!
I've been a victim of the "gee that's an easier way" after completing a project many times.
I still can't understand how the Chinese manage to ship these products from halfway around the world for the prices they do!
I've been a victim of the "gee that's an easier way" after completing a project many times.
I still can't understand how the Chinese manage to ship these products from halfway around the world for the prices they do!
Government subsidy?
...and quit showing me neat electronic stuff like the relay bank that I wish I needed!
OK, I won't post any more "neat" stuff.
Has anyone done any work with the Raspberry Pi processor? How does this one compare with the Arduino? I am interested in both...
Has anyone done any work with the Raspberry Pi processor? How does this one compare with the Arduino? I am interested in both...
As far as I know, a Raspberry Pi can be paired with, but is not a substitute for Arduino.
This article explains how someone did that: http://www.element14.com/commu...RPi-beginner-callout
The Raspberry Pi processor is much larger in their basic form factor. As Flash states, I think it has a different target market.
How do you program an Arduino board? Is there a PC interface? What programming language do you use?
Al,
There is an interface to the PC via a usb cable. You download the free Arduino software from the internet. The software provides you the programming tools for the Arduino. You write the code, compile it and then download the "script"onto the arduino. (I don't believe the program you create is actually called a script but I cannot think of the actual name at the moment). It is all one step to accomplish. The programming appears to be similar to C. Instructions IMO are clear and fairly easy. There are tons of free scripts available. If you do get into it there is an excellent book called
the Arduino cookbook. Explains every function and has lots of example scripts you can modify to suit your purpose. You will need a bread board, jumpers and whatever electronic components you need for your project. All available very cheaply.
Ed
You are close, Ed - they are called 'Sketches'. There are many YouTube videos on how to use and program the Arduino, and I believe that the series by Jeremy Blum is the best. Just do a Google or YouTube search for his Arduino series.
And to revisit the topic of relays, here is a picture showing the relay modules I have been making for my layout using automotive relays, and the readily available modules. The latter are intended for the Arduino, but work fine with a 5VDC supply and plain toggle switches.
Cost of the home-made 6-relay module: About $20 and 3 hours.
Cost of the ready-made 8-relay module (Ebay): $10 delivered.
Also, the ready-made modules have an LED for each relay, all inputs are optically isolated, and each relay has a flyback diode. (My home made modules also have flyback diodes.)
Alex
Access to this requires an OGR Forum Supporting Membership