Voltage divider drifing when voltage increaeses.

Hello,

I have a voltage divider, 68K/1M so I can read close to 80 volts on a 5 volt analog pin.

But something is wrong.

I thought I should get a reading (in my case it's 12 bit) and measure the volt with my volt meter.

If I divide the (milli) volts shown on the volt meter by the analog read result I should get how many milli volt 1 unit represents.
This value should than be (more or less) constant over the whole range right?
Well my readings change too much.

At 1.5 volts I read 86 which that should be about 18,10465 milivolt per digit.
At 15.01 volt I read 860. So 860 * 18,10465 = 15,569. This half a volt different.
At 19.889 volt I read 1144 . 1144*18,10465 = 20.712.
At 19889 mv it actually is 17,385489 mv per point and this get more when the voltage gets less.

I read on an old thread that haveing a voltage divider with Mega ohm resisters kan be problematic but they do not say what the symptoms are.
Can it be that the high value resistors are the cause of my drift?

Here a list I made to check.

//31 = 607 mv 19,5806451
//57 = 1050 mv 18,4210526
//86 = 1557 mv 18,10465116
//112 = 2000 mv 17,8571428
//115 = 2050 mv 17,8260869
//170 = 3030 mv 17,8235294
//230 = 4050 mv 17,608695
//288 = 5070 mv 17,60416666
//289 = 5090 mv 17,612456
//319= 5590 mv 17,5235109
//348 = 6100 mv 17,528735632
//407 = 7130 mv 17,51842751
//462 = 8007 mv 17,331168831
//520 = 9009 mv 17,325
//576 = 10040 mv 17,430555555
//721 = 12560 mv 17,42024965
//860 = 15010 mv 17,4534883
//1144= 19889 mv 17,3854895
//1442= 25000 mv 17,3370319

Which Arduino board (or non-Arduino board) do you use ? If you use a ESP8266, is that with or without a onboard voltage divider ?

What is the device that has 80 Volts that you want to measure.
How is that connected to the Arduino GND ?
Can you show in a photo how the GND wires are ? or can you make a schematic that shows the GND wires ?

In OP's other thread an ADS1115 and solar panels are mentioned.
No use answering these threads if most of the details are missing.
Leo..

The board is a Green Logic LGT8F328P.

Ik wil have to try to make a schematic later. They should all share the same ground.

I guess my main question was if it normal that voltage dividers drift? Or if it's likely the drift is caused by my too high values in my voltage devider.

Yes my goal is to beable to measure my solarpanels that can go up to 80 volts. But I did the testing with a simple usb variable power supply. (usb stick that can go from 0.6 to 25 volts) with no load. I used batteries to power the board but I also had it connected to the same laptop to upload sketches and read the serial data.

I gues will just have make test setup so I can experiment with differentboards and resistor and see what happens.

The A/D converter , by default uses the 5v power supply as a reference - if that changes , then the voltage you calculate will change too .
You might be better using an internal reference which is independent of the Arduino power supply and helps with over voltage protection ( you get ~1.1v fsd, but the input is protected to 5v) .
If your solar panel signal has any noise on it then you might get differing values between your dvm and the Arduino.

The A/D doesn’t drift enough to give the effect you see.
Using a hi value resistor across the analog input is not a good idea as it will affect the divider performance ( , possibly ok at 68k, but you could try reducing the resistor down to 1k? ). It is also worth while taking measures to protect the Arduino against overvoltage - if the divider resistor fails the 80v will kill the Arduino.

Keep the bottom end of the resistor chain connected to the Arduino 0v connection in a way such that it doesn’t carry any other circuit current ( star gnd)

Need a wiring diagram !

A clone of a ATmega328P ? So everything we know about the datasheet of the ATmega328P does not apply here ?
The ATmega328P has a very good ADC, it is linear, rail to rail, and accurate. I doubt if a clone can do the same.

I never had problems with clone Arduinos, and I think most, if not always, the user is to blame for problems.
I see that OP prints (80volt) with seven decimal places. Totally unrealistic for a 10-bit A/D.
If a stable reference is used (the internal 1.1volt Aref), and metalfilm resistors, and ground of the voltage divider is not shared, and some smoothing code is used, then you can expect a solid ONE decimal place over that 80volt range (= 800 A/D values).
Leo..

Edit: I see that OP is using a 12-bit A/D. Not sure which Arduino.
Still not enough for two decimal places.

To add to Wawa's point, there are also hysterisis errors associated with any resistor, as well as absolute accuracies that change characteristic with different voltage: this because it changes the dissapated power and heat generation. Its not just about the electronics when interfacing with the real world! There are physical limitations too.