# Another use for the MRC AD322 decoder



## dbodnar (Jan 2, 2008)

The MRC AD322 DCC decoders that have been discussed recently do a fair job of operating under DCC control. The weaknesses that have been documented are most likely the fault of the microcontroller and/or its resident program. 

When I got a batch of them for experimentation I was more impressed with the non-DCC specific components on the board than their DCC capabilities. Specifically, I found that the board contains:

a set of four 3 amp diodes that act as a bridge rectifier
a power Mosfet that controls the motor's speed - it is rated for at least 8 amps
a DPDT relay to determine the train's direction
a sound generating circuit that generates a number of locomotive sounds (bell, whistle, etc)
an amplifier that gives good volume for the sounds
a 12 volt and a 5 volt voltage regulator
 That got me to thinking about removing the factory installed microcontroller and replacing it with one that I could program myself. One thing led to another and I now have a pair of Christmas trolleys running on a point-to-point layout under the control of an AD322 (that has had a frontal lobotomy) and a PIC 16F88 microcontroller.

The trolleys will run (one at a time) on a point-to-point track on the front of our house from December 1 --> January 1. I have done something like this for the last 6 years and am always challenged to come up with a system that can run day in and day out without failure.

Last year I converted two Bachmann trolleys to run from constant AC power on the track. This is not too far from running DCC as it uses something like AC to provide continuous, high voltage. The AC that I supply to the track is nothing special, but it is high enough in voltage to keep the trolley from stopping when it gets onto a dirty or wet section of track. It also keeps the lights on when the trolley pauses before reversing.


Inside of the trolley is a circuit that converts the AC into DC and a controller that operates the motor, senses the end of the track, reverses and makes appropriate bell & whistle sounds. Most of the components that I used in last year's trolley controller are already on the AD322.

I have documented what I put together on my web page and welcome you to have a look. 

http://www.trainelectronics.com/AC_Trolley/index.htm 

The AD322 equipped test units are working like a charm. So, before you pitch any "defective" AD322 decoders you may want to see if you can salvage the really interesting part of them!


dave


----------



## Jerry McColgan (Feb 8, 2008)

Hi Dave,

I wish I could say that I understood the information on your web site but most of it was over my head.

Still, I think it is great that you have discovered additional applications for the AD322.

One thing I would like to use some of the AD322's for is as a simple on/off switch to control some accessories such as street lights, business building lights etc.

Rather than take track power away from the DCC system I would prefer to use external power that is currently powering the building lights etc. but simply use the decoder to connect or break those lighting circuits (like a remote controlled wall switch).

The relay seems perfect for this. It appears to have two connections for powering the relay and two SPDT switches that it controls. I would expect that in effect it is a DPDT motor direction control switch. 

I would like to remove the motor circuit from the relay and instead use the relay as a decoder controlled double SPDT switch (no outgoing power). With a 5 amp 24VDC rating it could be a very useful switch. This could be a LOT more useful than the 0.1 amp available from F1 - F3.

My problem is that I do not understand enough about the decoder (and I cannot see one side of the board wiring) to tell what I would need to do to isolate the relay from everything else and if I can do so without destroying everything.

Any suggestions you or anyone else can make would be appreciated.

Thanks,

Jerry


----------



## Jerry McColgan (Feb 8, 2008)

Yet another use for the AD322 decoder just occurred to me. 

I have installed several of the LGB 4135/4235 series Sound Car sound boards in various locomotives. These are relatively inexpensive analog sound units but I rather like them and I have been able to get them to work with MTS/DCC.

Their main limitation is that they are chuff (or diesel rumble) only with no bell or whistle.

I am already using the AD322 to power some of the LGB 4135/4235 sound systems but it just now occurred to me that I can use the same AD322 to provide the currently non-existent bell and horn as well. 

