Geoff Bunza geoffb

This article describes some simple changes for the SMA20 Mobile/Accessory/Multifunction 17 Channel Configurable DCC Decoders, which can increase the power provided with the on-board circuitry to deliver two Amps from the DCC bus to the decoder. A new decoder board is offered, as well as a couple of interface tips for the modeler.

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
Geoff Bunza geoffb

Building Beyond the SMA20 Decoders

Starting with the SMA20 Decoder Build

The detailed description describing the SMA20 17 Channel decoder can be found here:  SMA20 Low Cost 17 Channel DCC Decoders Ver 6.01 with Sound,Triggered Sound,Stepper,Dual Motor,LED and Servo Control  https://forum.mrhmag.com/post/sma20-low-cost-17-channel-dcc-decoders-ver-6-01-with-soundtriggered-soundstepperdual-motorled-and-12201920 including all the downloads and construction instructions.I will not repeat them here. If you are unfamiliar with the SMA20 decoders, read the article listed above first.

Now, let’s first show how to increase the power the decoder board can deliver. The following shows the original 3P Decoder schematic:
hematicS.jpg 
                        SMA20  3P Decoder Schematic

Device B1 is a diode bridge and IC1 is a 7805 5 Volt regulator. Depending on which parts you originally used, you were limited to 1 to 1.5 Amps for decoder power. By substituting two new parts I located, you can increase the available on-board power to 2 Amps. Both must be changed.

You can substitute either of these Digikey.com bridges:
DF204-G Bridge Rectifier 400V 2Amp Digikey #641-1341-5-ND  $0.59
or  DF210-G Bridge Rectifier 1KV 2Amp Digikey  #641-1343-5-ND  $0.59

And you can substitute these for the 7805 regulator:
MEZD71202A-G DC-DC  Converter 5V 2Amp          from Digikey.com   #1589-1465-ND  $5.22
or  PSU5a 5V 3A Regulator in TO-220 form Factor  from EZSBC.com   # PSU5a  $7.95

Both of these voltage converters run cold, producing little to no heat! They are very useful if your decoder will be placed in a tight enclosed space, or directly next to plastic. These are very useful in many modeling situations.
EZD7120A.jpg              PSU5a.jpg 
        MEZD71202A                                  PSU5a
20boardE.jpg 
                        SMA20  3P Decoder Board

A New Decoder Board

I modified the original 3P decoder board (the one that would accept the TO-220, 7805 voltage regulator) and you can download the new, zipped Eagle board file (.brd) from here: 
http://mrhpub.com/files/users/geoffbfiles/DCC_Decoder3PJ.zip

As per the directions laid out in SMA20, you can use the Eagle .brd  file to get your boards made at your favorite fabricator. I still use OSHPark.com and have never been disappointed.
%20board.jpg 
                        3PJ Decoder Board

The 3PJ decoder board has power selection jumpers added to select either the 5 Volt supply or the Raw 12 Volt DCC supply to power the dual H-Bridges used for motor and stepper control. You should form a solder bridge (blob) from either TP1 to TP2 to select the 12 Volt feed, or TP2 to TP3 to select the 5 Volt feed. Do not bridge all three! To create the jumper blob solder on the two adjacent pads you intend to short together. Then with your hot soldering iron, melt a small additional amount on your iron’s tip, and touch it between the two solder pads on the board to fuse the two together. It is quick and effective. Don’t leave your iron heating any of the pads for long or you will “lift” them off the board!

The 3PJ decoder board also has minor trace modifications to widen all the Ground and Power traces on the board. Another small change was to set the spacing  between the DCC1 and DCC2 input pins to 0.10 inch to allow for certain headers and connectors to be used to attach to the DCC bus. Considering  the changes described above, the overall functionality of the 3PJ board is exactly the same as the 3P board I originally provided.
aticS(1).jpg 
                                     3PJ Decoder Schematic

0Jumpers.jpg 

                         3PJ TP1,2,3  Power Jumpers on Bottom of Board

Direct +5 Volt Power to the Board

This has been covered before but keeps getting asked: How can I power the decoder independent of the DCC bus? Answer simple -- leave the regulator off the board, and directly connect the external +5 Volt DC supply to the center and rightmost pin of the +5 Volt regulator in the picture below. (You can also omit the bridge rectifier too).

