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! :-)


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.

  • hi, I have read your explanation and other links (instructables.com/id/How-to-Use-a-Light-Dependent-Resistor-LDR) many times, but I still don't get it. What would happen without the resistor? We would still have a varying resistance applied to A0 when the light applied to the LDR would vary. I mean, what's the need for anything else?
    – seinecle
    Feb 7 '16 at 13:50
  • What exactly don't you get?
    – Majenko
    Feb 7 '16 at 13:51
  • just edited my comment! :-)
    – seinecle
    Feb 7 '16 at 13:54
  • The voltage dropped across the LDR without the other resistor is dependent on the current flowing through it. Simple Ohms Law. Since the input pin A0 is very high impedance that current will be minuscule. As a result the voltage drop will be incredibly tiny - too small for the Arduino to measure. Learn Ohms Law and these things become obvious.
    – Majenko
    Feb 7 '16 at 13:56
  • ok I finally got it. it is far from trivial: Ohm's Law is one thing, but then it is a matter of getting the clever trick of the voltage divider, which took me a while to get...
    – seinecle
    Feb 7 '16 at 14:36

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.


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.