Help With Photodiode and Transimpedance Amplifier - Page 1
Forum section: electronics / beginners

author: AxisCat
author_rank: Contributor
timestamp: December 13, 2023, 06:18:04 pm
content: Hi All,New member here, really new to electronics too. Like I don't even have Ohm's law memorized. But I draw on other strengths and my math is good so here goes:I am working with a Texas Instruments OPT101 photodiode with built in TIA. Here is the data sheet:https://www.ti.com/lit/ds/symlink/opt101.pdf?ts=1702486061804&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252Fde-de%252FOPT101I am having trouble inserting images inline so here are links to my images:This is the basic layout of it -https://postimg.cc/5XQcnKJsHere is a screenshot of my Visual Basic program I am using to acquire the sensor data -https://postimg.cc/S2VqwZKHLet me try and explain what I am doing. I am passing a tungsten light source through a monochromator and reading the light intensity with the photodiode above.The light source is fairly continuous through the visible band most people can see. The monochromator takes this light and outputs a narrow bandwidth of it, down to a single nanometer wavelength if I want. My Visual Basic program controls everything. It drives the instrument to the requested wavelength then communicates with a NodeMCU that is driving the photodiode. The NodeMCU has a built in 10-bit resolution ADC that works but not the best quality (I have an Adafruit ADS1115 16-Bit on order).So basically I am scanning a range of light wavelengths in one nanometer increments and charting the light intensities. It is not high speed at all and right now I allow 2 seconds for each measurement. That gives time to move the next wavelength and do some averaging of the photodiode signal.Sorry to be so long winded, just thought I would give everyone plenty of details. On to my question. I am struggling to understand the output from the TIA. If you look at the data I acquired above it had a maximum output of about 914 and then the signal clipped. Vs to the TIA is 3.3 volts. If i did my math correct 914/1023 x 3.3 = 2.95 volts. I know how to decrease the gain what I don't understand is the data sheet shows a max voltage out of Vs - 1.3 volts. Shouldn't I seen this clipping occur at 2 volts? 3.3 - 1.3??I look forward to your help,Axis

author: Manul
author_rank: Super Contributor
timestamp: December 13, 2023, 06:36:36 pm
content: Datasheet states typical Vs - 1.15 with 10k load on the output. If you have almost no load, just connected to ADC input, the output might be able to rise higher, no surprises here. But you should avoid using that region of output range. At least this is the obvious answer. If that's not the case, then I don't know.

author: RoGeorge
author_rank: Super Contributor
timestamp: December 13, 2023, 08:25:46 pm
content: The voltage output is the diode current * R feedback. From the sensitivity chart, for example at 850nm, the diode will deliver 0.6A for 1W of light. E.g. a 10uW of light will produce 6uA in the photodiode. If your R feedback is 1M\$\Omega\$, the output voltage at pin 5 should be 6uA*1M\$\Omega\$ = 6V in theory.However, if you power the chip at only 5V, then instead of the expected 6V, you'll measure in practice only 5V-1.15V = 3.85V. Any optical power that in theory should produce more than 3.85V at pin 5, will be capped at 3.85V.Or else said, the max input power you can still measure in this particular setup is about 6.416uW or so. I'll let a little margin, and consider only the range from 0...5uW as a reliable measurement.

author: voltsandjolts
author_rank: Unknown
timestamp: December 13, 2023, 08:33:09 pm
content: Quote from: AxisCat on December 13, 2023, 06:18:04 pmThat's not what the datasheet says. It says the maximum output voltage is aminimum of Vs–1.3, typically Vs–1.15 and no maximum is specified. So the 2.5V you are seeing is within specification for the OPT101 with a power supply of VS = 2.7 V to 36 V.

author: AxisCat
author_rank: Contributor
timestamp: December 13, 2023, 10:13:47 pm
content: Thanks for the reply. I do see that a MAX is not listed. Guess I need to ponder a bit on why I am not seeing a 'Typical' reading.

author: AxisCat
author_rank: Contributor
timestamp: December 13, 2023, 10:15:11 pm
content: Thanks.. Good stuff here. I need to digest what you posted so I can understand it a lil better...

