We couldn't control an electromagnetic TO, such as the Kato, directly from the pins since there is not enough current to drive the coil. We would need a small circuit that includes a few resistors, transistors, and capacitors (for each TO). Since accessory decoders already have these embedded, I stuck with them for my own layout. However, it would be neat to design a shield that includes this so you would not need the decoder.
Hi Gregg, I have ordered parts to (also) build several of Geoff Bunza's fabulous accessory decoders (based on Arduino Pro Mini's) to use as DCC servo controllers for turnouts. Combined with your DCC++ as a controller this is truly a great setup! I do like the idea of having the option to run a layout with a physical throttle and control panel to throw the turnouts in addition to fully PC based control. I was thinking of using the extra Mega to just generate the DCC signals to throw the turnouts via push buttons, and use the other Mega as primary base station. Just a thought.. Kay
If you do a google search for Arduino Model Railroad Turnout Control using servos there is extensive responses and code to do so....to Michael who asked about which Pololu Motor Shield I used it is this one: https://www.pololu.com/product/2503
Arduino pins won't be able to fire anywhere near enough current to drive a Kato (or any other) turnout. You'll at least need a relay (or two) to handle the current.
Oh that is AWESOME! I had something like that in mind, but haven't gotten around to working on it yet. What I actually need are some custom IR detector boards, but they're the same basic idea with different "shield" circuits... Very, very cool. Thanks for the link!
Thank you for the confirmation Scott, I did search back in the topic and found the references to this motor shield, the required jumper arrangements etc. It certainly looks robust enough and the specs are good! I might need to get me one! As Twindad exclaimed, this is getting exciting and I'm thrilled to see more options wrt accessory decoders based on the mini...... Time for some serious "playing". Michael
I really like the idea of Arduino-based accessory decoders! However, I would note that for mobile decoders, we don't have much choice and need to generate DCC signals if we use standard mobile DCC decoders in our engines. But for an accessory that ultimately is controlled by a logic pin, if we use an accessory decoder based on an Arduino (or similar) AND we use an Arduino to create DCC signals in the first place, we are basically telling one Arduino to flip a pin, at which point it creates a DCC signal, sends it to another Arduino, which decodes that signal, and then flips the pin on its own board. Nothing wrong with that of course. But sort of like printing a copy of a Microsoft Word document, and faxing it to someone, who then scans it into a computer and uses OCR to re-create the original Word document. That works, though it may have been easier to simply send the Word document directly in email.
using something like https://en.wikipedia.org/wiki/XBee setup as star topology might be interesting for accessories, lights turnouts etc. EDIT: Or https://en.wikipedia.org/wiki/ZigBee might be better.
Here's a webpage about a basic setup for a servo. You'd still need to write the logic for handling a push button input, if that's what you're using. I just tried it on my Uno and it works. http://www.hobbytronics.co.uk/arduino-tutorial2-servos Steve S
Hello All, I pulled this link from the Arduino Forums and it goes into depth about controlling servos and model railroad turnouts: http://forum.arduino.cc/index.php?topic=315457.0 Again there is alot of information out there on how to do this. And another one for NScale: http://thenscaler.com/?page_id=174
Yes, absolutely, I get that..... and I understand the added complexity of decoding and transmitting a signal which then is merely received and untransmitted. However, part of the appeal to me is the removal of the "spaghetti" wiring from all turnouts, etc. that I recall from my grandfather's setup; the thought that all the signalling can be sent along the rail "bus" to strategically placed decoders is very appealing to me.
Yup, same here. Imagine a pretty complex switch panel, and all you need are the 2 track wires coming out of it! And all you would really need to run the length of your layout is the track wire bus and maybe a separate 5V DC bus to power the accessory decoders, servos and everything else. That would make an additional Mega/Motorshield look worthwhile to me. My last layout had 2 control panels, and one of them had to have two 25 pin connectors to make it removable and to connect all the TO switch machines and feedback LEDs assigned to that panel. The wiring had gotten so complicated, that I no longer had fun working on it and decided to tear it down and to start over. 2 pairs of cables. Yes!
For Your Information, I suspect that some of you might be interested in this. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ World’s Largest Arduino Maker Challenge This two-phase challenge is for you! Phase 1: 1,000 makers will win the newly released Arduino MKR1000 (US only) and Genuino MKR1000 (Outside US) boards powered by Atmel. Phase 2: Three finalists will be selected to showcase their projects; a professional video production of you and your creation; and a whopping $500 gift certificate to Adafruit. Finalists will also be profiled on Atmel’s Social Media channels—one of the largest semiconductor social media footprints in the world. What are you waiting for? Check out the details and sign up today! Have a question or need inspiration? Explore the Atmel blog and Community. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Bob
Michael - that's a terrific point and I completely agree. The mess of wires under my layout is just barely manageable. Anytime we can converge on a single bus, especially if that happens to be the tracks, it greatly simplifies everything. Because my own layout is very small (80" X 36"), I can readily reach the Arduino from anywhere. But for a large layout, running all of those extra wires would be problematic. Dwayne's idea for using an XBee or ZigBee would also be worth exploring, since that might eliminate the signal bus entirely. However, no matter how we control the signals, we still have the problem of being able to drive electromagnet snap-switches. Ironically, even though servos are a bit more complicated, they can be controlled directly from an Arduino, provided they have separate power. But snap-switches either need two mechanical relays (as w8one shows above), two solid state relays (check out https://www.sparkfun.com/products/10636), or some combination of power transistors. Would be great if we could come up with a robust design and mass-produce small ready-to-go units.
I have a fairly generic relay shield I've been meaning to play with. Should do the job nicely for a pair of turnouts, anyway. Once I get clear of the initial JMRI work and the WiThrottle implementation, I'll take a look at a custom board...
Iv'e been looking at openLCB http://openlcb.com/, but it looks like its only half baked right now and out of date. Browsing you tube i found a website called http://www.superhouse.tv/ He is using arduino's with MQTT http://mqtt.org/ Not for model trains but same principals using Ethernet powered arduinos. Looks interesting to me.
These 8 channel relay boards on eBay are going for around 5 bucks and can control 4 solenoid switch machines directly from an Arduino.
OpenLCB is now NMRA's LCC (or at least a slightly watered down version ogm It only looks half baked and out of date (actually the documentation might be alittle behind). OpenLCB is under active development, and is the base for NMRA's new LCC (LCC is essentially a slightly downlevel version of OpenLCB). Most of the development conversation, I believe, is occurring on the OpenLCB Yahoo! group.