Introduction: Control LED Blink Rate With Potentiometer
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
Step 1: Tools and Supplies
* Arduino 101
* 100Ω Resistor
* Red LED
* Jumper Cables
Step 2: Circuit
* 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.
Step 3: Potentiometer Black Box
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.
Step 4: Arduino Code
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.