Posts Tagged ‘leds’

LED Organ [simple analog electronics project]

Friday, February 24th, 2012

Recently I’ve gotten interested in playing around with, and learning about analog electronics. This is an outgrowth of my existing passion for physical computing prototyping using the Arduino platform. So I did some research on the Make:Project website and found a few simple projects to kick-off my exploration.

For a long time I’ve had a passion for both music and lights, so I decided to start out my exploration of analog circuits with a simple LED organ project that provides me with a new way to link these phenomena. The project that served as my inspiration is called Wearable LED Organ, though my version was just built on a regular breadboard and is therefore not really wearable. Here is a short video of my breadboard prototype, please ignore the Arduino in the background because it is not connected to the circuit.

Now that I have this project under my belt, I want to take it to the next level. My plan is to create two new versions of this project: (1) I want to create a smaller version of this project that goes towards the wearable side of things, but that is more wearable than the original project featured on the Make site; (2) I want to also create a larger version of this project that incorporates band pass filters so that I can have different sets of leds responding to different frequencies.

Here is a video of a project, also from the Make site, that does something similar to what I have in mind for the large LED Organ. Another thing that I like about this video tutorial is that Collin Cuningham is about as fanatically organized with his soldered breadboard as I am. I just love it. Go Collin!


HSB to RGB [arduino library]

Sunday, August 28th, 2011

The first version of the firmware that I created for Bright Words only supported changing the color of the lights by controlling the RGB values – red, green, and blue. From a coding perspective this is an easy approach since it is consistent with the physical set-up of the device (the red, green and blue lights are each controlled individually).

Unfortunately, this is not a very intuitive way to cycle through colors. The HSB color model (hue, saturation, and brightness) provides a much more natural approach.

Intuitive Control
By supporting direct control of the hue, users are able to cycle through all colors that are of the same saturation and brightness. Users can use the saturation setting to select the appropriate tint of a color. Tints are essentially mixtures of a color with white. The brightness setting enables users to select the appropriate shade of a color. Shades are mixtures of a color with black.

Higher saturation and brightness levels resolve to stronger colors. A color with no saturation will be achromatic, or in other words, it will have no color. Such a color will range between white, grey and black. A color with no brightness will always resolve to black.

The Code
After deciding to take this route I searched online to find existing code samples that I could use to guide my own work. I found a few examples that were written for the Arduino, though in the end I decided to create my own code from scratch so that it would be structured in my own way. I’ve formatted my code into a simple library that you can download from the github repository.

Here is a brief overview of how to use this simple library. It features two methods that do the exact same thing, they just take different input parameters. Both of them accept 4 different parameters: hue, saturation, and brightness values, and a pointer to an integer array that can hold at least 3 elements (the r, g, and b values).

The difference is that method HSBtoRGB accepts hue integer values ranging from 0 to 360, and saturation and brightness integer values ranging from 0 to 100. The method HSBtoRGBfloat accepts hue, saturation and brightness float values ranging from 0 to 1.

Resource Links