...

LEDs


IR Detectors:

The IR detector marked "380A" has the pinout NJL61H380 (data | GND | Vcc). This reads signals from the Sony remote.

Sample Arduino Code to dump the signals being received:

#define IR_BIT_LENGTH 12    // number of bits sent by IR remote
#define BIT_1 1000          // Binary 1 threshold (Microseconds)
#define BIT_0 400           // Binary 0 threshold (Microseconds)
#define BIT_START 2000      // Start bit threshold (Microseconds)
#define IR_PIN 7            // Sensor pin 1 wired through a 220 ohm resistor


void setup() {
  pinMode(IR_PIN, INPUT);
  Serial.begin(9600);
}

void loop() {
  int key = get_ir_key();
  do_response(key);
  delay(150); // short delay to cancel duplicate keypresses
}

// wait for a keypress from the IR remote, and return theinteger mapping of that key 
int get_ir_key() {
  int pulse[IR_BIT_LENGTH];
  int bits[IR_BIT_LENGTH];  
  do {} //Wait for a start bit
  while(pulseIn(IR_PIN, LOW) < BIT_START);
  read_pulse(pulse, IR_BIT_LENGTH);
  pulse_to_bits(pulse, bits, IR_BIT_LENGTH);
  return bits_to_int(bits, IR_BIT_LENGTH);
}

// respond to specific remote-control keys with different behaviors
void do_response(int key) {  
  switch (key) {
    case 3451:  // left scroll
      Serial.println("toggle left scroll");
      break;
    case 3452:  // right scroll
      Serial.println("toggle right scroll");
      break;
    case 3339:  // ok button
      Serial.println("toggle ok key");
      break;
    default:
      Serial.print("Key ");
      Serial.print(key);
      Serial.println(" not programmed");
      break;
  }
}

// use pulseIn to receive IR pulses from the remote.
// record the length of these pulses (in ms) in an array
void read_pulse(int pulse[], int num_bits) {
    for (int i = 0; i < num_bits; i++)
        pulse[i] = pulseIn(IR_PIN, LOW);
}

/*
  IR pulses encode binary "0" as a short pulse, and binary "1"
  as a long pulse.  Given an array containing pulse lengths,
  convert this to an array containing binary values
*/
void pulse_to_bits(int pulse[], int bits[], int num_bits) {
  Serial.println("-----");
  for(int i = 0; i < num_bits ; i++) {
    Serial.println(pulse[i]);
    if(pulse[i] > BIT_1) //is it a 1?
      bits[i] = 1;
    else if(pulse[i] > BIT_0) //is it a 0?
      bits[i] = 0;
    else//data is invalid...
      Serial.println("Error");
  }
}

// convert an array of binary values to a single base-10 integer
int bits_to_int(int bits[], int num_bits) {
  int result = 0;
  int seed = 1;
  for(int i = 0 ; i < num_bits ; i++) {       
    if(bits[i] == 1)
        result += seed;
    seed *= 2;
  }
  return result;
}

