Amplifier Selection for Photodiode - Page 1
Forum section: electronics / projects

author: neo0351
author_rank: Newbie
timestamp: March 21, 2017, 04:58:54 am
content: Hi all,I'm working on placing sensors for temperature, relative humidity, and light into some plant growth chambers. The plan is to place a small box inside each chamber with a combined T/RH sensor, a photodiode, and an ATmega microcontroller (most likely 328p). All the sensor boxes will be connected to a Raspberry Pi via RS485 that will log, plot, and post the data to the interwebs. Sensor data will be collected at no faster than 500Hz by the micro. The T/RH sensor output is I2C, so that's easy enough. The photodiode isn't to get an accurate measure light, but to detect if a bulb goes out or the lights turn off. Some of the growth chambers are quite old and sometimes the lights randomly turn off or flicker. So the onboard ADC on the micro should suffice.The issue I'm having is with the selection of a suitable amplifier for the photodiode. I'm thinking of transimpedance amplifier with the photodiode in photovoltatic mode. I used an LM358 on the breadboard and found a 10k resistor for Rf should work. The temperature range of the chambers are about 0-50C. So something that doesn't change much with temperature is of high importance. At first I thought something like a OPA277 or an OP97F might work well due to their low Ib and Ib pretty much doesn't change with temperature. Then I found the OPA380. Maybe that would be better? Now I'm wondering if I'm making this all to complicated and something like the LM358 would do just fine considering I'm only using a 10 bit ADC. Oh, and I almost forgot, the T/RH sensor and micro will be running at 3.3V and the RS485 will be at 5V.

author: Siwastaja
author_rank: Super Contributor
timestamp: March 21, 2017, 07:28:27 am
content: Instead of a photodiode + amplifier, simply use any $0.1 phototransistor. You only need a simple pull-up resistor plus a small cap at the ADC input pin!

author: Kleinstein
author_rank: Super Contributor
timestamp: March 21, 2017, 02:12:44 pm
content: The LM358 has quite a lot of bias current to work with an photodiode. So there are better OP: lower bias / noise, lower drift and close to Rail-Rail operation . Though with a 10 K FB resistor the current does not look very small - so one might not need super low bias / noise. With an only 10 Bit ADC also temperature drift should not be that critical. For a 2.5 V range (internal reference) resolution is good for about 2.5 mV. This would permit up to 50 µV/K for a 50 K range to make it visible. So the LM358 could be good enough. An MCP6002 might be an Rail-Rail alternative - though not really much better. The direct upgrade to the LM358 would be the LT1013.A phototransistor is less linear - so might not such a good choice.One might get away without the OP and directly measure at the µCs AD input, with an integrating capacitor. So have to photodiode towards VCC and a capacitor (10 nF range) to GND. The cap is discharged and than charged through the PD in reverse mode. With the delay from discharge to measurement with the AD one can even chose amplification and this way get a larger dynamic range.

author: MagicSmoker
author_rank: Super Contributor
timestamp: March 21, 2017, 02:28:41 pm
content: Quote from: Kleinstein on March 21, 2017, 02:12:44 pmThe OP says he just needs to detect if a light is on or not, so a phototransistor would work quite well here.The only real issue the OP has to contend with - using a phototransistor - is setting the trip threshold so that light from the other grow chamber lights doesn't interfere.

author: Siwastaja
author_rank: Super Contributor
timestamp: March 21, 2017, 04:02:25 pm
content: Quote from: MagicSmoker on March 21, 2017, 02:28:41 pmYes, which is easily done by adjusting the pullup.This is easily achieved by using a fixed R + variable resistor in series as the pullup. Something like 1k fixed + 47k variable. First prototype is done in a few minutes, and gives a good idea of the final pullup value.

author: ScottK
author_rank: Contributor
timestamp: March 21, 2017, 04:17:53 pm
content: Quote from: Kleinstein on March 21, 2017, 02:12:44 pmI like this method.

author: neo0351
author_rank: Newbie
timestamp: March 21, 2017, 05:51:03 pm
content: Thanks for the replies.I think I'm going to stick with the photodiode for it's linearity and spectral response. The one I chose has a very nice bell curve over only Photosynthetically Active Radiation (PAR). There are three different chamber types and all have different lights and vary considerably in max brightness and spectra. Also the light inside the chamber be changed in different ways (moving the lights down, dimming, turning off bulbs). So a linear response is nice. Also, I know the photodiode I have chosen with a 10K resistor will work in all chambers under all the possible lighting variations we will use.I'll give the suggested op amps a look. I got to reading too much about photodiodes and forgot I'm working under relatively high light and 10 bit resolutionThe integrating capacitor sounds interesting. I might give that a play just for kicks.

author: james_s
author_rank: Super Contributor
timestamp: March 21, 2017, 06:12:11 pm
content: What do you need linearity for if all you want to do is check if the light is on or off? Even an old fashioned CdS cell could do that easily.

author: james_s
author_rank: Super Contributor
timestamp: March 21, 2017, 06:23:21 pm
content: Black plastic tube around the sensor, pointed at the light one wants to monitor? That ought to filter out any nearby lights.

author: neo0351
author_rank: Newbie
timestamp: March 21, 2017, 06:52:57 pm
content: There are multiple bulbs in the chamber. I'd like to be able to detect a single bulb going out. If it's on the far side of the chamber it's going to cause a smaller response than if its the bulb directly overhead. Since the chambers are basically like big refrigerators, outside light is not an issue. As I stated, that was only one of the reasons I was choosing to stay with the photodiode. Others being spectral response and knowing this diode will do everything I want under all the conditions possible in the chambers with a one size fits all solution.

author: james_s
author_rank: Super Contributor
timestamp: March 21, 2017, 06:57:32 pm
content: Fair enough, having that information makes it easier to suggest a solution.

author: syin25
author_rank: Newbie
timestamp: March 23, 2017, 03:24:06 am
content: I think you can use an integrated IC , such as OPT101, that should be able to solve your problem even you want it to work in all chambers.All you need to do is power the IC and connect the output pin to the onboard ADC pin.