Practical case: Choosing the right capacitor for an LED

Schematic — Practical case: Choosing the right capacitor for an LED

Objective and use case

What you will build: A small RC circuit where an LED turns on smoothly (fade in) when a push button is pressed, using an electrolytic capacitor to define the turn‑on time. You will see how the rise time depends on the value of C and the resistor.

What it is used for

  • Gently lighting an indicator LED when powering up a DIY device (for example, a DIY power supply or a homemade charger).
  • Simulating the progressive turn‑on of a courtesy light in a model, diorama, or miniature control panel.
  • Testing and comparing the effect of different capacitor values (for example, 10 µF vs 100 µF) on the LED’s turn‑on time.
  • Experimenting with combinations of R and C to create visual effects such as slow blinking or “breathing” light activated manually.

Expected result

  • The LED takes approximately between 1 and 3 seconds to reach its maximum brightness, depending on the value of the capacitor (for example, 47 µF versus 100 µF).
  • The voltage on the capacitor VC rises smoothly from 0 V to almost the supply voltage (for example, from 0 V to 5 V) when pressed.
  • The LED current ILED remains limited by the series resistor, typically between 10 and 20 mA, depending on the selected value.
  • By increasing the value of the capacitor, you can see a clearly slower turn‑on (for example, doubling C almost doubles the time to reach maximum brightness).

Target audience: People with basic electronics knowledge (ohms, volts, LED, resistors); Level: beginner–intermediate.

Architecture/flow: Push button connects the supply to the RC circuit (resistor + electrolytic capacitor); the capacitor charges following an exponential curve, progressively raising the voltage at the LED; the series resistor limits ILED; when releasing or discharging the capacitor, the LED turns off, and the turn‑on time is controlled by varying the value of C and/or the resistor.

Materials

  • 1 × 5 V DC power supply (can be a USB module, a power bank, or a regulated supply).
  • 1 × Breadboard.
  • 1 × LED (standard 5 mm red or green).
  • 1 × R_LED resistor, 330 Ω (LED current‑limiting resistor).
  • 1 × R_C resistor, 100 kΩ (capacitor charging control).
  • 1 × Electrolytic capacitor C1, 100 µF / 16 V or higher.
  • 1 × Normally open push button (simple push button).
  • 4–6 × Male–male jumper wires.
  • 1 × Digital multimeter (to measure voltages and, if possible, current).

Wiring guide

Assume we are working with a 5 V supply and ground (GND):

  • Connect the positive terminal of the 5 V supply to a power rail on the breadboard; label it +5 V.
  • Connect the negative terminal of the supply to the ground rail on the breadboard; label it GND.
  • Connect one end of the R_C (100 kΩ) resistor to +5 V.
  • Connect the other end of R_C to the VA node (this will be the node where the capacitor is charged).
  • Connect the positive terminal of capacitor C1 (100 µF) to the VA node.
  • Connect the negative terminal of capacitor C1 to GND.
  • Connect one end of resistor R_LED (330 Ω) to the VA node.
  • Connect the other end of R_LED to the anode of LED D1 (long lead).
  • Connect the cathode of LED D1 (short lead) to GND.
  • Connect one end of the push button to GND.
  • Connect the other end of the push button to the VA node (so that when pressed, the capacitor is quickly discharged to ground).

Schematic

           +5V
           |
         [R_C] 100kΩ
           |
        VA node o-------------------------[R_LED] 330Ω----------[D1] LED---------GND
           |                                   |
          [C1] 100µF                            |
           |                                    |
          GND                                  (serie hacia GND)

                                   Pulsador (descarga C1)
                          GND o----[PushButton]----o VA node
Schematic (ASCII)

Measurements and tests

  • Basic circuit verification:

    • Connect the 5 V supply and observe that, at first, the LED is off or very dim.
    • Press and release the push button: the LED should turn off almost instantly and then turn on gradually.
    • Repeat the operation several times until you verify that the behavior is stable.
  • Measurement of capacitor voltage (V_C):

    • What V_C is: V_C is the voltage between the positive terminal of capacitor C1 (VA node) and its negative terminal (GND).
    • Place the black probe of the multimeter (COM) on GND.
    • Place the red probe on the VA node (positive terminal of C1).
    • Set the multimeter to DC voltage measurement (20 V range or similar).
    • Press and release the push button: observe how V_C rises from near 0 V to a value close to 5 V in 1–3 seconds.
  • Measurement of LED voltage (V_LED):

    • What V_LED is: V_LED is the voltage between the anode and the cathode of LED D1.
    • Place the black probe of the multimeter on the LED cathode (side connected to GND).
    • Place the red probe on the LED anode (side connected to R_LED).
    • Observe how V_LED increases as the capacitor charges; for a typical red LED it stabilizes around 1.8–2.2 V.
  • Measurement of LED current (I_LED):

    • What I_LED is: I_LED is the current flowing through the LED from anode to cathode.
    • To measure it in series, disconnect one end of R_LED (for example, the end going to the LED).
    • Set the multimeter to DC current measurement (mA range) and connect it in series:
      • Red probe of the multimeter to the free end of R_LED.
      • Black probe of the multimeter to the LED anode.
    • Power again and repeat the push‑button test: observe how I_LED rises progressively to a value close to the calculated one (for example, about 10–15 mA, depending on the actual components).
  • Capacitor change test (influence of C1 value):

    • Replace C1 = 100 µF with another of 47 µF (if you have one).
    • Repeat the V_C measurement sequence and LED observation: verify that the LED turns on faster (shorter rise time).
    • If you can, try a 220 µF capacitor and observe the opposite effect: much slower turn‑on.

