Here is a very simple situation. I have a resitor from 5v to ana in 0 and another resistor from ana 0 to 0v. 5v- 80k- input- 1k7 -0v
However the read is not stable at all, it ranges from 19 to 32. Does anyone know of a way of stabalizing this.
If I use higer value resistors it does get a bit better in the 500 range for the input, but this will not work for my intended project as I need a wide range or input.
I am using a battery to supply the voltage which is going through a voltage regulator, so the 5v line should be pretty stable.
I am using a nano and cant see a 1v1 pin anywhere, there is a 3v3 though.
You are seeing about 60mV of noise. You might try adding a capacitor fro AIN0 to ground in an attempt to filter it out. The software approach is to make multiple measurements and average them.
Your divider has a reduction ratio of 48:1, to get an ADC reading in the 500 range, would take over 100 volts across the divider. What voltage are you trying to read (AC or DC)?
You are obviously getting noise from somewhere. Might not be much that you can do if you can't track the source down (oscilloscope?). You need a solid ground, a solid analog reference (look up the analogReference function, and the 1.1V reference is called INTERNAL. It will be better than the 5V power as a reference. And a solid signal.
Your divider has a reduction ratio of 48:1, to get an ADC reading in the 500 range, would take over 100 volts across the divider. What voltage are you trying to read (AC or DC)
No it wouldn't. Analogue inputs work from 0v to whatever vcc is, so maximum vcc would be a reading of 1023, in my case 5v would be 1023, you can't input more voltage than is the maximum.
What I meant was if I changed the resistors to a more equal value, then the readings would be 500 ish.
What I am trying to do is read the resetance to 0v, I am not reading voltage at all.
OK, so I have added code analogReference(INTERNAL);
to the setup. When run this now gives me range 68 to 106, so believe it or not, even worse still.
Thanks for the suggestion though, it was a good one.