How to connect the digital decoder to different kinds of lights and how to connect relays

Updated 09.01.2010

Märklin 3071 is used as an example

This train set have pick-up shoes in both ends of the train and a change-over system, so the pick-up shoe in the front end (according to the driving direction) always picks up the current to the decoder.  The train set has white and red lights in both ends, changing with the driving direction.  I converted my set with a 60904 conversion set.  to keep the pick-up shoe changeover , I used an instruction I found on internet, http://www.jus-kn.de/schleif.htm.  This explains how to connect output 13 and 14 from the 701.22B chip on the decoder to a bi-stable relay.  As far as I remember, pin 13 is active in the forward direction, pin 14 in reverse.

Original lamp connections in the 3071:
Originally the 3071 control car is electrical connected like this:
There are two wires connecting the control car with the locomotive, running through the other one or two cars.
The wire from the rear pick-up shoe goes directly to the rear red lamp and to the electro-mechanical reversing unit in the locomotive.  This means that the rear red light is on all the time, also when the white light is on when the control car is in the front end of the train.  The white light is brighter than the red, so the red light is hardly visible.
This is why only two wires are required:
- one wire from the control car pick-up shoe to the reversing unit, also connected to the rear red light.
- one wire from the light change part of the reversing unit to the white light in the control car.

Unfortunately I do not have a photo or wiring diagram of the original connections.

There are several ways of connecting the front and rear light in 3071. Here are some suggestions:

1. The simplest way, no relay, no extra wire:
Just leave the control car as it is.  Connect the yellow wire from the decoder (as the locomotive runs in reverse direction) to the original wire from the locomotive to the rear white lamp.  Leave the red lamp in the control car as it is.  The yellow wire should also be connected to the red bulb in the locomotive.  Connect the gray wire from the decoder to the white bulb in the locomotive.  Voltage dropping resistors may be installed directly to the bulbs, or (except for the rear red) in the locomotive.
Advantage:
Simple connection.  No additional wires through the train required.
Disadvantage:
The red lamp in the control car is on all the time.  It is not possible to switch it off from the decoder and it is very bright without dropping a resistor.  The red light in the locomotive and the white light in both ends will also become very bright (resistors may be installed), end they will flicker with the digital pulses on the track.

2. The semi-simplest conversion, one mono-stable relay, no extra wire:
Install a small mono-stable relay in the locomotive, controlled by the yellow wire from the decoder.  Connect the wire to the rear white lamp (and the front red lamp) to one end of the switch in the relay, the other end to the red wire from a pick-up shoe.  One end of the coil in the relay should be connected to the yellow wire (minus), the other end to the orange wire (plus).  The gray wire from the decoder is connected to the front white lamp.  This will be like the front relay in my conversion.
Advantage:
Rather simple connection.  No additional wires through the train required.  The current to the front red and rear white lamps are not drawn from the decoder.  Resistors for voltage drop (except for the rear red light) may be installed in the locomotive.
Disadvantage:
The red lamp in the control car is on all the time.  It is not possible to switch it off from the decoder and it is very bright.  The red light in the locomotive and the white light in both ends will also become very bright, but will not flicker, as they get the non-rectified current from the track via the relay.  The front white light will flicker with the digital pulses on the track.

3. The second most complicated conversion, two mono-stable relays, one extra wire:
Install two small mono-stable relay in the locomotive, controlled by the gray (relay 1, forward) and the yellow (relay 2, reverse) wires from the decoder.  Connect the wires to the front white and the rear red lamps (requires one extra wire through the train) to one end of the switch in relay 1, the other end to the red wire from a pick-up shoe.  Connect the wire to the rear white and the front red lamps to one end of the switch in relay 2, the other end to the red wire from a pick-up shoe.  One end of the coil in relay 1 should be connected to the gray wire (minus, on in forward direction), one end of the coil in relay 2 to the yellow wire (minus, on in reverse direction).  The other ends of the coils in both relays should be connected to orange wire (plus) from the decoder.  This will be like the relay 1 and 3 (counted from the front) in my conversion.
Advantage:
The rear red lamp is not on all the time.  All lamps will light flicker free and are switchable from the decoder.  The lamp current is not drawn from the decoder, only a small current to activate one relay at the time.  Dropping resistors may be installed for all lamps, to avoid the too strong light with the original low voltage bulbs..
Disadvantage:
More complicated installation and an extra wire is required through the train.

