Skip to main content
Arduino

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Required fields*

Use photocell as digital input

I need to use multiple photocells as input, but its more than the amount of analog pins that my arduino has.

I'm wondering if theres any way to use a photocell as a digital input, with the photocell triggering at a specific set threshold of light.

It doesn't seem quite possible but I thought I'd ask.

Answer*

Draft saved
Draft discarded
Cancel
3
  • 1
    The numbers you quote are not the voltage thresholds: they are the lowest voltages where the pin is guaranteed to be read as high. On the Uno, more than 3 V is HIGH, less than 1.5 V is LOW, anything in between is not guaranteed. The "typical" thresholds are 2.6 V for the LOWHIGH transition and 2.1 V for HIGHLOW. These are different thresholds because of the hysteresis introduced by the Schmitt trigger at the inputs. Commented Sep 6, 2016 at 20:45
  • I'd suggest using a potentiometer, so you can tweak at which light level the pin goes high/low. Commented Sep 7, 2016 at 8:04
  • You wrote: "Your voltage divider should observe this thresholds". No, it should not. If it does, then the pin is guaranteed to read HIGH when you expect it to read HIGH (good), but it will also read HIGH across a significant range of voltages where you expect it to read LOW (bad). Commented Sep 7, 2016 at 9:12

lang-cpp

AltStyle によって変換されたページ (->オリジナル) /