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.

  • \$\begingroup\$ Arduino "analog" pins are pulsed between 0 and 5 V to approximate an analog voltage (PWM). If you connect an IC to an arduino's analog pin that isn't designed for 5 V it may well damage it. \$\endgroup\$ – LeoR Feb 11 '15 at 11:33
  • \$\begingroup\$ The IC is designed for 3V to 5V so I think 5V should be OK? \$\endgroup\$ – Morty Feb 11 '15 at 11:33
  • \$\begingroup\$ Please confirm you are wanting to use a 5V, 40ma Arduino pin as a 5V, <1ma power supply. \$\endgroup\$ – Jon Feb 11 '15 at 11:41
  • 1
    \$\begingroup\$ For future reference, the kind of current to which you are referring is known as "inrush current" and is something that has to often be taken into consideration with many power supply systems. Especially things like USB where they actually specify a maximum allowable capacitance on the power pins. \$\endgroup\$ – Majenko Feb 11 '15 at 13:25
  • 1
    \$\begingroup\$ Can you upload a schemetic of the circuit you intend to make ? \$\endgroup\$ – Parth Parikh Feb 11 '15 at 14:22

Edit: Just to get this in proper format for closing, I would note that you already had this 99% figured out. After adding the resistor, the pin is protected from anything and everything downstream; the only consideration is the effect that a limited current supply will have on the downstream devices. Additionally, with the recommended bypass capacitor on the Arduino's power pins, an additional capacitor is probably unnecessary.

The math behind the OP's values is as follows:

$$E = I \cdot R$$ $$R = \frac{E}{I}$$ $$R = \frac{5V}{0.0278A\ max} = 180 \Omega$$ $$E = I \cdot R$$ $$E = 0.001A * 180\Omega = 0.18V\ drop\ across\ R$$

  • \$\begingroup\$ But a 1 mA load will drop 1V across a 1000-ohm resistor, delivering only 4V to the load. The OP's calculation resulting in a 180-ohm resistor is more reasonable. In fact, a 125-ohm resistor would be sufficient to limit the peak current to 40 mA. \$\endgroup\$ – Dave Tweed Feb 11 '15 at 12:48
  • \$\begingroup\$ @Dave: Right. I arrived at the 180 ohm by going for a max of 35 mA (always good to have some tolerance), then calculating the needed resistance, and rounding up to the nearest resistor I have in the "assortment" i have - which was 180 ohm :) Seeing that 27 mA is more than I need, this should be OK. \$\endgroup\$ – Morty Feb 11 '15 at 14:38
  • \$\begingroup\$ Is the downstream device going to be switched on and off frequently/quickly (not PWM)? Although the pull-ups are weak, the pin is buffered. The Arduino should already have a bypass, so the capacitor for the IC is for good measure? 1mA out of 40 (per pin) doesn't seem that "bursty". \$\endgroup\$ – Jon Feb 11 '15 at 20:28
  • \$\begingroup\$ Yes the cap was for good measure. What does it mean it has a bypass? That it has a built in cap? \$\endgroup\$ – Morty Feb 11 '15 at 21:09
  • \$\begingroup\$ The capacitor you are wondering about placing across Vin and Ground of the IC is a decoupling capacitor and is also referred to as a "bypass cap". The Arduino should already have one; there are some "magic numbers" for various combinations of supply and demand, but a 10uF is usually "good enough". They are recommended and described in most logic-IC datasheets. \$\endgroup\$ – Jon Feb 11 '15 at 21:21

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.