🧰 Project 3C: LED Fade with Potentiometer! | myBetabox

🧰 Project 3C: LED Fade with Potentiometer!

This Project is an Example of…


DIMMER SWITCHES
Adjust your room’s light intensity to your heart’s delight!

Let's use the potentiometer to control a different behavior of an LED.  We'll use an LED on the breadboard and control its brightness with the potentiometer, just like the dimmer switch on the wall in your home.

What you will learn:

This project uses an important concept called pulse width modulation, or PWM, to control the brightness of the LED.

PWM creates a wave pattern in the current being sent to the LED. To create the wave pattern, the Arduino turns the power going to the LED on and off very quickly, many times a second.

  • If the wave is OFF more than it is ON, the LED acts as if the voltage coming to it is lower and gives off less light.
  • If the wave is ON more than it is OFF, the LED acts as if the voltage is higher and burns brighter.

PWM is a very important concept in electronics. Microcontrollers like Arduino do a great job of giving us a way to manage PWM to control a wide variety of components, including lights, motors, and heaters.

Required Components

Add Sketch to Editor


Download the Sketch

Fritzing Diagram


Building Tips

  • Wire this project according to the Fritzing diagram for Project 3C.
  • This is one of the more complicated builds; take your time and make sure that all the connections go to the right places.
  • IMPORTANT: Make sure to plug the long color jumper wire to the CENTER lead of the potentiometer.
  • The other end of the color jumper wire goes to Analog Pin A0 on the Arduino.
  • Double-check your connections before powering up, especially the power connections.
  • UPLOAD AND SAVE the correct/current sketch to your Arduino from the Web Editor.

Expand Your Learning

Experiment with the potentiometer by turning the dial up and down.

  1. Leave it low for a while and see what happens.
  2. Leave it high for a while; now what happens.

Think of other things you could control with the potentiometer by using PWM.

    Troubleshooting