LED Tower With Arduino
In this tutorial I’ll show how you can create your own LED tower and using the code provided you can make your very own light show!
Supplies
- 1x Arduino Board
- 27x LED’s of any colour (In my tower I use of mix of different LED'S
- 1x Breadboard
- 3x 10k ohm Resistors
- 9x 330 ohm Resistors
- 3x NPN Transistors
- Wires
3x3 Layers
You're going to want to connect the cathodes of the LED's with solder (Make sure the cathodes and anodes do not touch). Repeat this step till you end up with 3 layers that look exactly the same.
Soldering
Now that you have all the layers, solder them together to make a tower like this
Breadborad
On the Arduino your going to make connections going from pin GND - 2
Pins 13 - 11 will be the negative connections.
Pins 10 - 2 will be for LED's. Wire them in rows, Start from top left led leg to bottom led left (pins 10 - 8). Middle row, top middle led to bottom middle led (pins 7 - 5). Right row, top right led to bottom right led (pins 4 - 2).
Code
This is the code for the LED tower to make a light show
void setup() {
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
}
void allLayer() {
digitalWrite(11, HIGH);
digitalWrite(12, HIGH);
digitalWrite(13, HIGH);
}
void noLayer() {
digitalWrite(11, LOW);
digitalWrite(12, LOW);
digitalWrite(13, LOW);
}
void rotate() {
allLayer();
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
delay(100);
empty();
digitalWrite(2, HIGH);
digitalWrite(6, HIGH);
digitalWrite(10, HIGH);
delay(100);
empty();
digitalWrite(3, HIGH);
digitalWrite(6, HIGH);
digitalWrite(9, HIGH);
delay(100);
empty();
digitalWrite(4, HIGH);
digitalWrite(6, HIGH);
digitalWrite(8, HIGH);
delay(100);
empty();
noLayer();
}
void fill() {
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
digitalWrite(10, HIGH);
}
void swirl() {
digitalWrite(2, HIGH);
delay(50);
digitalWrite(3, HIGH);
delay(50);
digitalWrite(4, HIGH);
delay(50);
digitalWrite(7, HIGH);
delay(50);
digitalWrite(10, HIGH);
delay(50);
digitalWrite(9, HIGH);
delay(50);
digitalWrite(8, HIGH);
delay(50);
digitalWrite(5, HIGH);
delay(50);
digitalWrite(6, HIGH);
delay(50);
}
void myName() {
//Y
digitalWrite(11, HIGH);
digitalWrite(2, HIGH);
digitalWrite(4, HIGH);
digitalWrite(6, HIGH);
digitalWrite(9, HIGH);
delay(100);
noLayer();
digitalWrite(12, HIGH);
delay(100);
noLayer();
digitalWrite(13, HIGH);
delay(200);
noLayer();
digitalWrite(12, HIGH);
delay(100);
noLayer();
digitalWrite(11, HIGH);
delay(100);
noLayer();
empty();
//O
digitalWrite(11, HIGH);
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
digitalWrite(10, HIGH);
delay(100);
noLayer();
digitalWrite(12, HIGH);
delay(100);
noLayer();
digitalWrite(13, HIGH);
delay(200);
noLayer();
digitalWrite(12, HIGH);
delay(100);
noLayer();
digitalWrite(11, HIGH);
delay(100);
noLayer();
empty();
//U
digitalWrite(11, HIGH);
digitalWrite(2, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
digitalWrite(10, HIGH);
delay(100);
noLayer();
digitalWrite(12, HIGH);
delay(100);
noLayer();
digitalWrite(13, HIGH);
delay(200);
noLayer();
digitalWrite(12, HIGH);
delay(100);
noLayer();
digitalWrite(11, HIGH);
delay(100);
noLayer();
empty();
//R
digitalWrite(11, HIGH);
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(8, HIGH);
delay(100);
noLayer();
digitalWrite(12, HIGH);
delay(100);
noLayer();
digitalWrite(13, HIGH);
delay(200);
noLayer();
digitalWrite(12, HIGH);
delay(100);
noLayer();
digitalWrite(11, HIGH);
delay(100);
noLayer();
empty();
//I
digitalWrite(11, HIGH);
digitalWrite(3, HIGH);
digitalWrite(6, HIGH);
digitalWrite(9, HIGH);
delay(100);
noLayer();
digitalWrite(12, HIGH);
delay(100);
noLayer();
digitalWrite(13, HIGH);
delay(200);
noLayer();
digitalWrite(12, HIGH);
delay(100);
noLayer();
digitalWrite(11, HIGH);
delay(100);
noLayer();
empty();
}
void empty() {
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
}
void createX() {
digitalWrite(2, HIGH);
digitalWrite(4, HIGH);
digitalWrite(6, HIGH);
digitalWrite(8, HIGH);
digitalWrite(10, HIGH);
delay(1000);
digitalWrite(2, LOW);
digitalWrite(4, LOW);
digitalWrite(6, LOW);
digitalWrite(8, LOW);
digitalWrite(10, LOW);
delay(200);
digitalWrite(2, HIGH);
digitalWrite(4, HIGH);
digitalWrite(6, HIGH);
digitalWrite(8, HIGH);
digitalWrite(10, HIGH);
delay(200);
digitalWrite(2, LOW);
digitalWrite(4, LOW);
digitalWrite(6, LOW);
digitalWrite(8, LOW);
digitalWrite(10, LOW);
delay(200);
digitalWrite(2, HIGH);
digitalWrite(4, HIGH);
digitalWrite(6, HIGH);
digitalWrite(8, HIGH);
digitalWrite(10, HIGH);
delay(200);
digitalWrite(2, LOW);
digitalWrite(4, LOW);
digitalWrite(6, LOW);
digitalWrite(8, LOW);
digitalWrite(10, LOW);
delay(200);
digitalWrite(2, HIGH);
digitalWrite(4, HIGH);
digitalWrite(6, HIGH);
digitalWrite(8, HIGH);
digitalWrite(10, HIGH);
delay(200);
digitalWrite(2, LOW);
digitalWrite(4, LOW);
digitalWrite(6, LOW);
digitalWrite(8, LOW);
digitalWrite(10, LOW);
delay(200);
digitalWrite(2, HIGH);
digitalWrite(4, HIGH);
digitalWrite(6, HIGH);
digitalWrite(8, HIGH);
digitalWrite(10, HIGH);
delay(200);
digitalWrite(2, LOW);
digitalWrite(4, LOW);
digitalWrite(6, LOW);
digitalWrite(8, LOW);
digitalWrite(10, LOW);
delay(500);
}
void loop() {
//FILL - UP AND DOWN
digitalWrite(13, HIGH);
fill();
delay(200);
empty();
noLayer();
digitalWrite(12, HIGH);
fill();
delay(100);
empty();
noLayer();
digitalWrite(11, HIGH);
fill();
delay(200);
empty();
noLayer();
digitalWrite(12, HIGH);
fill();
delay(100);
empty();
noLayer();
digitalWrite(13, HIGH);
fill();
delay(200);
empty();
noLayer();
digitalWrite(12, HIGH);
fill();
delay(100);
empty();
noLayer();
digitalWrite(11, HIGH);
fill();
delay(200);
empty();
noLayer();
digitalWrite(12, HIGH);
fill();
delay(100);
empty();
noLayer();
digitalWrite(13, HIGH);
fill();
delay(200);
empty();
noLayer();
digitalWrite(12, HIGH);
fill();
delay(100);
empty();
noLayer();
digitalWrite(11, HIGH);
fill();
delay(200);
empty();
noLayer();
digitalWrite(12, HIGH);
fill();
delay(100);
empty();
noLayer();
digitalWrite(13, HIGH);
fill();
delay(200);
empty();
noLayer();
delay(1000);
//SWIRL - 1 LAYER EACH TIME
digitalWrite(13, HIGH);
swirl();
delay(10);
empty();
noLayer();
digitalWrite(12, HIGH);
swirl();
delay(10);
empty();
noLayer();
digitalWrite(11, HIGH);
swirl();
delay(10);
delay(400);
empty();
noLayer();
//SWIRL - ALL LAYERS AT ONCE
allLayer();
swirl();
delay(400);
empty();
noLayer();
delay(1000);
//NAME COMES UP
myName();
delay(1000);
//ROTATING PANE - ALL LAYERS
rotate();
rotate();
rotate();
rotate();
rotate();
rotate();
rotate();
rotate();
delay(1000);
}