Author Topic: Transimpedance amplifier design using STM32G484 with integrated opamp  (Read 3018 times)

0 Members and 1 Guest are viewing this topic.

Offline Matthew47Topic starter

  • Newbie
  • Posts: 5
  • Country: us
Hi,

I am working on a robotics project, and I have a need for 4 transimpedance amplifiers that will be used in object detection sensors. The STM32G484 contains several integrated opamps, so I will not have to use external ones for this project.

The following article helped me decide on the values for the compensation capacitor and feedback resistor; however, I would like to get a second opinion on the design before ordering parts for testing.

https://www.osioptoelectronics.com/media/pages/knowledgebase/b954012b64-1675100541/an-photodiode-parameters-and-characteristics.pdf

Notes:

1) I chose the 27500 Ohm resistor such that the typical reverse light current (60uA) will create a 1.65V signal on Vout of the opamp.
2) The expected signal will be modulated in the KHz range, and will be digitally filtered by the MCU to reject ambient lighting.

Photo diode: https://www.digikey.com/en/products/detail/vishay-semiconductor-opto-division/BPW24R/1681148
MCU: file:///C:/Users/Matthew%20Komitsky/Downloads/stm32g484ce-9.pdf

I would appreciate any thoughts on things I have missed, or areas of improvement!

-Matthew
 

Online TimFox

  • Super Contributor
  • ***
  • Posts: 12012
  • Country: us
  • Retired, now restoring antique test equipment
Re: Transimpedance amplifier design using STM32G484 with integrated opamp
« Reply #1 on: April 06, 2025, 08:18:38 pm »
The datasheet shows 11 pF (typical) capacitance at 0 V bias, so your 8 pF (8.2 pF is a standard value) seems reasonable.
That capacitance could be reduced to 3.8 pF (typical) at 5 V reverse bias, but the dark current will go up to 5 nA (typ) at 60o C:  is this acceptable?
Of course, 8 pF and 27.5 k\$\Omega\$ (standard value 27 k) would give a low-pass filter -3 dB at 720 kHz (probably OK:  how many kHz is your modulation?).
 

Offline Matthew47Topic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: Transimpedance amplifier design using STM32G484 with integrated opamp
« Reply #2 on: April 06, 2025, 10:35:36 pm »
I chose the photovoltaic mode of operation, so I don't need to reverse bias the photodiode --> I don't have a negative voltage supply on this project.

~30KHz is the modulation frequency, but this can be easily tweaked in software.

Another resource I forgot to mention: https://www.analog.com/en/resources/technical-articles/stabilize-transimpedance-amplifier-circuit-design.html

I was unable to reproduce their example calculations, so there might be a typo (or I am misinterpreting something) --> I calculated 12.2pF, and they got 15.6pF

My theoretical knowledge on this subject is limited, so it might be more worthwhile to experiment considering there will be unknown variables with the PCB design.
 

Online TimFox

  • Super Contributor
  • ***
  • Posts: 12012
  • Country: us
  • Retired, now restoring antique test equipment
Re: Transimpedance amplifier design using STM32G484 with integrated opamp
« Reply #3 on: April 06, 2025, 10:39:56 pm »
If you invert the diode, you can use a positive reverse bias and invert the input polarity.
Does that work with your modulation scheme? 
 

Offline Matthew47Topic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: Transimpedance amplifier design using STM32G484 with integrated opamp
« Reply #4 on: April 06, 2025, 10:57:19 pm »
That's possibility; however, I simply don't how much of a difference photovoltaic mode vs photoconductive mode will make in this application. My understanding is that the difference will primarily lie in response time.

Here's the context: These sensors (aimed sideways) will be used to center a robot moving down a walled path at >2 meters/second. Faster signal stabilization will allow me to spend less time reading the ADC, and more time processing the data.
 

Online TimFox

  • Super Contributor
  • ***
  • Posts: 12012
  • Country: us
  • Retired, now restoring antique test equipment
Re: Transimpedance amplifier design using STM32G484 with integrated opamp
« Reply #5 on: April 06, 2025, 11:10:44 pm »
That's possibility; however, I simply don't how much of a difference photovoltaic mode vs photoconductive mode will make in this application. My understanding is that the difference will primarily lie in response time.

Here's the context: These sensors (aimed sideways) will be used to center a robot moving down a walled path at >2 meters/second. Faster signal stabilization will allow me to spend less time reading the ADC, and more time processing the data.

