Interfacing multiple amplifier stages. - Page 1
Forum section: electronics / projects

author: oldfortune_
author_rank: Contributor
timestamp: March 30, 2017, 02:45:39 pm
content: Hey guys,I am trying to build a visible light to sound converter circuit, but I am having a strange issue with the interface between a TI headphone amp and the last stage of my OP amp circuitry. In the configuration shown in the Schematic the circuit goes into a totally unstable resonance state or something! I've tried things like putting a unity gain buffer in between the non inverting op amp stage and the TI amp but nothing seems to work...Can anyone provide any insight as to why this config would be unstable?The op amp is the LM324, and the following is the headphone amp.http://www.ti.com/lit/ds/symlink/tpa6100a2.pdfThanks in advance!

author: bobaruni
author_rank: Regular Contributor
timestamp: March 30, 2017, 02:55:50 pm
content: Is your power supply decoupled with the appropriate capacitors?Perhaps a schematic would be helpful that shows the values used for the passives, especially around the negative feedback path.

author: oldfortune_
author_rank: Contributor
timestamp: March 30, 2017, 03:02:15 pm
content: Power supply is decoupled with suggested caps. I attached a PDF of the schematic in the previous post.Cheers,S.

author: oldfortune_
author_rank: Contributor
timestamp: March 30, 2017, 03:08:44 pm
content: Here is an image.

author: tecman
author_rank: Frequent Contributor
timestamp: March 30, 2017, 03:54:39 pm
content: Your photodiode amplifier is ground referenced at the inputs. On a single ended supply you will have problems. Return the + input and ground connection of the photodiode to a reference point above ground. Your next stage is referenced to 1.8 volts, and has a serious frequency attenuation due to the 3.9k parallel to 1.8K being fed from a .1uf source. as a general design comment, when using a single supply, reference the op-amp to 1/2 supply voltage using equal value resistors. Increase the R1 R2 by at least 10 times and use a 1 uf coupling cap.try that for a start.

author: bobaruni
author_rank: Regular Contributor
timestamp: March 30, 2017, 04:22:14 pm
content: 1. Get rid of the voltage divider R1/R2 as this will couple rail fluctuations caused by the HP amp straight into a sensitive gain stage, it's a recipe for self oscillation.2. The PS decoupling should be a low ESR 100n in parallel with a 10uF electrolytic.3. You do not need the second stage, having gain outside of the transimpedance amplifier increases noise, increase the gain of the first stage and couple it via a cap to the HP amplifier.4. Stabilize your transimpedance amplifier by putting a small capacitor in parallel with R3, see here how to calculate it herehttp://www.jensign.com/transimpedanceamp/5. The TIA input is ground referenced, it will not work very well unless you use a rail to rail output op amp and one with also a common mode input range that includes ground (the LM324 includes ground but is not R-R output...should still work though as the output can go to ground) and even then there will be a dead zone in the first 100mV of signal above ground but ambient light should make that unnoticable.

author: tecman
author_rank: Frequent Contributor
timestamp: March 30, 2017, 08:34:24 pm
content: Quote from: bobaruni on March 30, 2017, 04:22:14 pmYou need a reference voltage above ground for the op-amp. A divider reference is common (R1/R2) to do that. I agree that power supply coupling in can cause oscillation. Common solution is a divider with a nice decoupling cap. Adding a unity gain buffer to the output of the divider as a 1/2 Vcc supply for the analog also improves things all around.paul

author: oldfortune_
author_rank: Contributor
timestamp: March 30, 2017, 10:21:18 pm
content: Quote from: tecman on March 30, 2017, 03:54:39 pmThanks for the response,- why is is that with a single supply ground referencing the photodiode is an issue? In ambient light conditions there is always some current generated right?-The reason I did not sue equal value resistors was due to the fact that the 324 positive rail is approx at VCC-1V, and with VCC = 3.3V its pretty tight with not much headroom. I guess equal value resistors would be ideal with a rail to rail OP amp?Cheers.

author: oldfortune_
author_rank: Contributor
timestamp: March 30, 2017, 10:29:18 pm
content: Quote from: bobaruni on March 30, 2017, 04:22:14 pmI was originally thinking of just using the transimpedance amplifier to provide sufficient gain, but the issue is that clipping occurs with large variations in ambient light, since the 324 rail is at approx 2V. I was looking around for a design to remove DC offset at the input of a Transimpedance amp but all the methods seem relatively involved, and i'm on a tight schedule :/ I think to get sufficient volume out of the headphones, I need a signal of approximately 1Vp-p, so perhaps a rail to rail op Amp at 3.3V supply might just be sufficient. (the ambient light conditions fluctuate a lot haha)

