Introduction: Control LED Blink Rate With Potentiometer

Picture of 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

Picture of Tools and Supplies

* Arduino 101

* Potentiometer

* 100Ω Resistor

* Red LED

* Jumper Cables

Step 2: Circuit

Picture of 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

Picture of 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

Picture of 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.

Comments

About This Instructable

229views

6favorites

License:

Bio: Aerospace Engineer working in Software Development with a passion for Hardware.
More by TechMartian:Flying Captain America's Shield - RC PlaneWide Angle ShotsLED Ping Pong With Shift Register
Add instructable to: