Arduino Controlled LED Light Tube Message Board
by the mechanical engineer in Circuits > LEDs
5548 Views, 8 Favorites, 0 Comments
Arduino Controlled LED Light Tube Message Board
I first began this project about a month ago, when I decided to do something special and unique for my girlfriend for Christmas. I didn't want this to be something that would break the bank (~$50) and be easy to construct using a very limited space (my college dorm room) and a few simple tools. In fact, most of my budget was spent buying replacement parts and tools that I didn't have. However, by following this guide you should be able to eliminate most of the errors I made, and most tools (and even some materials) are readily available around the house or online. This project requires some basic-intermediate level electronics and basic tool working knowledge, and by following this guide would take somewhere between 20-40 hours to complete. This board has 3 different modes, controlled by an input switch, and an on/off switch.
Tools and Materials
This project requires quite a lengthy list of materials and tools, most of which can be purchased off of eBay.
Tools:
Dremel or small power drill (optional, but makes the board look much cleaner)
Small drill bit
Hot glue gun and hot glue
Dry erase marker
Needle nose pliers
Regular pliers
Locking pliers
Soldering iron and solder (I used a 60 watt)
Materials:
printer paper
tape
9 volt battery
18x24 sheet of plexiglass- $9 at lowes
Roll of 1/4" ID milky white plastic tubing- $2.50 at lowes, amount depends on how many words you want
Roll of 18 guage automotive wire (40 feet)- $6 at wall mart
LED's- amount and color will depend on personal preference. I used red and blue, purchased in lots of 100. I would recommend buying from ebay user giorgio11185 (http://myworld.ebay.com/giorgio11185?_trksid=p2047675.l2559) His prices are fair and he includes free resistors (which I elected not to use for this project)- $4-$5 per lot of 100.
3 position (on/off/on) toggle switch- $.99 on ebay
2 position (on/off) toggle switch- $.99 on ebay
Project box (at least 4x3x1.5, or big enough to fit arduino and a few wires)- $6 on ebay
Arduino uno board- $15 on ebay
Arduino 9v power adapter-$5 on ebay
optional- solderless breadboard and jumper wires- $7 on ebay (well worth it in my opinion)
Tools:
Dremel or small power drill (optional, but makes the board look much cleaner)
Small drill bit
Hot glue gun and hot glue
Dry erase marker
Needle nose pliers
Regular pliers
Locking pliers
Soldering iron and solder (I used a 60 watt)
Materials:
printer paper
tape
9 volt battery
18x24 sheet of plexiglass- $9 at lowes
Roll of 1/4" ID milky white plastic tubing- $2.50 at lowes, amount depends on how many words you want
Roll of 18 guage automotive wire (40 feet)- $6 at wall mart
LED's- amount and color will depend on personal preference. I used red and blue, purchased in lots of 100. I would recommend buying from ebay user giorgio11185 (http://myworld.ebay.com/giorgio11185?_trksid=p2047675.l2559) His prices are fair and he includes free resistors (which I elected not to use for this project)- $4-$5 per lot of 100.
3 position (on/off/on) toggle switch- $.99 on ebay
2 position (on/off) toggle switch- $.99 on ebay
Project box (at least 4x3x1.5, or big enough to fit arduino and a few wires)- $6 on ebay
Arduino uno board- $15 on ebay
Arduino 9v power adapter-$5 on ebay
optional- solderless breadboard and jumper wires- $7 on ebay (well worth it in my opinion)
A Little Background on LED's
One of the most crucial components of this project is the LED. Now, LED's are very interesting electronic components. They have very little resistance, so if you want to test them by hooking them straight to a 9 volt battery you MUST have a resistor in series with the LED or it will EXPLODE!!!!! OK, not really, but it will burn out and you wont be able to use it anymore. Also, LED's are polar, which means the anode (positive lead) must be hooked to the positive on the battery (and vice versa for the cathode, or negative lead). You need to pay close attention to this, as it can cause you some serious problems when it comes to wiring the board.
Begin Construction- Lay Out the Pattern
In order to make sure everything you want fits on the board and looks nice and neat, it's neccesary to lay out the drawing in marker first. But you don't want all that nasty marker making your board look bad do you? No way! This is where the handiness of those little plastic sheets that cover the plexiglass come in. First, Draw whatever you want on the front side of the board (note that "front" is arbitrary, and can be whatever side you choose). Next, flip the sheet over and trace it onto the back plastic cover sheet. now tape some paper over the top of the back side (to make it easier to see the backwards writing, and strip off the front cover sheet. now you have a nice clean surface on which to glue and work, and writing that will show through from the backside and strip off when your done. How neat is that?
Constructing the Individual Light Tubes
Getting the "neon light" effect is very simple. since you used the "milky white" tubing, it will diffuse the light from the led placed at either end, making it glow almost like a neon light. Note that in my project, the blue LED's lit up the tubing much better than the red ones, and curving the tube will significantly decrease the amount of tubing that can be lit by a single LED. In constructing these tubes, you will find that the LED has a very tight fit within the tube. In order to make it easier, you can shove the needle nose pliers into the tubing, and spread the jaws just a little bit in order to widen out the tube and make it easier to insert the LED. This step requires a lot of care so as not to break the leads on the LED. A broken LED lead can cause a MAJOR setback in your construction (believe me, I had a couple). For the longer or bent sections, it's best to use an LED in each end, especially with the dimmer LED's (like the red ones in my project).
Mounting the Tubes on the Board
This is by far the hardest part of the project, so please, LEARN FROM MY MISTAKES!! really. I had to start over twice because I was having problems. For starters, use hot glue. Also, be sure you use hot glue. Oh, and did I mention to use hot glue? Do not attempt to use any other type of glue, because it wont work nearly as well. You will have to bend this tubing in many ways that it does not want to go, so you need a glue that is strong, has a high viscosity, and dries very quickly. Hot glue is the only adhesive that will work. Trust me on this one. Other than that, this is fairly self-explanatory. If you laid out your design correctly and carefully cut and mounted all of your tubes, then this should be an easy step. The most difficult part would be the letters with sharp bends and curves, like the B. These are tricky to do, and best done by starting at one end of bend and gradually working your way up with a stream of glue. Another thing to pay close attention to is the leads on the LED's. Remember step 2 where we talked about the polarity of LED's? Well here is your chance to make your life a lot easier in the next few steps, and make the board look a lot nicer. Situate the LED's so that you can get the same polarity leads of as many LED's as close together as possible. For example, on the circular shapes (O's and the heart) I put all of the positive leads facing outward, and the negative leads facing inwards.
Wiring Everything Together
Now is for the most tedious, time consuming, frustrating and rewarding part of the project: wiring all of the LED's. Hopefully you made your life easier by organizing the leads close together, but if not it's not the end of the world, it will just be more difficult. Before you decide how to wire, you will have to decide what animations you want to do. Do you want each individual letter to blink? or do you want the words to blink as a whole? All of this will depend on how fancy you want to get with the electronics and the code. Also, when doing this, be sure to keep in mind how many output pins you will have available for use. You wouldn't want to have more outputs than pins! For my project, I decided that I would wire each individual word together, so that the "I" was a pin, the big heart was a pin, the "dan" was a pin, and so on. In order to keep everything neat and tidy, I would suggest drilling very small holes in the board, and running the wires through on the back in order to keep the front looking nice and neat. To begin, find the positive lead of every single LED that you want to be connected to one output pin, and wire them all together. Do this for every LED for every pin. This might be a little confusing, so be sure to look at the pictures. Once all of the positives are wired together, go back through and wire ALL of the negative leads together, regardless of the pin. This one gigantic wire will be connected to the "GND," or ground pin on the Arduino board. What you should have now is a giant (8-10) positive leads, and one negative lead.
Creating the On/off for the Arduino
This step is very easy. All you have to do is cut and splice a normal on/off toggle switch into your 9 volt power adapter. mounting it on the project box is not necessary yet, but would be a good idea. This will allow you to turn on and off the arduino board by supplying power to it.
Creating the Mode Selector Input
This step is a little more complicated then the previous, and involves resistors and some soldering in tight places. included in the pictures below is a schematic for this basic selector circuit. This switch has 3 positions: on1, off, and on2. This will allow you to have 3 different modes of operation, determined by the position of switch (pin1 high, pin2 high, or both low).
Neatly Organizing Everything in the Box
This is a very exciting part! You get to take all of those nasty, gross looking electronics and mess of long wires and resistors and shove them away into pretty looking box where nobody can see them! Now there are several things you will want to consider before going through with this step. First, how easy do you want it to be to change the battery? Second, do you want it to be able to reprogram it? This will determine how many holes you will need to drill/cut in the box. To begin, you will want to find a place in the box to put your arduino board. Since I wanted mine to be easy to replace the battery and be re programmable, I placed it close to the edge and, using my pocket knife, cut 2 holes for the usb cable and power cable to go through. Next, I decided which would be the "top" orientation of the box, and drilled 2 holes for the switches to go through. Finally, in the bottom, drill a final hole where all the wires will come out. Now it's just a matter of mounting everything nicely in the box. begin by putting 4 dabs of hot glue on each corner of the arduino board, and nestle it snugly in it's spot. Once the hot glue has cured, you can begin mounting all of the switches and poking the output wires through the hole and connecting them to the board.
Mounting the Box, Battery and Finishing the Wiring
This step is fairly simple. All you have to do is put a dab of hot glue in each corner, find a nice place to stick the box, and attach it! well, that's half of it. The second part only involves finishing up the wiring, and requires (yes, I know your probably getting tired of it at this point) soldering. But I promise it's the last of it! All you have to do is wire all of the output wires with their corresponding light sections. Not that difficult to solder, but make sure it's done good!
Insulate Your Contacts and Control Those Unruly Wires!
Shorts are awesome! They keep your legs cool in the summer and allow freedom of movement. Who doesn't love shorts? Unless, of course, they are on your light board. Any positive wire that comes in direct contact with a negative, or ground wire will create a short, and all of your LED's will go out, not to mention it will cause the wires to heat up and possibly even fry your arduino board! that is not good at all! So once you have confirmed that you have no shorts in your wiring, you want to keep it that way. The easiest way to do this is to insulate all of your exposed wires with hot glue. Also, if you wired it like me, you probably have lots of unruly wires sticking out all over the place. this looks bad and can catch on things and cause you problems later on. So simply group as many of them as you can together and stick them all down to the board with a healthy dab of hot glue. BAM!! Two birds with one stone! Isn't this great?
Coding and Programming the Arduino
Although this is technically the last step, It's good to have a general idea what you want the code to be, and even write most of it before you begin construction of the board. This will allow you to test your code on a sample circuit prior to putting it on the final board. This is where a solderless breadboard comes in handy. It will allow you to test your code very easily and make changes until you come up with what you want. This step really depends on what you want, however if you have followed this guide exactly then you should have 3 modes of operation. This means you can code 3 different loops, and control them with if-then statements. My sample code can be seen in the pictures below. Please note: I'm sure that there are much better ways of writing code than this. However, my code works and did exactly what I wanted it to. I know it isn't to pretty, but please don't criticize it to harshly.
My code:
int i=13;
int heart=11; //pwm pin
int you=12;
int becca=10; //pwm
int dan=9; //pwm
int plus=8;
int modea=1;
int modeb=2;
void setup()
{
pinMode(i, OUTPUT);
pinMode(heart, OUTPUT);
pinMode(you, OUTPUT);
pinMode(becca, OUTPUT);
pinMode(dan, OUTPUT);
pinMode(plus, OUTPUT);
pinMode(modea, INPUT);
pinMode(modeb, INPUT);
}
void loop()
{
int x = digitalRead(modea);
int y = digitalRead(modeb);
if (x == HIGH)
{
digitalWrite(i, HIGH);
delay(1000);
digitalWrite(i, LOW);
digitalWrite(heart, HIGH);
delay(1000);
digitalWrite(heart, LOW);
digitalWrite(you, HIGH);
delay(1000);
digitalWrite(you, LOW);
delay(100);
digitalWrite(i, HIGH);
digitalWrite(heart, HIGH);
digitalWrite(you, HIGH);
delay(1000);
digitalWrite(i, LOW);
digitalWrite(heart, LOW);
digitalWrite(you, LOW);
delay(100);
}
if (x == LOW)
{
digitalWrite(i, LOW);
digitalWrite(heart, LOW);
digitalWrite(you, LOW);
}
if (y == HIGH)
{
digitalWrite(becca, HIGH);
delay(1000);
digitalWrite(becca, LOW);
digitalWrite(plus, HIGH);
delay(1000);
digitalWrite(plus, LOW);
digitalWrite(dan, HIGH);
delay(1000);
digitalWrite(dan, LOW);
delay(100);
digitalWrite(becca, HIGH);
digitalWrite(plus, HIGH);
digitalWrite(dan, HIGH);
digitalWrite(heart, HIGH);
delay(1000);
digitalWrite(becca, LOW);
digitalWrite(plus, LOW);
digitalWrite(dan, LOW);
digitalWrite(heart, LOW);
delay(100);
}
if (y == LOW)
{
digitalWrite(heart, LOW);
digitalWrite(becca, LOW);
digitalWrite(dan, LOW);
digitalWrite(plus, LOW);
}
if (x == LOW && y == LOW)
{
digitalWrite(i, HIGH);
digitalWrite(heart, HIGH);
digitalWrite(you, HIGH);
delay(5000);
digitalWrite(i, LOW);
digitalWrite(you, LOW);
digitalWrite(becca, HIGH);
digitalWrite(plus, HIGH);
digitalWrite(dan, HIGH);
delay(5000);
digitalWrite(becca, LOW);
digitalWrite(dan, LOW);
digitalWrite(plus, LOW);
}
}
My code:
int i=13;
int heart=11; //pwm pin
int you=12;
int becca=10; //pwm
int dan=9; //pwm
int plus=8;
int modea=1;
int modeb=2;
void setup()
{
pinMode(i, OUTPUT);
pinMode(heart, OUTPUT);
pinMode(you, OUTPUT);
pinMode(becca, OUTPUT);
pinMode(dan, OUTPUT);
pinMode(plus, OUTPUT);
pinMode(modea, INPUT);
pinMode(modeb, INPUT);
}
void loop()
{
int x = digitalRead(modea);
int y = digitalRead(modeb);
if (x == HIGH)
{
digitalWrite(i, HIGH);
delay(1000);
digitalWrite(i, LOW);
digitalWrite(heart, HIGH);
delay(1000);
digitalWrite(heart, LOW);
digitalWrite(you, HIGH);
delay(1000);
digitalWrite(you, LOW);
delay(100);
digitalWrite(i, HIGH);
digitalWrite(heart, HIGH);
digitalWrite(you, HIGH);
delay(1000);
digitalWrite(i, LOW);
digitalWrite(heart, LOW);
digitalWrite(you, LOW);
delay(100);
}
if (x == LOW)
{
digitalWrite(i, LOW);
digitalWrite(heart, LOW);
digitalWrite(you, LOW);
}
if (y == HIGH)
{
digitalWrite(becca, HIGH);
delay(1000);
digitalWrite(becca, LOW);
digitalWrite(plus, HIGH);
delay(1000);
digitalWrite(plus, LOW);
digitalWrite(dan, HIGH);
delay(1000);
digitalWrite(dan, LOW);
delay(100);
digitalWrite(becca, HIGH);
digitalWrite(plus, HIGH);
digitalWrite(dan, HIGH);
digitalWrite(heart, HIGH);
delay(1000);
digitalWrite(becca, LOW);
digitalWrite(plus, LOW);
digitalWrite(dan, LOW);
digitalWrite(heart, LOW);
delay(100);
}
if (y == LOW)
{
digitalWrite(heart, LOW);
digitalWrite(becca, LOW);
digitalWrite(dan, LOW);
digitalWrite(plus, LOW);
}
if (x == LOW && y == LOW)
{
digitalWrite(i, HIGH);
digitalWrite(heart, HIGH);
digitalWrite(you, HIGH);
delay(5000);
digitalWrite(i, LOW);
digitalWrite(you, LOW);
digitalWrite(becca, HIGH);
digitalWrite(plus, HIGH);
digitalWrite(dan, HIGH);
delay(5000);
digitalWrite(becca, LOW);
digitalWrite(dan, LOW);
digitalWrite(plus, LOW);
}
}
Enjoy Your Hard-earned Work of Art!
Finally, it's time to sit back and enjoy what you've made. Hopefully you've made this enough in advance so that you have a little time to enjoy it yourself before you give it away! Here is some video of the board running. Also, I have this entered in the A / V contest, the Holiday gifts contest, and the Instructables design competition, so if you enjoyed this instructable, please be sure to throw a vote my way! It would be greatly appreciated!