sLabeled.jpg 
Direct Power connections for Ground (GND) and Power (+5 V)
 

Simple interfaces for lots of applications

It is sometimes desirable to have your decoder turn on an off higher power devices that exceed the nominal 20 milliamp current limit of the Arduino pins. The output pins from a Pro Mini can both sink and source about the same amount of current (up to 20 milliamps). So it can easily turn on a cheap NPN transistor like a 2N3904, 2N2222A, PN2222 or PN100 and the like -- very low cost and easily obtainable either new or on the surplus market. Many more transistors will work too. The NPN Base connects to the Pro Mini digital output pin via a small resistor 470-2K should do just fine. The emitter connects to ground and the collector goes to one side of the device you want to turn on and off, like an incandescent lamp or small motor.. The other side of the coil goes to the appropriate power supply for the device -- likely 5-12 V or whatever. This is shown in the following figure:
nterface.jpg 
Simple Single NPN Transistor Interface for Single Pro Mini Output Pin

Note: these comments assume you are powering something requiring higher current/power from the +5 Volt supply (in the above diagram). It is assumed the +5 Volts power is not coming from the Arduino on-board 5 Volt regulator, as it has limited capability. When using an external power source (like a 5 Volt wall adapter), make sure the Arduino GND and the external power ground are connected.

You can connect the transistor collector to a relay energizing coil. The other side of the coil goes to the appropriate power supply for the relay. A diode across the coil (cathode to + supply feeding the relay, anode to the other side of the relay connected to the transistor). This is a clamp to prevent undesirable spikes generated when the coil discharges. It would be wired like this:
driver-s.jpg 
                                    Simple Interface for a Relay Driver

Here is a commercial offering found on the net (ebay.com, amazon.com and many more) that offer transistor controlled relays available in 1,2,4,8, and 16 relays per module for a relatively low cost:
                d_relays.jpg 
Quad Commercial Relay Board - Arduino Pins connect to IN1,IN2,IN3, and IN4

If you are very careful selecting the appropriate relay you can directly drive the relay coil with an Arduino output pin. Appropriate relays can be rated from 3-5 volts and should require less than 30 milliamps to operate. Again, it is still a good idea to add the diode across the coil as shown before. Here are a couple of examples from Digikey.com:
OMRON G6K-2P DC5 RELAY TELECOM DPDT 1A 5VDC Digikey #Z116-ND  $3.86
or Potter & Brumfield 1-1462039-5 RELAY TELECOM DPDT 2A 3VDC $3.87

These relays can switch 1 Amp and 2 Amps respectively. They represent an easy way to control much higher power devices (like turnout solenoids) than the unaided Arduino decoder can handle.

I hope this is of help to some of the many hundreds of modelers who have found the SMA decoder series of help to them. As always, appropriate comments and suggestions are always welcome
Have fun!  [smile]
Best regards,
Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 1
JohnFFlanagn

Nice upgrade Thanks

Nice change.  Thank you for all the work you do.

Reply 0
Geoff Bunza geoffb

@John F

Hi John,

'Glad you enjoyed this. I'm trying to catch up on some loose ends and open issues. 
Have fun! 
Best regards,
Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
RadioFlyer

Files

Dr. Bunza,

I am wanting to build one of the SMA 20/34 Decoders for driving Servo Turnouts, and believe that I finally have the time to devote to a project like this. I have read through quite a few of your blog posts and tutorials now on MRH regarding your different decoders and electronics projects. I am sure that many people have asked you the same question I have though, is where to I find the link to the entire Arduino sketch, to load into the Arduino?  There seems to be quite a few references to past MRH Blogs, and quite a bit of reading involved. May I suggest a single website or link with all the current info and updates on your projects.

If you could post the link to the entire sketch, here in the meantime I would appreciate it. Thanks. 

Reply 0
Geoff Bunza geoffb

@RadioFlyer

Hi RadioFlyer (name?),

