Created on: 2 August 2012
Updated on: 17 January 2023
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.
An Arduino Uno is used in this easy tutorial for beginners in electronics. One of the example sketches from the Arduino IDE is used in this tutorial, so no code needs to be written.
Besides an Arduino Uno or compatible board and a USB cable you will need:
1 × 10k potentiometer
Depending on the type of potentiometer, you may also need a breadboard and wire links. A potentiometer with wires soldered to it are shown in the video for this tutorial. Alternatives are to use a trim-pot and wire it from a breadboard, or use a panel mount potentiometer and Dupont wires.
File → Examples → 3.Analog → AnalogInput
The following video shows that turning the shaft of the potentiometer in one direction increases the flashing frequency of the Arduino on-board LED. Similarly, turning the potentiometer shaft in the other direction decreases the LED blink or flash rate.
Connect the potentiometer as shown on the Arduino website AnalogInput page.
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.