AC or DC power to relay coils and switch machines?

Some relays say to wire the coils with AC, others DC, and some say either. I tried an ancient Atlas switch machine with both AC and DC, and it worked both ways. The instructions for new Atlas machines of this type indicate AC. If that’s the case for that switch machine, is it basically true for all relays? Or will using the non-recommended voltage source damage the relay or be an electrical hazard?

On Atlas switch machines use AC, or a Capacitive Discharge system.

On any relay that specifies AC or AC/DC, use AC when ever possible.

Coils are inductors, they will try to keep current flowing. With AC, this is taken care of, with DC, you will get arcing of your control switches. Take a look at a typical toggle switch with both AC and DC ratings, typically, for a given current, the AC voltage rating is 10x the DC voltage rating, due to this arcing situation.

How about relays that specify DC for the coils? Is there any reason they wouldn’t work with AC as well? They are momentary-contact, latching relays (like switch machines.)

Snap-action switch machines work with either AC or DC. I find that they’re a bit noisier with AC. A regular relay, the kind you’d buy at an electronics store, is designed to be operated on DC only. The problem with a relay is that when the current is removed, as the magnetic field collapses, it creates a momentary spike of high current flow in the opposite direction, called back emf. This spike can damage the switch or fry the transistor that is controlling the relay. To prevent this, you wire a rectifier diode across the relay coil backwards–that is the cathode (the end with the white band) is attached to the end of the coil with the more positive voltage. For example, if one end of the relay coil is attached directly to, say, +12 volts and the other end of the relay coil is attached to a toggle switch, the other side of which is attached to -12 volts, the cathode (banded end) of the diode is attached to the +12 volts side of the coil and the anode is attached to the toggle switch side of the coil. The diode short-circuits the back emf and saves the toggle switch or transistor. For most electronic applications in model railroading, a 1N4001 diode will do. And, yes, there are “regular” relays designed to operate from AC, but they are uncommon, more expensive and most are designed for 110 volts. (Oh, don’t put a diode across a snap-action switch machine coil–that won’t help anything.)

Is the diode blocking the flow of current, or shorting it? If it’s shorting, should I put a resistor in series with it to limit the instantaneous current flow?

The reverse diode is shorting the coil for back EMF and does not need a resistor. Adding a resistor defeats the reason for it as the current will generate a voltage across the resistor. Back EMF can be several hundred volts but of very short duration i.e. a spike!