Psoc 62 Opamp issue

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

cross mob
Anjali
Level 2
Level 2
50 sign-ins 10 replies posted 5 questions asked

Hi Community,

I am using CY8C6247BZI-D54 microcontroller. I had used internal Opamp for amplification and I measured the output of the Opamp. For different input, I found different gain. What should it be?

Thank You.

0 Likes
1 Solution

Anjali,

I'm assuming that your Rf and R1 resistors are external to the PSoC6.

Your gain should be close to 51 for a noninverting Opamp.

You're getting about 47. This could be that your gain error is due to the accuracy of the resistors.

For example if your Rf resistor = 50K is -10% then the resistance then your actual resistance could be 45.0K    Then your actaul gain would be Av = 1+(45K/1K) = 46.

The reason you might be seeing the apparent different gains at different inputs is not due to gain error, but due to the +/-4mV input voltage offset (Vios)

If I take your results and adjust for different Vios values the closest match to give me close to the same gain across all readings is Vios = -1.5mV

Here is the adjusted table:

Input(mV) Vios (mV) Output(mV) Gain
15 -1.5 680 50.37037
16 -1.5 726 50.06897
17 -1.5 778 50.19355
18 -1.5 829 50.24242
19 -1.5 880 50.28571
20 -1.5 930 50.27027
21 -1.5 980 50.25641
22 -1.5 1030 50.2439
23 -1.5 1080 50.23256
24 -1.5 1130 50.22222
25 -1.5 1181 50.25532
26 -1.5 1231 50.2449
27 -1.5 1282 50.27451
28 -1.5 1333 50.30189
29 -1.5 1383 50.29091
30 -1.5 1434 50.31579
       
    StdDev => 0.064494

You will also notice that the calculated gain is much closer to the 51 predicted by your selected Rf and R1 values.

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

7 Replies
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi Anjali,

At what configuration are you using the Opamp ? When you say for a different input, are you telling you were trying to use a different GPIO ? Or did you feel that the gain change with change in input. Let us know the GPIOs used as inputs too.

Best Regards,

Vasanth

0 Likes
Anjali
Level 2
Level 2
50 sign-ins 10 replies posted 5 questions asked

Hi Vasanth,

Different input means different values (From 15mV to 35mV). Below is the measured values for Opamp.

The gain resistors are Rf = 50k and R1 = 1K for Noninverting Amplifier.

Input(mV) Output(mV) Gain
15 680 45.33333
16 726 45.375
17 778 45.76471
18 829 46.05556
19 880 46.31579
20 930 46.5
21 980 46.66667
22 1030 46.81818
23 1080 46.95652
24 1130 47.08333
25 1181 47.24
26 1231 47.34615
27 1282 47.48148
28 1333 47.60714
29 1383 47.68966
30 1434 47.8
0 Likes

Anjali,

I'm assuming that your Rf and R1 resistors are external to the PSoC6.

Your gain should be close to 51 for a noninverting Opamp.

You're getting about 47. This could be that your gain error is due to the accuracy of the resistors.

For example if your Rf resistor = 50K is -10% then the resistance then your actual resistance could be 45.0K    Then your actaul gain would be Av = 1+(45K/1K) = 46.

The reason you might be seeing the apparent different gains at different inputs is not due to gain error, but due to the +/-4mV input voltage offset (Vios)

If I take your results and adjust for different Vios values the closest match to give me close to the same gain across all readings is Vios = -1.5mV

Here is the adjusted table:

Input(mV) Vios (mV) Output(mV) Gain
15 -1.5 680 50.37037
16 -1.5 726 50.06897
17 -1.5 778 50.19355
18 -1.5 829 50.24242
19 -1.5 880 50.28571
20 -1.5 930 50.27027
21 -1.5 980 50.25641
22 -1.5 1030 50.2439
23 -1.5 1080 50.23256
24 -1.5 1130 50.22222
25 -1.5 1181 50.25532
26 -1.5 1231 50.2449
27 -1.5 1282 50.27451
28 -1.5 1333 50.30189
29 -1.5 1383 50.29091
30 -1.5 1434 50.31579
       
    StdDev => 0.064494

You will also notice that the calculated gain is much closer to the 51 predicted by your selected Rf and R1 values.

Len
"Engineering is an Art. The Art of Compromise."

Thank you so much.

0 Likes

Len:
Easy.

DennisS_46_0-1650300112277.png

Open switch (could be analog mux). Measure Vout_unitygain.
Close switch. Measure vout_with gain.

Voffset = (Voutwithgain - voutunitygain)/(1+r2/r1)

Make R1, r2 large compared to switch resistance, set gain to at least 16.

---- Dennis

0 Likes
DennisS_46
Employee
Employee
100 sign-ins 50 likes received 50 solutions authored

Thanks Len.
Another way to look at is to measure the differential gain from step to step. This is plotted below from excel.

DennisS_46_0-1650048140812.png

Notice that the computed slope (gain) is very close to 50.36. If you expect 51 for the non-inverting gain,
then the measured vale is nicely within 1% resistor tolerances.

---- Dennis Seguine
PSoC Applications Engineer

 

Dennis,

Thanks.  It looks like you used the "Trendline" function in the chart.

I used a 'brute-force' method to find the input offset of -1.5mV.   Knowing this offset, you can place the offset into the results to compensate for it.

Is there a best way to find the opamp's offset 'on-the-fly' in the FW?


Len
"Engineering is an Art. The Art of Compromise."
0 Likes