Light Projects

A collection LED control examples for Arduino

Low-voltage DC Lamps
LED Strip Control
Addressable LEDs
Fading
Color Spaces
Inventory

This project is maintained by tigoe

Light Projects

A collection of lighting projects controlled by microcontrollers.

Low-voltage DC Lamps

Low-voltage LED Lamps are easy to control from a microcontroller when you know what properties you need to be aware of. In fact, there are so many low-voltage sources on the market now that you can manage most indoor lighting needs without needing to control high-voltage AC sources.

This list pf parts is not comprehensive, it’s just a list of some of the parts I’ve used in building this repository.

You may find it useful to combine the examples in this repository with some of my Arduino general examples or Sensor examples to add interactive conntrol over your light projects.

LED Strip Control

Single-channel and multi-channel LED strips are very popular these days, and pretty easy to control with a microcontroller and a few transistors. You can find LED strips in a variety of combinations:

Addressable LED Control

There are a number of addressable LED components on the market now, and they come in a variety of form factors. Covered here are a couple of the most popular, the WS28xx/SK68xx LEDs, and the APA102C LEDs. Adafruit calls their products that use these LEDs NeoPixels and DotStars, respectively. SparkFun calls their APA102C line Lumenati. Whatever you call them, they’re relatively easy to use, and there are many good tools for controlling them. Addressable strips can be found in the many of the same variations as non-addressable strips, including RGB, RGBW, RGBAW, and WWA.

The examples below are written mostly using Adafruit’s NeoPixel and DotStar libraries. Since they have mostly the same API, you can convert any of the sketches from one protocol to the other with minimal changes.

Examples:

Fading

The relationship between perceived brightness and the power controlling a light source is non-linear. In otherwise, if you fade an LED source in a straight line, it won’t appear to you to be fading evenly in time. Depending on the effect you’re looking for, you might want a light source to start fading slowly and then speed up, or slow down at the end of its fade. It helps to have methods for a few different fade curves available.

Examples

Color and Color Temperature Fading

Whether you’re working with tunable white lighting sources or color sources, it’s useful to understand a few things about Color Spaces and Color Temperature in order to get the most our of your sources.

Color Space Examples

Examples:

I’ve also written a ColorConverter library that converts RGB and RGBW values to hue, saturation, and intensity (HSI values); and converts HSI values to RGB.

Examples:

Tunable White (Color Temperature) Examples

The examples below use the ColorConverter library to control a WWA strip by calculating relative mix of warm, cool, and amber as hue. Intensity can then be controlled independently of color temperature. Examples: