Maker Pro
Maker Pro

High Precision LED Absorbance Measurement

jnod

Nov 17, 2015
7
Joined
Nov 17, 2015
Messages
7
I'm building an absorbance device with a UV LED and a photodiode. See the attached pdf for specifics. Basically, the LED shines light through a solution and the photodiode detects how much light is blocked. As concentration goes up, the amout of light reaching the photodiode goes down. This device is for the Pharmacy department at my university.

I'm using Adafruit's ADS1115 16 bit ADC with the Adafruit Python library. It provides 16x gain so I haven't tried using an external op-amp circuit. I'm also using a 5v switching power supply as Vdd for all of the components.

I have a working prototype, but it has a few problems. First, there is a fair amount of noise, even with the primitive .16 Hz RC filter and software averaging. More importantly, the signal drifts upward very slowly, and I'm not sure why.

Below are a few improvements I've been considering. Let me know if they're worthwhile or if I should do something else.

I'd like to replace the 5v power supply with a 9v power supply and a regulator. I also intend to attach a capacitor from the ADC's Vdd to ground. I'm not sure what capacitor value to use, though.

The diodes are currently connected with jumper wires. I'd like to connect them with shielded wires instead. Both are in a TO-5 package. The photodiode has 3 pins: cathode, anode, and one connected to the housing. The LED has a cathode and an anode, with the anode connected to the housing. Both are mounted in an aluminum enclosure, so their housings are electrically connected. I'm not sure what kind of shielded wire I should use or how I could ground it since the housings are essentially connected to 5v.

I'm also open to using a different ADC, to using a microcontroller with a built in ADC, or to any other option that would work better.
 

Attachments

  • AbsorbanceDevice.pdf
    158.5 KB · Views: 99

Alec_t

Jul 7, 2015
3,587
Joined
Jul 7, 2015
Messages
3,587
the signal drifts upward very slowly, and I'm not sure why.
I would guess due to thermal effects? The diode forward voltage is temperature dependent, and the spacing between emitter and detector could be varying (probably negligibly) due to temperature change.
 

jnod

Nov 17, 2015
7
Joined
Nov 17, 2015
Messages
7
I would guess due to thermal effects? The diode forward voltage is temperature dependent, and the spacing between emitter and detector could be varying (probably negligibly) due to temperature change.

Yea, that's very likely. Any idea on how I'd compensate for thermal effects? Could I attach thermistors to each diode and come up with a compensation curve? Would regulating the current through the LED help? I could try putting a small resistor between the LED and ground and use an op-amp circuit to maintain a constant voltage across it to regulate the current.
 

chopnhack

Apr 28, 2014
1,576
Joined
Apr 28, 2014
Messages
1,576
Would regulating the current through the LED help?

I think that this would be a great change to make, using a constant current source for the LED would stabilize the heat produced, it would reach homeostatis with the environment, aluminum housing, etc.

Would all of the solutions be of equal temperature? Some solutions are super saturated by heating the solvent first, if the sample was brought to the device hot, it could lead to some error.

Welcome to EP, btw :)
 

jnod

Nov 17, 2015
7
Joined
Nov 17, 2015
Messages
7
I think that this would be a great change to make, using a constant current source for the LED would stabilize the heat produced, it would reach homeostatis with the environment, aluminum housing, etc.

Would all of the solutions be of equal temperature? Some solutions are super saturated by heating the solvent first, if the sample was brought to the device hot, it could lead to some error.

Welcome to EP, btw :)

Yes, the solutions should all be the same temperature. I'll include a constant current source in my redesign.

Thanks!
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Hi Jnod
Do you have the actual circuit diagram you are using which shows the regulator, this will really help. The switching noise could be coming from your ADC or your DC/DC. You can find out which one by disconnecting your ADC or replace the DC/DC with a battery. Do you have the part numbers for the transmitter and detector you are using? You may find buffering the signal before it goes into the ADC useful.
Thanks
Adam
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,878
Joined
Jun 21, 2012
Messages
4,878
I once needed a similar arrangement to control the emission temperature of a Nernst glower. The problem was my photodiode started at room temperature and then got hotter because of visible and infrared radiation from the glower. To compensate for this huge temperature excursion, I used two identical photodiodes, connected in series, and both mounted side-by-side in a common aluminum heat sink. One diode "stared" at the incandescent Nernst element and the other "stared" into the bottom of its blocked mounting hole. Thus both diodes were at the same temperature, but only one diode was used to sense the light.

Both diodes were reverse-biased, one with a positive power supply rail, the other with a negative power supply rail, thus causing their leakage currents (which are a function of temperature) to sum to zero at their common connection. This common connection was a source of photoelectric current from the diode that was not blocked optically. This current is linear through more than six decades of intensity variation, which is a very good thing when you are doing metrology. The photodiode current from the common connection of the two diodes is applied to the inverting input of a FET-input operational amplifier with a largeish feedback resistor that converts the current to a voltage output. The value of the feedback resistor depends on how much sensitivity you need. A smallish capacitor can be connected across the feedback resistor to provide high-frequency roll-off.

Connecting wiring from the photodiodes should be Teflon insulated, because any photodiode current that gets diverted from the op-amp summing junction input represents light that is not measured. Use Teflon-insulated standoffs to make the op-amp connections. The op-amp should be mounted in a socket with Teflon insulation to prevent leakage currents. The voltages, positive and negative, that are used to reverse bias the photodiodes do not have to be regulated. Reverse leakage current is not sensitive to the reverse bias voltage, nor is the photodiode current in response to illumination sensitive to the reverse bias voltage. This circuit is very robust if care is taken in its construction to avoid leakage current paths.
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,878
Joined
Jun 21, 2012
Messages
4,878
I can't really take credit for this idea. My mentor at the time, perhaps ten or fifteen years my senior, suggested it because I didn't know diddly about photodiodes at the time. The Nernst glower was the central figure in an infrared radiation source that we built using a salt lens (NaCl) to collimate the source. It had to have a very stable output to use as a radiometer calibration source.

Nernst glowers were notoriously hard to start, and even harder to control, because they had a negative coefficient of resistance once they began conducting. But they start out as pretty good insulators and begin to conduct electricity only after they are incandescent, so most devices that use them as IR sources heat them up with an auxiliary platinum-wire heater. IIRC, we did that too, but I found out much later that I could strike a high-voltage arc across the ceramic and it would instantly "light up".

More difficult was controlling the power to the Nernst because of the negative temperature coefficient of resistance, plus the fact that you could not use DC excitation because that would cause the refractory oxides to migrate from one end of the rod to the other, eventually destroying the Nernst rod. So I ended up modulating a sinusoidal oscillator with feedback from the photodiode sensor and using a modified Bogen C100 PA amplifier with a 70.7 V output transformer to light up the Nernst. We actually ditched the Bogen circuit board and replaced it with one of my own design.

This source was later used to calibrate a large and complex radiometer system at the Air Force Weapons Laboratory in Albuquerque NM, sometime in the 1970s as part of the laser window characterization of the Airborne Laser Laboratory (ALL). The ALL was eventually mothballed, many years later, at the Air Force Museum here in Dayton. And AFAIK the Air Force is still trying, almost fifty years later, to build a high-energy laser (HEL) to mount on an airplane to use in place of missiles to shoot down things in the sky. Good luck with that. I prefer momentum-based weapons over energy-based, even if it does take longer to reach the target. The Navy gets it right with their electric rail guns.
 
Last edited:

jnod

Nov 17, 2015
7
Joined
Nov 17, 2015
Messages
7
@Arouse1973
I have a 5v micro usb power supply connected to the raspberry pi, and the adc is connected to the 5v output pin on the raspberry pi. I've come to realize that this isn't a very good configuration for noise. I'll have to get a higher voltage power supply and a linear regulator and see if that helps. I'll post links to the datasheets for the diodes below:

http://www.marktechopto.com/pdf/products/datasheet/MTE280H33-UV.pdf
http://media.digikey.com/pdf/Data S...tors Inc PDFs/SD100-13-23-222_Rev12-03-14.pdf

@hevans1944
That's a very innovative solution! I'll draw up a circuit diagram and see if I can make it happen. The only drawback for me is that the photodiodes I'm using are around $50 each.

Thanks for your responses everyone!
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,878
Joined
Jun 21, 2012
Messages
4,878
You are in for an adventure in analog signal processing. The reverse leakage current (dark current) of your photo-diode is quite small and probably accounts for a goodly part of its cost. The responsivity is also good at 100 mA per watt (minimum) at 365 nm. However, this is a broadband sensor and you are exposing it to a narrow-band UV light source. You either need to purchase a narrow band-pass filter to place in front of the photo-diode to prevent it from responding to background radiation, or operate the instrument in a light-tight box to exclude any possibility of stray light illuminating the photo-diode. If you take either of these precautions, you may not need to temperature-compensate the already low reverse leakage current with a second photo-diode.

I would not operate the photo-diode in the photo-voltaic mode, and certainly not with a large load resistor. Instead, reverse bias it with five volts or so and feed the photo-induced current into the summing junction (inverting input) of an op-amp with a low-noise resistor in the feedback path from output to summing junction. If necessary, you can use a plastic-film capacitor in parallel with the feedback resistor to roll off the high frequency response. Again, a high impedance input JFET op-amp is preferred over a garden variety bi-polar transistor input op-amp. And use Teflon insulated connections.

Using physical optical geometry, try to estimate how much optical power reaches the photo-diode from the UV LED emitter with the liquid container present but with no solute present. That will be your maximum signal and you can use it as a guide to the value of the feedback resistor you need to produce a full-scale input to your A/D converter. Or, if your mechanics of mounting the UV LED and the photo-diode are ready, power up the LED and measure the current produced by a reverse-biased photo-diode. Most Digital Multimeters are adequate for this current-measuring task.

Build the photo-diode signal conditioning circuit on a circuit board separate from the digital processing (including the A/D converter) and provide it with its own adequately filtered voltage-regulated point-of-use power supply. You might even want to put it inside a little metal box and attach it to your LED/photo-diode mount. Then you only have to run power, ground, and signal leads in a shielded cable back to your A/D and Raspberry Pi.

If you do experience output variations or "drift" that can be attributed to temperature variations, this can be solved without using dual photo-diodes but the solution is more complicated. Basically, you modulate the UV LED output with a square wave and then synchronously detect after the photo-diode. Any leakage current will be canceled in the peak-to-peak amplitude between the illuminated and the non-illuminated states. This is also a good procedure to use if you are looking for very small changes in the transmitted light absorption.

Since your proposed instrument has no reference path independent of the sample path, it is very important that the UV LED output is constant, the photo-diode transfer function is linear and constant, and that you make a provision to "calibrate" the full-scale output of the A/D using an empty path prior to making any absorption measurements. But, other than that... a piece of cake. Have fun!
 

GPG

Sep 18, 2015
452
Joined
Sep 18, 2015
Messages
452
Since your proposed instrument has no reference path independent of the sample path,
A technique used in exhaust gas analyzers a few years back. With a rotary wheel to switch paths.
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,878
Joined
Jun 21, 2012
Messages
4,878
Virtually all absorption measuring instruments include a reference path that alternates with the measuring path to the detector. As @GPG stated, this is often just a rotating mirrored disk with open spaces to either pass the beam or reflect it. Seems like a lot of complexity to just measure absorption, but it does help to remove the stability of the radiation source as a factor affecting the measurement. You still need a stable and linear detector for comparative measurements. Signal-to-noise ratio becomes important when measuring large absorption ratios, as well as small differences in absorption.

There is a huge amount of literature available on this subject, but I suspect most of the "good stuff" is hidden behind a paywall for peer-reviewed journal papers. Your university may have a subscription to one or more of these services, so it is worthwhile to try to gain access to them.