Radio Shack IR Emitter Detector pair (276-0142:

const int signalPin = 4;
void setup() {
  Serial.begin(9600);
  Serial.println("started...");
}
void loop() {
  Serial.println(digitalRead(signalPin));
  // prints 0 when uninterrupted, prints 1 when beam is broken.
  delay(500);
}

QRB1134 Phototransistor Reflective Object Sensors:

The QRB1133/1134 consists of an infrared emitting diode and an NPN silicon phototransistor mounted side by side on a converging optical axis in a black plastic housing. The phototransistor responds to radiation from the emitting diode only when a reflective object passes within its field of view. The area of the optimum response approximates a circle .200” in diameter.

       E                   S

Anode    cathode   emitter   collector
orange    green      blue      white

See these code listings for examples on how to interface with Arduinos.

Keyes IR Infrared Sensor Switch Module

  • Working range: 2~40cm
  • Voltage: 3~6V

Got this from DX.com


LPD8806 RGB LED Strip:

  • LPD8806 - 5V RGB LED lighting (7 Sections x 1-5/8" Piece = 11.375" Length = 14 Total LEDS)
  • Each Section = 1 x LPD8806 IC + 2 RGB LED Per Section (Total = 14 LEDs + 7 LPD8806 each section)
  • 14mm White Flexible PCB - NON-Waterproof. PLCC-6 (SMD5050) RGB LED.
  • Every Single LED is individually Addressable/Controlled via 1.2MHz Built in PWM on each Channel.Each LPD8086 integrated circuit contains 2 x PWM Channels
  • Each Pair Controlled by LPD8806 IC for 21 bits of color (red, green, and blue - or ANY Color Combo)
  • LPD8806 Integrated Chips Are FAR SUPERIOR to WS2801 IC Control Chips?
  • Do NOT exceed 5.5VDC on the power connectors. 2 Feet can easily be powered by 5V at about 500mA.
  • Strips are cuttable at every 2 LEDs (1 LPD8806 IC, 2 LEDs per segment)
  • needs 4 wire connector
    • Black=Ground
    • Red=5V DC
    • Yellow=Clock
    • Green=Data
  • LPD8806 - 5V RGB LED lighting (7 Sections x 1-5/8" Piece = 11.375" Length = 14 Total LEDS)
  • Each Section = 1 x LPD8806 IC + 2 RGB LED Per Section (Total = 14 LEDs + 7 LPD8806 each section)
  • 14mm White Flexible PCB - NON-Waterproof. PLCC-6 (SMD5050) RGB LED.
  • Every Single LED is individually Addressable/Controlled via 1.2MHz Built in PWM on each Channel.Each LPD8086 integrated circuit contains 2 x PWM Channels
  • Each Pair Controlled by LPD8806 IC for 21 bits of color (red, green, and blue - or ANY Color Combo)
  • LPD8806 Integrated Chips Are FAR SUPERIOR to WS2801 IC Control Chips?
  • Do NOT exceed 5.5VDC on the power connectors. 2 Feet can easily be powered by 5V at about 500mA.
  • Strips are cuttable at every 2 LEDs (1 LPD8806 IC, 2 LEDs per segment)
  • needs 4 wire connector
    • Red=5V DC
    • Black=Ground
    • Green=Data
    • Yellow=Clock

Adafruit library and tutorial.
Arduino FASTSPI library.

Code sample for Arduino, using the Adafruit LPD806 library.

#include "LPD8806.h"
#include "SPI.h"
/*
Got the above libraries from https://github.com/adafruit/LPD8806.
Installed them into /usr/share/arduino/libraries/LPD8806 (on my machine).
*/
/*
Example to control LPD8806-based RGB LED Modules in a strip.
pin:   GND   +5v   CLK   DATA
port:              13    11   (for hardware SPI on Arduino UNO or Deumilanove)
color: BLK   RED   YLW   GRN

Sample usage:
  strip.begin(); // to init
  strip.setPixelColor(i, uint32_t); // to set colour on pixel i
  strip.setPixelColor(i, 0); // to turn off pixel i
  strip.show(); // to write out and render
*/
const uint16_t nLEDs = 14; // Number of RGB LEDs in strand:
LPD8806 strip = LPD8806(nLEDs); // constructor to use hardware SPI
//
const uint32_t RED    = strip.Color(127,   0,   0); 
const uint32_t GREEN  = strip.Color(  0, 127,   0);
const uint32_t BLUE   = strip.Color(  0,   0, 127);
const uint32_t WHITE  = strip.Color(127, 127, 127);
const uint32_t YELLOW = strip.Color(127, 127,   0); 
const uint32_t VIOLET = strip.Color(127,   0, 127); 
const uint32_t CYAN   = strip.Color(  0, 127, 127);
//
void setup() {
  strip.begin();
  strip.show(); // start up with all LEDs off
}
//
void loop() {
  test1(RED);
  delay(250);
  test1(GREEN);
  delay(250);
  test1(YELLOW);
  delay(250);
  test1(BLUE); 
  delay(250);   
}
//
void test1(uint32_t color) {
  uint8_t wait = 50;
  uint8_t N = 7;
  for (uint8_t i = 0; i < 7; i++) {
    strip.setPixelColor(N-i-1, color);
    strip.setPixelColor(N+i, color);
    strip.show();
    delay(wait);    
  }
}

Got this from seller's ebay listing.


RGB LED 5mm:

  • 5mm Ultra Bright RGB LEDs - 4 Wire - Common Cathode - Each LED comes with a free 470 Ohm Resistor.
  • Use 470 ohm resistor when powering the LEDs from 12 Volt or 5 Volt power (for 3.3 Volts you may not need the resistor). Resistor should be connected to the common Cathode wire (The longest wire) then to the negative power. The other 3 wires connect to the positive power or to the electronics driving the LEDs.
  • Red: 620-625 wavelength, 5000-8000 Milli Candelas
  • Green: 515-520 wavelength, 6000-7000 Milli Candelas
  • Blue: 460-465 wavelength, 2500-3000 Milli Candelas
Got these from this seller's listing.

RGB LED 5mm:

  • Common cathode
  • Forward Voltage: 3.0-3.4V
  • Luminous Intensity: 12000-14000mcd
  • Specs?
  • 20mA forward current, for each?
Got these from this seller's Amazon listing.

Common Anode RGB LED:

  • Style: Round 5mm Diffused
  • Wavelength/Color Temperature: 620-630nm
  • Luminous Intensity: 4000 - 8000 mcd
  • Forward Voltage: R~2.4V, G~3.4V, B~3.4V
  • Forward Current: ~20mA
Got these from this seller's Ebay listing.

Adafruit NeoPixel Digital RGB LED Strip - Black 60 LED - 1m

Specs

These are WS2812 ("NeoPixels"). Low refresh rate about 400Hz), not good for POV stuff. LPD8806 strips better for POV, about 4 KHz refresh rate). 60 LEDs strip peak at all white full brightness: 18 Watts (about 3.6 Amps at 5 Volts). DO NOT exceed 5V!

Recommended adhesives for the silicone sleeve Permatex 66B Clear RTV Silicone (not all silicone glues will work!) and Loctite Plastics Bonding System, a 2-part cyanoacrylate glue.

Before connecting NeoPixels to any power source, add a large capacitor (1000 µF, 6.3V or higher) across the + and – terminals as shown above. Place a 300 to 500 Ohm resistor between the Arduino data output pin and the input to the first NeoPixel. This resistor must be at the NeoPixel end of the wire to be effective! Avoid connecting NeoPixels to a live circuit. If you simply must, always connect ground first, then +5V, then data. Disconnect in the reverse order. If powering the pixels with a separate supply, apply power to the pixels before applying power to the microcontroller.


Breadboard-friendly RGB Smart NeoPixel - Pack of 4

Specs

30-LED 5.5W RGB Silicone LED Light Strip (12V DC)

Got this from DX.com