More help with IR photo diodes please.  - Page 1
Forum section: electronics / beginners

author: cvriv
author_rank: Frequent Contributor
timestamp: April 22, 2020, 01:22:10 am
content: I asked for some help a bit ago, but haven't really done much since then because of everything that's been going on these days. I didn't want to reopen that old post so I'm just going to create a new one.I'm working on a project that's basically a matrix of IR sensors and LEDs that are controlled with a microprocessor and some LED drivers.Each IR sensor has an associated LED. The idea is that when an IR sensor sees something above, it will turn on it's associated LED, and the closer that something is to the sensor, the brighter the LED will become.This project works, but the problem im having is that some of the sensors are way more sensitive than others, so they see the object way before the others. When I was seeking help before I was told that I was forward biasing the photo diodes, which is true, and that they needed to be reversed biased. I was linked to this document:https://www.analog.com/en/technical-articles/optimizing-precision-photodiode-sensor-circuit-design.htmlI read through the whole document. I set up a small little test circuit to test this out. The photo diodes do actually work reversed biased. I used an oscilloscope and a DMM to observe what happens. I kept this test simple, just the transmitter, the receiver, and a resistor; no opamps.What I noticed is that even though I was reverse biasing the photo diodes, the change was significantly different from one photo diode to the next. This is what I was experiencing when I had them forward biased. I really thought that the change would be more consistent once I had them reverse biased, but that just isn't so. Am I missing something here?Some in the old post mentioned that I had to add some compensation to my code to basically calibrate all the diodes so they behave the same. Is that really the way it needs to be done? If some company was using these photo diodes for a product their manufacturing in the thousands or millions, would they have to do some unique compensation for each product so that they all operate exactly the same?This is my small test with my DMM connected:I swapped numerous photo diodes and got many different current measurements. Some of the measurements were negative and some were positive??? Some of the readings I got using the test setup were 13nA, 14nA, -28nA, -24nA, -17nA, -34nA, -31nA, etc.I don't understand the positive and negative readings. Im thinking the negative readings are correct seeing that the photo diode is reversed biased?

author: Jwillis
author_rank: Super Contributor
timestamp: April 22, 2020, 04:24:02 am
content: No diode will have exactly the same forward current at a specified voltage . Try using current limiter resistors in series with each IR diode .

author: Ian.M
author_rank: Super Contributor
timestamp: April 22, 2020, 09:22:05 am
content: Starting a new topic for the same problem, and not linking to your old one, is unlikely to get you much help. It gives the impression you wish to ignore much of the help you previously received, and wastes your audience's time either teasing a full description of your project out of you again, or searching your profile for your previous topic to get the background details!Continuation of:https://www.eevblog.com/forum/beginners/help-with-photo-diodes/You've already been told its probably an optical geometry issue:Quote from: StillTrying on March 21, 2020, 02:02:25 pmResin encapsulated photodiodes are *NOT* precision devices. Small tolerance variations in die positioning on the leadframe and leadframe positioning in the mould during encapsulation lead to wide variations in spatial response due to the short focal length of the high curvature resin lens. It also doesn't help that the die attach surface of the leadframe will have been stamped or press formed rather than precision machined. If you want photodiodes with precision optics and unit to unit repeatable responses, they will cost you an order of magnitude or two more and wont come in simple moulded resin packages.Quote from: cvriv on April 22, 2020, 01:22:10 amGenerally, resin encapsulated photodiodes like yours will be used in applications that don't require high precision. Another possibility (assuming a MCU is present) is self-calibration in a test jig after board assembly. The firmware would detect its in the test jig by the state of a pin, would run a self-test and calibration routine, signal 'PASS' or 'FAIL' back to the test jig via another pin and if it passed, store the sensitivity correction factors in FLASH or EEPROM. When the firmware powers up not in a test jig, it will use the stored calibration. The whole self-calibration process may only take an extra second or two in the jig so it doesn't cause a bottleneck on the production line, especially if the jig handles a whole panel of boards at a time.

author: cvriv
author_rank: Frequent Contributor
timestamp: April 22, 2020, 09:39:30 am
content: Quote from: Ian.M on April 22, 2020, 09:22:05 amI don't fully undertand what you are saying here. Some forums do not like old posts revived, so I didn't. I wrote as much out again as possible so that its understood what I'm trying to do. Why would I write all this out just to ignore help?I don't understand what your trying to say.

author: cvriv
author_rank: Frequent Contributor
timestamp: April 22, 2020, 09:48:59 am
content: Ok well I dont want to buy any other special diodes so I guess the only thing I can do is build a test jig and then calibrate each one in the code. I was hoping I didnt have to do that. I thought maybe I still not doing something right. The linked document talked about precision detection of this and that using the diodes so I guess I expected more than what their capable.

