I've used photoresistors for hobby projects before, such as this one:


However, now I'm working on a commercial product that needs to sense when it's dark and I'm unsure of whether the circuit I designed on the above page is adequate. The reason I'm concerned is that in my experience photoresistors have very low wide tolerances (i.e. high deviations in photosensitivity).

If you were designing a low cost circuit that could output a HIGH logic level when dark and LOW logic level when light (or vice-versa), would you use a circuit with a photoresistor like the one I designed, or is there something else that is more reliable?

  • 3
    \$\begingroup\$ I think the question is unanswerable at the moment, beyond saying "It depends." The definitions of "dark" and "light" in your context will play a part in the answer. \$\endgroup\$
    – user16324
    May 5, 2014 at 20:31
  • \$\begingroup\$ @BrianDrummond I'm not sure how to quantify light levels as I don't have a lux meter, but the exact point at which the circuit decides it's "dark" isn't hugely important right now as I'm sure it can be tuned later. What's important is that the sensor/circuit is relatively consistent if/when mass manufactured. Does that help at all? \$\endgroup\$
    – Nate
    May 5, 2014 at 20:44
  • \$\begingroup\$ Then whatever sensor you use, it is up to you that it will function to your (customer's) satisfaction despite whatever variability your sensor exhibits. Test with (simulations of) both extremes of sensitivity. \$\endgroup\$
    – user16324
    May 5, 2014 at 20:50
  • \$\begingroup\$ @BrianDrummond Yes, I do think photoresistors would work given that the design allowed for quite a bit of variance, but I'm also wondering if there's anything better than photoresistors? \$\endgroup\$
    – Nate
    May 5, 2014 at 21:08
  • 1
    \$\begingroup\$ If you want something better than photoresistors, check out "ambient light sensors". Just Google the term and you'll see a whole bunch of options. \$\endgroup\$
    – John D
    May 5, 2014 at 21:44

2 Answers 2


How to deal with highly variable components? Pick one or more:

  1. tune each device manually
  2. restrict your problem domain to fit within the available tolerance of the components
  3. tune each device automatically (e.g. a circuit built into your device which finds the light-dark range of the photoresistor automatically and saves the result somewhere)
  4. sort devices to fit your problem domain

The best results will happen when you hit the sweet spot of the device working correctly for all inputs with a minimum of labor and parts.


I don't see why a photoresistor wouldn't work. If you're concerned about tolerances, put a resistor in series with the photoresistor. This will reduce the effects of variation in the component. This also reduces the effects of light changes, which may be good or bad, depending on your needs. For tuning, you can replace R2 in your diagram with a potentiometer (At least when prototyping). With a simple circuit like the one you linked, it's really easy to prototype it. So, I wouldn't say, "I'm unsure of whether the circuit I designed on the above page is adequate." I'd build the circuit and test it.

There's some caveats, here. Manufacturers give tolerances for a reason. When designing the circuit, it would be best to assume first one extreme, then the other. Additionally, will you be working in a hot or cold environment? Most silicon devices are temperature-sensitive. If you first simulate your circuit using something like Spice, you can specify this, and it will be included in the simulation. The takeaway here, for a simple circuit like this, is to build it first and see if it will be sufficient, then improve the design based on any problems you see.


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.