0
\$\begingroup\$

I have made a voltage divider with two trim pots set at 900k and 14k with a source voltage of 300V DC. I am supposed to get 4.5V at the center, which I do get and checked by a standard multimeter. Now when I feed this point to any of the analog input A0/1/2/3/4/5 of the UNO and try to read the analog value, I get somewhere around 560 for a couple of seconds and then around 650 for a couple of seconds and it keeps repeating. After a reboot the values change but they always seem to jump between two levels. I know these values are from 0-1023 range but 4.5V should have given anaolog value of somewhere in the region of 900. There is a delay of 1 second in the loop. The arduino is powered by a 12V adapter through the barrel jack. I checked whether the analog inputs are good by using a acs712 ampere sensor at the analog input, and it works fine and gives proper analog values with respect to the load.

\$\endgroup\$
1
  • \$\begingroup\$ Can you please show a shematic and your code for for clarification? \$\endgroup\$ Nov 24 '20 at 20:25
0
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

An ADC typically needs a low impedance. What you have is a very high impedance. With that large of a voltage divider it will take a while for the sampling capacitor to charge. The standard way to solve this issue is to use a voltage follower. This gives you a low impedance to you ADC pin. Depending on which op amp you chose will determine if you need R2. If the op-amp can drive a larger capacitive load than what the internal sampling capacitor of the ADC in the microcontroller is then you won't need it. But anything from 10 to 100 ohm won't hurt anything for what you're doing.

\$\endgroup\$
0
\$\begingroup\$

Try adding 1 a 1-10uF capacitor parallel to the 14k resistor, it will help if smooth out the measurement in case there is any noise. if it still happens and you have a scope, hook it up and check if the voltage fluctuates.

\$\endgroup\$
1
  • \$\begingroup\$ Doing it this way is not a very good idea for this application. With 900k of resistance it will take around 2.7 seconds to charge to 4.28V which is 3 time constants. And that's only for the 1uF capacitor. If the ADC is reading every second, having this capacitor will cause a very slow response to any changes to the 300v rail. \$\endgroup\$ Nov 24 '20 at 22:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.