The diodes are currently connected with jumper wires. I'd like to connect them with shielded wires instead. Both are in a TO-5 package. The photodiode has 3 pins: cathode, anode, and one connected to the housing. The LED has a cathode and an anode, with the anode connected to the housing. Both are mounted in an aluminum enclosure, so their housings are electrically connected. I'm not sure what kind of shielded wire I should use or how I could ground it since the housings are essentially connected to 5v.
Don't connect any analog components with jumper wires. Use Teflon-insulated TO-5 sockets and Teflon-insulated wire until the analog signal levels have been properly conditioned by an op-amp circuit to provide a low-impedance, high-level (zero to ten volts) signal. It is preferable to do this signal conditioning at the photo-diode, placing the circuit board inside a die-cast metal box like one of these, and mounting the box over the photo-diode and onto the heat sink. You could also place a UV LED constant-current source inside this box and run a thin twisted-pair cable to the UV LED.

The aluminum heat sink should NOT have voltage applied to it. It should be at "ground" potential. Since the anode of your UV LED emitter is connected to the case, let that lead be at "ground" potential and apply a negative polarity from a constant-current source to the cathode lead. The emitter output is linearly proportional to excitation current, so you want that constant-current source to be as constant as possible. A three-terminal negative voltage regulator operating as a 20 mA constant-current source will be adequate.

I use Beldfoil shielded dual twisted-pair cable for analog instrumentation. One pair for supply voltage, the other pair for signal. You can usually get away with using the shield as a common for the power if you need ± polarities. Grounding discipline is a whole 'nother story and there are volumes written about it. General advice: keep analog commons separate from digital commons and connect the two commons together at only one point. Avoid having any digital signals return on an analog common.
 

jnod

Nov 17, 2015
7
Joined
Nov 17, 2015
Messages
7
@hevans1944
Thank you very much for all of the excellent information! Sounds like I have lots of work to do to get this working properly. I'll start working on the circuit diagrams, and I'll make sure to update this thread with my progress.
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,878
Joined
Jun 21, 2012
Messages
4,878
Many years ago, before the availability of delta-sigma A/D converters with twenty-something bits of resolution, I was involved with micro-densitometry. Using a stable incandescent light source, channeled down to a micro-meter sized spot with proprietary techniques, we illuminated fine-grain reconnaissance film and measured the resulting density with a photo-multiplier tube. This system was capable of measuring density over five orders of magnitude (0 to 5 density) by presenting the linear PMT signal to a logarithmic amplifier. The film was mounted on a glass plate attached to a motor-driven x-y table. The table was moved in a raster pattern to sample, digitize, and store the density readings of the film on 9-track digital magnetic tape. This could take several days, depending on the size of the region-of-interest being examined and the sample interval. Today such techniques for high-resolution image analysis are virtually obsolete as electronic imaging replaced photographic imaging.

Photogrammetry was used to measure the size of objects in the film imagery, so it was important when digitizing to use a uniform spacing, move at a known (constant) raster-scanning speed, and step-over after each scan line a precisely known distance. Such details were handled fairly well by the precision lead screw driving the x-y table, but there is always room for improvement. Serious problems are fine irregularities in the lead-screw pitch and variations in drive-motor speed, both of which show up as inaccuracies in determining distances on the images.

In a project lasting most of a year, I fixed both of those problems by installing a two-axis Hewlett-Packard laser interferometer on the x-y table and interfacing it to an IBM PC. From then on, the PC loaded external hardware registers to determine scan length and sample interval on both axes. Table position registers were updated "on the fly" with up/down pulses from the interferometer. Density data was taken at each sample position and stored on the PC until the end of a scan. At the end of each scan, the stored data was sent to the 9-track digital tape recorder, the table was allowed to overrun a short distance to remove backlash in the lead screw, stepped over a defined amount for the next raster line, and the scan started again in the opposite direction.

Sadly, I was not able to make any improvements in the log amplifier, which was already state-of-the-art in the mid-1980s when this project was completed. However, today I would probably not use a log amp but would instead digitize the linear PMT output to greater precision with a delta-sigma A/D converter... if I could find one that would convert fast enough "on the fly" to keep up with the sampling interval!

Perhaps you should consider using either a good log amp or a delta-sigma A/D to measure absorption... might be able to extend the dynamic range down to nearly opaque samples like I did with the micro-densitometer.
 

jnod

Nov 17, 2015
7
Joined
Nov 17, 2015
Messages
7
I drew up a rough draft of how I'd like to attach the die-cast box to my aluminum diode housing:

File_000.jpg


