Go Down

Topic: The Radio Shack 7-Color LED and you (Read 5727 times) previous topic - next topic

brianicus

Noob here.  Picked up a "7-color LED" today and I couldn't find much info on it.  Radio shack doesn't have any info on it, and this is basically a compilation of search results.  I thought I'd leave it here for others to use as reference in the event they make the same purchase as I do.

Code: [Select]

/* Brief HOWTO on "7-Color LED"
Radio Shack part number 276-0016, mfg part number MSGBB557TA

Datasheet at http://www.alldatasheet.com/datasheet-pdf/pdf/184695/MICRO-ELECTRONICS/MSGBB557TA.html


LED looks like
        (   )
        / | -
        | |  |
        C +  -

Center straight positive pin needs 330 ohm resistor to +5 rail
Right-angled negative pin to negative rail
45-degree-angled control (C) pin to ground through button or digital11

The LED goes through a "boot up" sequence once it receives power.

COLOR SEQUENCING
1 press = red
2 press = off
3 press = green
4 press =  off
5 press = blue
6 press =  off
7 press = purple?
8 press =  off
9 press = light blue?
10 press =  off
11 press = orange?
12 press =  off
13 press = orange?
14 press =  off
15 press =  cycle thru all colors
16 press =  off again, next press will restart the sequence
*/


int ctrl =  11;  // control coonected to digital pin 11

void setup() {               
    pinMode(ctrl, OUTPUT);
}

void loop() {
    delay(3000); //let led boot up
    changeColors();
}

void changeColors() {  //each HIGH --> LOW cycle simulates a button press
    digitalWrite(ctrl, HIGH);
    delay(50); //simulate 50ms button press
    digitalWrite(ctrl, LOW);
    delay(10000);  //hold at 10 seconds per color
}



dexknows

/* Brief HOWTO on "7-Color LED"
Radio Shack part number 276-0016, mfg part number MSGBB557TA

Datasheet at http://www.alldatasheet.com/datasheet-pdf/pdf/184695/MICRO-ELECTRONICS/MSGBB557TA.html


LED looks like
        (   )
        / | -
        | |  |
        C +  -

Center straight positive pin needs 330 ohm resistor to +5 rail
Right-angled negative pin to negative rail
45-degree-angled control (C) pin to ground through button or digital11

The LED goes through a "boot up" sequence once it receives power.

COLOR SEQUENCING
1 press = red
2 press = off
3 press = green
4 press =  off
5 press = blue
6 press =  off
7 press = purple?
8 press =  off
9 press = light blue?
10 press =  off
11 press = orange?
12 press =  off
13 press = orange?
14 press =  off
15 press =  cycle thru all colors
16 press =  off again, next press will restart the sequence

To get the best performance with this LED, I did make some modifications to the circuit.  I found that sending 50ms of
5 volts doesn't always go to the next color. I also am using a 150 ohm resistor because it gives more current
and gives you better results if your using 5 volts as your main supply.  I added a 2N7000 N-Channel MOSFET to the
circuit to simulate a momentary switch.  MOSFETS will conduct Drain to Source just like a switch.  I'm using a 1000
ohm load resistor between pin 11 and the gate of the MOSFET.  I have another 1000 ohm resistor between the gate and the
source to discharge the gate of the MOSFET.  The Drain gets connected to the control pin.  The source gets connect to
ground.  This leaves the control pin floating and gives you the quickest change between modes.  The code
below has been modified for a longer boot up time.  It works flawless on bootup without the LED off and coming on for 50ms.
Of course If you are using 12 volts on the LED you want to use 330 ohm resistor instead which will give you about 36mA which
is close enough to specs on the LED. 


*/


int ctrl =  11;  // control coonected to digital pin 11

void setup() {               
    pinMode(ctrl, OUTPUT);
    digitalWrite(ctrl, HIGH);
    delay(13000); //let led boot up
    digitalWrite(ctrl, LOW);
    delay(50);
    }

void loop() {
   
    changeColors();
}

void changeColors() {  //each HIGH --> LOW cycle simulates a button press
    digitalWrite(ctrl, HIGH);
    delay(50);
    digitalWrite(ctrl, LOW);
    delay(50);
    digitalWrite(ctrl, HIGH);
    delay(50);
    digitalWrite(ctrl, LOW);
    delay(10000);  //hold at 10 seconds per color
}


Go Up