Ongoing donations help keep the site running. Contribute to this website by clicking the Donate button. Many thanks to all who have donated.
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 →