user17100: I am reading Arduino for Dummies, and I am blocked at the pitch follower exercise. It consists in making a piezo vary with a light sensor. I can't see the point of the resistor (and why 4.7?) in this sketch:

Any help for a dummy is appreciated! :-)

user13432: Arduino measures Voltages on pins A0 to A5; but the LDR is a variable resistor (varying with Light). So we need to convert the varying resistance to a voltage that the Arduino can measure.
For more details see here. 
Cheers!

user4143: The resistor couples with the LDR to form a voltage divider. The voltage at the point where the resistor and LDR join will vary depending on the ratio of the two resistances - the resistance of the LDR and the 4700 ohm resistor.
The value of 4700 is chosen to allow a reasonable range of voltages when in a ratio with the LDR, and the best value depends on the resistance range of the LDR.

17100: <p>I am reading <em>Arduino for Dummies</em>, and I am blocked at the pitch follower exercise. It consists in making a piezo vary with a light sensor. I can't see the point of the resistor (and why 4.7?) in this sketch:</p>

<p><a href="https://i.stack.imgur.com/Ja5ht.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ja5ht.jpg" alt="http://media.wiley.com/Lux/98/381398.image0.jpg"></a></p>

<p>Any help for a dummy is appreciated! :-)</p>
 13432: <p><em>Arduino measures Voltages on pins A0 to A5; but the LDR is a variable resistor (varying with Light). So we need to convert the varying resistance to a voltage that the Arduino can measure.</em></p>

<p>For more details see <a href="http://www.instructables.com/id/How-to-Use-a-Light-Dependent-Resistor-LDR/" rel="nofollow">here</a>. </p>

<p>Cheers!</p>
 4143: <p>The resistor couples with the LDR to form a <em>voltage divider</em>. The voltage at the point where the resistor and LDR join will vary depending on the ratio of the two resistances - the resistance of the LDR and the 4700 ohm resistor.</p>

<p>The value of 4700 is chosen to allow a reasonable range of voltages when in a ratio with the LDR, and the best value depends on the resistance range of the LDR.</p>
