How to Wire a LED Light to a Switch

Wiring an LED to a switch allows you to turn it on or off at will.
••• green led image by Albert Lozano from

A diode is an electronic semiconductor device through which current can only flow in one direction. A light emitting diode (LED) is a device that lights up when current flows through it in the proper direction. While early LEDs were low intensity and only produced red light, modern LEDs are available that release light across the visible spectrum. Because of this, they can be used for many different purposes. In order to have control over when the LED is on, you should wire it to a switch.

    Note the rated amperage and voltage for the LED that you purchased.

    Calculate the value of resistor that you will need for your circuit using the formula: (source voltage - LED voltage drop) / LED current amps = ohms. For example, using a 12-volt power source with an LED rated at 3.1 volts and 20 milliamps results in a resistor value of 445 ohms. Purchase a resistor with a value close to this value, rounding up as little as possible.

    Solder your resistor to the positive wire of the LED; this is called the anode and is the longer of the two wires coming out of the LED.

    Ensure the switch is set to the "Off" position. Connect the other side of the resistor to one terminal of the switch with a piece of copper wire. Solder the wire to both the switch and the resistor.

    Solder a piece of copper wire between the other terminal of the switch and the positive side of the power supply; this side of the power supply will be marked with a "+" and will usually be the red terminal on a commercial power supply.

    Place a third piece of wire between the negative side of the LED and power supply; the negative side is called the cathode and will be the shorter of the two leads coming out of the LED. Solder the wire to the LED and the power supply.

    Flip the switch to the "On" position and ensure that the LED lights up properly.

    Things You'll Need

    • LED
    • Switch
    • Resistor
    • Copper wire
    • 12-volt power source
    • Soldering iron
    • Solder


    • Make sure you wire your LED with the anode and cathode in the proper positions or else the LED will not light up.


    • Always include the proper value resistor in your circuit. If the LED receives too much current it can explode, causing a safety hazard.

Related Articles

How to Use a 9-Volt Battery to Power LEDs
How to Check a Zener Diode
How to Wire LEDs for 12V
How Do I Control the Light Level of an LED?
How to Power a LED
How to Check LEDs
How to Power a Lightbulb Using a Potato
How to Test an SCR With an Ohmmeter
How to Make LEDs Brighter
How to Make a Simple Circuit
How to Wire a 5V LED to a 9V Battery
How to Wire Resistor Load in LED Lights
How to Build an LED Electric Counter
How to Make a Potato Lamp
How to Make a USB Powered LED Light String
How Do Fruit Batteries Power an LED Light?
How to Determine the Positive Side of an LED
How to Wire 50 LEDs Together
How to Use a 12V Diode to Prevent Backfeed
How to Convert Incandescent Watts to LED Watts