Lightsabia Galactica Insania in the Cranium
By: Sir Mick Higgins and John Solimanto
Basic Description
We created a lightsaber. Our lightsaber uses switches that can change the color of the lightsaber to any color possible.
Advanced Description
We used the Arduino Teensy 3.0. We gutted a Hasbro lightsaber in order to make room for our Arduino. We soldered pins onto the Arduino instead of using a breadboard. To change the colors of the lightsaber, we set up three potentiometers with red, blue, and green leds that would change the brightness of each color by moving the switches. We connected the Arduino to the positive and negative end of the battery slot. We bought a blade off a site that sells legit lightsabers. This blade fit into out handle that we molded in order to make a tight fit. The wiring on the inside of the lightsaber is connected to the potentiometers that we made slots for near the top of the handle.
Circuit diagram or Fritzing Picture
Lightsaber Code
int potPin = 2; // select the input pin for the potentiometer
int ledPin = 20; // select the pin for the LED
int val = 0; // variable to store the value coming from the sensor
int PotPin = 3; // select the input pin for the potentiometer
int LedPin = 21; // select the pin for the LED
int Val = 0; // variable to store the value coming from the sensor
int potpin = 4; // select the input pin for the potentiometer
int ledpin = 22; // select the pin for the LED
int vAl = 0; // variable to store the value coming from the sensor
void setup() {
pinMode(ledPin, OUTPUT); // declare the ledPin as an OUTPUT:
pinMode(LedPin, OUTPUT); // declare the LedPin as an OUTPUT:
pinMode(ledpin, OUTPUT); // declare the ledpin as an OUTPUT:
}
void loop() {
val = analogRead(potPin); // read the value from the sensor
val = map(val, 0, 1023, 0, 255);// make val a number between 0 and 255
analogWrite (ledPin, val); // turn on LED with a value between 0-255
Val = analogRead(PotPin); // read the value from the sensor
Val = map(Val, 0, 1023, 0, 255);// make val a number between 0 and 255
analogWrite (LedPin, Val); // turn on LED with a value between 0-255
vAl = analogRead(potpin); // read the value from the sensor
vAl = map(vAl, 0, 1023, 0, 255);// make val a number between 0 and 255
analogWrite (ledpin, vAl); // turn on LED with a value between 0-255
}
Some of the problems we encountered was getting the glow to be bright enough. We figured out there was extra plastic film in the tube that we removed. Another problem was finding space in the lightsaber to fit the wiring. Finally, we encountered a problem of making the leds fit in the lightsaber.
If we had more time we could possibly had added sounds and maybe make a better light. If we had more money, we could have bought a better handle, created a stronger light, or have the lightsaber make sounds.