A while ago I asked a question about having 2 push buttons, and an LED and you set the led to an on or off state with the two buttons, and then remove the power, and when turned back on, the led should stay in the state that was set when the power is on. I realized that I couldn't do it with any of the components that I had, and the best solution was a mechanical 2 button switch. Now I have the 24c00 EEPROM chip, 40 and gates, 40 or gates, 60 inverters (not gates), a few 555 timers, 4 NAND gates, an 4 NOR gates (I am not counting the amount of chips, just the total amount of gates). So now with EEPROM, I know that with its floating gate MOSFETS, it can store electrons by tunneling, so I am wondering if there is a way to store an led's previous state with these components.
3 Answers
With the components that you have listed, you will not be able to build a system that will remember the state of a LED after power-off. The EEPROM that you listed can hold a value without any power, but the problem is that it has a (relatively) complex input/output protocol (I2C) compared to the other parts you have on hand.
I think you will find that there are very few methods for storing data that are both persistent while power is removed, and electrically simple enough that you could build it with the parts you have.
Given your requirements, a toggle switch is still probably the simplest method for storing a state, followed by some arrangement of latching relays.
If you wanted to store the LED state on the EEPROM you purchased, then the easiest way to interface with that device is to use a microcontroller. For example, you could get Texas Instrument's Launchpad board for around $5. But, many microcontrollers have built-in storage that would be more than adequate for storing the state of a LED.
You could "fake" your requirements by making a small, 1-bit memory cell (SR-Latch) and powering just the latch with a coin-cell battery. When you remove power, you would then only remove the power to the LED, not the SR latch, and this could last a long time. You would need to use low-current parts (CMOS), but this would be a very easy method as well.
If you insist on doing this with the components you (mostly) have, try making your own "floating gate" 1-bit store.
Take a smallish MOSFET and wire its gate to a large capacitor. To start with, just use another pushbutton labelled "Store" to connect the cap to the Led's state (not the LED itself but the 0V or 5V supply that drives it) and figure out how to "read" the FET - possibly drive another LED.
Try different capacitors (the biggest ceramic you can get, plastic/foil ones used in speaker crossovers go to 10uf and more with low leakage, etc.). Electrolytics get HUGE but have high leakage so they probably won't be useful.
How long is your memory reliable?
If you can get one of those 1 Farad supercaps, so much the better...
[edit] if the FET is configured as a "source follower" you can measure its source voltage periodically and see how much of the stored charge has gone...
I would look into getting some type of small microcontroller so you can communicate with and utilize the EEPROM that way. PIC is a good place to start if you are just learning to program. This book really helped me a lot.
-
\$\begingroup\$ Many controllers have a small EEPROM on board, size varies with exact controller type. So if it is only about storing the state of a single LED, one of the smaller controllers will be sufficient and not need any external memory. \$\endgroup\$– jippieCommented Nov 29, 2012 at 7:37