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.

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
 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)

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

Comments

  1. got this working and have designed the hardware to drive 8 KATO points with mods to the supplied software. goconnor62@me.com

    ReplyDelete
    Replies
    1. Nice work, feel free to post a link where we can see the results.

      Delete
  2. hello,
    This 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

    ReplyDelete
    Replies
    1. Strange, seems to work alright for me.
      What extractor program are you using?

      Delete
  3. I can't Unzip the file on MacOSX !!!

    ReplyDelete
  4. Sorry, I found The Unarchiver : it's OK now !

    ReplyDelete
    Replies
    1. Good to hear, let me know how you get on with it

      Delete
  5. Hi,
    I can´t extract your compilled code too! I´m using the WinRAR. The error code is: "unknow format file or damaged file!"

    ReplyDelete
  6. Hmm, I'll have to try reziping the code and trying again

    ReplyDelete
  7. Hello Adam,
    I tried to download the code but the link is not working anymore. Can you help me?
    Thanks,

    Frits

    ReplyDelete
    Replies
    1. Altough the link is not working i managed to download it by accessing your website directly.

      Greetz,

      Frits

      Delete
    2. 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

      Delete
  8. Hello Adam,
    I 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

    ReplyDelete
    Replies
    1. 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.

      As for the error your getting, I can't recreate it on my end, have you made any changes to the basic example sketch?

      Delete
  9. Hi,

    The link pointing to the source code is not working.. Will you be able to fix it?

    Thank you

    ReplyDelete
    Replies
    1. Hi Nuwan
      In 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

      Delete

Post a Comment

Popular posts from this blog

DCC Decoder v3 Firmware

The Price of decoder parts