Building a DCC Decoder
For some time I've been considering various ways of controlling points, the one thing that keeps coming back to me is to operate them through DCC, but perhaps also link it to a control panel that will allow me to combine it with the toggle Switch method.
Now although Myna bay Provides a DCC monitor code to load onto the Arduino, it doesn't help us much as it only provides binary feedback.
The better Monitor to use is included with the NMRA DCC Arduino Library here (It is also included in the code for the Decoder) as it tells you whats accessory has been called and is better to code with.
Now I'm not putting up the assembly steps for the monitor because it should be easy enough by reading the circuit diagram and comparing it against my picture, (note, you may need to change DCCAckPin in the NMRA example to 2 or just change the jumper cable from pin 2 to 3)
For some time I've been looking at Arduinos and they may do what I need them to do.
So far I've got a basic circuit and code set up, all thats needed is a servo to Test, which is on order, I shall perhaps upload a video once its all working.
Though I'm sure some people may like to see whats been done so far.
The Circut for the monitor which allows the Arduino to see whats going on Myna Bay DCC Monitor |
An Arduino Uno, any Arduino can be used for this, though its easier if you can attach shields to it |
The Prototype shield set up with the DCC Monitor Circuit |
The better Monitor to use is included with the NMRA DCC Arduino Library here (It is also included in the code for the Decoder) as it tells you whats accessory has been called and is better to code with.
Now I'm not putting up the assembly steps for the monitor because it should be easy enough by reading the circuit diagram and comparing it against my picture, (note, you may need to change DCCAckPin in the NMRA example to 2 or just change the jumper cable from pin 2 to 3)
The code I have compiled so far can be downloaded here (download includes additional librarys that are not included with the Arduino Programmer, just extract to your sketchbook folder and it will maintain its architecture)
As of yet I have not been able to test the code but it should™ work, Currently I am waiting on a servo to test it and I'll add a video once I have it working.
1/12/13
Edit, I have re uploaded the decoder sketch, and should work now without any errors
9/2/14
Edit, Link was pointing to a file that no longer exists, this has now been fixed, new version also uploaded solving issues that meant servo would not respond to its adress
1/12/13
Edit, I have re uploaded the decoder sketch, and should work now without any errors
9/2/14
Edit, Link was pointing to a file that no longer exists, this has now been fixed, new version also uploaded solving issues that meant servo would not respond to its adress
got this working and have designed the hardware to drive 8 KATO points with mods to the supplied software. goconnor62@me.com
ReplyDeleteNice work, feel free to post a link where we can see the results.
Deletehello,
ReplyDeleteThis assembly is very interesting and promises beautiful assemblies decoders.
I can not download your compiled code. (this archive is not a valid zip archive).
cordially
Strange, seems to work alright for me.
DeleteWhat extractor program are you using?
I can't Unzip the file on MacOSX !!!
ReplyDeleteSorry, I found The Unarchiver : it's OK now !
ReplyDeleteGood to hear, let me know how you get on with it
DeleteHi,
ReplyDeleteI can´t extract your compilled code too! I´m using the WinRAR. The error code is: "unknow format file or damaged file!"
Hmm, I'll have to try reziping the code and trying again
ReplyDeleteHello Adam,
ReplyDeleteI tried to download the code but the link is not working anymore. Can you help me?
Thanks,
Frits
Altough the link is not working i managed to download it by accessing your website directly.
DeleteGreetz,
Frits
Thanks for letting me know, I will update the link, though the version on the server is old, and I have a new version to upload when I get the chance
DeleteHello Adam,
ReplyDeleteI tried to compile NmraDccExample_1. The compiler gives an error and hold at:
struct CVPair
The error message is: variable or field 'notifyDccMsg' declared void.
Can you please help me out?
Frits
Hi frits, can't really help on that as the example is something that was included in the library for seeing what the dcc signal is giving out and what I based parts of my code on.
DeleteAs for the error your getting, I can't recreate it on my end, have you made any changes to the basic example sketch?
Hi,
ReplyDeleteThe link pointing to the source code is not working.. Will you be able to fix it?
Thank you
Hi Nuwan
DeleteIn anticipation of something I plan to do with this in the next couple months, I have removed the code from public access, please keep an eye on my blog for more information