Archives for category: Closed Circuit

When I went to the electronics store, I picked up a few things that I didn’t quite know what they were, just because they looked cool.

[insert picture]

It’s a switch, I can tell that much, but why does it have 6 leads coming out of the back? Which ones connect to what?

[insert picture]

So what I decided to do was run a test.  I don’t want to worry about ungrounded circuits, so I hooked up all the leads to ground, but first going through one of the LEDs to see which ones are active.  I’m going to power each lead one at a time, and see what happens in the on and off position.

[insert picture]

Here are the results:

On Off
Lead 1
Lead 2
Lead 3
Lead 4
Lead 5
Lead 6

via LadyAda.

Need

  • Arduino Uno (+ USB cable, power cable, software)
  • 2 each of red, green, and blue LEDs
  • 6 resistors
  • tissue paper for diffusing

Code

int redPin = 12;
int greenPin = 11;
int bluePin = 10; 
void setup() {
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);
}

void loop() {
  digitalWrite(redPin, HIGH);
  digitalWrite(greenPin, HIGH);
  digitalWrite(bluePin, HIGH);
  delay(1000);
  digitalWrite(greenPin, LOW);
  digitalWrite(bluePin, LOW);
  delay(1000);
  digitalWrite(bluePin, HIGH);
  delay(1000);
  digitalWrite(redPin, LOW);
  delay(1000);
  digitalWrite(greenPin, HIGH);
  delay(1000);
  digitalWrite(bluePin, LOW);
  delay(1000);
  digitalWrite(redPin, HIGH);
  delay(1000);
}

Circuit

Results

I added an origami paper box (instructions here) for a diffuser.

(Edit: Apparently my camera can’t take pictures in low light. I’ll add an image as soon as I can get my hands on a better one.)