SMA10 – Build a 17-Function DCC Decoder for about $5

geoffb's picture

My activities in Scale Model Animation often lead me to use DCC as a control method for sequencing. This could include building and street lights, even sparking welders and twinkling camp fires. Timing can be done with JMRI scripts (Like this: http://youtu.be/RXpvp5mIXvU?list=PL4dHfZjHc9t-pvctGQzSuOXBLG1M42xbS) or with programmatic control (Like this: http://youtu.be/zlcdJKXj_YI?list=PL4dHfZjHc9t-pvctGQzSuOXBLG1M42xbS). Control switches for such projects are a must. Using 4 or 6 function DCC decoders in this regard, can get costly, quickly. But with a little effort, and some low cost components one can build a DCC decoder supporting 17 independent functions for about $5.00, or less, depending what you have on hand.  This version has no CV’s, uses no DCC programming, can be set for any short address in CV1, and controls 17 Function Lines (which I am using to drive the green LEDs in the example below). Interested? Read on! (Latest Rev for this work can be found here: http://model-railroad-hobbyist.com/node/19446 )

Comments

...

Geoff, you're not a professional getting paid to do it....which is kind of the point.  The professionals putting decoders on the market should have done this already.  Instead they offer 4 function switch decoders [enough outputs for four switches] for absurd prices like $30 each...

Best of luck to you, I'll certainly stay tuned in!!!

---------------------------------------------------------------------------------------------------------

Benny's Index or Somewhere Chasing Rabbits

geoffb's picture

Follow up comments

Hi all,

It has come to my attention that some people already found and loaded a previous version of the NmraDcc library. I have modified the original library. Use ONLY the one in the zip file I provided and delete the other, else your decoder  will NOT work.

As was correctly pointed out, small wattage soldering irons are appropriate for this kind of work (12-25W) BUT higher wattage temp controlled irons with small pointed tips are fine too. Never use a soldering gun here-- you would be asking for trouble.

@Benny-- Ah! I got your point. Thanks.

Best regards,

Geoff Bunza

 

Michael T.'s picture

On my to do and explore list....

I have several ongoing projects which are occupying my time and most importantly my very meager hobby budget but this decoder is definitely on my "to do and explore" list, especially when servo control becomes a reality.  Still holding out hope for a PCB too!!

Michael

Michael

Original member of the "Gang of Six"

R.I.P. Verne Niner. The time I got to know you was way too short my friend.

"We all model the prototype, to suggest otherwise is ridiculous"

My Pike, https://mrhmag.com/blog/MichaelT

 

geoffb's picture

@Michael

Michael,

You keep working on me!   ;-)

The response to this has been so strong, I am weakening to build and test a small PC board.

I'm giving clinics at the NNGC next week so have some patience.

The odds are increasing.

Best regards,

Geoff Bunza

 

Test unit with Servo control working

Good day, all - with Geoff's help I have my test units working and have tweaked the code to operate a servo. 

There are two servo routines.  One uses three DCC controller function keys to move the servo to three preset positions, one left, one right and one center.

The other routine moves the servo incrementally to the left and right as well as to the center.

I have my notes and program files posted on my web page here:

http://www.trainelectronics.com/DCC_Arduino/

Please let me know if you have any questions

dave   (email: dave@davebodnar.com )

 

diodes D1 and D2?

Geoff, 

What is the purpose of the schottky diodes D1 and D2 in the circuit?

 

Thanks,

Glen Frix

geoffb's picture

Diodes D1 and D2

Hi Glen,

Great question! Short answer-- noise mitigation, together with all the capacitors in circuit, particularly C8, the 270pf cap.

You're not going to believe this but I put the circuit and the code together very quickly but couldn't get the decoder to work consistently when I moved the connections around the track, and then spent days trying to identify the problem. I found that high frequency noise spikes were messing up the DCC signal transition decoding by the 6N137, which is a fast opto-coupler. The Schottky diodes were an old trick to isolate the power feeds to the two sensitive devices: the 6N137 and the Pro Mini processor. They helped, but it wasn't until I added C8 as a small low pass filter to the 6N137 photodiode that it became very stable for me. I left the Schottky diodes in the circuit as a continuing precaution.

Or maybe I was too tired to take them out and see if it would work regardless!  ;-)

Best Regards,

Geoff Bunza

 

geoffb's picture

@Dave's Servo

Hi Dave,

Great job! This is exactly what I hope more modelers will try!

And if people follow Dave's link, you'll also find that you can build  this decoder up rather easily on a small solderless breadboard-- as Dave has demonstrated too.

Best Regards,

Geoff Bunza

 

...

That servo control is just the ticket for Semaphore operations!!!!

Good Bye Tortoise!

---------------------------------------------------------------------------------------------------------

Benny's Index or Somewhere Chasing Rabbits

Short video showing servo operation

I made a video of the servo in operation:

 

dave


>> Posts index


Journals/Blogs

Recent Blog posts: