Measuring 0-60V with a voltage divider bad accuracy - Solved

Hi!

I use a voltage divider (110K - 10K Pot) to measure 0-60V.
At low voltages it works very good but as I increase the voltage the error increases. At >40V the error starts to get big (several volts).
I can adjust the divider with the pot but it does not help.

So my question. Is it a dead end to use a simple voltage divider + internal 10bit ADC to measure 0-60V with max 0.5V accuracy?

I think my code is good. I use the internal 1.1V reference to get the actual VCC when calculating the ADC voltage.

/Olof

Post a diagram.

Are you using a linear or logarithmic pot.

Edit

And why the pot anyway.

Look at the input impedence of the adc you may be creating a voltage divider with that.

Hi!

I use the ADC on the ATMEGA328.
The potentiometer are low quality, I had to measure a couple to find one that actualy was 10K.
I thought it was a good idé to have a pot for calibration.

I attach a diagram.

VoltageDivider.png

Look at the datasheet for the atemega.
Somewhere in those 400 pages it discusses the adc.

From memory it requires a source impedence of 50 k or thereabouts to function correctly.

Perhaps someone who knows can say as i dont have time to search.

With a scource impedence of 100k this would form a divider which may explain your non linear response.

Google on kirchoffs law.

A simple way to test this would be to divide all your resistor values by 10.
Provided that your 60v scource can supply enough current.

Thanks Boardburner2 for your help!
I will test with smaller resistor values tomorrow.

/Olof

Hi!

That was interesting.
After I replace the resistors (and test the result) I will try and remove the zener.

Maybe I skip the zener and add 5 volts to the maximum allowed voltage (and change the divider) instead.

/Olof

Hi, with your divider 10k/120K you are dividing by 12, so 60V will be 5V at the arduino input, now you say you are using the 1.1V reference.
?????
You analog count will be 1023 at 1.1V input, so your 5V for 60 will also show 1023.
Broadburner2 and JohnLincoln have also valid points that would contribute to the non-linearity.

By the way the pot in your circuit does nothing in the way of adjustment, the wiper is open circuit.

Tom..... :slight_smile:

"I use the internal 1.1V reference to get the actual VCC when calculating the ADC voltage."

You can use the internal 1.1V reference voltage to calculate the actual VCC voltage instead of guessing and assume the voltage is exactly 5V.
I think it is a great feature that some of the Atmega and Attiny mcus support.

/Olof

I use a voltage divider (110K - 10K Pot) to measure 0-60V.
At low voltages it works very good but as I increase the voltage the error increases. At >40V the error starts to get big (several volts).

I would not discard heating: although the power you generate is less than a mW, common resistors and pots are very sensitive to temperature.

Does the measured voltage vary as time passes?. Does it stabilize finally at a -wrong or not- value?

Regards

Thanks again guys for your help!
Now it works perfectly.

First I followed Boardburner2 advice and changed the resistors to a lower value. The measurments was good up to ~52V.

I then understod that the zener had started to conduct as JohnLincoln mentioned and I removed the zener.
After that the measurments was good up to 60V .
I only print the voltage to my LCD with one decimal and it shows exactly the same voltage as my multimeter and bench power supply.

/Olof

1 Like

Something i forgot to mention.

The 10 k resistor should be rated at 1/2 W if you have not already noticed.

The 10 k resistor should be rated at 1/2 W if you have not already noticed.

:.

P=V2/R ===> P=60*60 / 100.000=0.036 W

??

Regards

P.D. Sorry . . . I've just remembered you suggested lower values . . . :blush:

Thanks I forgot about that.
But it's ok because I put a fixed 5.1K resistor + 10K pot in series.
The pot was good because I had to fine adjust the resistance as the resistors was heating up.

Something i forgot to mention.

The 10 k resistor should be rated at 1/2 W if you have not already noticed.

Just to insist: 0.3 W will heat the resistors & pot and they will vary their (nominal or calibrated at Tamb) values substantially; the accuracy of the whole system will be poor.

I think. :cold_sweat:

Regards

I don't think that the heat are going to be a problem because the resistor and pot will always have the same temperatur.
All I have to do is to calibrate with the pot when the resistor and pot have reached maximum temperature.

I tested yesterday for 40 minute and the accuracy was acceptable.

I am measuring a 48V battery bank so the voltage don't change much.
But if I measured a voltage that changed much over time I would have a problem with varying temperature.

/Olof

I don't think that the heat are going to be a problem because the resistor and pot will always have the same temperatur.
All I have to do is to calibrate with the pot when the resistor and pot have reached maximum temperature.

That's the point: temperature coefficient will probably be much different from resistor to pot (even temperature will be different; the one that counts is the temperature inside the component). I do recommend you (if accuracy is a goal) to 1) verify carefully accuracy and, if it is the case 2) using low temperature dependant resistors (they are unexpensive).

Regards.

vffgaston, I appreciate your advice.

I have done a lot of measurment (with two different multimeter) and I get 0.1-0.2V accuracy, I have put alot of "heat glue" around the components, maybe that helps to keep the temperatur more stable between the pot and resistors (I don't know).

But for future project I will try and get better accuracy. I did not know that it existed low temperature dependant resistors.
Should get some.
I also read that the internal 1.1V reference actually can vary between 1.0-1.2V so a good external voltage reference should improve the accuracy even more when calculating the VCC.

Regards

Olof

Thanks

I also read that the internal 1.1V reference . . . . .

The arduino one?

Regards

Yes the internal reference voltage.
See datasheet under 28-4 http://www.atmel.com/images/doc7810.pdf