0
\$\begingroup\$

I am trying to use PDV-P8103 photocell as a sensor for LCD dimming circuit. The application requirements are to have comfortable brightness level from almost total darkness up to direct sunlight.

The problem is that the cell swings between about 300 Ohm all the way to over 1M. Usual connection as part of voltage divider simply does not work, as depending on fixed resistor the ADC quickly saturates at either 0 or VCC.

Is there a simple way to squeeze dynamic range of a photocell into something useful for reading by ADC? Note, that the precision is not important for this application, only the ballpark ambient light assessment.

Here are some approaches I have considered:

  • Adding OP-Amp in attenuator configuration;

  • Powering the voltage divider from DAC output and use it to select range first before sampling ADC;

  • Giving up on full range and picking fixed resistor for dark conditions, since human eyes adapt to darkness much better than to bright light.

Neither of the above struck me as ideal solution, so any ideas are welcome.

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

The PDV-P8103 is only specified to a maxium of 100 lux. Direct sunlight is ~100,000 lux. Extrapolating the graph to this illumination I get ~250 Ω resistance, so the resistance range you need to measure is ~80k Ω (at 1 lux) to ~250 Ω.

Resistance is inversely proportional to light intensity, so get a more linear response you should keep the voltage constant and measure current. This can be done by measuring the voltage across a small 'shunt' resistor in series. However this makes the output voltage rather small.

If you don't mind a bit of non-linearity at high light levels then the shunt can be made larger, eg. 220 Ω with a 3.3 V supply should give you ~9 mV at 1 lux, 88 mV at 100 lux, 711 mV at 10,000 lux and 1.5 V at 100,000 lux. This can be converted to a linear brightness control value using a lookup table and/or piecewise linear curve fitting.

\$\endgroup\$
1
  • \$\begingroup\$ I got tangled in the mix of lux and ftc used by the manufacturers and did not look at the range. Although to be fair the photocell datasheets are rather scarce on data and messy. This one actually calls it "surface mount photodiode" in the title. My mistake was to use 10k resistor and no filter, resulting in output passing 3V in dark room conditions. After some calculations and code tweaking I've arrived at 470 Ohm giving useful range and 8x hardware oversampling giving nice stable output. Thanks for your help! \$\endgroup\$
    – Maple
    Commented Apr 13, 2020 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.