Introduction: Circuit With One LED & Potentiometer

About: I am a student at American High School. I love math, programming, and building circuits!

The LED will turn on when the potentiometer is between 2 values. It will turn off otherwise. The Serial monitor in the Arduino IDE app will continuously print the value of the potentiometer.

Supplies

The circuit uses:

  1. 1 LED
  2. 1 potentiometer
  3. 1 330 ohm resistor
  4. Elegoo UNO R3 microcontroller board
  5. Breadboard
  6. Laptop
  7. USB cord

Step 1: Install Arduino IDE

Go to https://www.arduino.cc/en/software

Step 2: Connect the Microcontroller Board to Laptop

Use a USB cord to attach the Elegoo board to your device.

Step 3: Attach the LED

Connect one wire from pin 9 to the resistor, then connect the resistor to the LED. Then use another wire to connect the LED to ground.

Step 4: Attach the Potentiometer

Put the potentiometer on the breadboard. The left wire goes to power (5V). The right wire goes to ground.

Step 5: Add the Knob to the Potentiometer

Use another wire to connect the bottom of the potentiometer to A2. Finally, add the the knob to the potentiometer.

Step 6: Write the Program

https://github.com/tejbho/ArduinoProjects/blob/main/potentiometer/potentiometer.ino

Step 7: Test the Circuit

Turn the knob on the potentiometer until the LED light turns on. The light should turn on when the value is between 2 and 3. Then turn the knob back to see that it turns off.