Latching relay - remember last state on power failure

Hi everyone - first off this is my second question here so pardon me for any blunders.

I am trying to use a relay to control appliances. My arduino will trigger the relay on/off. Additional requirement is in case of power failure the relay should be able to maintain its state so that it is in same state when power comes back. Ex: arduino turned on the lamp (using relay), power failed, power is back, the lamp is in ON state.

I read about them quite a bit and found out that I need a Latching relay. I tried to find them online and stores(vetco, radio shack) but all I find is bulky things. Are there any latching relays that are similar in form factor to regular ones?

Also any other alternate options to make my requirement possible without a latching relay?

raghavendra3790:
Also any other alternate options to make my requirement possible without a latching relay?

If you store the current relay state in the Arduino eeprom memory this survives a power down. When the power returns just read the relay state from eeprom and turn the relay on if needed.
Be aware the eeprom has a low(ish) finite number of write cycles so probably best to only write to it when a value changes.

Hi Riva, I did consider the option of state change to EEPROM. But that has its own side effects. The state might go in consistent some times. Consider the following example:

  1. Power Off a Lamp
  2. Save Off state to EEPROM

What happens if the power fails between steps 1 & 2 above? I will be reading an in-consistent state. This happens even if I do the steps in reverse order.

What happens if the power fails between steps 1 & 2 above?

Use supercap, read input power status and trigger a shutdown procedure that writes to eeprom and completes before the supercap discharges to the minimum operating level.

Lots of latching relays available here.

raghavendra3790:
Hi Riva, I did consider the option of state change to EEPROM. But that has its own side effects. The state might go in consistent some times. Consider the following example:

  1. Power Off a Lamp
  2. Save Off state to EEPROM

What happens if the power fails between steps 1 & 2 above? I will be reading an in-consistent state. This happens even if I do the steps in reverse order.

The time between sending the relay signal and writing to the eeprom will be a lot less than a second so the likelihood of a power failure at that second will be remote. If the project has to maintain the previous state to such a high level of certainty then backup power as pointed out by dlloyd is the way to go.