author: bobaruni
author_rank: Regular Contributor
timestamp: March 31, 2017, 12:44:52 am
content: Quote from: oldfortune_ on March 30, 2017, 10:29:18 pmCool, then your TIA gain is set to max gain for the ambient light and there is enough ambient light to overcome the ground reference.Setting the bias point using the divider at half the op amps output swing is the correct way to get the best dynamic range so you have put some good thought into this.To stop rail coupling into the second stage, try the following:1. Use the bias point as you did with R1/R2 but add a medium cap (maybe 10uf) from the junction to ground to remove rail noise and prevent oscillation but don't use this node as the input.2. Remove C3 and then couple the output of the TIA through C1 to where C3 used to connect, this way you are using less parts to achieve an inverting amplifier that only has gain at the frequency of interest and is biased for best dynamic range.I would still also pay attention to a bigger electro rail cap and a small cap in the feedback loop of the TIA as they tend to be unstable without this cap.Anyway, sounds like a fun project, listening to light

author: oldfortune_
author_rank: Contributor
timestamp: March 31, 2017, 03:59:01 pm
content: Quote from: bobaruni on March 31, 2017, 12:44:52 amTo stop rail coupling into the second stage, try the following:1. Use the bias point as you did with R1/R2 but add a medium cap (maybe 10uf) from the junction to ground to remove rail noise and prevent oscillation but don't use this node as the input.2. Remove C3 and then couple the output of the TIA through C1 to where C3 used to connect, this way you are using less parts to achieve an inverting amplifier that only has gain at the frequency of interest and is biased for best dynamic range.I would still also pay attention to a bigger electro rail cap and a small cap in the feedback loop of the TIA as they tend to be unstable without this cap.So I've made these changes and while it its more stable the circuit can still fall into a resonance state when exposed to large amplitude modulated light audio signal. It seems super unstable... here is the latest, still unstable schematics...Analog electronics is strange and wonderful! but also super frustrating.

author: bobaruni
author_rank: Regular Contributor
timestamp: April 01, 2017, 03:13:16 am
content: Don't give up just yet, you're nearly there!Having a good look at the data sheet, again I must re-iterate that an electrolytic cap is needed on the power pin to ground, data sheet recommends 10uF or higher, I would actually use also a 100uF to 470uF to keep the rail stable especially if it's not supplied by a low impedance source like a battery.I don't see this rail cap on your latest schematic.In the evaluation module, they strongly recommend a minimum output capacitor of 33uF for headphones and or line output, It may need this for stability? your circuit only shows 1uF output caps.Seehttp://www.ti.com/lit/ug/slou084/slou084.pdfAlso, the data sheet states that the amplifier is unstable if the source impedance around the - input is more than 50K and recommends a small cap across the feedback resistor in such cases, I'm wondering if it's worth just adding a small cap to prevent HF oscillation, see page 5 of the data sheet.The LM324 is not a very good op amp, consider a CMOS rail to rail input and output op amp to maximise your dynamic range especially since you only have 3.3v to play with.Just curious how you're sending audio to the detector, are you using some sort of modulation?

author: oldfortune_
author_rank: Contributor
timestamp: April 02, 2017, 11:26:06 am
content: Quote from: bobaruni on April 01, 2017, 03:13:16 amIt seems to be working relatively reliably now! after making a bunch of changes, however there is still a lot of noise. I think it might be a good idea to upgrade the op amp like you said.yer so the installation will have a bunch of visible light audio modulatorsI learnt a lot from this guys page:http://modulatedlight.org/optical_comms/LED_linear_modulator.htmlpretty cool stuff!cheers!

author: bobaruni
author_rank: Regular Contributor
timestamp: April 02, 2017, 12:39:18 pm
content: AwesomeConsider that even with an outstanding op amp, there may be some residual ambient noise sources and RF pickup that just can't be removed.One trick is to connect the anode of the photodiode to the +input of the opamp and the junction of these is connected to ground using a resistor of equal size to the feedback resistor, this will null out a lot of common mode noise and hum by making the TIA differential instead of single ended.Since the gain is now doubled, halve both resistors to restore the correct level, so if you're using 18k Rf, then halve it to 9k and the resistor between the + input and ground should also be 9k.Also, don't be fooled by op amp noise figures, you really have to calculate one that suits your particular case using the previous link posted.Here's a spreadsheet with some good starting points.