Circuit With Potentiometer and 3 LEDs

by tejbho305 in Circuits > Arduino

22 Views, 0 Favorites, 0 Comments

Circuit With Potentiometer and 3 LEDs

IMG_2463.jpg

This circuit uses a potentiometer and 3 LEDs of different colors: green, yellow, and red. Turning the knob of the potentiometer will change what light turns on.

Supplies

  1. Elegoo Uno R3 microcontroller board
  2. Breadboard
  3. USB cable
  4. laptop
  5. 1 Potentiometer
  6. 1 Green LED
  7. 1 Yellow LED
  8. 1 Red LED
  9. 3 330 ohm resistors

Connect the Potentiometer

IMG_2459.jpg

Start by placing a wire going from the "-" row of the the breadboard the ground pin on the circuit board. Then connect the right of the potentiometer to ground. Connect the left side of the potentiometer to 5V. Finally, connect the bottom of the potentiometer to the A2 pin.

Connect the Red LED

IMG_2460.jpg

Connect one wire from pin 9 to the breadboard. Connect this to one resistor and the red LED. Then place one wire from the LED to the ground line.

Connect the Yellow LED

IMG_2462.jpg

Do the same thing to the yellow LED as you did for the red LED, but this time using pin 5.

Connect the Green LED

IMG_2463.jpg

Repeat the same process for the green LED, using pin 2. Once you're done, use the USB cable to attach the microcontroller board to the laptop.

Install Arduino IDE

download.jpg

Install Arduino IDE for your computer.

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

Write the Program

Screenshot 2025-01-11 at 4.53.56 PM.png

Download the file below, or go to https://github.com/tejbho/ArduinoProjects/blob/main/3LightPotentiometer/3LightPotentiometer.ino

Test the Circuit

IMG_2463.jpg

Turn the knob on the potentiometer. The Serial Monitor should write the value of the potentiometer continuously. The red LED should turn on when the value is less than 3. The yellow LED will turn on if the value is between 3 and 4. The green LED will turn on if the value is greater than 4. Download the video below to see how it works.

Downloads