Strange behaviour of photoresistor

Hello,

I have built an arduino based weather station which sends its data to thingspeak. Besides the temperatute, humidity and pressure data it also measures the light intensity using a photoresistor. The photoresistor is connected to GND and an analog input pin of the arduino, while a 10k resiustor is connected to the analog input pin and 5V (voltage divider). When it is completely dark, during the night, and the room light is switched off and then I switch on the room light, we see the following strange behaviour (see picture)

The photoresistor detects the change in light intensity, but then the detected light intensity slowly decreases over the timescale of minutes to one hour. Lower ADC values mean a higher light intensity because the decreasing resistance of the photoresistor in the voltage divider. Has anyone of you seen soimething like this? The room light is a thermal light source, a halogen lamp that reaches its temperature very quickly and does not change its intensity over minutes.

The photoresistor is probably temperature influenced and is heating due to it's own current when illuminated.

This sensor might be more suitable. It has a temperature effect but is documented in the data sheet.

Hi,

thanks for your answer. According to the readings of the ADC and the known total voltage of 5V one can calculate that a power of only 0.25mW is dissipated in the photoresistor, but it seems that this is enough to heat it up enough to change the resistance significantly. I will look at the sensor you suggested, but there the light current as a function of the temperature is known, but the temperature difference caused by current is not known. Maybe I will apply a voltage to the sensor only a short time during reading, so it cannot heat up enough to cause bad readings.

Thanks again

Here's another choice that may be more suitable. I'm going to use one with a high resolution camera and a Teensy 3.6 surveillance system.

For my own weather station I used a bpw34.
With a basic schematic like this one :

bpw34

You don't have to power the Photoresistor fulltime, only when you read it. Say every 15 seconds, like this, connect the resistor to an output pin instead of VCC:

   [pseudo code]
  //time to check
digitalWrite(outPin,HIGH);
delay(5);
analogRead(inPin);
digitalWrite(outPin,LOW);

Lower ADC values mean a higher light intensity because the decreasing resistance of the photoresistor in the voltage divider.

Depends on how you have it connected.

If it's connected on the low side of the divider (R2), then yes, a higher light intensity will lower the resistance, lower the voltage and lower the ADC value.

If it's connected on the high side of the divider (R1), then a higher light intensity will lower the resistance, increase the voltage and increase the ADC value.

Thanks all of you for your answers. I also thougt about the solution outsider mentioned of turning the voltage to the photoresistor on only a short time before the measurement. Another solution would be a resistor with a higher resistance in the voltage divider, but that would decrease sensitivity for high intensities because the resistance of the resistor in the voltage divider should be close to the resistance of the photoresistor, which is low for high light intensities. dlloyd, you are right. The photoresistor is connected to GND and an analog input pin of the arduino, while a 10k resistor is connected to the analog input pin and 5V (voltage divider).

This could be an artifact of obscure semiconductor physics. I wouln't worry about it, CdS sensors
are imprecise and slow, fine for a rough indication but precision photodiodes and light sensing ICs
are better for measurements.

You might have a light whose output varies as it heats up.

And the temperature change might matter.

So you'll need a good photmeter and temperature sensor to track these confounding
variables if you want to figure it out for sure.

This page suggests CdS sensors have both poor stability and poor reproducibility:
http://www.johnloomis.org/ece445/topics/egginc/tp4.html

[ in particular note this sentence from that site: "The resistance also has "long term memory" which depends, at any given time, on the amount of light actually incident on the sensor plus the sensor light history for the past several days." ]