How to Make a Light Box for Illuminating Fiber Optics

Fiber Optic LightBox

How to Make a Light Box for Illuminating Fiber Optics

Maybe you’re here from my WonderHowTo article on making fiber optic wall/ceiling stars, or maybe you’re an avid contemporary lighting fan. Nevertheless, this article will show you how to build your own LightBox for fiber optic illumination. Lets get started!

Parts & Tools


Though I’m pretty specific when I list parts here, almost none of these are mandatory. The basic concept behind the LightBox is to illuminate several LEDs or lights and then cross-fade them to create a twinkling effect. If you’re not a DIY super hacker or a hardcore tech enthusiast, I’d recommend following my parts list in order to minimize confusion and general headaches.

Parts

  • An Arduino (I use the Pro Mini, but an Uno or similar will work fine)
  • Some LEDs (really, use any color. Up to you)
  • Electrical wire
  • Some heat-shrink tubing
  • Project box
  • Mounting foam (this can be anything from spare packaging Styrofoam to a block of wood)
  • 100 ohm resistors (or similar, for LEDs)

Tools

  • Soldering Iron
  • Solder
  • Various clippers
  • Hot glue
  • Source of heat (lighter, heat-gun, etc. for activating heat-shrink tubing)
  • Drill (for modifying project box)

The Procedure


First off, lets get the project box set up. Mark five or six holes on one end of your project box, depending on how many fiber optics you plan on running. Each 1/4 inch hole fits about 40 fibers, so plan accordingly.

Project Box Holes

Project Box Holes

Now, set up the LEDs by soldering wires to each one like so:

Soldering LEDs With Wires

Soldering LEDs With Wires

Its a good idea to insulate the positive terminal via heat-shrink tubing like so:

Heat-Shrink LED Protection

Heat-Shrink LED Protection

You’ll want to use PWM pins on your Arduino, as they permit LED fading. When choosing the number of LEDs to use, take into account the number of “fade channels” you intend to target. Most Arduinos, like my pro mini, support about six PWM outputs. Feel free to use simple I/O (I used one in my setup and code), but they won’t support any fading. You should end up with a set of LEDs similar to this (left are three colored LEDs, right are five white LEDs):

Set of LEDs for Arduino

Set of LEDs for Arduino

Solder the positive leads to your chosen Arduino pins, then solder all the ground lines together onto the Arduino ground. You may not need a resistor, but its recommended each LED has one in series with the board connection.

Lets prepare the project box for mounting the Arduino. Grab that mounting foam and glue a piece about this big into the bottom of the project box:

Mounting Foam Arduino

Mounting Foam Arduino

Now, fasten the Arduino onto the mounting foam with a little hot glue:

Arduino Mounting

Arduino Mounting

The above picture contains a second board, as I build a programmable sequencer for some fiber optic art I created. This isn’t covered in this tutorial, but if I get enough interest I’ll write an article on programmable fiber optic displays.

I’ll cover the best way to connect the LEDs to the fiber optics here, even though it’s not vital for the LightBox functionality. First, grab some heat-shrink tubing that fits snugly over the LED size like so:

LED heat shrink tubing

LED heat shrink tubing

Now, feed your selected fibers into the other end of the tubing:

Fiber Optic and Heat Shrink Tubing

Fiber Optic and Heat Shrink Tubing

Now heat the tubing. It should shrink nicely around the fibers and the led, providing a secure fastener. The neat part is the LED will actually pop out of the tubing with a little force, providing an easy fasten/unfasten method.

LED Fastener

LED Fastener

Finally, when everything is put together, the LightBox looks a bit like a Star-Trek gadget! Any Arduino power supply will power up your LightBox. Ensure its the correct voltage though – don’t want to blow your board!

Fiber Optic Light Box

Fiber Optic Light Box

The Code


I’ve posted the code below, or check out my Github profile for the files:

/*

 By Christopher Voute 
 Technical Visionary
 This example code is in the public domain, but I'd love it if I got a little credit 😉
 */

int led1 = 3;
int led2 = 5;
int led3 = 6;
int led4 = 9;
int led5 = 10;
int led6 = 11;
int led7 = 12;
int brightness = 110;
int brightness1 = 60;
int brightness2 = 120;
int brightness3 = 180;
int brightness4 = 140;
int brightness5 = 100;
int fadeAmount = 1;
int fadeAmount1 = 1;
int fadeAmount2 = 1;
int fadeAmount3 = 1;
int fadeAmount4 = 1;
int fadeAmount5 = 1;

// the setup routine runs once when you press reset:
void setup()  { 
  // declare pins 3, 5, 6, 9, 10, 11, 12 to be an output:
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
  pinMode(led4, OUTPUT);
  pinMode(led5, OUTPUT);
  pinMode(led6, OUTPUT);
  pinMode(led7, OUTPUT);
  // write the only always-on LED to high
  digitalWrite(led7, HIGH);
} 


void loop()  { 
  
  //this part here adds/subtracts a random amount to the brightness value depending on if its fading or brightening the led 
  //uses the six checkAmount functions to pass brightness(s) for validation
  brightness = brightness + checkAmount(brightness);
  brightness1 = brightness1 + checkAmount1(brightness1);
  brightness2 = brightness2 + checkAmount2(brightness2);
  brightness3 = brightness3 + checkAmount3(brightness3);
  brightness4 = brightness4 + checkAmount4(brightness4);
  brightness5 = brightness5 + checkAmount5(brightness5);
  //now use analogWrite to change the brightness of the six leds
  analogWrite(led1, brightness);
  analogWrite(led2, brightness1);
  analogWrite(led3, brightness2);
  analogWrite(led4, brightness3); 
  analogWrite(led5, brightness4); 
  analogWrite(led6, brightness5); 
  //this randomizes the delay in order to create a "random twinkling" effect
  delay(random(5, 20));
}
//theses six functions do the same thing but for different leds. Randomized values ensure a twinkly effect
int checkAmount(int amount) {
  if (amount < 50 || amount > 250) {
    fadeAmount = -fadeAmount;
  }
      if (amount < 50) {
    fadeAmount = random(5);
  }
  return fadeAmount;
}
int checkAmount1(int amount) {
  if (amount < 50 || amount > 250) {
    fadeAmount1 = -fadeAmount1;
  }
      if (amount < 50) {
    fadeAmount1 = random(5);
  }
  return fadeAmount1;
}
int checkAmount2(int amount) {
  if (amount < 50 || amount > 250) {
    fadeAmount2 = -fadeAmount2;
  }
      if (amount < 50) {
    fadeAmount2 = random(5);
  }
  return fadeAmount2;
}
int checkAmount3(int amount) {
  if (amount < 50 || amount > 250) {
    fadeAmount3 = -fadeAmount3;
  }
      if (amount < 50) {
    fadeAmount3 = random(5);
  }
  return fadeAmount3;
}
int checkAmount4(int amount) {
  if (amount < 50 || amount > 250) {
    fadeAmount4 = -fadeAmount4;
  }
      if (amount < 50) {
    fadeAmount4 = random(5);
  }
  return fadeAmount4;
}
int checkAmount5(int amount) {
  if (amount < 50 || amount > 250) {
    fadeAmount5 = -fadeAmount5;
  }
    if (amount < 50) {
    fadeAmount5 = random(5);
  }
  return fadeAmount5;
}

Be sure to check out my other articles on Arduino, including basics like Understanding Digital Pins!

 

Comments

comments

Leave a Reply

Your email address will not be published.