The two differences are capacitance (reduced by photoconductive mode with reverse bias) and dark current (increased in photoconductive mode, increasing drift and noise somewhat).
The datasheet shows little difference in sensitivity.
You can model the response time question in Spice (or its derivatives), modeling the diode as a current generator (photocurrent) in parallel with a capacitance and either a resistor (voltaic) or DC current (conductive).
In conductive mode, the I-V curve has a finite slope going through zero.   In voltaic mode the equivalent parallel resistance is very high, but there is the leakage (dark) current.
Both the parallel resistance (in voltaic mode) and dark current (in conductive mode) are strong functions of temperature.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 23122
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Transimpedance amplifier design using STM32G484 with integrated opamp
« Reply #6 on: April 07, 2025, 09:43:37 am »
1) I chose the 27500 Ohm resistor such that the typical reverse light current (60uA) will create a 1.65V signal on Vout of the opamp.

Thank you for providing a decent explanation of your thinking, plus links. Too few people manage that :( The PD characteristics document is a good starting point.

It is unwise to rely on any "typical" value, especially one that is temperature sensitive.

The mean output voltage will depend on the ambient light intensity - and that will, of course, change as equipment moves.

Have you assessed the relative intensity of the modulated light vs ambient light + dark current, over a range of conditions? Possible contexts: analogue saturation, required ADC resolution, and your device's ADC's ENOB.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline RobertBarnes

  • Newbie
  • Posts: 1
  • Country: nz
Re: Transimpedance amplifier design using STM32G484 with integrated opamp
« Reply #7 on: April 09, 2025, 10:59:41 am »
I am just replying here so that I can keep track of this thread.
 

Offline Matthew47Topic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: Transimpedance amplifier design using STM32G484 with integrated opamp
« Reply #8 on: April 10, 2025, 04:20:54 am »
I was able to get a waveform with no overshoot by tinkering with the value of the capacitor. However, it is much larger than what I initially calculated, so  there might be something wrong in either my understanding and/or the model I created.

Photos of the waveform and the Excel calculation based on this article are attached: https://www.analog.com/en/resources/technical-articles/stabilize-transimpedance-amplifier-circuit-design.html

Note: The model isn't using the exact opamp I am using, so that might be an issue, but the Spice model and calculation are so disconnected that I can't help but think I am missing something fundamental.

What am I missing here?
 

Offline electron_plumber

  • Regular Contributor
  • *
  • Posts: 51
  • Country: us
Re: Transimpedance amplifier design using STM32G484 with integrated opamp
« Reply #9 on: April 10, 2025, 01:51:51 pm »
On my way out the door, so I can't walk through your math but... you definitely need to use an op amp with the same bandwidth/gain for the math to work out. If there isn't a spice model available, build one in ltspice and match the datasheet's OL gain. Additionally, it may be the case that the analog article is solving for a gain margin of 45 degrees or something, which will result in some overshoot by definition.

Try out the TIA calculators on Michel Gallant's website:

https://www.jensign.com/transimpedanceamp/index.html
 

Offline Matthew47Topic starter

  • Newbie
  • Posts: 5
  • Country: us
Re: Transimpedance amplifier design using STM32G484 with integrated opamp
« Reply #10 on: April 15, 2025, 03:33:31 am »
I spent some time with that article, and it did help me get closer to understanding this.

My simulations look more correct now (using a model closer to the actual OPA), but I would need to spend more time with a pencil and paper learning the mathematics to make more sense of the theory. Perhaps a more careful experiment with a precision opamp would be in order to practice with...

In the meantime --> My plan is to build the circuit with a feedback capacitor in the 8pF range, and see how it performs. The opamp in the STM32 seems to range from GBW ranging from 7MHz to 13MHz, so it would influence the calculations quite a bit.
 

Offline dietert1

  • Super Contributor
  • ***
  • Posts: 3020
  • Country: br
    • CADT Homepage
Re: Transimpedance amplifier design using STM32G484 with integrated opamp
« Reply #11 on: April 15, 2025, 08:55:52 am »
In order to use the opamp properly i would turn around the photo diode. You want negative feedback from the opamp output and all your supplies are positive, so the diode should produce a negative voltage (cathode at opamp input). At least that's what i remember from our pulse oximeter circuits. For linear and temperature stable output the diode is better running near zero voltage, so the positive opamp input should be at Gnd.

Regards, Dieter
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->