3
\$\begingroup\$

I was wondering if it's possible to build a digital circuit without using mechanical relays or micro controllers to retain a state even after a power loss?

So a circuit would have a input and an output. The input could be, let's say, a rising edge detecting to toggle the output pin to high/low. When a power loss happens it would retain the last state.

If there are already prebuilt ICs for this, great! If not, is it even possible to build one?

\$\endgroup\$
6
  • 1
    \$\begingroup\$ What is allowed? EEPROMs can be accessed without a microcontroller. \$\endgroup\$
    – Mattman944
    Mar 13, 2021 at 18:00
  • \$\begingroup\$ You could use a battery to keep it powered or EEprom. \$\endgroup\$
    – Andy aka
    Mar 13, 2021 at 18:01
  • 1
    \$\begingroup\$ I think even if your circuit or microcontroller used entirely MRAM or if you used latching relays, you might still lose a very tiny bit of the state if you lose power mid-switch or mid-write. You could get close though. \$\endgroup\$
    – DKNguyen
    Mar 13, 2021 at 18:05
  • \$\begingroup\$ No electro mechanical device and no MCU. A flip flop with a battery, then. \$\endgroup\$ Mar 13, 2021 at 18:30
  • 7
    \$\begingroup\$ Does this answer your question? How to make 1 bit permanent memory circuit? \$\endgroup\$
    – Dave Tweed
    Mar 13, 2021 at 18:30

5 Answers 5

3
\$\begingroup\$

Yes. One thing I have done is to use a very low current fuse as a one-time programmable bit. You may need to parallel some drivers or use a transistor to get enough current.

For example, connect one end of the fuse to ground and the other end to a pullup resistor. As long as the fuse is intact the voltage across it is (nearly) zero. Blow the fuse, and the voltage across it will be the power supply voltage forever more.

\$\endgroup\$
2
\$\begingroup\$

Single D-Flip-Flop

Single D-Flip-Flop with Preset and Clear

What about a low power (900nA, 0.8 to 3.6V) d-flip-flop powered by a coin cell when your circuit loses power?

It even has the edge detection ready...

\$\endgroup\$
1
\$\begingroup\$

Hint:Flash memoryFlash memory is a non volatile computer memory which can be electrically erased and reprogrammed.

\$\endgroup\$
1
  • \$\begingroup\$ @vangelo Flip flops are made of multivibrators so I don't think they are non-volatile memories. \$\endgroup\$
    – Miss Mulan
    Mar 13, 2021 at 19:46
1
\$\begingroup\$

It gets better. You don't need ICs. Just capacitors. A decent electrolytic capacitor can act as memory cell that retains its state for months or even years. I've built thousands of bits of such memory for a relay computer - it's almost like core memory. You turn the thing off at the end of the day, power it on the next day, and all the data is still there. Those capacitors are charged to about 30V DC in my design, but that's only because they need enough energy stored to actuate 12V reed relays acting as read-out amplifiers - the circuit has no semiconductors.

Even with decades old FET/MOS op-amps acting as sense amplifiers, you can use tiny surface-mount capacitors (on the order of 0.1uF), and the main concern is self-discharge rate: this requires attention to cleanliness during assembly - gloves, mask, and an organic then ionic decontamination wash after assembly. With good capacitors, the state can be retained for weeks too. For storage on the order of hours, you don't even need op-amps. Plain old CMOS logic gates are excellent at sensing the capacitor voltage :)

\$\endgroup\$
-4
\$\begingroup\$

You can use a serial-in parallel-out shift register like 74hc595. It requires a clock pulse, with latch input, and the last you need to send data in form of high and low with each clock pulse.

Remember you need to connect the output Enable pin to the ground permanently. So it's always in output enable mode.

Now you don't need any backup power supply. you just use these shift resisters normally when you have a proper power supply. you can give outputs to different bits of the shift register and also if you need more output pins you can add multiple shift registers.

Now let say you have set a few pins of the shift register to High state and rest to low.

Now you cut the power supply. and when you power back it will restore the last shifted value until you send new serial data to the register.

I don't know all the fancy stuff from datasheets but I have personally tested this thing with Shift Registers I am using 74hc595 IC in my test circuit. And I am also attaching a test video to support my solution and if I am wrong then before saying that explain to me that how my test solution is working. https://youtu.be/Ee0cbzn1aLI

Thank you.

\$\endgroup\$
6
  • 1
    \$\begingroup\$ This is 100% wrong. A shift register like the 74HC595 is a completely volatile device. If you cut power for more than a short period of time (much less than 1 second), it will lose all memory of its last state. When you power it up again, you cannot depend on the state of the register until you assert /SRCLR or clock through all new bits. \$\endgroup\$
    – DoxyLover
    Mar 14, 2021 at 7:14
  • 1
    \$\begingroup\$ This is wrong. What makes you think the 74xx595 retains its state when powered down? \$\endgroup\$
    – StarCat
    Mar 14, 2021 at 7:36
  • \$\begingroup\$ Please before saying that my solution is wrong can anyone explain to me that why my outputs are followed when I tested it in my circuit. watch the video in the solution. \$\endgroup\$
    – Dharmik
    Mar 14, 2021 at 12:00
  • 1
    \$\begingroup\$ If you can point me to a manufacturer’s datasheet that states the 74HC595 is a non-volatile device and it stores its state between powerups, I might consider the possibility that you are not wrong. Until then, my comment stands. I hope you understand that just removing power for a few seconds might not completely reset the device. Leave it off for a few hours and try again. \$\endgroup\$
    – StarCat
    Mar 14, 2021 at 16:21
  • \$\begingroup\$ @StarCat believe me went through 4-5 manufacturers datasheet it seems like no one has mentioned this. I have noticed this when I was working on one of my projects which has 16 LEDs controlled by 2 shift registers & I noticed that when I power OFF & when the power it back ON and the 16 LED pattern remained the same as when power OFF. I think you are right like leaving it OFF for few hours would erase everything. It's due to low power like max 80uA & min to 1uA & its working voltage range is -0.5 to 7v & I think even if we have few capacitors the IC will be wake even when no power for a while. \$\endgroup\$
    – Dharmik
    Mar 15, 2021 at 11:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.