0
\$\begingroup\$

I am trying to measure a current of a PV module that can range from 0-15 A. The ASC712 chip can handle current from -20 to 20 A.

However, the issue is that to get a current of 15 A, the output voltage of the current sensor would be 4 V, and my STM32F446re can only handle 3.3 V. I therefore need a voltage divider. My circuit looks as follows:

enter image description here

I am trying to scale the 5 V down to about 3.2 V.

I therefore expect the voltage at the output pin of the current sensor to be 2.5V at 0 A (which I get), however, when I connect the output of the voltage divider (I1) to the ADC pin, the (12-bit) ADC reads a value of 1938 (1.5 V), which is way off 2.5 V.

I understand I need to calibrate the sensor but I dont see a linear relationship with the current input and voltage output of the sensor.

From research I suspect something to be wrong with the choice of my resistors, since I have take into consideration the output resistive load of the ACS712 (4.7 kΩ) and also looked at the input impedance of the ADC pin. I dont know how to take these conditions into considerations, if that's where the problem is.

I also found an application circuit in the datasheet shown below:

enter image description here.

However, I do not know how to design for RF and C1.

Please advise on why am I misunderstanding a simple voltage divider concept.

\$\endgroup\$
5
  • 1
    \$\begingroup\$ Zeners aren’t quite the component you hope they’d be. Namely that they’re leaky and coupled with your high resistor values means you will get significant errors. Remove the zener, divide your resistors by 10 and add a 100nF capacitor from gnd to the analog input pin. With the example circuit with Rf as 2k and the other as 10k, the voltage to divided by 10/(10 +2) or 5/6. Increase Rf if you need a greater division. \$\endgroup\$
    – Kartman
    Sep 9, 2022 at 8:30
  • 1
    \$\begingroup\$ Why R1= 560 k? 20 A will never pass ... through IP+ and IP-. \$\endgroup\$
    – Antonio51
    Sep 9, 2022 at 12:29
  • \$\begingroup\$ What is V1 at the IP- side of the sensor? \$\endgroup\$
    – Jens
    Sep 10, 2022 at 5:05
  • \$\begingroup\$ Sorry, so I havent indicated the remaining part of the circuit, but from terminal 3 of ACS712 I have low resistance path to the rest of my circuit for the current to flow. Hence dont want a lot of current to flow through the resistors for better voltage division. \$\endgroup\$
    – Mayur
    Sep 10, 2022 at 8:12
  • \$\begingroup\$ @Kartman Thank you. So the capacitor value in the example circuit I can have it 100nF as you suggested or it would change in this case? \$\endgroup\$
    – Mayur
    Sep 10, 2022 at 8:18

1 Answer 1

2
\$\begingroup\$

The resistor divider values give an output impedance of 200 kΩ to the ADC input which is absurdly high. It won't work unless the ADC sampling time is configured to be extremely long.

Assuming the measured current is even flowing through the ACS712, because there is a 560 kΩ resistance in series.

\$\endgroup\$
2
  • \$\begingroup\$ So there is a path from terminal 3 of ACS712 with least resistance for current to flow. How did you calculate the output impedance of 200kΩ? I want my ADC sampling time to be very quick thus could you please advise me on what changes can I make? \$\endgroup\$
    – Mayur
    Sep 10, 2022 at 8:15
  • \$\begingroup\$ The ADC input sees 560k ohms to ground and 330k ohms to chip output. You can calculate how much that is and read the datasheet what source impedance the ADC needs to work properly. Also, you say you want to have quick sampling time, but do you really mean sampling rate to be quick? How much is "quick" to you, is there a specification or number you can give? \$\endgroup\$
    – Justme
    Sep 10, 2022 at 8:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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