All my blogs start with a short intro, and the first "comment" posted is the article of interest. As stated in the beginning of this article, the main decoder article can be found here: SMA20 Low Cost 17 Channel DCC Decoders Ver 6.01 with Sound,Triggered Sound,Stepper,Dual Motor,LED and Servo Control  https://forum.mrhmag.com/post/sma20-low-cost-17-channel-dcc-decoders-ver-6-01-with-soundtriggered-soundstepperdual-motorled-and-12201920 including all the downloads and construction instructions, this article also being contained in the first post. You really need to read this first before attempting this project.

As also stated in the SMA20 article the download link can be found here:
http://mrhpub.com/files/users/geoffbfiles/MRH_V6_01_SMA.zip
as well as other links for boards, software and tutorials. The SMA20 article is kept up to date regarding new versions of libraries and materials. The links below will get you to my set of blog articles, videos, and web page of published articles.

'Hope this helps. Have fun!  [smile]
Best regards,
Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
JohnFFlanagn

Thank for updating your older blog posts

I have to say you are one of the few who updates their older blog posts.  Most are really out of data with respect to libraries and many can't compile any more.  And certainly many reference materials that are not available anymore.  I have seen that on very recent posts.

Thanks

John

Reply 0
Geoff Bunza geoffb

@John re: New Posts for Old

Hi John,

You are most welcome. While some of these posts are old, many are still active with questions and mods from modelers. I know the SMA20 decoders have been built by many modelers and thousands are in use. Many other projects have been active for quite a while too.

'Glad to hear they are useful !

Have fun! 
Best regards,
Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
Daljinder

SMA20/34 for Mobile decoder

Hi Geoff,

can we build a locomotive decoder using SMA20 decoder.

Regards,

Daljinder

Reply 0
Geoff Bunza geoffb

@Daljinder re:Loco Decoder

Hi Daljinder,

As much as I am sometimes reluctant to admit it, yes you can use this as a loco decoder:

ler_4389.JPG 

The decoder is shown in the picture fit into the re-motored red Athearn Hustler. The decoder versions: Dec_2Mot_12LED_1Srv_6Ftn, Dec_2Mot_4LED_Aud_8Ftn, and Dec_2Mot_3LED_TrigAud will all provide DC motor functions.(Clever how they all have MOT in the name... eh?) They have only the simplest, linear, motor control function. Which, of course, you can extend and modify.

I have generally discouraged loco control applications simply because there are many low-cost commercial mobile decoders available that have more motor control features for a slightly higher cost. These were designed for relatively simple models.

To fend off any potential pleas from modelers, it would take several fine brass articulated steam locos enhanced with the finest case of 30+ year aged tawny port before I will consider making even the simplest such enhancements. Send all locos and cases to me via MRH together with a detailed spec of enhancements, in triplicate of course... with diagrams,

Have fun! 
Best regards,
Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
vggrek

 and thank you. It seems you

 and thank you. It seems you are acting like a search machine who is suggesting results based on the searches .  The tip120 is also an option as a switch for higher currents. It was mentioned in your posts by a member who was used it to power on/off the servos.

Have a nice day

Reply 0
Martin Kirkby

100+ LED’s

Hello Geoff

thank you for this update, can the code be scaled to be used on the Arduino Mega? I need to drive 100 LED’s on a mimic panel using DCC commands. I understand a Mega can be configured for 50+ Outputs.

regards

Martin

Reply 0
Geoff Bunza geoffb

@martin re:The Arduino Mega2560: 67 Function Accessory Decoder

Hi Martin,

Yes, both the SMA decoder code (for the most part) and the NmraDcc library can be run on the Arduino Mega2560. The pin assignments would need to be changed and you would need to add a small DCC bus interface to the Mega.

Here is what the interface would look like:

chematic.jpg 

The DCC OUT would connect to pin 2 of the Mega.

Here is the Eagle .brd file for Printed Circuit Board fabrication:  mrhpub.com/files/users/geoffbfiles/DCC_FE2.zip

Here is a example of the pin re-assignment for the AccDec_17LED_1Ftn.ino deoder in the SMA20 library rebuilt for the Mega2560 with 67 switches (possible LEDs):

