2016-03-15 06:42 PM
Hello guys.
I am using STM32F051K8 with CubeMX. While using ADC conversion, the adc value is working weird.The value I measured is adc value from position sensor. the range is from 0 to 2.9V(measured with Oscilloscope).When the value is reached in 2.9v, the measured ad value is 3600 which is correct(3600/4095 * 3.3v). However the ad value became 0 when it measured below than 0.7v.Is there any calculation that I missed?For example, if 1v is measured, I think the ad value should be 1240 (1v/3.3v*4095(12bits)) but the real ad value is 280.Please help me with this. Thank you for reading guys. #adc #stm32cube #bug2016-03-15 07:07 PM
Try setting the sampling time to max cycles. If that substantially improves the result, your position sensor probably has a high output impedance.
If increasing the sampling time is not the answer, provide more details on the sensor, adc channel and your code. Cheers, Hal2016-03-15 07:38 PM
I tried to increase the sampling but it wont help neither :(
I am using the 357 potentionmeter from Vishay. I attached a datasheet in pdf. Here is thecircuit diagram2016-03-16 12:45 AM
Self Answer:
I figured that it occurs because of the potentiometer.in 360 degrees, this potentiometer can use only 250~260 degrees.because of the high resistance, around 100~110 degrees are not usable.and calculation of ad value is different with normal ad calculation.In this situation, I am just using ad value to get degree not voltage value.Thanks for Hal to answer my question, anyway it was helpful for me too.2016-03-16 10:27 AM
The ADC sampling circuit has a 1K input resistance in series with the 470 Ohm and pot resistance. This causes the mysterious 0.7V drop.
When using a resistive signal source, a buffer amplifier to the ADC channel is recommended. Cheers, Hal