# Cypress Developer CommunityTM

## Help with using ADC to LCD to measure a sine wave

Summary: 6 Replies, Latest post by vl123 on 29 Jan 2012 12:59 PM PST
User
8 posts

Hi, Can anyone help ?

I'm just trying to use the LCD to display voltage of the sinewave but so far i'm not getting any luck.

I'm feeding an a sine wave with from a function generator to ADC and display it on the LCD display.

I brought out AGND to en external pin to move the reference to Vdda/2.

It is able to read the dc values not ac values. HELP ??? I want to be able to read the value of a sine wave . Peak to peak or RMS.

Thanks

User
9259 posts

A "normal" multimeter rectifies an AC input and measures the DC about 10 times a second. When you try to measure a sine-wave, first question is: of what frequency? PSoC 5 normally is fast enough to measure 10ksmpl/s, when you take the values and look for the smallest and for the largest result, you have peak-to-peak which you can display on your LCD. Of course you can use the usual "rectify" method.

Bob

User
8 posts

Thanks for the reply Bob. I know it should work but it just not working. Whenver I input a sine wave it is showing a value almost zero. If I add a DC offset , it will show that DC offset. I tried different frequency but still gives me a zero. I don't really need to display it on the LCD but I just want to make sure I'm getting the correct data from the ADC. LCD is just for testing. I attached my project files hopefully someone can help me out.

User
1362 posts

If you want to meansure an AC signal, you can

1. recitfy the siganl, use the peak detector then use the ACS to read the peak value of the signal. If the signal is pure sin wave, multipy the volage by 0.707 whcih would be the rms value ot the signal, I think there is a applciation notes of making peak detector or rectify here.

2. Use the ADC with sample rate much faster then the signal, then use the software to read the maximum value which would be the peak value of the signal.

In both cases, I think you can not measure signal of too high frequeny.

User
9259 posts

Would you mind to upload your project here, so that we can have a look at it? Please use Zip - archive format and "Clean Project"  before you kompress it.

Happy zipping

Bob

Cypress Employee
730 posts

Hi vl123,

If you are having trouble uploading the project over the forum, please mail it to me (dasg@cypress.com)

I'll upload it in this topic.

User
8 posts

Thanks for the replies. I attached the project files.

Thanks

Attachments: