LESSON 13: Dimmable LED Controlled by a Potentiometer

This lesson demonstrates how to create a dimmable LED controlled by a potentiometer using an Arduino, building on previous lessons on reading analog values and controlling output through PWM. Here’s a brief overview of what you will learn:

  1. Reviewing Previous Homework: Recapping the assignment from Lesson 12, which involved using a potentiometer to control the brightness of an LED.

  2. Setting Up the Circuit: Detailed instructions on how to correctly connect a potentiometer and an LED to the Arduino, ensuring that each component is properly configured for the experiment.

  3. Writing the Code: Step-by-step coding instructions to read the analog value from the potentiometer and use it to adjust the LED’s brightness through PWM. This includes mathematical calculations to translate the potentiometer’s variable resistance into a voltage value that the Arduino can use to control the LED.

  4. Debugging Tips: Guidance on troubleshooting common issues such as incorrect readings from the potentiometer or errors in the PWM output that affects the LED brightness.

  5. Homework Assignment: Extending the lesson’s project by experimenting with different mappings of potentiometer readings to LED brightness to understand linear versus exponential scaling and its perceptual impacts on LED dimming.

Video