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

geoffb's picture

@Michael

Hi Michael,

In my clinics you would likely hear me say "As a modeler, don't first learn programming... learn how to copy and edit." As stated in the article above, there's all the code to implement this version as is, and references to get to started and how to load it, step by step. Any unintentional gaps or omissions I can cover with Q&A. With your experience this should be straightforward. You MIGHT want to learn more and go beyond that, but that's up to you alone. I've worked with modelers who have less experience than you to get up and running.

Sometimes, people suggest things that are really costly, and I don't want to try them because if they don't work I will loose too much. Even if one considers this a risky proposition, it's a low cost experiment, and you can take it as far or as little as you want. smiley In my experience the return has been worth it-- you can see some of the results in my other blogs:

http://model-railroad-hobbyist.com/blog/geoff-bunza

and in these videos:

https://www.youtube.com/user/DrGeoffB

Have Fun! Best Regards,

Geoff Bunza

 

 

Michael T.'s picture

One suggestion....

from the hardware point of view would be a PCB.  Nothing wrong with point to point on a perf board but a PCB would make life easier when making more than one decoder. Where is Alan when we need him...LOL 

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

 

LKandO's picture

Busy

Where is Alan when we need him...LOL

Busy making Photoshop files for Rob.

Seriously Geoff, if you want PCB and mask art isn't your thing then contact me.

Alan

All the details: www.LKOrailroad.com        Just the highlights: MRH blog

When I was a kid... no wait, I still do that. HO, 28x32, double deck, 1969, RailPro

geoffb's picture

@Alan

Hi Alan,

The PCB should be very doable-- there really isn't much. One would have to pick the right components, sources, and footprints. I drew the schematic with the Eagle PCB tool, but didn't pay attention to packaging since I had no need for PCB's myself. If anyone wants the Eagle schematic file I'd be happy to post it. The LEDs and dropping resistors would need to be changed to solder pads (unless you wanted then as a diagnostic tool version).

There seems to be more interest in this than I had imagined. A PCB board might be warranted.

Thanks for the interest.

Best regards,

Geoff Bunza

 

Michael T.'s picture

I think a PCB would be cool....

Geoff may not care...LOL.  Again, PCB layout is something I need to learn how to do, just like I need to learn basic programming. I've always thought I'd get around to it at some point but I've just got some many irons in the fire, what with being involved in several different hobbies, that I just never find the time.

Michael

P.S. If you go SMD's I'd suggest no smaller than 1205 size.  Anything smaller is a bugger to hand solder.

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

 

Bernd's picture

Question

Geoff,

What you have presented here is a receiver ,correct? So in order to be able to operate the 17 function decoder I would need a system such as NCE or Digitracks makes in order to operate or program the decoder? Like a Pro Cab or a Cab6 from NCE. This is not a stand alone device. I guess what I'm asking is that you would need a DCC system to operate the 17 function decoder?

Bernd

New York, Vermont & Northern Rwy. - Route of the Black Diamonds     

geoffb's picture

@Bernd's question

Hi Bernd,

Yes, this is configured as a non-programmable DCC decoder. As you correctly state-- a DCC receiver. The DCC decoder address is set once you load the Pro Mini. These are no configuration variables (CV's) in this version. To turn on and off each function one would need some kind of DCC controller. There is no motor speed control, either, in this version.

Later versions will have programmable CV's and address. This version can be programmed in CV 1 for a short address via DCC protocol, but it auto resets on power up-- intentionally. KISS is operable in this version.

Best Regards,

Geoff

 

Bernd's picture

Ok

Thanks Geoff. I probably won't start right now, to many other projects on the burners. But I surely will be following along.

Bernd

New York, Vermont & Northern Rwy. - Route of the Black Diamonds     

HVT Dave's picture

Hardware vs code

Geoff,

Great project, thanks for sharing.  I really like the diagnostic capabilities. 

If I understand correctly once this hardware is assembled you use changes in code to change the output such as flashing, dimming, push-on/push-off, active while pushed, etc?  

Will servo control require additional hardware or just code?

Can JMRI Logix be used to control the 17 outputs, making this a possible signaling decoder?

Regards,

Dave

Dave

geoffb's picture

@Dave's Questions

Hi Dave,

If I understand correctly once this hardware is assembled you use changes in code to change the output such as flashing, dimming, push-on/push-off, active while pushed, etc?  

For the decoder exactly as presented here: Yes, code changes are the only way to enhance features. That said, I am working on code changes to support writing CV values into the decoder, so we can set functions per pin. For example, say CV 70 controls Function 10. I could program the Pro Mini to recognize that if CV 70 were set to 0 it would behave as a simple on/off switch corresponding to DCC Funtion10 on/off, but if I set CV 70 to a 1, it might blink on/off at a set rate. Another value for CV 70 might do other weird and wonderful things. I haven't conjured up what the array of capabilities will be... yet! This is the baseline decoder from which I am starting, or from which you can start!

Will servo control require additional hardware or just code?

I regularly drive cheap 9G servos directly with the output pins of the Pro Mini-- it works great and requires no additional hardware! If you look into the building animation I've presented here:

http://model-railroad-hobbyist.com/node/14093

The movement of the two figures in the windows are servo controlled in this manner. For servo control it is really desirable to designate a start and stop position (end to end). Think of controlling the swing of a turnout for example. So one, maybe two CV's might be used to state this, likely per servo pin. If we want to get fancy about it, we might also want another CV to set relative speed of the servo swing. So multiple CV's are needed. The really neat thing here, is that the Pro Mini has plenty of memory to do all this.

Can JMRI Logix be used to control the 17 outputs, making this a possible signaling decoder?

I sorry to say that I don't know the answer to this. I use JMRI but have never used JMRI Logix, nor do I know what is required of the hardware to support it. Perhaps some other enterprising soul will have a go at this one. I use JMRI scripts all the time, and they should have no problem setting functions as they do with other decoders. This is actuaally the real value of the NMRA DCC standard-- as long as the decoder conforms to the basic communication standards, this should work with most any DCC controller.

'Hope this helps. Have Fun! Best Regards,

Geoff Bunza

 

 


>> Posts index


Journals/Blogs

Recent Blog posts: