5 Replies Latest reply on Mar 16, 2017 11:18 AM by userc_38872

    SAR ADC reading random values between 1430-1460



       I am trying to read an analog signal with the SAR ADC. In the components (Analog), I plug in the analog signal wire directly to the + input of SAR ADC and use (Vss) as - input. 


       I am uisng external VRef (2.000 V) in the config parameter. 


       I am definite that I am getting analog signal from my sensor. However, my ADC reading is some random noise between 1430 - 1450. 




       I am using these commands: 


      void init()






      void readADC()




          val = ADC_GetResult16(0);






      Please help me out if I am missing some commands.





        • 1. Re: SAR ADC reading random values between 1430-1460

          Welcome in the forum, Chandra.


          Can you please post your complete project, so that we all can have a look at all of your settings. To do so, use
          Creator->File->Create Workspace Bundle (minimal)
          and attach the resulting file.


          Are you using a Cypress Kit or a self-made board? Are you buffering your Vref??





          • 2. Re: SAR ADC reading random values between 1430-1460

            Hi Bob 


             Thank you for your interest and responding to my post. 


              Unfortunately, I cannot give you the entire project. However, I can give you snapshots of what I am trying to do. I am using a custom cortex M0 board (PSoC 4 creator) CY8C4***-BLE chip. 


              I can attach images of the relevant sections for the ADC. We have an analog sensor which is hard wired to the SAR ADC pin 0 and are trying to read values from this pin. 


               Any information would be really helpful. 





            • 3. Re: SAR ADC reading random values between 1430-1460

              Assuming that ADC_SAR input range is set to 0+2Vref (Vref=2V), output signal 1430 - 1450 (1440+/-10) corresponds to


              (1440+/-10)  / (2^12) * 2 Vref = 1406 +/-9.8 mV, which seems to be quite normal for analog noise for the system without special care.


              Standard troubleshooting steps: check with a multimeter, that the sensor produces DC=1.406V, and AC < 0.01V. Apply internal 1.024V reference to ADC_SAR (+) input, and make sure that it does not produce noise. Add 1u bypass capacitor on Vref input pin (pin # does matter due to path high resistence, see ADC_SAR datasheet for details). Add buffer OpAmp before ADC input. Shield or twist wires coming from the sensor. Add some 0.01u capacitor to ADC input to filter incoming noise (note that ADC_SAR input impedance is low <~20k). Try ADC_SAR in differential mode.      

              • 4. Re: SAR ADC reading random values between 1430-1460

                Hi Chandra,

                Some additional info.

                1.Vref should be stable. To remove noise at Vref pin, you can connect a capacitor.


                2. If the input is slow varying a small value capacitor will eliminate high frequency noises at input.


                3.Firmware filter (Averaging in firmware) could help in reducing noise.

                Best Regards,

                • 5. Re: SAR ADC reading random values between 1430-1460

                  Hi Guys


                   There was some error in configuring the analog pin to the sensor. This issue is now resolved. Thank you for your feedback and suggestions.