กลับไปหน้ารวมไฟล์
working-with-a-potentiometer-and-an-led-32dd9d-en.md

Abstract

  • This project demonstrates working with a potentiometer.

Also visit here.

Objective

  • To control the brightness of a LED using potentiometer.
Working with a Potentiometer

Introduction to Analog Control

While digital components can only be "ON" or "OFF," analog components like the Potentiometer allow for a spectrum of control. This project explores how to use a rotary potentiometer to adjust the brightness of an LED, bridging the gap between physical rotation and electrical intensity. It is a fundamental lesson in Pulse Width Modulation (PWM) and Analog-to-Digital Conversion (ADC).

Hardware Infrastructure

  • Arduino UNO: Functions as the primary hub, reading the variable voltage from the potentiometer and translating it into a brightness level for the LED.
  • Potentiometer (10k Ohm): This is a variable resistor that provides a smooth voltage range between 0V and 5V as you turn its knob.
  • LED and 1k Ohm Resistor: The optical output. The resistor ensures the LED operates safely within its current limits.
  • Breadboard and Jumper Wires: For creating a solderless, organized circuit path.

Technological Logic and Signal Path

The brightness control follows a specific multi-step logical path:

  1. Analog Sensing: The Arduino reads the position of the potentiometer knob using an Analog pin (like A0). This gives a digital value between 0 (fully counter-clockwise) and 1023 (fully clockwise).
  2. Value Remapping: Because the LED's brightness is controlled by PWM (which works on a scale of 0 to 255), the Arduino uses the map() function to gracefully scale the 0-1023 sensor reading down to a 0-255 output value.
  3. PWM Output (Dimming): Instead of sending a constant voltage, the Arduino uses Pulse Width Modulation. It switches the LED pin on and off extremely fast; the longer the "on" period, the brighter the LED appears to the human eye.
  4. Execution: By updating the analogWrite() command in the loop() function, the LED responds instantly to any turn of the potentiometer knob.

Practical Learning and Next Steps

Building this dimmer switch teaches you how microcontrollers handle "real-world" analog data. This same logic is used in volume knobs, speed controllers for motors, and adjusting the frequency of sound. Once mastered, you can apply this to control more powerful DC motors or even the color balance of an RGB LED.

ข้อมูล Frontmatter ดั้งเดิม

title: "Working with a Potentiometer and an LED"
description: "Use of a potentiometer to control brightness of an LED."
author: "SBR"
category: ""
tags:
  - "starter"
  - "beginner"
views: 50598
likes: 8
price: 299
difficulty: "Easy"
components:
  - "1x Breadboard (generic)"
  - "1x LED (generic)"
  - "1x Single Turn Potentiometer- 10k ohms"
  - "1x Resistor 1k ohm"
  - "1x Jumper wires (generic)"
  - "1x Arduino UNO"
tools: []
apps:
  - "1x Arduino IDE"
downloadableFiles: []
documentationLinks: []
passwordHash: "fc232c82c785be7854a4c8b294a7d6bdde784e3448b7d962ec06b9c73e2a3955"
encryptedPayload: "U2FsdGVkX1+zvvMs3S+/RvJ1M94rwqRdUH6rxgiAjS8ZxTjD6X2sK250oHJfQRm/d3XN75XgKRrh+roGcFerrQ=="
seoDescription: "Learn how to control LED brightness using a Potentiometer with Arduino. Simple step-by-step guide for beginners."
videoLinks:
  - "https://www.youtube.com/embed/jzSYn3A_l_M"
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/working-with-a-potentiometer-and-an-led-32dd9d_cover.jpg"
lang: "en"