Vishay TEPT5700 - Ambient Light Sensor problem

I am using Vishay TEPT5700 sensor for automatic turning outside light on and off between day and night. I wired the sensor with 10k resistor to analog pin. I made the whole circuit, test it and measure it. Everything works but it looks like sensor depends a lot of outside temperature although graph in datasheet is almost linear. This is the problem because when outside is -10 degrees, the sensor value is 185 in dusk (for example, when i want to turn the light on), and 195 when outside is +10 degrees. Because of that i can't set proper on/off turning border (i tried but difference is too big).

Have got anybody any idea, what could be wrong (maybe resistor value or wiring?) or recommend another sensor?

Here's my wiring scheme for sensor..

Sensor datasheet
http://www.google.si/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&ved=0CEgQFjAB&url=http%3A%2F%2Fwww.vishay.com%2Fdocs%2F81321%2Ftept5700.pdf&ei=6NgSUZGvNpGM4gS9woF4&usg=AFQjCNHQRhqLQjioGuUq4yGjNVLnacavWA&bvm=bv.42080656,d.bGE

The typical scheme is 5V -> 10K resistor -> analog pin -> phototransistor -> GND (a "common emitter" scheme). This sets the pin high when it's dark and low when it's bright. I can't say I fully understand the math but it just seems to work better at typical light levels.

With your current wiring a larger resistor should give you more of a sensor swing.

Chagrin:
The typical scheme is 5V -> 10K resistor -> analog pin -> phototransistor -> GND (a "common emitter" scheme). This sets the pin high when it's dark and low when it's bright. I can't say I fully understand the math but it just seems to work better at typical light levels.

With your current wiring a larger resistor should give you more of a sensor swing.

So this scheme is not ok? I don't understand how you mean that i should wire it.. Can you make a scheme please?

And you recommend bigger resistor value.. I will try that. Any starting point (1M, 10M?)

Can somebody recommend any other sensor, which works well for this purpose? Btw, what kind of sensors are in those automatic turning on/off light detectors?

For starters you setup is totally wrong you want to feed the ptoto transistor with a 100k resistor VDD to collector and tap the ADC to the emittor with a 10k resistor

lightsen.png

be80be:
For starters you setup is totally wrong you want to feed the ptoto transistor with a 100k resistor VDD to collector and tap the ADC to the emittor with a 10k resistor

Thank you for your explanation.. I will try that!

I used this scheme before.. http://img.techpowerup.org/090723/pt%20circuit.gif
So that mean that this sheme is wrong..

I don't understand why Vishay didn't put any "typical configuration" schemes in datasheet. I googled a lot of pages about phototransistor but there's so many different schemes.

Chagrin:
The typical scheme is 5V -> 10K resistor -> analog pin -> phototransistor -> GND (a "common emitter" scheme). This sets the pin high when it's dark and low when it's bright. I can't say I fully understand the math but it just seems to work better at typical light levels.

With your current wiring a larger resistor should give you more of a sensor swing.

I changed my wiring like you said, with common emitter and 10k resistor..

Like this, just with phototransistor

I will test it outside but still, ratio between night and room with medium lighting is really small.. In the dark i get value about 833 while in room with medium lighting value is about 825. Could i make this "area" more accurate, with bigger ratio area if i change resistor value?

The way I posted was at the emitter side which should work fine the one you
Posted is not going to have the range your looking for

be80be:
The way I posted was at the emitter side which should work fine the one you
Posted is not going to have the range your looking for

I just find original scheme from VISHAY and it shows that phototransistor should be wired exactly the same as i wired it first time, just with 200k resistor.

I also tried with your scheme be80be but with 100k and 10k resistor i get really small values range..

If VISHAY's original scheme is correct than, in that case, sensor really depend of temperature a lot.

I fixed it.. I used the same scheme as first time, just with 200k resistor. Now the whole thing is really sensitive and i can set turning border more accurate.

With regards to the temperature you could use a simple DHTxx temp sensor and compensate.

I realise this is an aged topic but would like to straighten out some points. There is an application sheet https://www.vishay.com/photo-detectors/list/product-81321/ where you can download the application sheet.

The device will handle Ic = 20mA max. It only needs an emitter resistor. But what value? Well being a transistor the effective gains vary considerably so the transfer function (quantity of light falling on the sensor to Ic) will follow a common pattern but any two devices are very unlikely to have exactly the same transfer function.

However a starting point (from App note) is Ic = Lux x 0.75uA for a 3 to 5volt Vcc. The transfer function appears to hold for many decades from 1 Lux to 10,000Lux. [Full moon overhead in tropics to full daylight]. Clearly the Arduino ADC only has a range 0..1023 so there will be no single choice of resistor to get those extremes.

The lowest value for Re would be 5volt @ 20mA => 250 Ohm and would be good for the brightest light (20mA / 0.75uA => 26,000 Lux). However, 1 ADC count would be proportional to 2600Lux change; full moon to TV studio lighting.

The numbers are a starting point - because of the large variability in transfer function.

I offer the comments to:
a) provide a link to an application note
b) provide some starting points for thinking about lighting range and Re

luxy:
I don't understand why Vishay didn't put any "typical configuration" schemes in datasheet. I googled a lot of pages about phototransistor but there's so many different schemes.