Non-linear ADC reading

I’ve decided to build a bench power supply. Using a dc to dc step down convertor and a nano for reading voltage and current. Voltage range is from 1 to 19 volts. For the voltage measurement part i am using a 68k and 10k voltage divider. Problem is that the readings from ADC are quite not linear. From around 6-7 volts and higher i get somewhat accurate reading but around 3-4 volts there is more 30% of error. Same thing is with the current measurement - i am taking voltage from 0.1 ohm shunt resistor(range is 0-0.6 v) and even in that small range i also get an error, especially in the lower values. Haven’t done any mathematical conversion in the code - using the raw values and comparing them to multimeter reading. Do you have any suggestions?

How much noise is on the converter output? A scope should show if there is a problem.

What’s the ADC reference source?

Just hooked the scope - there is absolutely no noise on the output. Reference source is the internal. While searching i found some solution with external reference like lm4040 but and cant get one anytime soon so i was wondering can i use just regular zener diode? Also forgot to mention the nano is power from a 7805 hooked to the input of the dc converter.

Is a load resistor connected ?

I have an H4 bulb connected to the output as a load.


That’s okay, Vcc instead were a bad reference, too high and unstable.

Does the Arduino Vcc also look good?

How exactly is the Arduino hooked for the voltage and current measurement? Ground loop? A simple circuit diagram were nice.

7805 should do a pretty decent job putting out stable voltage. Here is a quick schematic i’ve drawn.

That shows the problem - you can’t feed 5V into Vin. 5V needs to connect to VCC. Vin feeds the on board regulator, which can’t create a 5V output when it is being supplied with 5V.

Do the - in and DC- output connect internally in the DC to DC block?

Just confirmed ground is connected on both sides (XL4016 chip on the converter)

I will try powering the nano directly from input of the converter without the 7805 regulator to see if there will be any difference.


You could make the ADC more precise by using the internal 1V1 reference instead of the 5V supply as reference.

Moving your gnd to near the 0R1 shunt will also help your current readings.

Tom… :grinning: :+1: :coffee: :australia:

Thank you guys! After connecting the 7805 to the 5v pin everything worked as it is supposed to be. I also changed the 68k to 36k to use all the resolution and added a 10uf capacitor to have a more stable reading.