Common errors and how to avoid them

  • Reversed polarity of the electrolytic capacitor:

    • The negative terminal is usually marked with a stripe and must always go to GND.
    • If you connect it the wrong way round, the capacitor may be damaged or, in the worst case, may even explode.
  • LED connected backwards:

    • The anode (long lead) goes to resistor R_LED, which comes from the VA node.
    • The cathode (short lead, sometimes with a flat on the case) goes to GND.
    • If it never lights up, check this orientation.
  • Forgetting the LED current‑limiting resistor (R_LED):

    • Without R_LED, the LED may receive too much current and burn out.
    • Never connect an LED directly between +5 V and GND without a resistor.
  • Push button wired incorrectly:

    • Make sure one side of the push button goes to GND and the other to the VA node.
    • If the LED never turns off quickly when pressed, the push button may not be discharging the capacitor.

How to choose the right capacitor for your LED

  • Time–capacitance relationship (basic intuition):

    • The typical charging time depends on the product R_C × C1 (called the time constant τ).
    • The larger C1 is (keeping R_C), the slower the LED will turn on.
    • As a very rough guide:
      • 47 µF → fast turn‑on (less than 1 s).
      • 100 µF → smooth turn‑on (~1–2 s).
      • 220 µF → very smooth turn‑on (several seconds).
  • Working voltage of the capacitor:

    • For a 5 V supply, choose an electrolytic capacitor of ≥ 10 V (16 V is very common and safe).
    • Never use a capacitor with a rated voltage lower than the supply voltage.
  • Type of capacitor:

    • For visual effects and times of seconds, the electrolytic type is practical (large values in µF with reasonable size).
    • If you wanted very short times (milliseconds), you could use ceramic or polyester capacitors with lower values (nF, small µF).

Possible improvements and extensions

  • Soft turn‑off control:

    • Add another resistor and a second push button to discharge the capacitor in a controlled way, producing not only soft turn‑on but also soft turn‑off.
  • Use with a microcontroller:

    • Bring the VA node to an analog input of a microcontroller (e.g. Arduino) to measure the capacitor charging shape and visualize the curve over time.
  • Multiple LEDs:

    • Connect several LEDs in parallel (each with its own current‑limiting resistor) from the VA node to GND; they will all share the same “fade in” controlled by C1.

With this setup you not only understand how to select and size a capacitor to control the turn‑on time of an LED, but you can also experiment by changing values and directly observing the effect in practice.

More Practical Cases at Prometeo.blog

Find this product and/or books on this topic on Amazon

Go to Amazon

As an Amazon affiliate, I earn from qualifying purchases. If you buy through this link, you help keep this project going.

Quick quiz

Question 1: What is the main function of the electrolytic capacitor in the described circuit?




Question 2: What observable effect is expected when pressing the push button in the RC circuit with LED?




Question 3: How does increasing the capacitor value affect the LED’s behavior?




Question 4: According to the article, one purpose of this setup is:




Question 5: The voltage on the capacitor VC, when pressing the push button, is expected to:




Question 6: What relationship is mentioned between the capacitor value and the time to reach maximum brightness?




Question 7: Which of the following applications is mentioned for this RC circuit with LED?




Question 8: What is intended by testing different capacitor values, for example 10 µF versus 100 µF?




Question 9: What combination of components allows you to create effects such as slow blinking or breathing light activated manually?




Question 10: In the expected result of the experiment, the typical time for the LED to reach its maximum brightness is:




More Practical Cases on Prometeo.blog

Carlos Núñez Zorrilla
Carlos Núñez Zorrilla
Electronics & Computer Engineer

Telecommunications Electronics Engineer and Computer Engineer (official degrees in Spain).

Follow me:
Scroll to Top