author: Ian.M
author_rank: Super Contributor
timestamp: April 22, 2020, 10:24:25 am
content: Quote from: cvriv on April 22, 2020, 09:39:30 amYou've got to use common sense when posting to old topics.'Bumping' your own topic with a followup, even years later, is generally preferable to starting a new topic. However if the topic is many pages long, its courteous to add a link in your original first post to your latest update post. OTOH some newbies necro-post in a long dead topic just because they are (usually mistakenly) under the impression that their problem is identical to the topic originator's problem, instead of starting a new topic, and most forums (rightfully) strongly discourage that.Quote from: cvriv on April 22, 2020, 09:48:59 amAttempting to calibrate individual photodiodes in a jig is unlikely to get you consistent results due to their sensitivity to small alignment differences. Its also a PITA to have to manually update code with an array of individual calibration values.The test jig should be for the whole board, e.g. an array of white card disks over each LED/Photodiode pair at the desired detection distance, and the calibration routine should save the calibration data to non-volatile memory. If your MCU has limited program memory or doesn't have runtime writeable non-volatile memory, or the toolchain makes it difficult to preserve the calibration memory when updating the firmware, you may be forced to dump the calibration data using a programmer, debugger or some sort of serial link to the host, then incorporate it in your firmware, but for the sake of your sanity, automate the process so you aren't manually copy/pasting the calibration results into part of a larger source file then massaging them by hand to suit the language syntax!

author: cvriv
author_rank: Frequent Contributor
timestamp: April 22, 2020, 07:52:14 pm
content: I don't spend a lot of time in forums online so i don't know a lot about what your mentioning here. I only show up once in awhile to ask a question or get advice with something.All that your saying I need to do or can do... I have no clue how to do any of that. I was going to build a fixed height platform with a white sheet of paper on the under side. I'm going to place that over the circuit and figure out someway to calibrate each in the code because thats about all I know how to do right now. Maybe once I do that, I'll make auto calibrating them another project. That's sound kind of fun. I dont know how to save to memory yet, so i have some work to do. Thanks.

author: Ian.M
author_rank: Super Contributor
timestamp: April 22, 2020, 08:19:40 pm
content: Yes, white card or paper at a fixed height + calibration in code sounds workable.Hint: if you can copy/paste all the ADC readings as a block into a spreadsheet, you can fairly easily get the spreadsheet to calculate the calibration constants and generate a properly formatted array you can paste back into your code. Using a spreadsheet is a crutch that doesn't scale well to doing the calibration process repetitively, e.g for multiple units, but is far less error prone even for one unit than taking separate individual readings for each LED/Photodiode pair and calculating the values to put in your calibration array manually.

author: leeatljs
author_rank: Contributor
timestamp: April 23, 2020, 08:07:07 am
content: How are you biasing the photodiodes? A schematic would help describe what you are trying to do.

author: Day101
author_rank: Contributor
timestamp: April 25, 2020, 06:44:09 am
content: For a prototype I would order some good optoelectronics from osram etc. You can make it cheap once the concept is working. The problem you are seeing might not be related to inaccuracies in the diodes. It’s an unknown. You wouldn’t need to change any of your setup if you just slot in some high-quality components. It costs a few dollars instead of a few days.https://www.osram.com/os/I would also start with an array of 2 x 2 instead of a full-size proof of concept.

author: cur8xgo
author_rank: Regular Contributor
timestamp: April 25, 2020, 04:53:56 pm
content: Ignore the hall monitors here. They spend WAY too much time on forums, which is why their weird anti-social behavior seems weird and anti-social. Because it is.Anyways, your first post has a key idea in it. Variability between photodiodes is something that may exist, and something that you may not have taken into consideration in your original design. So, look at the datasheet for the photodiodes and see what the variability of amps-per-photons is. If it seems high enough to be a factor for your project, voila, one more problem to solve and an important lesson learned.Making things like this work in array is not trivial and so you should expect some challenges. Although it may seem weird that there would be variability, ask yourself how often photodiodes would get used in an array like this besides hobby projects? A tight photon per amps relationship across diodes may not be an important factor for inexpensive diodes.If you can come up with a way to compensate for this variability (one way or another), you are doing real engineering!

author: StillTrying
author_rank: Super Contributor
timestamp: April 26, 2020, 07:29:46 pm
content: Start simple, with an IR emitter on a wire, or even a TV remote close to the photo diode, most camera phones can see the light from IR LEDs.