UPDATE:
I have removed switch and shielded cables and improvised the board as shown in below image. The transimpedance amplifier is stable. I applied four signal of 10kHz, 1kHz, 1Hz and 100mHz of 200mVpp and it's working without any oscillations.
So, culprit is the switch.I believe, somehow, switch adds up the capacitance in the feedback path and because of that the transimpedance amplifier was oscillating. now question is how can I minimize its effect on the transimpedance amplifier?
I don’t have experience in hardware design.
I am developing a system to do impedance spectroscopy where I am generating and applying sine waves in the range of 100mHz to 40kHz of 100mVpp-200mVpp to an electrochemistry cell, then reading the current through an I to V converter and then I will calculate the impedance.
I have an issue with the I to V converter. When any signal except DC is applied, it oscillates around 2.6MHz.
The conceptual circuit is given below. I am using the ADA4530 (datasheet) transimpedance amplifier. I am setting the gain and compensation capacitor through analog CMOS octal SPST switch ADG714 (Datasheet) for reading the current in the range of few micro-amps to few milli-amps.
Feedback resistors are as follow: 100, 1k, 10k, 100k and 1M ohms and capacitors are as follow: 2.4pF, 24pF and 2.4nF. Please note that ON resistance of the switch is around 2ohms and it has source and drain on and off capacitance as follows:
The ADA4530 transimpedance amplifier has input capacitance of 8pF and GBP is 2MHz with phase margin of 62 degrees.
For testing, I have generated 500Hz square wave of 800mV and applied to one end of the 100k (load) resistor and other end of the resistor is connected to negative terminal of the transimpedance amplifier which acts as virtual ground.
I have measured the signal at the input and output of the transimpedance amplifier.
The orange signal is input and yellow one is output (both signals are not out of phase with each other, I messed up delay in oscilloscope.)
The transimpedance amplifier oscillates just like this irrespective of any input signal except DC. I have selected different feedback resistors through switch but the problem still persists. When I measured this signal, I had 100k feedback resistor and 2.4pF compensation capacitor.
I have kind of reproduced this issue on LTspice, but the feedback capacitor looks unrealistic. Please note that while testing I have also selected feedback resistor without any feedback capacitor and thr problem still remains. So, I think it is a problem with the layout. Somehow input, output capacitance and capacitance on feedback path seems to be looks like values in LTspice and they seem to be unrealistic.
The below image is of layout of I to V converter and analog switch. I have guarding on TOP layer and 3rd layer and both guarding is connected through ‘via fencing’. The bottom layer is solid ground. I have measured guard voltage which was 230mVpp of around 2.7MHz.
The setup looks like this
Please help me out. Please let me know if you need any further information.