If I leave the diesel rumble turned off the engine sound will come from the LGB sound units and (by adding the MRC 2" speaker to the AD322 as well as the LGB speaker) I will then have a better quality (LGB) diesel sound plus bell and horn - all at ZERO additional cost.

Heck, I might even add the speaker to some LGB 2-4-0's. After all some of the existing steam locos now have a horn as well as a whistle. 

I love a bargain and this one seems to be getting better and better.

Jerry


----------



## dbodnar (Jan 2, 2008)

Jerry - there are a few ways that you could operate lights and such with the AD322. If you don't want to modify the board you could simply use the lighting outputs to operate external relays that would control the lights. Just make sure you put a diode across the relay terminals to protect the electronics on the board from spikes that the relay will generate when the coil's field collapses.

If you want to use the relay on the board you can access a SPST, normally open set of contacts with minimal changes. I removed the relay from one of my boards and took some photos that will help to explain what has to be done.

Here is what is under the relay on the top of the board. Pins 1 and 2 go to the coil. Pins 3 and 4 are normally closed, pins 5 and 6 are common and pins 7 and 8 are normally open.

As you can see there is a trace under the relay that goes from pin 4 to pin 7 - that is part of the wiring that is needed to reverse polarity. Since you can't easily get to that trace to cut it you are limited to using only two of the pins for a SPST set of contracts. You need to cut the trace just to the left of pin 6 (where you see some black marker). If you can't get to that trace with a razor blade you can just cut the center lead on the power transistor and pull it up and out of the way. 










On the bottom of the board (seen below) you will have to cut the trace to the right of Pin 6 and the trace that goes between Pins 3 and 8. That will give you a completely open SPST / Normally Open contact that you can use to control a good bit of power, say 5 amps or so.












Hope that all makes sense.

dave


----------



## Trains West (Oct 4, 2008)

makes me wonder if you could just solder wires to the pins that run the coil and add a relay off the board ....... though you could use the fuction outputs and do the same thing or add a dioide to the output power so you only have one polarity that is on power


----------



## Jerry McColgan (Feb 8, 2008)

Hi Dave,

That is exactly what I was looking for.

Seeing the top traces as well as the bottom traces made all the difference for me.

The markings on the side of the relay suggested that it would work but my electronics training was 40+ years ago and I have not used it since.

I've learned to distrust the obvious without some sort of confirmation.

Do you know if the relay top is glued on or if there is some non-destructive way to remove it to clean the contacts?

While simple and rugged I think the relay is the main problem with the decoder because it appears to take about 5 volts to energize it during which time the loco will be attempting to run in the wrong direction and as the relay flips the loco instantly changes direction.

I am guessing that DCC avoids this by having a higher starting voltage and raising the analog starting voltage may help resolve the issue. One of these days I plan to do some experimenting with it.

The killer for me with this decoder for steam locos is that there is no function output with 1/2 amp output for smoke via F1.

Thanks,

Jerry


----------



## Jerry McColgan (Feb 8, 2008)

Hi Dave,

Another question or two:

You mentioned the AD322 has both "a 12 volt and a 5 volt voltage regulator"

I don't know how to tell one from the other (or how much power they could handle) and is there a way that the decoder switches these on and off such as when the decoder is selected or deselected? If so, how could 5 (or 12) volts be tapped from the circuit? If they could handle 1/2 amp I could see how they could control a remote smoke unit such as in a chimney. I think I still have some old Bachmann smoke units that I had replaced with LGB smoke units.

I am not sure where I am going with this other than the 5 volt regulator seems to offer some possibilities.

Thanks,

Jerry


----------



## Jerry McColgan (Feb 8, 2008)

Posted By Trains West on 11/21/2008 7:08 AM
makes me wonder if you could just solder wires to the pins that run the coil and add a relay off the board ....... though you could use the fuction outputs and do the same thing or add a dioide to the output power so you only have one polarity that is on power 


I realized that I could do that but using the decoder's relay would save me the expense and effort of adding an extra relay plus it has the advantage of being rated for a full 5 amps.

Thanks,

Jerry


----------



## dbodnar (Jan 2, 2008)

Jerry - the top of the relay is glued to the base and would not be easy to remove - that shouldn't be much of a problem as the contacts are not likely to need cleaning unless you are using them to control high voltages that will arc as the contacts open / close.

I would still recommend that you try adding your own relay to the lighting outputs on the decoder - that will give you much more flexibility than using the on-board relay - it will also give you a way to control the power to your smoke unit. If you want to maintain the lighting as it is you could use the "coupler sound" output on the microcontroller to activate a relay.


All you need is a 12 volt relay and a diode (note that you would have to add a transistor if you connect directly to the microcontroller to use the "coupler sound" for activation). If you would like to give it a try I can do some testing and draw you a wring diagram - that might come in handy for others, too.

dave


----------



## dbodnar (Jan 2, 2008)

Jerry - the 5 volt regulator is a 78L05 which is only good for about 100 ma - the 12 volt regulator is a 7812 (it is the larger of the two with the tab at the top) is rated for 1 amp but to pull that consistently you would need to add a heat sink. I would recommend against using either of those to power anything other than what they are powering now -



The decoder does not turn either of them on or off - they are always connected and doing their regulation duties.

dave


----------



## Jerry McColgan (Feb 8, 2008)

Hi Dave,

I am interested in anything that you may come up with even if I do not do anything with the information. At the moment I am somewhat swamped with other projects including putting more AD322's in additional locos. 

Bear in mind that while I know what diodes, capacitors, relays etc. are that I only know what they do and not now to determine which ones to use. A trip to Radio Shack uses about $5 worth of gas and a trip to any other electronics store would cost about $25 in gas so unless I need a quantity of something and order on line Radio Shack gets most of my business and lately it seems like they are trying to move away from stocking electronic parts. I almost need a Radio Shack part number to know what to buy.

Living in rural Arkansas has many benefits but having handy access to electronic components is not one of them.

Thanks,

Jerry


----------



## dbodnar (Jan 2, 2008)

Jerry - Ill let you know if I come up with a circuit for you- most of the parts I use are ordered from various on-line vendors - a better choice than Radio Shack as the price (and frequently the quality) are better.

dave


----------



## Jerry McColgan (Feb 8, 2008)

Posted By dbodnar on 11/21/2008 7:48 AM

Jerry - Ill let you know if I come up with a circuit for you- most of the parts I use are ordered from various on-line vendors - a better choice than Radio Shack as the price (and frequently the quality) are better.

dave 




Hi Dave,

On-line vendors are fine as long as I know which vendors and their part numbers. On-line shipping costs and gas to drive to Radio Shack cancel each other out for me. I agree about the quality. I have never been impressed with RS quality but when it's the only game in town...

Thanks,

Jerry


----------



## Bills (Feb 20, 2008)

Hi dave 
very intresting topic. I have been think of using a relay to control the smoke unit, as it draws more current than the decoder can handle. when you say add a diode to the relay circiut do you mean to the trigger circiut?
Thanks,
Bill


----------



## dbodnar (Jan 2, 2008)

Bill - the diode goes in parallel with the coil contacts on the relay - when a magnetic field (like the one creaeted in the coil of the relay) collapses it produces a spike in voltage that can get back into the electronics that activated the relay - the diode blocks this spike - the system will work without it but only for a while - eventually the transistor that triggers the relay will fail.

I did some experiments yesterday and find that the current that is available at the lighting terminals is too anemic to close most relays - I plan on doing a test with a transistor in the circuit that should take care of the problem - I'll post a wiring diagram when I get something working properly.


Stay tuned!

dave


----------



## Jerry McColgan (Feb 8, 2008)

Hi Dave,

Another question...

If the sound part of the decoder is not being used is there a way to tap the F1 function for other purposes? One major problem with the AD322 for some of the applications I would like to use it for is the lack of an external F1 function.

I am thinking about LGB circuit boards which only have contacts for F1, FOF and FOR.

Thanks,

Jerry


----------



## dbodnar (Jan 2, 2008)

Jerry & Bill - I spent some time with the decoder and relays this morning - I put step-by-step instructions for adding a relay that will latch on whenever you activate the BELL sound. You could use any of the sounds to activate the relay but the others are only momentary - the bell latches on, something you would want for a relay that operated a smoke unit, for example.

http://www.trainelectronics.com/MRC_DCC/index.html#Relay_Installation_Notes_ 

The toughest part of the wiring is soldering a wire to pin #2 (the BELL's connection) on the microcontroller - you may want to use thinner wire than I used as it might be easier. I would also suggest using non-stranded wire as shorting to other pins is more likely with stranded wire.















You could also connect the yellow wire to any of the lighting connections ( I tested white & yellow ) to activate the relay. That would make the above connection unnecessary! 


Please let me know if you have any questions.

dave


----------



## Greg Elmassian (Jan 3, 2008)

I found relays that only took about 28 ma at 24 volts at Mouser. Using the full voltage of the DCC source has helped me run relays from the outputs when the current budget was low. 

Regards, Greg


----------



## Bills (Feb 20, 2008)

THANKS Dave and Greg, 
I had not concidered the current required to drive the relay. I now see 2 issues 
if I add a transistor to amplify the relay current then that transistor will need a power supply or, if i use the current from a lighting source I will only have a max of 20 volts as that is what my boster outputs. It maybe easyest to wire the smoke unit to the track with the existing switch and a fullwave rectifier leaving the dcc board out of the circiut.


----------



## Trains West (Oct 4, 2008)

I have been useing 12v relays for quite a while and have had no trouble..........


----------



## Jerry McColgan (Feb 8, 2008)

I am now in the process of installing a couple of AD322's into Hartland Interurbans. it has become more of a project than I had anticipated but I keep learning new things about the AD322's with each new type of installation I make.

It is hard for me to believe but counting the two Interurbans I will have installed thirty two (32) AD322 decoders (not counting the defective one and the one I fried).

With the last loco I put a AD322 into an Aristo FA-1 completing a PRR ABBA set. As I was installing the decoder I decided to try something different. Since I was using LGB 4235s sound units I had a better sound quality (than the AD322) but no bell or horn. I went ahead and installed the decoder plus the LGB sound unit but I also installed the 2" MRC speaker on the side of the FA-1. The result is very satisfying. I have the LGB diesel sound plus bell and horn. The horn includes both short and long bursts.

With the Hartland Interurbans I ran into a different problem I kept getting a too high voltage failure warning from the LGB Programming Module and it was driving me nuts. First I thought it was the diodes for the directional front and rear lights but after removing the diodes the problem persisted.

Finally I took the motor apart and discovered that although there are only two wires coming out of the Hartland motor block it is internally wired both to power the motor AND to pick up track contacts - and this is what was shorting out the decoder.

After I rewired the motor(s) I got the Interurbans to work with the decoder but then I had a problem with the lights getting too much voltage. The decoder seems to allow reprogramming of CV49 and CV50 to #5 (for 5 volt lights) and the CV's even read back properly but the fact is that the output remains at full track voltage.

i found that a 220 ohm resistor in series with the blue (common) lead dropped the voltage to an 18 volt LGB bulb to 15 volts so that is what I will do for the Hartland lights.

I found that the front and rear lights worked OK with the AD322 output for them but that left me with no power for the interior lights.

After some testing I discovered that I can use F1 to control power to the green wire (ditch light) or F2 to control the purple wire (ditch light) or F3 to control the brown wire (strobe light). I have not finished yet so I cannot confirm that it will work. My concern is that while there is 0.2 amps for the front and rear lights there is only 0.1 amps available for F1, F2 and F3 which will probably be too little for the 4 interior incandescent lights. I may have to wire them permanently to the track contacts but that will leave me with no shut off - or I may wire them to the motor output.

Jerry


----------



## Jerry McColgan (Feb 8, 2008)

*Thanks to the MLS Admin*

These topics from years ago about MTS and DCC products have made me realize how much I have forgotten about DCC and how much my mental dexterity has declined in the years since these topics were started. 

I don't understand much of what I posted those years ago but I do appreciate how valuable these old postings are proving to be to me today as I now find DCC even more baffling than I did those years ago.

I would like to thank whoever it is that currently owns and operates MLS for having preserved and made readily searchable so much valuable information from those years past. Postings from MLSers those past years are just as fresh and valuable as they were long ago. Frequently when I post a question on Google today I find myself referred to long ago MLS topics.

It was and continues to be those true experts from long ago as well as those who continue to post multi-brand non-competitive assistance today that have enabled me (and probably a lot of others) to enter or re-enter the world of MTS and DCC.

For me I still have no desire to become any sort of MTS or DCC expert. I still simply want to learn how to install various decoders in LGB locos and to have the use of Loco ID's with control of the motors, lights, chuff-chuff, woo-woo, and ding-ding.

Thanks MLS,

Jerry


----------



## Greg Elmassian (Jan 3, 2008)

Jerry, I have info from my investigations and Dave Bodnar on my page:

http://www.elmassian.com/dcc/specific-manufacturers/mrc-equipment/mrc-ad322

The wire colors don't exactly match between Dave's data and yours, you might want to take a look. Maybe there are different versions.

Greg


----------



## Jerry McColgan (Feb 8, 2008)

OK. 

Thanks


----------

