Starting Electronics Needs Your Help!
It is that time of the year when we need to pay for web hosting and buy new components and equipment for new tutorials. You can help by making a donation. Contribute to this website by clicking the Donate button. The total will be updated once daily. (You may need to clear your browser cache to see the updates.)
Target Amount: $2000
Amount Raised: $289
Created on: 2 August 2012
A tone will be played on the loudspeaker that will change pitch as the light intensity levels on the LDR change. Moving your hand around the LDR will cause the light intensity to change. The value from the LDR is read on the Arduino analog pin A0. This value is displayed on the Arduino serial monitor window.
File → Examples → 2.Digital → tonePitchFollower
The circuit diagram and breadboard connections can be found on the tonePitchFollower page on the Arduino website.
Select File → Examples → 2.Digital → tonePitchFollower in the Arduino IDE to open the sketch for this project. Upload the sketch to the Arduino board.
If you would like to see the values that are being read on analog pin A0 of the Arduino, then open the serial monitor from the Arduino IDE. Move your hand around the LDR and hear the pitch played on the loudspeaker change.
Can't see the video? View on YouTube →