Electronic – arduino – How to calculate Op Amp’s gain using Arduino’s ADC

adcarduinogainoperational-amplifier

enter image description here

Hi, I'm feeding a 500 Hz PWM signal to the Op Amp's V_IN using Arduino DUE.

The Op Amp, which is ADA4000-2 from Analog device, is connected to +12V, -12V using an external power supply.

The power supply's GND is also connected to Arduino's GND.

The R1 part is replaced with a potentiometer to adjust the gain and R2 = 10k Ohms.

The signals from Vout were amplified as I expected.

However, I wanted to read the gain using my Arduino, maybe using the ADC, and print that out using the serial UART.

What methods or circuits should be used to get the Op Amp's gain?

I'm curious this both works for inverting/non-inverting case.

Thanks for your help!

Best Answer

schematic

simulate this circuit – Schematic created using CircuitLab

You can try this circuit. Thanks to voltage follower your output signal doesnt has distortion when read output signals. Also there is voltage divider because output signal level can damage your arduino. Maximum output signal level is 12V and voltage divder can reduce this level to 4V. So your arduino doesnt damage from signal high signal level. Your gain is ADC Value * 3 /1024. Your R1 values is (gain -1)*10k. Note: You must use pwm for input signal. Otherwise output signal maybe has negative value and this can damage your arduino.