A power supply, when suddenly turned off, bleeds voltage slowly. Attached electronics experience a gradual voltage decline from 5V to 3.3V and eventually to zero. The problem is that microcontrollers and microprocessors don’t know how to behave with under-voltage. Unless they have a brown-out detect circuit enabled, which is not the default, their behavior and flash memory integrity is not defined. Flash memory can even be erased.
Attempt 1: Direct connection to the power supply
My first attempt at powering a cluster computer with a direct connection to the PSU ended badly.
I noticed that some of my microcontrollers suffered memory erasure due to this, but I was thankfully able to enable the brownout-detect circuit (BOD) in each of them and reflash them. However, I’d like to solve the problem which is what I attempt next.
Attempt 2: Use an AC-sensing relay to cut off power
This next attempt had all the hallmarks of an elegant and efficient design: connect an AC-sensing relay to the mains and the switching part to the 5V output of the PSU. When the mains are disconnected, the relay opens and the power is completely cut off to the microprocessors. Simple and effective.
The voltage decay waveform shows a sharper voltage drop under the internal resistance of the electronics when the PSU is mechanically disconnected via the relay. Problem solved?
Solution: Use a high-power DPDT switch and bleed resistor
I discovered a six-pin, 2400W DPDT toggle switch that solves this problem. The plan is to establish three circuits toggled by the switch: 1) AC mains to the PSU, 2) PSU to the electronics, and 3) electronics to a bleed resistor.
The DPDT circuits are established as follows:
When the switch is off, the electronics are disconnected from the PSU and are connected to a 1.5Ω bleed resistor for rapid discharge. The stored charge in the smoothing capacitors in the electronics bleeds quickly leaving a square-wave-like logic-level voltage decay curve. The momentary delay while the switch toggles is taken into consideration and will not cause a short circuit anywhere.
This simple solution causes no excess heat nor extra EMI.