Should I use a shielded or an unshielded twisted pair to connect to the LED? I think I'll just drill a hole in the housing and route the cable through to make for a cleaner assembly.
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,878
Joined
Jun 21, 2012
Messages
4,878
Probably doesn't matter if LED is connected with shielded wire, since this is a high-level analog power signal. It would take an extraordinary amount of external "noise" coupling to the twisted pair to affect the LED output. Still, some small diameter coax, if you can find a short piece laying around, wouldn't hurt. If you don't use a socket for the LED (I know, cutting the leads short for a socket is an irrevocable act!) you need to place a wire strain relief somewhere close to the LED after soldering wires to the LED leads. I would mount a socket for the UV LED (doesn't have to be Teflon like the photo-diode socket) on the end of the cable, pot it with a dab of RTV cement, and then rig a little plastic washer to hold it and the back side of the LED against the heatsink using a couple of small machine screws (2-56 or 4-40) inserted through holes drilled near the edge of the washer.

Inside the die-cast box you need to make photo-diode connections as rigid as possible to prevent microphonics, especially if the feedback resistor needs to be more than a megohm or so. I have built these current-to-voltage converters with as high as 100 MΩ feedback resistors. Such large resistances are packaged inside a sealed glass tube (usually) to minimize leakage current across the body of the resistor. Any relative movement between the resistor and the circuit board will show up in the output as "microphonics". However, I wouldn't worry about that until you determine what value of resistor to use.

Plan on placing inside the box two 5 V three-terminal point-of-use regulator ICs, one for positive voltage and one for negative voltage (for the LED). Feed these regulators with ±10 to ±12 V DC. Current requirement will be very small, less than thirty milliamperes probably. Use a few hundred microfarad, fifteen to twenty-five volt, tantalum capacitors at the regulator input. Aluminum electrolytic capacitors will also work and are less expensive, but if you can afford them tantalum works better IMO. There is usually no need to filter the output, but check the datasheets and application notes for your regulators.

You should operate the FET-input op-amp with bi-polar power and "ground" the non-inverting input. Also, if you apply positive reverse bias to the cathode, and take photo-diode current from the anode to the summing junction, the op-amp output will be negative. You may then need to add a second op-amp stage to invert the polarity to conform to what your A/D converter expects for input. Conversely, if you reverse-bias the anode of the photo-diode with the negative supply and connect the cathode to the summing junction, the op-amp output will be positive and a second stage is unnecessary. However, think of a second op-amp stage as an opportunity to add another filter pole plus offset and gain adjustments. You can also do all that at the other end of the connecting cable if necessary, and that might be more convenient.

Don't forget to provide your box with a multi-pin connector for the connecting cable that carries signal and power. I like to use DB-9 connectors because they are reasonably small and readily available, and it never hurts to have a few spare terminals in the connector. And it gives your machine shop something useful to do cutting out the mounting holes for the connector. Use a male connector on the box so there are no pins exposed on the mating female connector attached to the connecting cable. The other end of the cable should have a male connector mating with a female connector providing signal and power.

Nice sketch. Don't forget to put this in a project folder or notebook you keep forever and review years later when you are making big buks.
 

jnod

Nov 17, 2015
7
Joined
Nov 17, 2015
Messages
7
Sorry it took so long for an update, I've been busy with other schoolwork. Again, I appreciate all of the responses! I've been drawing up some complete circuit diagrams and putting together parts lists, and I've come up with a new wave of questions:

Should I place the digital circuit inside an aluminum enclosure, too? And if so, should I ground one or both ends of the shielded cable? Can I buy a cable with enough wires for all of the different pins, or should I use separate twisted pairs?

I've been looking all over for a reasonably priced enclosed power supply that'll give me -12V, 12V, and 5V, and the best one I've found is http://www.mouser.com/ProductDetail...=sGAEpiMZZMs1jjUfAXmXymhhF658ouRgMVmSKxZ345Q=. The connector has 2 COM ports as well as the 12, -12, 5 volt ports. Which one is connected to earth ground? Or is the shield connected to earth ground? Will I need to connect the aluminum chassis to earth ground? Should I consider a different power supply?
 
Top