// Production 67 Switch Acessory DCC Decoder    MAccDec_67LED_1Ftn.ino
// Version 7.01  Geoff Bunza 2014,2015,2016,2017,2018,2019,2020
// Now works with both short and long DCC Addesses for CV Control Default 24 (LSB CV 121 ; MSB CV 122)
// ACCESSORY DECODER  DEFAULT ADDRESS IS 40 (MAX 40-106 SWITCHES)
// ACCESSRY DECODER ADDRESS CAN NOW BE SET ABOVE 255
// BE CAREFUL!  DIFFERENT DCC BASE STATIONS  ALLOW DIFFERING MAX ADDRESSES
// ******** UNLESS YOU WANT ALL CV'S RESET UPON EVERY POWER UP
// ******** AFTER THE INITIAL DECODER LOAD REMOVE THE "//" IN THE FOOLOWING LINE!!
//#define DECODER_LOADED
#include < NmraDcc.h>
int tim_delay = 500;
#define numleds  67
byte ledpins [] = {3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,
                   23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,
                   43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,
                   63,64,65,66,67,68,69};          // 67 Pins Available
NmraDcc  Dcc ;
DCC_MSG  Packet ;
#define SET_CV_Address       24           // THIS ADDRESS IS FOR SETTING CV'S Like a Loco
#define Accessory_Address    40           // THIS ADDRESS IS THE START OF THE SWITCHES RANGE
                                          // WHICH WILL EXTEND FOR 16 MORE SWITCH ADDRESSES
                                          // THIS CAN START ABOVE ADDRESS 256
