Connect with us

Want circuit to return to previous state when turned back on

Discussion in 'General Electronics Discussion' started by steveo2110, Apr 9, 2013.

Scroll to continue with content
  1. steveo2110

    steveo2110

    4
    0
    Apr 9, 2013
    Hey. I wonder if you good guys can help. It's been 10+ years since I did electronics in school so I'm a bit rusty, but I do know the basics of circuits. So I hope you can share your knowledge in solving my problem :)
    No need to go into the full workings of my circuit, but just the bit I'm stuck on.

    I have an LED which is controlled by push button switch. Using logic gates, the state if the LED remains once the button is released. So, press button and LED turns on. Press button, LED turns off. Press again and comes on etc

    Now lets say the LED is on when the power is cut to the circuit. Is there a basic way that the circuit can remember this, so when power to the circuit is restored, the LED comes straight back on and not back to its default setting of off?

    Could this be done with a capacitor somehow through an OR gate? So when power is restored, the capacitor flows through the OR gate and then loops back round into the OR gate to keep the LED on? Or is there a simple IC which can store this simple piece of information?

    I know the simple option is a toggle switch but that isn't an option here

    Hope what I've said makes sense.
    Cheers
     
  2. brevor

    brevor

    87
    16
    Apr 9, 2013
    It may be possible by using a battery backup, we would have to see a schematic of your circuit to be sure.
     
  3. BobK

    BobK

    7,682
    1,688
    Jan 5, 2010
    It may seem like overkill, but a microcontroller could do this and replace all your logic gates as well.

    Bob
     
  4. Laplace

    Laplace

    1,252
    184
    Apr 4, 2010
    To decide between a capacitor and a battery as the backup power source it would be necessary to know the maximum duration of the power interruption to design for.
     
  5. gorgon

    gorgon

    603
    24
    Jun 6, 2011
    The simplest way to do this is to use a latching relay as the memory component.
     
  6. steveo2110

    steveo2110

    4
    0
    Apr 9, 2013
    Thank you for all your replies. I only have a circuit diagram on paper ATM, but will try get in online.

    This could solve it and like you say include the logic gates in the circuit. The circuit has two logic gate ICs as it is.

    I'll look further into microcontrollers. Anything you recommend reading or to look out for? Especially as I need to be able to save this single piece of information (whether the LED is on/off) when power is cut

    Thanks again guys
     
  7. CocaCola

    CocaCola

    3,635
    5
    Apr 7, 2012
    Just make sure to choose a micro that has an internal EEPROM (almost all of them now) as the circuit transitions from one to the other simply write the value in the EEPROM... Upon power up simply read the EEPROM and start at that value...
     
  8. steveo2110

    steveo2110

    4
    0
    Apr 9, 2013
    thank you once again

    I've had a look and i think i'm gonna head down this route of microcontroller. Been having a play with PicBasic and i'm able to use it as have a web programming background. Think i've managed to get my head round the read/write EEPROM too.

    As this is all a bit new to me, which PIC would suit my needs? I need to have 4 inputs and 7 outputs plus store if one of the inputs was high or low prior to power off.

    Will PIC 16F84A-04P be suitable? Use PORTA as inputs and PORTB as outputs

    Thanks :)
     
  9. CocaCola

    CocaCola

    3,635
    5
    Apr 7, 2012
    The PIC16F84a is an antique PIC16F628a (or even newer chip) would be a much better option, if for no other reason then it has a build in oscillator...
     
  10. BobK

    BobK

    7,682
    1,688
    Jan 5, 2010
    The PIC16F1826, 1827 or 1847 are cheaper and more capable than either the 16F84A or 16F228A. Each new generation adds capabilities and decreases the cost. The 18xx are the latest chips.

    Bob
     
  11. steveo2110

    steveo2110

    4
    0
    Apr 9, 2013
    thanks guys for you help :)
     
  12. BobK

    BobK

    7,682
    1,688
    Jan 5, 2010
    duplicate
     
  13. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    As gorgon suggested, a latching relay is the simplest option, if size is not a concern.

    These are available from around USD 3~6, in coil voltages of 3V, 5V and higher. Some types have a single coil, which is driven with a positive voltage to latch the relay ON, and a negative voltage to latch it OFF. Other types have two coils; this is simpler to drive. Most of the ones I found at Digikey were two-pole changeover, which may be more than you need.

    Here's one with 3V dual coils: http://www.digikey.com/product-detail/en/TX2-L2-3V/TX2-L2-3V-ND/649628 USD 4.58 in 1-up quantities.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-