LED Light (Addressable) Operation + Arduino

From ESE205 Wiki
Revision as of 20:47, 2 May 2017 by Liz halter (talk | contribs)
Jump to navigation Jump to search

Know Your LEDs

This is a tutorial for Addressable LED Strips that operate off of the Adafruit NeoPixel Library. Check your LEDs' data sheet and product info for what library your LEDs operate on. If your LEDs operate on one single digital pin, it is likely that they will operate on the NeoPixel Library. If they require a clock line, they do not operate on the NeoPixel library.


The Basics of Your LEDs

Your LEDs are addressable. This means that you can tell each pixel what color to be. And, further, you can hand each pixel an RGB value, meaning you can set any pixel to any color. This gives you a lot of freedom, but it can be quite daunting. Have no fear! Your LEDs are very easy to control. The NeoPixel library comes with a ready-to-go demo that you can push right to your Arduino to make your lights operate.

Wiring your LEDs

Your LEDs are likely cut-able, meaning you can cut them to however small your project requires. This cutting does not impact your coding at all! The closest LED pixel to the Arduino on a strip is always considered the first pixel.

Your LEDs are likely directional, meaning the wires must be soldered to a specific and of your length of LEDs. Once you cut to your desired length, locate the direction of the arrows on the LEDs strip. You want these arrows to point away from the 3 wires you're going to solder on.

Once you've cut the LEDs to length and have located where you need to solder, solder your 3 wires on (Ground (GND), Signal (DO, or "Digital Out"), and Power ("5V")) using this wonderful student tutorial.

Then, connect the Signal, Ground, and Power to the appropriate places:

  • Signal goes to the pin on your Arduino
  • Ground goes to the black port on your power supply
  • Power goes to the red port on your power supply

For information on how to use power supplies, see this tutorial.

You are now ready to play around with your LEDs!

Getting the Library

The Adafruit NeoPixel Library is a library of code needed to operate your lights. It is open sourced and you can download it here.

For instructions on how to set up the library, look here.

Using the Library