SAR ADC reading random values between 1430-1460

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi 

   

 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()

    

{ADC_Start();}

    

 

    

void readADC()

    

{

    

    ADC_StartConvert();
    ADC_IsEndConversion(ADC_WAIT_FOR_RESULT);
    val = ADC_GetResult16(0);

    

}

    

 

   
   

Please help me out if I am missing some commands.

   


Thanks

   

Chandra 

0 Likes
1 Solution
Anonymous
Not applicable

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. 

   

Best

   

Chandra

View solution in original post

0 Likes
5 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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??

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

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. 

   

Thanks

   

Chandra

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

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.      

0 Likes
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

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,
VSRS

0 Likes
Anonymous
Not applicable

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. 

   

Best

   

Chandra

0 Likes