I have a transformer based AC fan regulator with five output steps. The regulator has a manual rotary switch (5 steps) which selects different windings on the secondary coil to give different output voltage (240-120V). I would like to replace the switch with something I can interface from a microcontroller.

Can I assume the regulator already contains circuitry to handle the inductive load discharges while breaking current, so it should be safe to simply put in a relay (one relay for each output step) instead of a switch? Or is a relay more sensitive to voltage spikes than a manual switch, so I would need some extra protection?


If you put the relay contacts in parallel with the switch contacts, they will have whatever protection the existing circuit provides. But you should inspect the existing circuit to ensure for yourself that it really does have protection.

That said, putting five relays on those taps is almost certainly a REALLY BAD IDEA. A rotary switch is guaranteed to select only one transformer tap at a time. You have no such guarantee with five separate relays controlled by microcontroller... it is highly likely you'll end up turning two relays on at once, which will present a short circuit between two taps of the transformer, and result in a fiery demise.

So... don't do that please!

  • \$\begingroup\$ Two active relays at a time must be prevented of course. I was thinking to use an address decoder such as 74HC137 to activate the relays. The microcontroller would just send an address to the address decoder, and the mutually exclusive outputs of the decoder make sure the relays activated only one at a time. Is this sane? \$\endgroup\$ – Eivind Apr 8 '14 at 13:00
  • \$\begingroup\$ Relay contacts can get stuck. \$\endgroup\$ – Peter Apr 8 '14 at 13:05
  • \$\begingroup\$ I would say it's still pretty insane to have any way for a controller to even by accident create a short across a portion of a mains transformer. There are multiple ways this could fail and in the process turn on multi relays. Of course, you will have a fuse upstream from the transformer, right? \$\endgroup\$ – gwideman Apr 8 '14 at 13:08
  • \$\begingroup\$ Ah, good point @freyyr. Is there a similar risk with SSRs? Is there really no standard component available as the electronic alternative to a manual rotary switch? \$\endgroup\$ – Eivind Apr 8 '14 at 13:09
  • \$\begingroup\$ Well there are motorized rotary switches, which are basically multi-position relays. \$\endgroup\$ – gwideman Apr 8 '14 at 13:12

Second gwideman's opinion of things.

If you really wanted to, you might be able to play with the rotary switch to attach some sort of actuator to it, like a servo or some such. But that sounds kind of Frankenstein to me.

The relay system becomes quite workable, though, as long as you install interlocks. It would be a small investment to route B-contacts on relays to electrically prevent accidentally (through code or operator error) switching any two relays at a time. That and little bit of switch debouncing could work beautifully, if you are exceedingly careful.

  • \$\begingroup\$ Interesting point. I don't dispute that an interlock using additional relay contacts would be possible... how do you see it working on 5 relays like this? Just curious, I haven't had to think very deeply in "relay logic" :-). \$\endgroup\$ – gwideman Apr 8 '14 at 11:34
  • \$\begingroup\$ It takes a lot more wire, that's for sure. The better answer is to use a PLC, really. But if you're hacking hardware, the B-contact on the relay just has to break one side of the coil path for the other four relays, while ensuring that its own coil path remains intact. This would get complicated unless the chosen relay actually had four available B-contacts - thats not exactly a common case, but neither is it incredibly rare. Relay closes, b-contacts open, voila! I suppose if you really had to you could route the common returns through a single contact, but that gets hideous. \$\endgroup\$ – Sean Boddy Apr 8 '14 at 12:15
  • \$\begingroup\$ Darn I was hoping you had some clever trick up your sleeve to avoid needing so many B contacts! \$\endgroup\$ – gwideman Apr 8 '14 at 13:03
  • \$\begingroup\$ I am a bit surprised there is no standard component available as the electronic alternative to a manual rotary switch. The complex wiring to get mutual exclusiveness are already in an address decoder such as 74HC137, so what is left is just adding a relay on each output line. \$\endgroup\$ – Eivind Apr 8 '14 at 13:06
  • \$\begingroup\$ @Eivind, hadn't thought of that. Of course digital logic would handle that smashingly. It is worth pointing out though that some relays need more current than a typical CMOS encoder will push, and may require a current follower. But brilliantly thought. \$\endgroup\$ – Sean Boddy Apr 8 '14 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.