Starting Electronics needs your help! Please make a donation to help cover our hosting and other costs. Click the donate button to send a donation of any amount.

Project 5: Play Different Tones as Light Intensity Changes (tonePitchFollower)

Created on: 2 August 2012

Tutorial 10 – Pages

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.

Parts Needed

  • 1 × LDR (Light Dependent Resistor)
  • 1 × 8 ohm loudspeaker
  • 1 × 4k7 resistor
  • 1 × 100 ohm resistor

Arduino Website Page


In the Arduino IDE

File → Examples → 2.Digital → tonePitchFollower

Building the Circuit

The circuit diagram and breadboard connections can be found on the tonePitchFollower page on the Arduino website.

Programming and Operating the Circuit

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.

Project 5 Video

Can't see the video? View on YouTube →

As an Amazon Associate I earn from qualifying purchases: