I would like to make a laser sensor to detect light coming from a 650nm diode. My current idea would be to use CdS photoresistors/LDRs. I want to measure a few (4-8?) at once, where light falling onto any one of them generates a signal - I don't care from which sensor it actually came. However, I would like to put as many sensors on as few pins as possible.

I've already somewhat figured out that putting LDRs in parallel isn't ideal, because any changes in voltage will become smaller the more I use. Instead, it would seem like a better idea to build some kind of 'switch' by putting each LDR together with a fixed resistor and a transistor. How exactly would a circuit for this look like, or are there better ways to do it?

  • Can you check this post. I think that what you want arduino.stackexchange.com/questions/4027/…
    – qqq
    Dec 27 '17 at 13:32
  • So you want open collector bus and transistors will be used as comparators to pull the bus LOW if any of sensors is active?
    – KIIV
    Dec 27 '17 at 13:38
  • I still think the parallel solution could still work. You just have to lower the value of the (pull-up) resistor, to get a bigger range of different values.
    – Gerben
    Dec 27 '17 at 14:39
  • solar cells (PV) are much faster than CDS and unlike resistors, can be chained in series.
    – dandavis
    Dec 27 '17 at 14:47
  • Depending on how much light falls on it, an LDR can see its resistance fall by several orders of magnitude. Thus, putting several LDRs in parallel could definitely work. Shining a laser on one of them will effectively short the whole parallel assembly into a very low resistance. Dec 29 '17 at 20:45

If response time is critical (on the order of about a quarter of a second) consider using photo diodes instead of Cadmium sulfide cells.

Also, consider using an Arduino with more ADC ports. The number of ADC ports is usually a constraint of the processor used. Different Arduinos use different processors. Some may have more ADC ports.

Finally, to utilize a single ADC port for multiple unknown resistances, consider using a resistor network where all the unknown resistances and a known pull down resistance are connected to the ADC port. Then, in turn, using as many Arduino digital pins as there are unknown resistance, apply a digital high to only 1 unknown resistance. Keeping the digital pins to all the other unknown resistance in a high impedance state. That is, change them from OUTPUT to INPUT digital ports. Then take an ADC sample. Apply this same procedure for all the other unknown resistances. Consider adding a delay after changing the state of the digital pins to allow for the ADC input to acclimate to the new voltage.


simulate this circuit – Schematic created using CircuitLab


I think you can take them paralel to each other and in series with a simple resistor. The point within the series can be used as input voltage. Everytime the input voltage is higher than the reference voltage you can generate an interrupt from the comparator. This means if one of x resistors decreases its value this will affect the upper half resitance. Simply it will decrease the value too. Because of this the input voltage will increase and will be above of the reference voltage. This will produce interrupt (signal).

The Question is how accurate will it work. The resistors are nor 100% accurate because of that the circuit will not work accurate. What can accept? What is OK and what not?

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.