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: $495

Donations Received

Top Donor: D.C. $30


Project 7: Control the Flashing Rate of an LED using a Potentiometer (AnalogInput)

Created on: 2 August 2012

Tutorial 10 – Pages

The analog value on the Arduino analog pin A0 is changed using a potentiometer. The value read on this pin by the Arduino is used to change the rate at which the on-board LED flashes.

Parts Needed

1 × 10k potentiometer

Arduino Website Page


In the Arduino IDE

File → Examples → 3.Analog → AnalogInput

Building the Circuit

Connect the potentiometer as shown on the Arduino website AnalogInput page.

Programming and Operating the Circuit

Open the sketch in the Arduino IDE (File → Examples → 3.Analog → AnalogInput) and then upload it to the Arduino board.

As the shaft of the potentiometer is rotated, the rate at which the Arduino on board "L" LED flashes will change.

Project 7 Video

Can't see the video? View on YouTube →

← Go back to P6: AnalogInOutSerialGo to P8: Calibration →