Learn to Solder: USB LED


[Updated 10/2024 to make it easier for students]
This is a learn to solder project by making a USB LED. This approach is inexpensive and designed for a more free-form soldering experience for robot building etc. as opposed to through-hole soldering kits (which are great). The result is a fun LED light that can be powered from any USB source - wall adapter or battery.
This is also a very low cost project - about $1.50 in parts.
Supplies


Parts Needed:
- Wire: I used 22 AWG stranded wire. Either regular, or silicone are fine. Silicone is more flexible, and the jacket will not melt when soldering. You will need 5" of red and 5" of black per project.
- LED: 5mm LEDs are more impressive than the 3mm ones. You can even get them that flicker!
- Resistor: 180 ohms for some and 120 ohms for others - see comments in the next step
- Heat Shrink Tubing: 4mm or 3mm seems fine - will need (3) 1" pieces per project
- USB Connector - the plastic casing ones are easier to use and less prone to shorting out.
LEDs and Resistors











.jpg)




LEDs are a special kind of diode that convert electron movement into light. In a water-as-electricity analogy, a diode can be thought of as a valve. Once it is supplied with its required forward voltage (typically 2-3 volts), It will allow a lot of current to flow in one direction but not the reverse. The issue is that it will allow too much current and burn out, so a resistor is added to the circuit to slow down the current.
A resistor in the water analogy is like pinching a hose. It limits the amount current that can flow through it, and the pressure (voltage) before it is higher than than after it. Unlike an open ended hose, an electrical circuit is more like a loop of hose with a pump in the loop (like a battery), so squeezing the hose (adding a resistor) will limit the current in the whole circuit.
So, we almost always use a current limiting resistor with an LED. The LED can't control the current by itself, so the resistor helps out since it's very good at that.
An LED has Polarity - the positive and ground sides are important since current will only flow one way through them. The Anode is the positive side and has a longer wire from the LED. There is sometimes a flat side on the LED plastic cover - that is the Cathode (- or Ground) side, and should also be same side as the shorter wire. If you are not sure, you can use a resistor and battery to test it. LEDs will not burn out if hooked up in reverse.
Resistors do not have polarity, so you can hook them up in either direction.
Here are a simple and longer comic style guide to soldering
- https://mightyohm.com/files/soldercomic/FullSolderComic_EN.pdf
- https://cornfieldelectronics.com/cfe/mfaire/soldercomic/soldercomic.pdf
Basically:
- Iron in: Heat all the wires at once with the soldering iron for about a second
- Solder In: Touch the solder to the connection
- Solder Out: Pull the solder away
- Iron Out: Pull the soldering iron away
For this step, you will need a 5" piece of red wire (for +5V), and a 5" piece of black wire (for Gnd). 22 gauge wire is fine. 24 or 26 AWG would be good too. Silicone wire is more flexible, and the jacket will not melt while soldering.
You will also need an LED, a corresponding resistor (see below), and two pieces of heat shrink tubing - 1" & 2".
You will also need three 1" pieces of heat shrink tubing.
The resistor is different for each LED color since they are made with different semiconductor compounds and have different forward voltage drops. One of the many calculators is here: http://ledcalc.com USB voltage is 5V. Roughly, you can use a 180 ohm resistor for red, yellow, and green LEDs, and a 120 ohm resistor for blue and white LEDs. There are more links below with more detail.
Steps:
- Cut the red wire in half. so you will have two 2.5" red wires, and one 5" black wire.
- Strip the ends of all the wires about 1/4".
- Twist the red wires on each end of the resistor. Try not to twist the resistor wire itself. Slide the wires down close to the resistor. This may be easier if you twist and solder one wire at a time.
- Solder the two red wires to the resistor
- Cut off the extra resistor leads and straighten this assembly out.
- Twist the red wire to the anode (+) of the LED - the longer lead. Leave the wire at the bottom of the lead - LEDs are more heat sensitive than resistors. Solder the red wire.
- Repeat for the black wire on the LED cathode (-) - the shorter LED wire
- Slide the heat shrink pieces down and use a heat gun to melt them. Don't heat them too much since you can unsolder the connection or burn the components. Two pieces are for the LED leads, and one is for the resistor.
Wires and USB Connectors



For this step, you will need the USB Type A connector.
The power connections on the USB plug are on the outside two pins. The two inner ones are for data. The picture shows which one is for the +5 (red) and Gnd (black). A reference can be found here. I used a red and black marker to note which is which for reference.
Soldering can be tricky since you kind of need four hands. You can use a "third hand" alligator clip stand to hold them together, or Tin them. Tinning means you add solder to each piece separately, then just touch them and heat with a soldering iron. Tinning is essential for this step mostly since the USB plastic melts fast, so you need to solder quickly.
Steps:
- Trim the wires so they are the same length.
- Strip a small amount (~1/8") off the end of each wire, and tin the wires and USB jack. Then you can easily solder the wires onto the jack.
- The USB jack cover snaps on. One side has two bumps that match two holes on the jack, so be sure to line those up first.
Notes and Resources





A couple alternate builds:
The first is very similar with an all-metal USB plug. That was a bit trickier to assemble and had tabs that had to be bent over and crimped on the wires with some needle nosed piers. It is also more likely to short out if any LED wires are sticking out.
The second used a 2.1mm CCTV jack and the wires were screwed on. Then, a USB to 2.1mm cable is used to connect to the battery. There are also USB A terminals - they just cost more.
Note that some USB batteries will shut off automatically after a few seconds when they think not enough power is being used, and I had that happen with one battery I used for this project.
You can use multiple LEDs in parallel, and each should have it's own resistor with the 5V supply in this circuit.
A picture set of steps is attached.
Here are some useful links with more information:
https://en.wikipedia.org/wiki/LED_circuit
https://learn.adafruit.com/all-about-leds/forward-voltage-and-kvl
https://www.circuitbread.com/ee-faq/the-forward-voltages-of-different-leds
https://learn.sparkfun.com/tutorials/light-emitting-diodes-leds/all
http://lednique.com/current-voltage-relationships/iv-curves/
https://www.waveformlighting.com/pcb-designs/led-strip-light-schematic-and-voltage-information