I am building a cnc drawbot and for my position sensor I turned my entire x-axis into a giant (1,20m) potentiometer (like this here). I just checked and discovered that my sensor readings are really accurate. But then I measured the current through the potentiometer and discovered it was 120mA. And that is a middle position reading. I am afraid that when I get to one of the edges, current will get too high and I will blow up my arduino.
Should I worry about this, and if so, how would you solve this?
The analog inputs are very high impedance (on the order of 10-100 Meg Ohms) so very very little current flows into the input. As long as the voltage never goes negative or over the analog reference voltage or Vcc your Arduino is safe. If you want extra protection, add a 10K or so resistor in series with the wiper to the analog input. Adding 10K to the > 10 Meg Ohm input impedance will not affect the reading, but will limit current in case of an overvoltage.
"The analog inputs are very high impedance (on the order of 10-100 Meg Ohms) so very very little current flows into the input."
More like 1 Mohm, as max current into any pin is 1uA.
1V/1,000,000ohm = .000001, 1uA
Current thru the pot has no impact on current into the Arduino. If the readings are accurate, don't mess with it.
groundfungus:
The analog inputs are very high impedance (on the order of 10-100 Meg Ohms) so very very little current flows into the input.
Do this test.
Take a DMM and measure the VOLTAGE between input and ground.
If the pin has pull-up resistance (leakage), you should measure a voltage.
100Megohm would measure 10/110 of 5volt (.45volt), because a DMM has an internal resistance of 10Megohm.
Then measure between pin and VCC for pull-down leakage.
Last time I measured >>1000Megohm (at room temp!).
Analogue pins have a different problem.
An internal (~12pF?) A/D sampling cap has to be charged/discharged.
That could have any voltage stored from a previous A/D read.
Best if OP uses some resistor, for safety, between wiper and analogue input. I would suggest >=100k.
And a >=100n cap from analogue input to ground.
Leo..
At room temperature just assume input pins take no measurable current at all - the 1uA figure
is across the whole temperature range and input diode leakage increases exponentially with
temperature, so at 20degC its more likely to be < 1nA.
Oh, add a 100nF capacitor to ground on the analog pin to knock out noise, you'll be picking
up lots of noise with that sort of sensor.
Thanks for the capacitor tip. That worked like a charm. I found some inductors in an old dvd player and that got me even less noise. Analog position sensors work surprisingly well. I wonder if the arduino zero will let me make a 16 megapixel image this way...