author: AxisCat
author_rank: Contributor
timestamp: December 14, 2023, 12:23:35 pm
content: RoGeorge, I digitized the sensitivity curve for this module. Using your example values, perfect world and all that then in theory this is what I would see?

author: RoGeorge
author_rank: Super Contributor
timestamp: December 14, 2023, 12:57:08 pm
content: Yes, the grey curve will be expected at 5V supply.To follow the correct orange curve, then the OPT101 will need to be powered with at least 7.15V or more (instead of only 5V).

author: AxisCat
author_rank: Contributor
timestamp: December 14, 2023, 01:53:37 pm
content: Thanks. That makes perfect sense to me. Can you explain about how the dark current would play into this? When I was using a Vs of 3.3 volts without any light on the sensor I was reading about .65 volts. The data sheet references 7.5 mV as dark error and varies with temperature. How would this chart on our theoretical response using Vs as 5 volts?

author: RoGeorge
author_rank: Super Contributor
timestamp: December 14, 2023, 03:01:38 pm
content: No matter the voltage supply, 650mV output with complete dark is very wrong. The max expected is no more than 10mV according to the datasheet.Post a picture with your current schematic, and another one with the physical circuit.Disconnect the ADC board (just to make sure the digital part doesn't influence the TIA). Make sure the photodiode is in complete dark, and measure the voltage at pin 5 of OPT101 with a DMM set on DC volts. It should measure no more than 10mV, no matter the supply is 3.3V or 5V.If you measure more than 10mV DC, either something is wrong with the circuit, or with the setup. Apart from visible light, a photodiode may also sense heat, 60Hz mains hum, broadcasted radio waves, or particles coming from radioactive materials. That is why a picture of the physical setup might help debugging the device.There is also the possibility that the circuit self-oscillates, or maybe the supply voltage is too noisy. That is why your current schematic and wiring is also needed.Once you have the analog part behaving as expected, you can move further to check the software and the control loop.

author: AxisCat
author_rank: Contributor
timestamp: December 14, 2023, 03:08:09 pm
content: Thanks... I am beginning to expect something is wrong with my setup... I got some work to do but later will post what you asked for. Again thanks for your help.

author: AxisCat
author_rank: Contributor
timestamp: December 15, 2023, 09:20:29 am
content: I did read about .65 volts on pin #5 with my DVM with the sensor in complete darkness.Here is my circuit:And a couple of pictures:The photodiode module is mounted on a perf board that I coated the back with epoxy to keep the wires from breaking off. I have several more modules so I am going to try some new ones to see if they work like they should.

author: Kleinstein
author_rank: Super Contributor
timestamp: December 15, 2023, 01:48:37 pm
content: The µC module with Wifi is not the ideal power source. It can possibly create quite some EMI.The datasheet usually wants a 10 K load at the output, though there is some internal JFET base current sink between pin 3 (should be at ground) and the output. It may be worth adding the load to see if the voltage comes down.

author: RoGeorge
author_rank: Super Contributor
timestamp: December 15, 2023, 05:53:57 pm
content: What is orange and yellow? If one of them are either Pin 2 or pin 4 from the OPT, that's not good. They make a long loop acting like an antenna. Please add a picture with the OPT101 connections, too.What you must change (or else it will work only by luck):1. bring to the ADC input only the pin 5, one wire. If you bring either pin 4 or pin 2 to the MCU board, that will make a loop, acting like an antenna that will catch and amplify mains hum and radio. Any additional resistors to change the OPT sensitivity must stay right near the OPT pins, as close as physically possible.2. move the 10nF ... 100nF from the breadboard near the OPT101. Connect it right near 1 and 3 not further away. The 100uF on the breadboard is not necessary, remove it, because it might have bad influence upon the 3.3V regulator of the MCU.3. connect pin 8 and 3 together, near the OPT pins (it is not visible in the pics how the OPT chip is wired). GND wire from the MCU must be connected near the pin 3, not near the pin 8.4. connect pins 4 and 5 together, right near the OPT101, not further away, and the wire from OPT to the ADC near pin 5 of the OPT.Optional:a. connect an external 1M\$\Omega\$ resistor between pins 2 and 4 of the OPT (in parallel with its internal 1M\$\Omega\$), such that the sensitivity of the amplifier will be reduced, so you can keep the OPT powered at 3.3V without enter the limitation. That will make your VB plot to look like a nice hill following the light intensity, not like a plateau. If the max voltage still enters the limitation, put an even smaller external resistor. Can't say the exact value, it depends of the max expected optical power.b. input ADC might be used instead of ADC_EX, but only in the case OPT with the additional external R produces too little voltage at its peak (ADC_EX divides the input voltage with a 220k+100k, While the ADC input lets the entire voltage to go to the chip).c. use a metallic enclosure (electrically shielded) with only a small hole for the light entering point, in case you want to reduce the noises even mored. if the 16bits extra ADC is not available, since the measuring speed is not an issue, you can increase the number of bits by oversampling (measure many times and average all the measurements). Oversampling might give you 1..4 more bits or so on top of the 10bits of the ESP8266.After implementing the changes 1...4, physically disconnect the wire from the MCU side, and connect it to a voltmeter instead. It should show 10mV or less.If you still measure the 600mV, that might be because the +3.3V from the NodeMCU is really bad. Use 2 AA or AAA batteries in series to improvise a 3V supply, and power the OPT from batteries instead of powering it from the MCU, for tests only, to see if the 600mV dark goes away.If you still measure with the voltmeter 0.6V while the OPT is powered from batteries, that can only mean the OPT101 still sees some light, or maybe it's fake/defective. In case the OPT101 is from a trustworthy supplier, yet it still doesn't work after all the changes, add new picture(s) with the updated setup.

author: AxisCat
author_rank: Contributor
timestamp: December 16, 2023, 03:09:11 pm
content: Thanks for suggestion. I tried a 10 k Ohm resistor on the output and same thing.

author: AxisCat
author_rank: Contributor
timestamp: December 16, 2023, 03:22:52 pm
content: The yellow wire is pin 4 and the orange wire is pin 5 so it isn't wired exactly like my diagram shows.2. move the 10nF ... 100nF from the breadboard near the OPT101. Connect it right near 1 and 3 not further away. The 100uF on the breadboard is not necessary, remove it, because it might have bad influence upon the 3.3V regulator of the MCU.So I should do away with the 100uF capacitor all together and just have a single 10nF right near pins 1 and 3??I am not exactly sure what you mean when you say this:GND wire from the MCU must be connected near the pin 3, not near the pin 8..... my ground wire should land close to pin 3 and then add a jumper from there to pin 8??

author: Kleinstein
author_rank: Super Contributor
timestamp: December 16, 2023, 04:40:53 pm
content: The small capacitor near to the sensor makes definitely sense, though I would use 100 nF, not 10 nF. The sensor chip is not super fast and it thus makes no real difference which pin (3 oris closer to the capacitor and ground wire. Some filtering of the supply a the µC side may still be good. I would consider some 10 ohm in series and the the capacitor (e.g. 10 or 100 µF). The resistor should be enough to keep the regulator happy with the large capacitor.The photosensors can be quite sensitive and it may take some effort to make sure one really gets the dark case.If available it could make sense to use a scope to look at the output signal - an oscillating out is a very real option.If the zero point is important and stray light from the back is hard to suppress, one could consider modulating the optical signal with a mechanical chopper and look at the difference between the on and off phase only.

author: AxisCat
author_rank: Contributor
timestamp: December 16, 2023, 07:30:35 pm
content: I really appreciate you all sticking with me on this as I try and sort things out. I will sketch up a new schematic and post for you guys to review.Tell you what is bothering me now is I have 10 of these sensors. I purchased them over a year ago, most likely on ebay. This is just hobby level stuff for me and I can see myself paying $20 or so for a decent item but not $200 for 10 of them. They very well could be counterfeit. Why anyone would do that with something like this is beyond me but it is an unknown now.

author: RoGeorge
author_rank: Super Contributor
timestamp: December 16, 2023, 07:57:23 pm
content: Quote from: AxisCat on December 16, 2023, 03:22:52 pmYes, more uF doesn't help here. In fact, too much uF might make a voltage regulator to become unstable, and/or might make it self-oscillate, depending on the regulator model."The more uF the better" is valid (with some upper limits, too) when it comes to lower the ripple right after mains transformer+bridge, for example in the supply for a power audio amplifier, but not after a voltage regulator.As for wiring, the idea is- to avoid ground loops (ideal star connections, not chained)- to keep in mind that any piece of wire has parasitic resistance, capacitance and inductance, so keep them thick and short- at the same time any piece of wire acts simultaneously as an electric Tx and an Rx antenna, shielding and/or twisting might help- any loop of wires acts simultaneously as a magnetic Tx and an Rx antenna, minimize the current loops area by running the wires together, parallel or twisted rather than spaced apartFor a start, try the wiring from the attached drawing. The goal is, when you disconnect the ADC_EX wire from the NodeMCU board and connect it to a voltmeter, you should read dark voltage less than 10mV, and not 600mV.For the ADS1115 board, the wiring most probably will need separated GND and AGND (GND=digital ground and AGND=analog ground), and shielded signal wire, or maybe shielding the OPT101 and the ADS1115 together in a metal enclosure.

author: Kleinstein
author_rank: Super Contributor
timestamp: December 17, 2023, 10:20:17 am
content: As the sensor is kind of working I would not expect it to be a fake. This is a kind of special chip and hardly an alternative with the same pinout.It may be possible that the glue / sealant used on the back of the sensor is somewhat conductive. It does not take much to get half a microampere.If it works otherwise one can also get away with the larger than normal offset, especially with an extra zero measurement, that may be needed anyway.

author: Terry Bites
author_rank: Super Contributor
timestamp: December 17, 2023, 11:21:18 am
content: I think 1nm resolution will be under the noise floor!

author: AxisCat
author_rank: Contributor
timestamp: December 17, 2023, 01:07:47 pm
content: This is tricky stuff for sure. I have learned a whole lot from you all so far!I am going to build a new sensor and see how it works. I will post my results when I have them.

author: AxisCat
author_rank: Contributor
timestamp: December 17, 2023, 01:10:50 pm
content: Thanks for the reply. 1nm is really getting down there for sure. When you say 'below the noise floor' do you mean with my specific setup and the internal 1-mega Ohm feedback resistor?

author: AxisCat
author_rank: Contributor
timestamp: December 18, 2023, 10:34:26 pm
content: So I fitted up a new sensor using your suggestions. I powered it with a 9 volt battery and still got .6 volts with my DMM. Even walked it out in the middle of a field and got the same result.I ran across someone else online who mentioned getting .6 volts without any light shinning on it. I am not sure what my next steps are going to be; I can easily offset the dark output in programming. I just don't like it when things don't behave the way the should. Makes it hard for me to trust.I have learned enough from you and other folks here that my next step might be to purchase a better photodiode and roll my own TIA for it. You all have been great and thanks again for all the help.

author: AxisCat
author_rank: Contributor
timestamp: December 18, 2023, 10:39:04 pm
content: I understand what you are saying. I need to rethink my plan a lil bit. I have a much better understanding of photodiodes and TIA's after working with this. I appreciate all the help you have given me.

author: RoGeorge
author_rank: Super Contributor
timestamp: December 19, 2023, 12:16:15 am
content: Quote from: AxisCat on December 18, 2023, 10:34:26 pmApparently OPT101 was a Burr-Brown.https://pdf1.alldatasheet.com/datasheet-pdf/view/56811/BURR-BROWN/OPT101.htmlTI acquired BB and their portfolio of products, thus the OPT101 is branded TI, now. Maybe TI updated/changed the fabrication process for OPT101 (for example the SIP capsule is not any more in the TI datasheet), and the new OPT has the dark voltage 0.6V, but they didn't update the datasheet accordingly.That's only a speculation, no hard evidence.I would try out as a curiosity to power the OPT with differential voltage (the 9V battery for the positive foltage, and yet another AA battery for the negative voltage, like in Fig.2 from the BB datasheet, then measure the dark voltage between Common (GND) and the output pin. You can put all in a metallic case (an Altoids box, or a metallic box for cokkies, a coffee can with a lid, etc. and only route to outside the 2 wires for the measuring DMM) in case you suspect high levels of mains hum might affect the measurements.- if the Common to Out still measures 0.6V with dual voltage, then something happened with the photodiode- if the common to out voltage comes to normal (less than 10mV), maybe they changed the opamp with a model that is no longer rail-to-rail outputAlso make sure the PCB or socket used for OPT101 are clean. Dirt and fingerprints (skin oils and dry salts can make invisible films, and this might be enough to affect very small currents like the ones in a TIA). Same for the soldering flux, some brands will leave conductive debris on the PCB and on the pins. For example, Bob Pease was recommending a wash for contaminated chips (though the application there was more fussy than the one here in OPT101):https://www.electronicdesign.com/technologies/test-measurement/article/21766108/whats-all-this-femtoampere-stuff-anyhowGuard rings around the opamp inputs might help too, in case the OPT101 is soldered on a PCB. If you want to investigate all these, add a photo of how the sensor is wired and it's fixture.Anyway, for casual applications there is no need to insist on the cause of the 0.6V dark output. Eventually the offset can be compensated in software, or the ADC can be used in differential mode relative to a 0.6V local potentiometer (so to not loose the resolution bits corresponding to the 0 to 0.6V interval).

author: RoGeorge
author_rank: Super Contributor
timestamp: December 19, 2023, 03:30:42 am
content: I've just noticed there is a simulation model for OPT101 (can be downloaded from the TI webpage, a SPICE model that was prepared by Burr-Brown). Gave it a try out of curiosity, and the simulated dark voltage is 7.5mV, so not 600mV.Maybe I'm missing something, but I don't know why in reality the output measures 0.6V. My best guess is those chips are something else than in the datasheet.

author: nfmax
author_rank: Super Contributor
timestamp: December 19, 2023, 09:30:38 am
content: One thing you might try to determine the cause of the 0.6V dark output voltage is to feed a small, adjustablepositivecurrent into pin 2 from a potentiometer across a battery via a large value resistor. As you increase the current, the output should go more negative. If it doesn't, the TIA output is somehow saturating at an abnormally high voltage. But if the output does go more negative, then it's a problem of leakage current into pin 2 - either photodiode dark current, or circuit leakage.If you have an oscilloscope handy, it's also worthwhile looking at the TIA output voltage.Is it oscillating in the dark? If so, supply decoupling needs to be improvedIf you apply a pulsed light source, say an LED driven at ~400Hz, do you see a corresponding signal?Following on from this, you would be better off (mechanically) chopping your light source and synchronously detecting the TIA output. That way you don't care about DC offsets, so long as they don't cause the TIA to saturate

author: voltsandjolts
author_rank: Unknown
timestamp: December 19, 2023, 10:51:08 am
content: Is the OP certain that the OPT101 sensor is actually in complete darkness? The black electrical tape will not be completely opaque, and perhaps also the orange coloured holder (homemade adapter?).

author: Kleinstein
author_rank: Super Contributor
timestamp: December 19, 2023, 06:45:13 pm
content: With 1 Mohm the 0.6 V of extra offset is already some 600 nA. It needs quite a bit of light to produce this much offset. It is worth checking if it is really dark, but the offset looks rather large to be explained by a little residual light. It is still worth a check if the offset changes, e.g. with the room light turned off. Getting it truely dark can be a challange, but this is more at 1/10000 the offset seen here.

author: TimFox
author_rank: Super Contributor
timestamp: December 19, 2023, 07:27:03 pm
content: Comment about darkness:I found during my job that plastics were not trustable to keep a diode in the dark.Regular aluminum foil (properly insulated electrically) is reliable, if you avoid gaps.