For a low-current IC (< 1 mA) where I need to be able to switch it on and off, I'm connecting it directly to an Arduino analog pin. In order to ensure a stable voltage, I was thinking of adding a small capacitor across the IC. But I'm wondering if this might damage the Arduino? The max current draw allowed per PIN is 40 mA, and adding the capacitor would mean that there's almost a high current draw while it is charging, albeit only for a very small time. But I can't find out if such a quick high draw is allowed.
I tried to calculate how much the current will be the but the equations in this Wikipedia capacitor article are not immediately usable.
There's an equation for current, but it depends on the derivative of the voltage function. And the voltage function in turn depends of the integral of the current function. Hence there's many pairs of solutions to these equations.
What is the general practice/recommendation here. Would putting a 100 nF capacitor be OK? I also thought I could add a small resistor - so I would add a resistor between the Arduino PIN and the IC source PIN, and then have the capacitor still across the IC's source and GND. The resistor could be, say, 180 Ω which would limit the max possible current to 27 mA while causing only a voltage drop of 0.18V when the draw is 1 mA.