2024-11-22 05:56 AM - edited 2024-11-22 06:03 AM
I am using STM32F423RHT6 in my project. I am using 2 ADC Channels for measuring Voltage and Current(through Current Sensor). But I am facing a strange issue. Where the channel corresponding to the current is getting accurate values of analog voltage. The issue arises when I measure ADC value corresponding to voltage. I am using a voltage divider to measure the values of voltage ranging from 83.5V to 70.0V. The values are within 3.3V.
Issues facing:
1.
The value of voltage when measuring across the multimeter is say 2.45V, but in conversion of digital to analog value, I am getting voltages more than 2.45. I am getting around 2.6/2.7.
2.
When I am Probing across the voltage divider using a multimeter, this ADC input voltage corresponding to the voltage divider is getting reduced. Which is why, if we don't probe, causing the issue number 1 which is more voltage.
NOTE:
Probing through the multimeter doesn't affect the current channel but only the voltage channel.
3.
When I simultaneously read from both the channels, the channel corresponding to the current is accurate and the value of the voltage channel is getting increased and unable to find the relation between V and I to map the voltage and current.
What might be the issue?
I am using ADC in DMA mode to read the ADC Values. Have taken the pin outs of ADC separately and have connected it to Gnd and Vcc to check if they are independently working or not. They are working with this scenario independently but when connecting to Voltage divider and Current sensor, again the same issue. Tried with a different channel but the ADC Pin concerning voltage divider face the issue of overvoltage during normal cases and undervoltage when probing. This is a hardware issue but don't know how to proceed further.
Kindly reply if anyone has a solution!
2024-11-22 09:38 AM
Hello,
I suggest you to debug the issue step by step.
Forget about the voltage and current measurement for the moment and use two external voltage sources for both ADC channel inputs and vary the voltage input, remove all these HW external stuff dividers etc.. and check if you have the same behavior.
2024-11-22 10:03 AM
DMA screenshot show word, but ADC results is HALF WORD. And you dont show haw and where you create array for adc values.
2024-11-22 12:34 PM
When there is no voltage to the voltage divider, does the channel read an offset voltage?
2024-11-22 01:33 PM
Showing schematics could help. Does the voltage divider have sufficient low impedance? Increase sampling time to the max. Is VDDA stable? You could measure internal VREFINT channel for reference.
hth
KnarfB
2024-11-23 02:51 AM
Yah! it does that. @Karl Yamashita
2024-11-23 02:54 AM
Tried that earlier. At that time, it worked perfectly. 2 channels are reading independent voltage when ADC pins are taken out with a wire and connected to Gnd and Vcc. They worked independently.
2024-11-23 03:07 AM
So you should read and save the offset voltage before there is any power applied to the voltage divider.
After when power is applied, you read the voltage divider and you subtract the offset voltage from it. That should be your calculated voltage you'd expect.
2024-11-25 12:02 AM
You need to share your schematics and code, so others can help you efficiently ..