How would I use a photoresistor like a switch. My issue is it is always bleeding out a little bit of power and always on. Is there a way to connect it to a digital pin and when a resistance of xxx is ment, set another digital pin to On?

  • First off, what is the circuit you are using with the photoresistor. What is the type, you get ones which have a light blocking casing allowing only IR through, or is it clear, if its clear it will pick up any light that leads to another point you can add, where is the sensor placed. There are other things to use other than an arduino, like a comparator. Have a look at this arduino.stackexchange.com/a/13318/2944 it has a few points there for you to start with – RSM Mar 1 '16 at 12:58
  • Without a schematic, how can we help you? – uint128_t Mar 1 '16 at 15:40

To turn an analog signal into a digital signal, at some sort of threshold xxx, you need to either condition it in electronic circuitry, with something like an amplifier or a comparator, or read the analog signal directly and apply the threshold in software.

You likely need to connect the photoresistor as half of a voltage divider, as in Why do you need a second resistor when using a photoresistor/LDR?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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