Control LED Blink Rate With Potentiometer

by TechMartian in Circuits > Arduino

32588 Views, 10 Favorites, 0 Comments

Control LED Blink Rate With Potentiometer

2016-07-02 12.57.20.jpg
2016-07-02 12.56.11.jpg

This is the second lesson module in the Arduino 101 Essentials series spanning beginner to advanced features.

This lesson will cover the following:

  • Reading analog input signals from a potentiometer
  • Controlling the blinking speed of an LED with a potentiometer

Tools and Supplies

2016-06-28 08.29.24.jpg
2016-07-02 12.57.08.jpg

* Arduino 101

* Potentiometer

* 100Ω Resistor

* Red LED

* Jumper Cables

Circuit

Screen Shot 2017-06-28 at 11.18.38 PM.png
Screen Shot 2017-06-28 at 11.29.47 PM.png

* Connect the LED exactly like it were in module 1

* Connect the potentiometer as shown in the circuit

* Connect the jumper cables to the arduino

Note there was an error in the drawing of the circuitry, the black wire between the LED and ground should be a 100Ω resistor.

Potentiometer Black Box

pot.png

A potentiometer is a variable resistor. In a series connection for analog circuits, as the knob is turned the resistance across of a potentiometer changes. As a consequence of Ohm's law which states V = IR where V is voltage, I is current, and R is resistance, the proportionality of resistance and voltage makes it such that when the resistance is lowered the output voltage is lower. Thus, if an LED is connected to this output, then the light will be dimmer, and the same principle works vice versa when increasing the resistance. This way, we can control the brightness of an LED allowing us to fade up and down.

Arduino Code

Screen Shot 2017-07-03 at 2.07.25 PM.png

Download the Arduino sketch and upload the code to the Arduino to blink the LED. Each line is commented as to what they do.

Once uploaded turn the knob of the potentiometer to change it's speed.

Downloads