Electronic – arduino – Best resistor value in series with LDR sensors

arduinointegrated-circuitldrsensor

I am designing sensors array for the Line following Robot, based on LDRs Resistors and transmitter LEDs, the value of LDRs Resistors in series is changing with the position of the array on the black Line, so I can measure the Deviation angle value from the voltage divider through R1 to control the tow Motors.

The value of LDR Resistors changing from 92 Kohm to 110 kohm, I put a resistor R1 in series with the LDRs, the ADC pin (A0) in arduino uno is connected to the voltage divider through R1.

Question: How I can choose the value of R1 to get the best sensitivity on A0 pin?
I tried 10k ohm but I get a small changes just [4.5,4.58] volt and that's not working I need more sensitivity. How can I choose R1 to get the best sensitivity on A0 pin?

schematic

simulate this circuit – Schematic created using CircuitLab

Best Answer

As with many things, but unusually obvious here, calculus comes to the rescue. Your senstitivity is $$ \frac{\partial V_{out}}{\partial R_{LDR} } $$ You need to find the expression for $$ \frac{\partial^2 V_{out}}{\partial R_{LDR} \partial R_1} $$ as a function of the resistance of the LDR and R1, set that equal to zero, and find the value of R1 when that derivative is zero.

Formally, you should take the second derivative and make sure its a maximum and not a minimum, and test your endpoints for absolutes, but in this case I'm reasonably sure that won't be necessary.

My gut feels like R1 should be 400 ohms, but my gut's been wrong before and will be again. (@Wouter-van-ooijen seems to think it will be an absolute at one of the endpoints. Interested to see what the right answer is)

Note that this in no way spreads your range of Vout over the dynamic range of your ADC. You may well need to do some signal conditioning beyond that circuit.

Oops, just noticed that the LDRS aren't 100 ohms like in the picture. The answer should be that R1 should be set at the total value of the four LDRs, which is right in line with Wouter. This will interfere with the adc, and you should buffer.