Grablo Help Grablo Help
  • User Manual
  • Tips
  • News
  • Go to
    • Grablo Home
    • Grablo App
  • 한국어
Grablo Help Grablo Help
문의하기
Grablo Help Grablo Help
  • User Manual
  • Tips
  • News
  • Go to
    • Grablo Home
    • Grablo App
  • 한국어
loading
  1. Home
  2. Tips
  3. Basics
  4. Calculating LED Resistor Values
Updated on August 11, 2025

Tips

  • Folder icon closed Folder open iconBasics
    • Bits and Bytes
    • Digital Input/Output
    • Digital/Analog Signals
    • Calculating LED Resistor Values
    • Pull-up/down Resistors
    • 3.3V ↔ 5V Conversion
    • Serial Communication (UART)
    • DC Motor, Servo Motor, Stepper Motor
    • Multi Thread
    • Relay
  • Folder icon closed Folder open iconHardware
    • Raspberry Pi
      • GPIO
      • Installing Operating System
      • How to Change 1-Wire Pin
      • How to Find I2C Device Addresses
      • Raspberry Pi vs Arduino
      • Serial (UART) Port
      • Using Desktop Environment with VNC
    • Beagle Bone
      • GPIO
      • Installing Operating System
    • Jetson Nano
      • GPIO
      • Installing Operating System
    • GPIO Expander
      • FT232H/FT2232H/FT4232H
      • MCP2221A
      • NUMATO USB-GPIO
  • Folder icon closed Folder open iconLinux
    • Linux Directory Structure
    • Configuring Linux Auto Login
    • Installing Linux on Windows (Virtual Machine)
    • Installing Linux on macOS (Virtual Machine)
    • Installing SSH Server
    • Finding Your Controller’s IP Address
    • Connecting via SSH
    • Transferring Files Between PC and Controller
    • Fixing “User is not in the sudoers file” Error
  • Folder icon closed Folder open iconAudio/Video
    • Fixing Audio Stuttering and Latency Issues
    • Playing Audio Through Bluetooth Speakers
    • Selecting Instruments from SoundFont Files
    • Fixing “Failed to create new vlc instance” Error
  • Folder icon closed Folder open iconDatabase
    • Setting Up Firebase Database
  • Folder icon closed Folder open iconIoT
    • Setting Up Google Cloud TTS/STT
    • Setting Up OpenAI TTS/STT
    • Setting Up ElevenLabs TTS
    • Setting Up Telegram Bot
    • Getting Data from WeatherAPI.com

Calculating LED Resistor Values

Estimated reading: 2 minutes 295 views

Why Resistors Are Needed

The reason for connecting a resistor when using an LED is to prevent the LED from burning out due to excessive current. The resistor can be connected to either the positive or negative terminal of the LED.

LED datasheets display voltage (forward voltage) and current (forward current) specifications. Below is an example of a red LED datasheet.

For the LED above, when 2V is applied, 20mA of current flows, and in this case, no separate resistor needs to be connected.

The following graph shows the relationship between LED voltage and current. In the case of Raspberry Pi, the GPIO output voltage is 3.3V, so if voltage is applied directly to a red LED without connecting a resistor, current far exceeding 20mA will flow, causing the LED to burn out. Therefore, when connecting an LED, if the supply voltage is greater than the LED’s forward voltage, a resistor must be connected to limit the current.

​https://www.electronics-tutorials.ws/wp-content/uploads/2018/05/diode-diode12.gif

​

If the LED datasheet is not available, you can find the voltage and current in the table below.

​https://opentutorials.org/module/779/7087

​

Resistor Value Selection

Ohm’s law is used to calculate the resistor value.

  • Ohm’s Law: V(voltage) = I(current) X R(resistance)


Using a red LED as an example, with a forward voltage of 2V and forward current of 20mA:

  • R(resistance) = (3.3V(supply voltage) – 2V(forward voltage)) / 0.02A (current) = 65 Ω


According to the calculation, a 65Ω resistor is needed. However, one more factor to consider is the maximum output current of the GPIO pin of the hardware being used. For example, the maximum current output of Raspberry Pi GPIO pins is approximately 8mA, and the total current sum of all output pins should not exceed 50mA. Therefore, to use an LED with Raspberry Pi, recalculating with a current of 5mA:

  • R(resistance) = (3.3V(supply voltage) – 2V(LED voltage)) / 0.005A (current) = 260 Ω


Therefore, you can use a commonly available 220-ohm resistor, which is similar to the calculated result. The current at this time is approximately 5.9mA, making it safe to use. Since the current flowing is less than the rated current of 20mA, it will be relatively dimmer, but generally provides an acceptable level of brightness.

​The approximate resistor values by color calculated using the above formula are as follows (based on Raspberry Pi):

Color Resistance
Red 220Ω
Yellow 180Ω
Green 220Ω
White 100Ω

​

찾으시는 내용이 없나요? 문의하기

문의하기

공유하기

Calculating LED Resistor Values

Or copy link

Clipboard Icon
콘탠츠

ㅤ

Grablo Inc.
support@grablo.co

Site Links

  • Grablo Home
  • Grablo App

이 사이트의 모든 컨텐츠는 저작권법에 보호받는 저작물로서, 무단으로 복제, 배포하는 경우에는 저작권법에 의하여 처벌을 받을 수 있습니다. Copyright 2024 grablo.co. All Rights Reserved.