Analog Input Reads Incorrect Voltages

I'm measuring it at the input into the Arduino and to the common ground the Arduino and every circuit shares; so physically, right at the analog pin into the Arduino after the division circuit(s). I also read the impedance reading for every known resistor in my 16 circuits and they are all within tolerance of 1%.

Is this referencing @Koepel's suggestion of ground currents? If so, I've already clarified that I've read no voltage on the ground which would also imply no current. This is consistent with both a multimeter and calibrated fluke (just to remove the suggestion that the multimeter could be imprecise).

Jules

Still did it just to exhaust that option.

Hi,
Welcome to the forum.
Can you please post an exported image of your PCB?

What range of unknown resistors are you aiming to read?

A 10A supply suggest some very low value resistors, have you got the gnds on your PCB STAR connected, so load gnd current through your potential dividers does not share gnd tracks for the rest of your project, including the Mega?

Thanks... Tom... :smiley: :+1: :coffee: :australia:

So, to move forward with this, I believe your suggestions of the reference voltage being low could be the culprit. I'll try to use an L7805CV voltage regulator to feed into the AREF pin on the Arduino. I'll set analogReference back to EXTERNAL and power the regulator with a separate power supply of at least 9V.

Please let me know if there is a flaw in this experiment.

Jules

What if the 7805 does not produce 5.00 volts?

@julian_orteil
Jules - have you seen my page here?

That is a REALLY BAD idea. A 7805 is not a voltage reference; also ..

CAUTION: Don't use anything less than 0V or more than 5V for external reference voltage on the AREF pin!

If you're applying an external reference voltage to the AREF pin without current protection , you must set the analog reference to EXTERNAL before calling analogRead(). Otherwise, you will short together the active reference voltage (internally generated) and the AREF pin, possibly damaging the microcontroller on your Arduino board.

Each resistor chain is drawing 5V/20 ohm = 0.25A = 1.25 watts.

There is no benefit in consuming that much power to measure resistor values, so you could usefully drop the supply voltage.

If your meter is reading correctly, then the ADC is not and that is down to the value you are assuming for the "internal" reference.
The internal reference is not accurate - but it is pretty stable; so you can just change your correction factor .

Have you connected the ADC input to ground to check the value it reports?

Also yes take and average multiple readings to eliminate (reduce) noise

Hi John, indeed I have. I found it yesterday while waiting for more input from @Koepel (who has been stellar). I'm not the best in electronics, so I'm still trying to wrap my head around some of the things you discuss on your website.

Can you clarify what you mean by this? I'm curious as to why you think this would be a poor decision.

@Koepel I measured the 5V pin on the Arduino and got 4.976V with a 12V barrel plug.

I did this earlier and saw that they were at or near 0 for every input on the Mega.

My first step would be to measure the 5V with your fluke.

Remember the A/D converter is only a ratiometeric measurement of the input voltage compared to the reference.

1 Like

Hi,

Can you please post an exported image of your PCB?

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

"If you're applying an external reference voltage to the AREF pin without current protection , you must set the analog reference to EXTERNAL before calling analogRead(). Otherwise, you will short together the active reference voltage (internally generated) and the AREF pin, possibly damaging the microcontroller on your Arduino board."

yes he is knowledgeable and helpful.

If your meter is reading correctly, then the ADC is not and that is down to the value you are assuming for the "internal" reference. The internal reference is not "accurate" - but it is pretty stable; so you can just change your correction factor .

How are you converting your reading to a voltage? You havent shown that in your code.

I understand this, that's not a problem. It just seemed to me like you had a problem with me using the 7805 as a step down for the external reference (which I am already following the steps you outline in your quote above). Maybe I read your comment wrong..

Isn't this what I'm doing above in my code? Or are you asking for something different?

analogRead(pin) / 1024.0 * 5.0

Also, I discovered that the voltage regulator on the board has become faulty. Probably because I put too much load on the Arduino while supplying it 12 volts? I just replaced the Arduino and am now only giving it 7.5 volts which seems to have helped a little bit. Now the range is only 0.1 - 0.2 volts.

I believe I can probably fix the rest of this using what you mention here, John. Thank you.

Hi Tom,

An image of the PCB wouldn't be possible. It's a rats nest of wires right now, so I don't see any benefit to providing it at this time. :slight_smile:

Jules

Hi,

Do you think that could be contributing to your observation?
If you are breadboarding and using dupont or just wire jumpers, that many connections can introduce a similar problem.

A schematic would help.

Tom.. :smiley: :+1: :coffee: :australia:

Each of the duponts are directly soldered into a PCB, so I wouldn't think it'd be a loose connection.

Regardless, @Koepel @johnerrington it appears the VRM was the main culprit. They're now consistently about 0.1 - 0.2 volts above the fluke and multimeter and then drop to 0.05 to 0.1 when using John's calibration recommendations.

Thank you to you both for your help; you know your stuff! Too bad I can only choose one "Solution"!!

Jules