5

Storing an LED's previous state even if power is removed

I want to build a simple circuit that consists of 2 push buttons and an LED. I want the LED to turn on when one pushbutton is pressed and off when the other is pressed. I am pretty sure this can be done with a flip-flop. But this is not the only part. I also want the circuit to keep its previous state even if power is removed. So if the LED is on, and power is removed, I want it to be on when the power is added. Same with if the LED is off and the power is removed I want it to stay off when power is added. I think that NAND gates or something are used to store flash data, but I am not sure. I want this circuit to be only consisting of transistors and other common parts like capacitors resistors diodes crystals inductors ect... I don't want to use any uncommon integrated circuits (I only have 555 timers and some dual flip flops and some buffers and a few other really odd ic's.

This may be impossible (especially with only transistors) but any information is helpful  and I'm only 14 so I'm still a beginner in this stuff.

Edit: I want to figure out a semiconductor way to do this. I know I don't have the parts but what would I need?

skyler
  • 10,196
  • 28
  • 81
  • 132
  • Strap a cap to a MOSFET gate? – Ignacio Vazquez-Abrams Nov 01 '12 at 03:34
  • 2
    Practically, the easiest way to do this is just use a toggle switch instead of two push-buttons. Then the switch itself will "remember" its state, without needing power to be maintained. – The Photon Nov 01 '12 at 03:45
  • 1
    How long do you need it to hold state without power? 1 minute? 1 year? – The Photon Nov 01 '12 at 04:10
  • 1
    A day should be good – skyler Nov 01 '12 at 04:14
  • 1
    A bi-stable relais is one option. – Wouter van Ooijen Nov 01 '12 at 07:55
  • You want a Set reset switch with power-failure memory. ( ie a non-volatile semi-conductor switch? or any momentary switches with memory on LED state or any simple solution on LED state with power fail protection but 2 switch control? One could also use 1 switch to toggle and still have memory. BE specific but don't over specify. Capacitor, battery, charged gate all have memory. SDRAM are designed for long term memory. Also budget, effort and intent are important. – Tony Stewart EE75 Nov 01 '12 at 21:05

3 Answers3

6

You need one of these:

image of dual pushbutton switch
(source: vandykes.com)

A bit retro, but meets your requirements exactly!

The point is, there are only a few ways to remember the state of an electric circuit with no power applied, and mechanically is one of the most common. The other ways can't be done with the types of components you've listed.

Dave Tweed
  • 172,781
  • 17
  • 234
  • 402
5

A bi-stable switch as Dave Tweed mentioned will certainly work. Another way is to use a tiny microcontroller that has EEPPROM built in. There are some PIC 12 available with EEPROM. The micro reads the two switches, drives the LED, and stores the last state in EEPROM, which it then recovers on powerup.

Olin Lathrop
  • 313,258
  • 36
  • 434
  • 925
3

If the flip-flop uses only a tiny bit of current, such as if it's CMOS, you could supply power for a day or more to the flip-flop with a battery. Keep the battery trickle-charged with the external power. A super-capacitor might work as well as a battery. Use only external power (not the battery/supercap) for the LED and its driver, and any other circuitry. A diode can keep the the memory-keeping low-current circuitry separated from the power-hungry LED.

BTW "NAND" in regards to flash memory isn't really the same as the basic logic gate. Flash memory involves shoving charges across an insulator to an island of semiconductor or metal, and nand gates are involved in some manner to read/write the data, but I'm no expert on that. Plain old NAND gates in TTL, NMOS or CMOS chips can't hold data at all.

DarenW
  • 4,060
  • 1
  • 25
  • 37