How remember relay position after restart

Discussion in 'The Projects Forum' started by riju12, Jul 25, 2016.

  1. riju12

    Thread Starter New Member

    Jul 25, 2016
    4
    0
    Hi
    I am trying to make a wifi on off switch,
    the problem i am facing is after the power re-start my circuit cant remember the relay position
    The latching relay i tried, but i am looking for anything can be done same with IC
    Like flip flop that will never reset after the power re-start...
    Thanks in advance
     
  2. eetech00

    Active Member

    Jun 8, 2013
    649
    112
    Hi..
    After reboot, can the wifi control unit send a query to the controlled switch unit and have it report back the switch state?
    Then set the relay to the appropriate state?
     
  3. crutschow

    Expert

    Mar 14, 2008
    13,001
    3,229
    You could use a CMOS flip-flop/latch with power supplied from one or two lithium coin cell battery(s) to retain the state when power is removed to the rest of the circuit.
    The battery will last for years under those conditions.
     
    Last edited: Jul 25, 2016
    absf likes this.
  4. noam ezra

    New Member

    Jul 20, 2016
    7
    1
    Can you please explain your circuit in more detail?
     
  5. crutschow

    Expert

    Mar 14, 2008
    13,001
    3,229
    You power the CMOS FF (such as a CD4013) from the 3V lithium battery.

    You power the input and output CMOS auxiliary circuits to the FF from a 3 or 3.3V power supply.

    Connect the FF output to a CD4049 or CD4050 powered from the power supply. It has a high impedance input that will not draw power from the FF when the power supply is turned off.

    The FF will then retain its state when the power to the rest of the circuit is turned off.
    You must be careful that powering the circuit back up will not generate a false trigger to the FF input.
     
    Last edited: Jul 25, 2016
    absf likes this.
  6. Sensacell

    Well-Known Member

    Jun 19, 2012
    1,128
    266
    Nice idea-

    Would't the flip flop end up powering the CD4049 via the input protection diodes?
    Perhaps a large value isolation resistor between the FF output and the normally powered circuits?
     
  7. dougy83

    Member

    May 11, 2011
    11
    4
    As mentioned by Sensacell, the output from the 4013 will power the 4050 (and potentially its load as well) or 4049 through its input diodes. It's simple just to connect the 4013 output to drive a mosfet; this will not draw unwanted current.
     
  8. crutschow

    Expert

    Mar 14, 2008
    13,001
    3,229
    No it won't.
    I mentioned that you want to have the FF output drive a 4049 or 4050 buffer, for a good reason.
    Since they are designed for logic-level translation, they do not have conducting protection diode from their inputs to the V+ so that the input signal can be greater than the supply voltage.
    This means that, even when the supply is 0V, the input will not draw any significant current from an applied voltage.
     
    Last edited: Jul 26, 2016
    Sensacell and absf like this.
  9. dougy83

    Member

    May 11, 2011
    11
    4
    Fair enough, my mistake
     
  10. riju12

    Thread Starter New Member

    Jul 25, 2016
    4
    0
    Thanks for the reply
    but in my system there is no wifi control..
    only mobile is toggling the switch through wifi.
     
  11. riju12

    Thread Starter New Member

    Jul 25, 2016
    4
    0
    Thanks for the reply
    I am planing a system without any battery because i need to give the device to my sister...so in that condition battery changing will be a problem
    and the device can be switch-off for at least 3 days... my idea is to use any kind of 1 bit NVM memory. but i cant find a appropriate IC for that
     
  12. riju12

    Thread Starter New Member

    Jul 25, 2016
    4
    0
    My circuit switch can be on/off via mobile WIFI
     
  13. dougy83

    Member

    May 11, 2011
    11
    4
    The CMOS flip-flip mentioned above with a single CR2032 button cell will power itself for over 10 years; there will be no issue with recharging in after 3 days.
     
  14. Kjeldgaard

    Member

    Apr 7, 2016
    71
    16
    To give a fairly optimal bids on a circuit, would I like to see how the current circuit looks.
    So riju12, let us see how your schematic is thought right now.
     
  15. crutschow

    Expert

    Mar 14, 2008
    13,001
    3,229
    As I noted in Post #3 and , as dougy83 noted, the battery will last many years, since the CMOS FF only draws leakage current, which is 1 μA maximum for the CD4013.
    For example, using the common CR2032 coin cell, which has a capacity of 225mAh, the battery would last 225mAh / 1μA = 225k hours = 9375 days = 25.7 years.
    The battery will likely die from old age well before that time is reached.
     
Loading...