Feedback!

RGB LED Starduino

Views: 3923 Difficulty: 2 Status: Complete
Sun_kit

RGB Flashlight, wearable sound art, rainbow lamp.

The Starduino kit is a wavy sun-shaped PCB that lights up rainbow colors. Totally interactive, the star kit can respond to touch, light and sound varying its rainbow symphony in sync with its surroundings. Totally Hackable, we release the source code and design files below. The sun kit is written on top of arduino and can be re-programmed to suit your needs. Want your own sun kit? Check out the product page! This Arduino-clone can power more RGB lights, check out our RGB breakout board tutorial.

Rainbow Light From you Sun-shaped PCB

Screen_shot_2013-01-25_at_11.49.30_pm
RGB Rainbows from a DIY Smart light. Build it yourself! Use it as full-spectrum handheld photography lighting solution, or as a smart nightlight, or as a programable LED grow lamp, or just a fun flash light.

The Starduino in Action

Check out the various modes of the Starduino: sound sensitive, rainbow, and hue select.

FFW Soldering Video

Watch the soldering and assembly process in fast forward. In real time putting the sunkit together takes about 45 minutes. In this video you can watch it all go down in 1 minute and change.

Step-by-Step Instructions

Step 0 Get the RGB SunLight

Grab the RGB SunLight kit from the LucidTronix store. You will also need a soldering iron, some solder, wire cutters (diagonal cutting pliers), and regular (slip joint or needle nose) pliers.

Step 1 Prepare your smart Light's brain (bend the Atmega pins)

This step is optional, but may make it easier to insert the atmega168 into the PCB. Use a ruler, or a stapler or anything small, flat, and strong to bend the atmega's pins so that the two sets of legs are little closer together. In the picture I'm using a piece of plexiglass (stay lucid!).

Step 2 Insert the Atmega168 in the Correct Orientation

The atmega168 must be inserted so that pin 1 lines up with the pin labelled 1 on the sun-shaped PCB. Pin 1 on the atmega (like on all DIP packages) is the one directly to the left of the U-shaped depression. Make sure you have same orientation as shown in the picture.

Step 3 Insert the LM386 Audio Amplifier in the Correct Orientation

The LM386 is the smaller chip with 8 legs. You may want to bend its legs together before inserting, like you did with the Atmega168. Again be sure to line pin 1 on the LM386 with the silkscreen 1 on the PCB. Use the picture as a guide.

Step 4 Add the Crystal and the 2n3904 NPN Transistors

Now insert the 16MHz oval-shaped, silver, crystal oscillator. The orientation of the crystal does not matter. Also insert the 3 2n3904 NPN transistors. These are the black semi-circular silicon transistors which have 3 legs. The orientation of the transistors DOES matter. Insert them so that their semi-circular bodies follow the white silkscreened outline of their shape on the PCB.

Step 5 Insert the RGB LED

Now after soldering down the chips, transistors and crystal, you are ready to start inserting the RGB LEDs. Again orientation matters, you must insert the RGB LED so that its longest leg (the common cathode pin) is closer to the flat side of the silkscreen led shape on the PCB. Use the image as a guide.

Step 6 RGB LED Correctly Inserted

Make sure your LEDs are in the orientation shown in the picture.

Step 7 Insert All the RGB LEDs

Now insert all the RGB LEDs, with each one being careful to insert it in the correct orientation. Long leg one pin away from the flat edge of the LED outline.

Step 8 Insert the 10K and 10 ohm Resistors

Once you've soldered the LEDs down and chopped off their legs with your cutting pliers, you are ready to start putting in the resistors. First grab the 10K ohm resistors the ones whose color bands go brown-black-orange-gold. Insert them in each of the resistor placeholders labelled 10K. You should also have one 10 ohm resistor with color bands brown-black-black-gold. Insert this one in the slot labelled 10 near the LM386 chip.

Step 9 Insert the 300 ohm Resistors

The kit comes with fifteen 300 ohm resistors, these protect the RGB LEDs from too much current. Insert all 15 in the resistor slots labelled 300 on the opposite side of each of the RGB LEDs. Don't worry about the orientation the resistors are symmetric.

Step 10 Insert the Buttons

Now insert the two buttons. They go on two of the sun's flames that don't have LEDs on them.

Step 11 Insert Potentiometer

Now insert the potentiometer (the five legged knob) in its correct place on the sun PCB.

Step 12 Insert the Electret Microphone and the On/Off Switch

Almost Done! Now insert the Electret microphone. The ground pin on the Electret Mic is the pin connected to metal shield this pin should go in the pad labelled with a minus sign on the PCB. If the circle outline fits snugly around the mic then you did it right. Also put in the black three-legged on/off switch.

Step 13 USB Power

Lastly insert the USB connector if you want to power you SunLight from a USB cord otherwise you can attach a battery pack to the pins labelled 5V and GND. Power you're badboy up and get ready for Rainbows!

