1
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

In the circuit above, I'm using a resistor (R1) and a couple of protection diodes (D3 and D4) to keep the voltage on an Arduino pin from 0V to 5V as the input from the LFO varies from -10V to 10V.

One thing that did not occur to me until I built this in reality was what happens when the Arduino is powered down. When the 5V rail on the far side of D3 isn't powered at all, but the +/- 10V is still applied at "In", the diode at D3 seems to be forward biased at all times. It seems to be allowing enough current to pass to at least light up the "on" LEDs of the Arduino, whether or not it's actually booting.

I suppose the maximum amount of current that would be passed in this situation would be (10V - Vf- 1V)/1K, so less than 9mA.

Could that be problematic for the Arduino? If so, is there a good way to prevent this?

\$\endgroup\$
  • \$\begingroup\$ Stick a 74xx4066 or 74LVCxG125 in front of it. \$\endgroup\$ – Ignacio Vazquez-Abrams May 24 '18 at 2:28
  • \$\begingroup\$ Don't remove power from the Arduino -- instead, leave the power connected and put the microcontroller into one of its low-power states. \$\endgroup\$ – Dave Tweed May 24 '18 at 2:42
1
\$\begingroup\$

You could just use a transistor for the input (assuming reasonably low frequency, as your 40Hz indicates- this will easily work to tens of kHz):

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
1
\$\begingroup\$

Fortunately that is likely an analog input, so a 1 K resistor is about the limit or you could go up to 10 K and be done with it. If you can sequence OFF your signal source seconds before the Arduino is powered down, that would be a safe move.

Since you do not have a capacitor filter on the input pin there is no problem of it discharging through the pin when the MPU is powered down.

Another solution is to use a 2N3906 PNP with its emitter at the pin, its collector grounded, and a 22K resistor from base to Vcc (5 V). When power is shut off the base voltage drops below any existing emitter voltage quickly and the transistor grounds out the pin. It will easily handle any current passing through the 1 K resistor.

However, you have BAT54 diodes with a low Vdrop, less than the BE junction of a PNP, so I think the upper diode will protect the input pin very well.

\$\endgroup\$
0
\$\begingroup\$

Instead of D3 to the +5 rail, consider using a suitable Zener diode to the ground rail.

\$\endgroup\$

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.