Why is my circuit so incredibly sensitive to electric fluctuation?
The advised capacitor is a long-lead buffer, so to speak.

Even if you had a perfect power supply, the cables that run to your design are far from perfect. And that's not your fault, it's just how cables are. I believe some rapper wrote a song about that... I'm pretty sure it was about cables anyway.

Your cables firstly pick up noise. Secondly they have silly characteristics that you will learn about later at some point in more detail, but basically for high frequency signals (such as digital circuitry makes) they have a very high reluctance to conduct current, possibly even only 50 mA. Those signals are hard to transport over just any cable. You can see it for now as the cables being a bit slow to react. If you switch on a current they will take some time to supply that steadily, so if you switch it often, you'll start to notice a lot of noise on the power supply.

Adding that capacitor will allow your high frequency switching currents to be taken from the capacitor, so the cables can supply just the short-term average, and normal DC leads are very good at short term average near-DC, they can do many amps at that and so can your supply: Everyone happy.

In fact, many design guides for voltage management or voltage regulator chips specify an input capacitor of 2.2 &mu;F, for example, parallel to a dotted 22 &mu;F or larger, with an asterisk saying "if the incoming power cables are longer than X or Y, regardless of power supply used, add the 22 &mu;F (or more) capacitor for stability and better noise rejection".

It may even be better to keep the 100 &mu;F capacitor, because the 8200 &mu;F capacitor will have a larger internal resistance, unless it's also much, much larger physically. The internal resistance of a capacitor determines how good it is at taking away the ripple of low-current high frequency signals. Smaller is better in most cases with first input capacitors like this one. But, with voltage regulators, that doesn't always apply for all input/output capacitors, so once you get to those beware! But that's not for now.

You can be happy about not everything being this sensitive, slowly switching or high frequency digital alike, there are many robust things that are much less sensitive to reboots, but it is often still a very good idea to add some capacitance if a board or design is powered with wires or sometimes even through a connector between boards. It doesn't always have to be as large as 100 &mu;F, but a little to take the edge off (pun for the more weathered reader intended). Having no noise to work with is always better than having to work with noise.

The reason the capacitor between the power wires and the circuit works better than the circuit between the power wires and the capacitor is because the trace inductance (whether it's a PCB or bread board) will limit the response of the capacitor, if you then have power wires nearby, your circuit will ask them to supply some of the current as well, which will cause the same kinds of dips, but possible in a lower order. You are already basically putting your switching noise onto the cables and the cables already react to it. When your noise sees the capacitor first, even with some inductance in the traces, the noise will not go into the cables and not cause any further problems, which reduces the noise your circuit sees by a much greater factor.

Edit: Note: The above about capacitor position is severely simplified in some respects, but it generally conveys the idea well enough. To clarify it should suffice, but there are many dynamics to things like this. In later years looking back, you may find this to be a bit lacking. But you don't need to know all that right now. This will do.

The reason with a relay and a capacitor and shared power things go wrong, still, is because the current spike of your relay is too large for the capacitor to help with and then the cables can't keep up either, or because the relay release creates a voltage spike. A solution could be, if your design can handle a diode-drop:







simulate this circuit &ndash; Schematic created using CircuitLab

D1 prevents anything powered by the DR832 from stealing power from your digital buffering capacitor C1. D2 prevents the relay from making any significant noise on your supply and D3 catches any power spikes the relay still makes when you turn it off.