Simple Rainbow Code

This code controls RGB LEDs using pulse width modulation (PWM). It relies on our arduino color library so we can specify the colors in terms of hue. Showing a rainbow can be achieved by iterating over all hue values. This will take us from red to orange to yellow to green to blue to purple to magenta and back to red at the start of the next for loop.
/* LucidTronix Arduino HSB RGB Color library 
 * http://www.lucidtronix.com/tutorials/19
 * Control rgb color by specifying
 * Hue saturation and brightness.
 * This code shows a rainbow
 */

#include <color.h>
// these are the pins connected to
// the RGB LEDs.  They must be PWM capable
int leds[] = {5,6,9}; 
Color cur_color = Color(1,1,1);
float hue = 0;
void setup()  // run once, when the sketch starts                  
{
  for(int i = 0 ; i < 3; i++ ){
    pinMode(leds[i], OUTPUT); 
  }
}

void loop() // run over and over again                   
{
  display_color(cur_color);
  rainbow();
}

void rainbow(){
  hue += 0.06;
  if ( hue >=1 ) hue = 0;
  float sat = 1.0;
  float val = 0.4;
  cur_color.convert_hcl_to_rgb(hue,sat,val);
  display_color(cur_color);
  delay(20);
}

void display_color(Color c){
  analogWrite(leds[0], c.red);
  analogWrite(leds[1], c.green);
  analogWrite(leds[2], c.blue);
  delay(100);
}

Parts

Title Description # Cost Link Picture
RGB SunLight PCB Printed Circuit Board (PCB) for the RGB SunLight. Has proven through-hole footprints and eletrically tested traces. 1 $15.0 Link Screen_shot_2012-12-28_at_7.38.23_pm
ATMEGA168A-PU IC MCU AVR 16K FLASH 28PDIP Value: 16KB (8K x 16) 1.8 V ~ 5.5 V 1 $2.54 Link Screen_shot_2012-12-28_at_7.40.44_pm
Battery Holder Holds 3 AAA Batteries. Has on/off switch. Value: 4.6V 1 $1.95 Link Id727_med
RGB LED Clear Common Cathode Value: (800, 4000, 900)mcd 5 $1.95 Link Screen_shot_2012-12-28_at_7.36.00_pm
Electret Condenser Microphone MIC COND ANALOG OMNI -44DB Value: -44dB ±2dB 20Hz ~ 20kHz 1 $0.96 Link Screen_shot_2012-12-28_at_7.35.36_pm
LM386 IC AMP AUDIO PWR .325W MONO 8DIP Value: 4 V ~ 12 V 1 $0.93 Link 8-dip
Photocell Photo resistor Light sensor 16-33KOHM Value: 16 ~ 33 kOhms @ 10 lux 1 $0.8 Link Screen_shot_2012-12-28_at_7.35.43_pm
Potentiometer POT ROTARY, Linear 10K OHM 9MM SNAPIN Value: 10k 1 $0.76 Link Screen_shot_2012-12-28_at_7.41.04_pm
USB TYPE B R/A BLACK USB connector type B Right/Angle black inside. 1 $0.54 Link Usb-b1hsb6
Capacitor Ceramic Capacitors CAP CER 0.1UF 50V 20% RADIAL Value: 0.1µF 2 $0.24 Link Screen_shot_2012-12-28_at_7.39.17_pm
Transistors (BJT) - Single IC TRANS NPN SS GP 200MA TO-92 Value: 40V 300mV @ 5mA, 50mA 100 @ 10mA, 1V 3 $0.18 Link Screen_shot_2012-12-28_at_7.39.40_pm
Button 6mm Through Hole Tactile Switch Through Hole SPST-NO 0.05A 12V Value: 0.05A @ 12VDC 2 $0.1 Link Screen_shot_2012-12-28_at_7.41.40_pm
Resistor RES 300 OHM 1/4W 5% CARBON FILM Value: 300 15 $0.08 Link Screen_shot_2012-12-28_at_7.28.01_pm
Resistor RES 10K OHM 1/4W 5% CF MINI Value: 10k 5 $0.08 Link Screen_shot_2012-12-28_at_7.28.15_pm
Resistor RES 10 OHM 1/4W 5% CARBON FILM Value: 10 3 $0.08 Link Screen_shot_2012-12-28_at_7.27.43_pm
Permalink: http://lucidtronix.com/tutorials/3
Combine an electret microphone, Arduino and a heart matrix for a sound-sensitive wearable device....
Think of it like a shift register for Pulse Width Modulation (PWM)....
The heartduino is a heart-shaped arduino clone complete with onboard sensors and a 70 pixel LED matri...
Rainbow flower necklace using the TLC5940....
Two LED matrices give 70 LEDs to light up a necklace with messages....
Control a 120v outlet with a 5V arduino....
A QWERTY keyboard you build yourself....
Write messages on Liquid Crystal Displays with potentiometers or keyboards....