LEDs on a Stick

Persistence of Vision – LEDs on a Stick

Rob Demmer

Joey Barnes

Description:

This project uses LEDs blinking at very high rates to create words when spinning. When not spinning, the lights appear just to be turned on and not blinking but when spun, the lights blink in such a way that the word “Hi” can be clearly seen. The breadboard is mounted to a rotating PVC pipe which allows for the device to spin. 5 LEDs are attached to the breadboard along with the arduino system. The aruduino board is powered by a 9V battery which is attached with velcro to the bottom of the board and secured also with a rubber band.

Code:

int ledPin6 = 6; // topint ledPin7 = 7; int ledPin8 = 8; // middleint ledPin9 = 9; int ledPin10 = 10; // bottomint lightflash = 1; void setup(){ pinMode (6, OUTPUT); pinMode (7, OUTPUT); pinMode (8, OUTPUT); pinMode (9, OUTPUT); pinMode (10, OUTPUT); Serial. begin(9600); } void loop() { digitalWrite(ledPin6,HIGH); digitalWrite(ledPin7, HIGH); digitalWrite(ledPin8,HIGH); digitalWrite(ledPin9,HIGH); digitalWrite(ledPin10,HIGH); delay(lightflash); digitalWrite(ledPin6,LOW); digitalWrite(ledPin7,LOW); digitalWrite(ledPin9,LOW); digitalWrite(ledPin10,LOW); delay(lightflash); digitalWrite(ledPin6,HIGH); digitalWrite(ledPin7, HIGH); digitalWrite(ledPin8,HIGH); digitalWrite(ledPin9,HIGH); digitalWrite(ledPin10,HIGH); delay(lightflash); digitalWrite(ledPin6, LOW); digitalWrite(ledPin7, LOW); digitalWrite(ledPin8,LOW); digitalWrite(ledPin9,LOW); digitalWrite(ledPin10,LOW); delay(4); //H digitalWrite(ledPin6,HIGH); digitalWrite(ledPin8,HIGH); digitalWrite(ledPin9,HIGH); digitalWrite(ledPin10,HIGH); delay(lightflash); digitalWrite(ledPin6, LOW); digitalWrite(ledPin8,LOW); digitalWrite(ledPin9,LOW); digitalWrite(ledPin10,LOW); delay(15); //i }

The code itself is very basic and relies mostly on the order which the lights turn on and off and the amount of delay in between. The variable “lightflash” is set to equal to one so that the LEDs flash at the fastest rate possible. “Lightflash” is only used within each individual “letter” being created by the LEDs. A different delay amount is used between the “H” section of the code and the “i” code. This is because if the delay were to be set to “lightflash” the “letters” being created would run into each other so to speak. With a greater amount of delay time between the two sections of code, each “letter” can be easily distinguished from one another and not blend together.

Problems Encountered :

The main problems encountered during the making of the project were the initial code being written and determining the speed the lights should flash at. This was difficult because the code had to be adjusted to compensate for the short radius of the spinning piece attached to the PVC pipe. Mounting the board was also difficult because as we shortly found out during testing, super glue was not able to securely hold the board together with the PVC. After drilling a hole into the PVC and tying string through it and to the board, along with more super glue, this problem was solved.

If we could continue further:

With more time, money, effort, and skill, we would have liked to mount the LEDs to a spinning motor so it could rotate at a faster rate with a greater radius. This would allow us to create more words through the coding and at the same time make it able to see the words more clearly. Going even further, an accelerometer could be attached to determine speed and then create different words for different speeds.