Has anyone ever heard of a method to use an Arduino Nano as a DCC decoder? It is a good candidate because it will fit in many locos with its small size and has many I/O pins for controlling lights and sutch, it also is very affordable. I bought one on Wish for $3. I also have a small audio amplifier module the size of a nickel that could then be used to even add some sound with some work. Does anything like this exist? Or do I have to venture on and do it myself?
in addition to the nano, you need a bridge rectifier, probably some tantalum capacitors and an h-bridge or a pair of dual mosfet chips to drive the motor. the nano is probably larger than the size of most decoders that has at least all these components.
see Geoff Bunza's article
greg - Philadelphia & Reading / Reading
Perhaps as a stationary decoder, where size doesn't matter. For a loco decoder, there is a DIY DCC decoder project out ther you can google for. Best be able to solder SMD, to get it small enough. The processor used in the Nano will work, although there are better choices that are smaller with fewer IO pins, but many can be programmed with the Arduino IDE.
--Randy
Modeling the Reading Railroad in the 1950's
Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.
For the price point of buying at the components needed (as stated in a previous post) you are already at the price point of a pre-fabricated decoder and have a much larger footprint.
I use them for accesories on the layout but wouldn't consider using the Nano's for a decoder.
Colorado Front Range Railroad: http://www.coloradofrontrangerr.com/
I think Arduinos make great decoders. I made a couple stationary decoders out of the similar Arduino Pro Mini, and I plan to put a couple in passenger cars for controlled lighting. Yes you can buy decoders that are more compact. But there are a lot of things in this hobby that we could just buy instead of make; making is part of the fun.
I looked at the link provided in the first reply... that'd undoubtedly work though both the hardware and the programming are a bit more complicated than mine. Basically all mine is, is four fast diodes to make the rectifier with a voltage regulator to supply power, a fast diode and an NPN transistor to read the DCC signal, and a few prudently placed resistors and ceramic caps. Their optocoupler is pointless IMO. Driving a locomotive would need a few more components but definitely doable.
It'd be a fun project if you enjoy tinkering with electronics and programming stuff, however you should have at least basic experience in both those fields before tackling it, lest you find it too difficult to be enjoyable.
Every considered making an LCC node?
BMMECNYCEvery considered making an LCC node?
CAN requires hardware that immediately recognizes collisions and aborts transmission.
speedybeeTheir optocoupler is pointless IMO.
i agree and built a decoder w/o an opto. Geoff B said you never know what someone might connect to it (??). did learn the common optos are not fast enough for DCC
CAN on Arduino isn't impossible, there are CAN Shields. The CAN interface chip handles the collision detection and retransmits. First couple I found talk to the Ardunio with SPI - so the speed of the Arduino isn't an issue in managing the connection the CAN bus.
I mean - you can do Ethernet on an Ardunio....
hobbyists (groups.io/g/openlcb/topics) are certainly developing Arduino SW to support CAN and LCC
along with the extra hardware and interafacing to it, recognizing when a transmission is aborted and retransmitting, LCC nodes are intelligent in that they directly communicate (address) messages to other nodes unlike C/MRI-like nodes that are simply slaves.
LCC nodes need to be configurable to generate (address) and respond to messages from other nodes. The means to configure LCC nodes is yet another consideration although JMRI may support it.
this level of sophistication avoids polling nodes so that it can support very large layouts requiring many more than a 100 nodes. how many of us have such a layout requiring such sophistication
Which is why so many people who have DCC systems that used polled busses have used Loconet int he past. It's more or less a slower CAN or Ethernet. Not polled. It's slow enough to be supported directly by an Arduino or similar small micro with just a simple hardware interface - a comparator on input and a transistor for the output. And fast enough for even a large layout with lots of detectors and signals.
An Arduino is a great tool for lots of small projects, including MRR. It's not good or bad, just different. If you think about it, DCC itself is kinda weird compared to most of the other data transmission methods used for computers! I, myself, wouldn't choose to do much in a small scale like HO or N, but if you go up a bit (I use 3/8"n20, 1:32 on HO track using On30 mechanisms) you can do amazing things. The important thing to realize is that computerizing things is a) an incredibly useful skill to have (I've made a $six-fig income doing this for decades, without a BSEE or CS), and b) only going to get easier and smaller, and c) a possible way to fascinate kids and get them into the MRR hobby.What you are suggesting is not difficult, and I guarantee that you'll learn a lot by doing it. There are lots of on-line articles that include code for Arduinos and audio, so use your browser FIRST. Ditto the electronics hardware interfacing, although even Google has a hard time interpreting schematics <wink>. Your first one may take you a week or two, but after that the stars are the limit! Some people are afraid of 'polluting' MRR with electronics and programming, but it's as much an artistic tool as an airbrush or X-Acto knife. Just tell them "YMMV, but I'm having fun!"Willdebeast, eh? WildeBEEST was my nick as a kid, because of my name and my long shaggy hair that begged the question... ;-) PM me if you want to chat.
in my opinion, an arduino doesn't save any space, possibly any time, or any money ...
BUT it's all about having fun, and that's certainly one way of accomplishing that end ..