Introduction to LEDs 1

LEDs are awesome. Arduinos are awesome. Programming gives you the power to make LEDs and Arduinos do exactly what you want them to do. Programming, then, makes you more than awesome! Today, I’m going to show you how to wire up our 64-LED strings to an Arduino.

LED wiring 2

What you’ll need:

Warning:

  • Never connect wires while the wires are plugged in!
  • Never mess with the circuit while it’s on!

I cut the PC-end off of a PC power supply cable. There are three wires inside: white, green, and black. As shown below, I’ve connected them to the power supply in a specific way. White wire goes to neutral (N), green wire goes to ground, and the black wire goes to live (L).

Then, I attach a red wire from the LEDs to V+ and a white wire to V- on the power supply.

Some of you might have a cable with the colours brown, blue, and yellow, or brown, blue, and green instead of the aforementioned colours; in this case, brown is live (L), green or yellow is ground, and blue is neutral (N).

LED Wiring 1

click for a larger image.

I plug the JST connector into the LEDs. The green wire on the LED goes through the JST connector and into pin 6 on the Arduino (A). The white wire goes into pin GND on the Arduino. One extra wire is run from pin GND to the V- on the power supply, as shown (B).

A good practice would be to add a small resistor between pin 6 and the LEDs and another one between V+ and the LEDs. This will prevent a power spike when the system is initially turned on from damaging the first LED. It won’t happen all the time, but it’s better to be safe than sorry. I’ve left it out for silly reasons.

Next, I fit the LEDs into a grid of holes I’ve laser cutted into some cardboard. In a normal TV, the pixels go left to right and top to bottom. When I’m flipping these lights back over the top-right and bottom-left hand corners, they’ll switch places, creating an S-shaped pattern.

Next

Next time I’ll cover how to install the Arduino LED library and run the sketches. We’ll learn about about how computers do what they do, what that means to us, and get our first lights working.

Special thanks to Inez Gowsell for helping improve this post