4. The most complicated conversion, two extra wires, no relay:
An orange wire must be drawn from the decoder to the bulbs in the control car and the locomotive.  The bulbs (bulb holders) must be insulated from the locomotive/car chassis.  The gray wire leads to the front white and the rear red lamp, the yellow wire to the front red and the rear white lamps.
Advantage:
The rear red lamp is not on all the time.  All lamps will light flicker free and are switchable from the decoder.  Bulbs for the correct voltage may be installed for all lamps, to avoid the too strong light with the original low voltage bulbs. Not so difficult installation in the locomotive.
Disadvantage:
More complicated installation as two extra wires are required through the train.  The lamp current is drawn from the decoder.

I have selected solution 3, with an additional relay for the interior light in the cars, controlled by function 1 from the decoder.  Therefore I need four wires through the train.  In addition, the pick-up shoe changeover is controlled by a bi-stable relay, connected to pins 13 and 14 on the decoder chip.  These outputs must be protected by diodes, the anode ends must face the pin 13 and 14 outputs, the cathodes are connected to the orange plus wire from the decoder.

Some explanation about relays:

Mono-stable relay:
A relay with one electrical coil and a return spring.  When energized, the relay coil creates a magnetic field and retracts a mechanical contact arm.  The contact arm operates a mechanical switch.  The switch may be just a simple on/off switch or a changeover switch, where on contact set is on in the relay's resting position and one contact set is on when the coil is energized.  There may be several contact sets, with common or separate inputs.  When the current to the coil is cut, the relay mechanism returns to it's resting position.  There are big numbers of different sizes, shapes, voltage and current figures for such relays, so the applied voltage and the wiring diagram must be checked for each type of the relays.  

Bi-stable relay:
A relay with two coils, without a return spring.  Usually one or more sets of changeover contacts.  When one coil is energized, either continuously or with a short pulse, the relay mechanism moves to one side, activating one contact set and stays there.  When energizing the second coil (the power to first one must normally be cut), the mechanism moves to the other side, activating another contact set.  Also here there are big numbers of different sizes, shapes, voltage and current figures for such relays, so the applied voltage and the wiring diagram must be checked for each type of the relays.

Relay coils:
A long and thin electric wire, with a very thin insulation, is coiled (wrapped) around an iron core.  When connecting electric current to the coil, it creates a magnetic field.  The magnetic field strength (flux) is decided by the inner and outer diameter of the coil, how many turns of wire, wire length etc.  The applied voltage and the inductive resistance will decide the current flow.  The current will normally drop if the temperature in the coil increases.  A resistor in series with the relay coil may be connected to reduce the coil voltage and current, for instance if the applied voltage is higher than the relay's specified coil voltage.

Relay contact points or switches:
A mechanical switch or contact points, activated by some kind of magnetically (magnetic force from the relay coil) controlled arm or rod. There are numerous kinds of relays, with one or more contacts, so the wiring diagram for the selected relay must be carefully checked.

High voltage peaks from relay coils:
Such a coil has one big disadvantage, electrically speaking.  When energized, a magnetic field surrounds the coil.  When the power to the coil is cut, this magnetic field collapses, generating a very high voltage.  This inducted voltage has the opposite polarity than the normally applied voltage and is very often many times higher.  On an oscilloscope I have seen small 12 Volt coils generate up to 100 Volt negative voltage spikes.  I have heard that they may be even higher.

Protection against voltage peaks:
An electronic control device meant to drive magnetic coils, like the function outputs on most of the Märklin decoders, are protected against such voltage peaks.  But, if a coil is connected to an output not meant for magnetic coils, like pin 13 and 14 of the 701.22B chip on Märklin 60902 decoder (from conversion sets 60901, 60903 and 60904), the outputs must be protected.  The protection is normally done by a diode, connected across the magnetic coil "the wrong way".  In case of a Märklin decoder, the wrong way would be the diode cathode (the end with the indicating ring or mark) connected to the orange wire (plus) and the anode to the output wire (minus) from pin 13 or 14.  The diode will "kill" the voltage spike.