Skip to main content
Visitor II
January 20, 2024
Question

stm8s003f3 adc value fluctuation

  • January 20, 2024
  • 1 reply
  • 1295 views

Hi Everyone,

I am measuring an Ac voltage which is biased on 2.5v dc on stm8s003f3. The input is coming from an op-amp. My problem is I am not getting a stable ADC value. there is always 2 3 point ADC fluctuation which ultimately fluctuates the AC voltage that I am measuring. I measure the minimum and maximum peak of the signal with 100 samples and then take an average of min and max with 30 samples. But still, I get fluctuation. For example, if the peak adc at 100 v is 630 I get a 630, 626, 634 wise sample. My hardware is OK as the same hardware is already working fine with someone else coded.

I would appreciate it if you suggest to me how to get stable ADC values.

Thanks

    This topic has been closed for replies.

    1 reply

    Super User
    January 20, 2024

    Hi,

    Whats the typical error from ds for this adc ?

    You have 630 +/- 4 digits , = 0,6% . What can you expect from ds values ?

    AScha3_0-1705755116444.png

    +/- 4 digits max. - so your adc is according to ds .

     

    +

    Did you measure the noise at the pin? (Maybe the ADC just showing the real noise there...)

     

    KRiaz.1Author
    Visitor II
    January 22, 2024

    Hi A.Sacha,

    Thanks for the reply. I have checked the input and there is no real noise. but can we reduce it in the coding section? I have a sample of the same hardware and its voltage is stable. but when I try to read on the same hardware I notice even after taking the average the ADC reading is +-  4 digits like I said 630 634 638 now due to this my voltage is not stable it also fluctuates from 100, 98, and 102. I am trying to settle it down but no success. what I am trying is is the voltage is 100.5 then it should be in between 100 to 101