Maker Pro
Maker Pro

Does this exist: a relay that defaults to its last setting?

I have a situation where I want to control some DIP switch inputs electronically. This is TTL levels, not hardly any power.

Mechanical relays would work, but I'd want the relays to "remember" the last position they were set to, and use that position as their default position if the power went out and then was restored. The DIP switches can ONLY be changed if the device is off; if the DIP switches changed position while the device they are on was powered, the device will likely be toast.

So it would really something more like a toggle switch activated by a solenoid, I guess,,, and I could make that but I want something more compact than a DIY job. Is there anything?
 

hevans1944

Hop - AC8NS
I want something more compact than a DIY job. Is there anything?
Yes, there is, but let's discuss latching relays first before moving on...

Latching relays can be a real PITA to properly design into equipment, much less retrofit to an existing design. It all depends on how they latch and how they change states. Some have two coils, each energized with a single pulse, to "set" and "reset" the relay. Others have a single coil which must be pulsed with alternating polarities, one polarity to "set" and the other polarity to "reset". Some are magnetically latched, thus requiring a polarity reversal to overcome the latched condition, said polarity reversal supplied by either a second "reset" coil or by reversing the polarity of a single coil that "set" the relay. So just deciding on what circuit to use to latch and unlatch the relay is a major design consideration. And whatever you decide on usually locks you in to a specific part that may or may not be readily available in the future.

There are many mechanical relay variations available. Perhaps the oldest is the ancient telephone stepping relay, used to store rotary-dialed pulses in a succession of stepping relays to effect a telephone connection between any pair of telephones connecting to the local telephone exchange. Not suggesting you even consider one of those! But they are interesting "toys" from previous-century technology.

A non-mechanical solution, which would be my choice, is to use a microprocessor with program-accessible, non-volatile, flash or EEPROM memory to store the DIP switch states, but this does require some programming effort. The up-side is it easily interfaces to DIP switches and TTL voltage levels. In effect, the microprocessor reads the DIP switch positions, "memorizes" their settings using non-volatile EEPROM , and then outputs open or closed circuit paths that replace the DIP switch functionality.

I would suggest looking at the Microchip PIC series, specifically the PIC 16F84A which has 64 bytes of EEPROM data memory on board to complement its 64 bytes of RAM.

If you are new to PIC microprocessors, there are folks here who can help you get started. Plan on spending a month or two getting familiar with the Harvard architecture and the small (35 words) command set. Microchip packs twelve pounds of stuff into a five pound bag, assigning multiple uses to most of the I/O pins, but it is well worth the time to learn how to use these itty bitty wonders. You just pick the features you want and need and ignore or disable the features you don't want or need. That may appear to be a waste of resources, and it is, but the chips are dirt cheap. You only need a PICkit 3 programming pod or the newer PICkit 4 (about fifty bux from Microchip) to get started. Beware purchasing counterfeits from Ebay vendors! The program development environment, MPLAB X IDE, is a free download from the Microchip website.
 
Last edited:
Why don't you simply make the DIP switches inaccessible once they have been set by using a cover or something. If you need to change the switches then remove cover etc, etc.
 
Top