uint8_t CV_DECODER_MASTER_RESET =   120;  // THIS IS THE CV ADDRESS OF THE FULL RESET
#define CV_To_Store_SET_CV_Address    121
#define CV_Accessory_Address CV_ACCESSORY_DECODER_ADDRESS_LSB
struct CVPair
{
  uint16_t  CV;
  uint8_t   Value;
};
CVPair FactoryDefaultCVs [] =
{
  // These two CVs define the Long Accessory Address
  {CV_ACCESSORY_DECODER_ADDRESS_LSB, Accessory_Address&0xFF},
  {CV_ACCESSORY_DECODER_ADDRESS_MSB, (Accessory_Address 8)&0x07},
  {CV_MULTIFUNCTION_EXTENDED_ADDRESS_MSB, 0},
  {CV_MULTIFUNCTION_EXTENDED_ADDRESS_LSB, 0},
  // Speed Steps don't matter for this decoder
  // ONLY uncomment 1 CV_29_CONFIG line below as approprate DEFAULT IS SHORT ADDRESS
  //  {CV_29_CONFIG,          0},                                           // Short Address 14 Speed Steps
  //  {CV_29_CONFIG, CV29_F0_LOCATION}, // Short Address 28/128 Speed Steps
  //  {CV_29_CONFIG, CV29_EXT_ADDRESSING


  {CV_29_CONFIG,CV29_ACCESSORY_DECODER
  //  {CV_29_CONFIG, CV29_ACCESSORY_DECODER

  {CV_DECODER_MASTER_RESET, 0},
  {CV_To_Store_SET_CV_Address, SET_CV_Address&0xFF },   // LSB Set CV Address
  {CV_To_Store_SET_CV_Address+1,(SET_CV_Address 8)&0x3F },  //MSB Set CV Address
};
uint8_t FactoryDefaultCVIndex = 0;

void notifyCVResetFactoryDefault()
{
  // Make FactoryDefaultCVIndex non-zero and equal to num CV's to be reset
  // to flag to the loop() function that a reset to Factory Defaults needs to be done
  FactoryDefaultCVIndex = sizeof(FactoryDefaultCVs)/sizeof(CVPair);
};

void setup()
{
   // initialize the digital pins as an outputs
    for (int i=0; i< numleds; i++) {
      pinMode(ledpins, OUTPUT);
      digitalWrite(ledpins, LOW);
     }
  for (int i=0; i< numleds; i++) {
     digitalWrite(ledpins, HIGH);
     delay (tim_delay/10);
  }
  delay( tim_delay);
  for (int i=0; i< numleds; i++) {
     digitalWrite(ledpins, LOW);
     delay (tim_delay/10);
  }
  delay( tim_delay);
    
  #if defined(DECODER_LOADED)
  if ( Dcc.getCV(CV_DECODER_MASTER_RESET)== CV_DECODER_MASTER_RESET )
  #endif  
     {
       for (int j=0; j < FactoryDefaultCVIndex; j++ )
         Dcc.setCV( FactoryDefaultCVs[j].CV, FactoryDefaultCVs[j].Value);
     }  
  // Setup which External Interrupt, the Pin it's associated with that we're using and enable the Pull-Up
  Dcc.pin(0, 2, 0);
  // Call the main DCC Init function to enable the DCC Receiver
  Dcc.init( MAN_ID_DIY, 61, FLAGS_OUTPUT_ADDRESS_MODE


}
void loop()
{
  // You MUST call the NmraDcc.process() method frequently from the Arduino loop() function for correct library operation
  Dcc.process();
}
extern void notifyDccAccTurnoutOutput( uint16_t Addr, uint8_t Direction, uint8_t OutputPower ) {
  if ( Addr> = Accessory_Address && Addr < Accessory_Address+67)  //Controls This_Decoder_Address+66
      digitalWrite( ledpins[Addr-Accessory_Address], Direction );
}


This does provide 67 outputs. There are still a few issues. The Mega cannot power that many LEDs at full power. It is limited to 40ma total. If you found ultra bright, ultra efficient LEDs that you could power at 0.5ma each (which do exist) you will have a chance. Next, the NmraDcc library will support 29 functions for the Mobile decoder but you will need to implement the Accessory decoder to get you the broader direct addressing range.

Sometime soon I will release a library specifically for the Mega and the details for the DCC generic front end too. Larger issues currently have priority.

Have fun!  [smile]
Best regards,
Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
lceggering

Wow!!

Another great project!! Oh boy next weekend is now booked...

Lawrence Eggering

CEO, COO and head engineer of the WDCNP Lines.

Reply 0
FrightRisk

Do you have issues with the H-Bridge Voltage Drop?

Hi Geoff,

With the high current changes, the board can handle up to 2A, but the SN754410 Quad H-Bridge can only handle 1A (if that with no cooling). But the datasheet says that if you can pump 1A through it in  a dual (full) H-Bridge configuration,  the high output voltage drop added to the low output voltage drop is 1.4 + 1.2 = 2.6V. If I start with 12V from the track, that leaves only 12 - 2.6 = 9.4V to run a motor. So a 12V motor will run slow and a 6V motor would get too much voltage. I'm guessing either would still work. I could make sure to PWM the 6V motor to never go above 1/2 duty cycle.  I'm not sure if your code also allows for the Bridge to act as a high current DC switch, but that would affect other accessories as well. Did you see any issues or have ideas about this in practice?

Thank you!

Fred
N4IXL
DCC-EX

Reply 0
Geoff Bunza geoffb

@Fred re: Questions re H-Bridge

Hi Fred,

The nominal DCC bus is usually between 14.5 and 18 Volts depending on the manufacturer and the power supply used. NMRA spec is for 15 Volts nominal for HO scale. The NMRA spec has a higher than 12V spec specifically to allow for two diode drops when controlling 12V motors.

This article does dot describe the use of an H-Bridge, so I will assume you are referring to a decoder used as described in: SMA20 Low Cost 17 Channel DCC Decoders Ver 6.01 with Sound,Triggered Sound,Stepper,Dual Motor,LED and Servo Control   https://forum.mrhmag.com/post/sma20-low-cost-17-channel-dcc-decoders-ver-6-01-with-soundtriggered-soundstepperdual-motorled-and-12201920 with the SN754410 Dual H-Bridge.

The SN754410 is spec'ed to 1 Amp for each bridge, but I would not run it to max unless the air flow around it was very good and I added a small heat sink to it with thermal epoxy. The SN754410 has a thermal cut off but no short circuit protection, so if you push it until it gets hot it will likely shut down. I seem to remember reading the application note for the SN754410 stating that with careful concern for the correct pins, you can also parallel the two H-Bridges to get nominally closer to a 2 Amp rating. Again heat dissipation is an issue.

Quote:

 I'm not sure if your code also allows for the Bridge to act as a high current DC switch, but that would affect other accessories as well. Did you see any issues or have ideas about this in practice?

The SMA20 series of decoders provides for switched PWM control of 2 motors using each channel of the SN754410. Another example in the SMA20 library uses the dual H-Bridge for control of a four wire stepper motor in the Dec_Stepper_6Ftn example.

'Hope this helps.
Have fun! 
Best regards,
Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 0
FrightRisk

Thank you!

Got it! I hate to fill your block with all the thank you's, but want you to know I got the message and truly appreciate all your help. Moving things back and forth are what I want to so, so less than 1A and short bursts anyway. Have a good weekend!

Fred

Reply 0
Geoff Bunza geoffb

@Fred

Hi Fred,

In these times, I gratefully accept all the "thank you's" I can get!  
You are most welcome, always.

Have fun! 
Best regards,
Geoff

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 1
AlexStanier
Hi Geoff, I am a relative newbie on the "Arduino" DCC decoder journey. I particularly would like one of your PCBs to fit into my guards van (lights and sound) and my coaches, also lighting, sound (My era is the UK, LMS 1930s Coronation Scot streamlined etc.). However my (OO gauge) coach roof sections are too narrow for your PCB design. Is it possible you could produce a version of your PCB that worked using a ATTiny85 instead of a Nano? Or at least was narrower/  thinner and if necessary longer? If a bottle of finest port was my donation to the open source community in return for your time on this small project, I would happily supply you with whatever is needed. Thanks for all the time you have put into your projects that help so many people,
Alex Stanier  
PS Possibly a simpler request, can you point me to some demo code where an Arduino loaded up with the NMRADCC library allows changing of the main decoder ID. I have found documentation that mentions the possibility but no easy to follow examples.  
Reply 1
Geoff Bunza geoffb
 
Hi Alex,
 
I particularly would like one of your PCBs to fit into my guards van (lights and sound) and my coaches, also lighting, sound
The NmraDcc library has been extended recently (I think) to work with some new processors including ESP32's. For an obvious size reduction I would start by looking at something like an ESP32 TinyPico or an ESP32 TinyPico Nano for a small outline processor coupled with a DCC front end like the DCC_FE described here:   SMA37 Simple DCC Connections for Wide Decoder Adaptation 
Which may or may not fit your size constraints. The little FE board could be relayed out for a longer, narrower form factor.
 
I'll put your idea on the pile of future projects with the hundred others -- no promises, but this is do-able.
 
Possibly a simpler request, can you point me to some demo code where an Arduino loaded up with the NMRADCC library allows changing of the main decoder ID.
If you mean the decoder address? All of them allow an address change. If you mean a completely different type of decoder, say mobile to accessory? No, I know of no example of the latter.
 
Have fun!  🙂
Best regards,
Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 1
AlexStanier
Hi Geoff, thanks so much. The board you pointed me to looks just thin enough to be a useful starting point for me, so I have ordered 18 from OSH. Enough for two rakes of nine coaches. The Pico and Pico Nano are just too expensive. When I look at prices by searching Google from here in London, the prices seem to be $24 per unit when an ATTiny85 is $2.50, and I know that on Alibaba, 100 x ATTiny85 SMD comes in less than $1 per unit.
I will keep plugging away seeing how far I can push the ATTiny85. I will need a second (tiny board) to create a constant 5V to power the LEDs and speaker, and a third board for the sound player... both "long and thin". I have seen seperate solutions for LED strip control, and sound playing so I can adapt for these, it just seems no one has combined everything (DCC front end, ATTiny85, LED lights, sound) together (inside a coach or wagon). What effects am I trying to achieve? As the guard walks down the corridor coach, the individual compartment and corridor lights come on/off, toilet compartment lamp comes on/off as people are using it, end coach red lamp comes on/off as required. Sound of guards whistle on platform, sound of passengers talking on platform, sound of doors slamming... sound of toilet flushing (maybe a step too far).

My question about programming the decoder address stems from the fact that I have not yet been able to try it. I want to program identical code into all 18 Arduinos (sitting inside my 18 coaches) and then I need to put each coach on the programming track and then set the decoder address using my DCC controller, like I would for any other loco. When using the NMRADCC.h library, and setting up an arduino based device, does it default to address 3, until you change it on the programing track like a loco?  
 
Thanks again for your response and ongoing work.
Reply 1
Reply