Capacitor sizing for voltage regulator

I have a fairly simple circuit I'm playing with, which is more or less an ATtiny84 microcontroller turning on and off some MOSFETs on a 9V battery. I had the ATtiny running on 3.3V but then changed the regulator to 5V to get more juice through the MOSFETs. At that point the controller started resetting itself when it tried to fire the MOSFET. I realized that the two regulators called for different capacitors. The new one is a L4931 which calls for 0.1uF on the input and 2.2uF on the output. I didn't have a 2.2uF handy but I used a 1uF instead (what I had on hand) and now it works again.

So my local radio shack doesn't have a 2.2uF but they have 4.7uF and 10uF. I'm assuming the 4.7uF would work fine, but my question is how do I know for the future what is not an acceptable substitute? I'm assuming smaller is NOT OK but somewhat larger is OK? But if so, how much larger is OK? While playing around I actually put a 470uF on the board before I tried the 1uF and it didn't work, so that was too big :wink:

Thanks in advance for any insight.

The data sheet says 2uf min, 10uf typ, does not list a max.

The capacitor value is related to the frequency of the noise. Lower value caps react more quickly to higher frequency noise.

You can also use multiple capacitors in parallel. And don't forget that a 9V battery should be limited to ~60ma current; if you try to pull too much then no amount of capacitors is going to help you.

Okay, I was pretty sure that smaller capacitors reacted faster, I'll have to research why that is. I knew that I needed a smaller one since the 470uF didn't work but the 1uF did. I guess I just wondered if there was a rule of thumb for this type of application (small microcontroller). I have seen some chips call for a 0.1uF and 10uF on the input, thought that might be a "standard?"

It's interesting since there isn't anything else on the circuit creating "noise", just the regulator and the ATtiny running at 1MHz. It seemed to run along just fine until it tried to activate the MOSFET, I just didn't think that tiny additional current would trip up the regulator.

As for the current draw from the 9V, I know about that, and this was just from noise on the board, not a brownout, since I was testing it with no load on the MOSFETs. That's what piqued my interest :wink:

Thanks for the input