loading
Picture of LilyPad Wrist Band POV
Persistence of Vision (POV) is the illusion  that an image continues to persist even though the image has changed.   In essence, we are taking advantage of the limitations of the brain-eye processing time.  With a camera we can tune our eye for a longer exposure.  The Lilypad POV (row of LEDs) is a fun toy to build with minimal programming and electronic needs.
 
Remove these adsRemove these ads by Signing Up

Step 1: Supplies

Picture of Supplies
 You will need:
  1. 8 LEDs (though you can use more or less, probably not less than 6 for a clear image)
  2. Lilypad Arduino 
  3. Lilypad Power Supply 
  4. Conductive thread
  5. Velcro/fastener
  6. Elastic Band

Step 2: Layout of LEDs

Picture of Layout of LEDs
4417265114_7990285299.jpg
Choose 8 LEDs.  I am using the Lilypad Bright White LED (www.sparkfun.com/commerce/product_info.php).  You can use other LEDs but keep in mind the LEDs required forward voltage and current consumption ratings; you may have to include a resistor and/or need additional power.   

I have chosen to use output pins 6-13 and 5 as ground.  (I will explain more in the next step)

Because I am inexperienced with sewing, I first stitched everything down on a piece of fabric to be transfered later to an elastic band 

Step 3: Sewing LEDs

Picture of Sewing LEDs
Before sewing make sure the plus side (+) of the LEDs is facing the Lilypad.   Make sure that each LED plus side is not connected or touching anything other than the corresponding pin of the LilyPad. 

We are going to use a fairly common trick.  We know that later we will have to attach a power supply to the LilyPad and it can be difficult to combine thread lines.  Therefore, we can use a little trick by declaring pin 5 as output and setting the pin to low (a fake ground).  In your code, you will write this:

int ground = 5;

void setup() {
   pinMode(ground,OUTPUT);
   digitalWrite(ground,LOW);



Note: while we can set any pin to ground, usually, it is not recommend to set a pin HIGH as another PLUS pin.  LilyPads can only output 40mA from each digital I/O pin.

We can stitch all of the minus sides of the LEDs together and then to pin 5.

After you complete your sewing, plug-in your LilyPad to your computer and use the following code to flash all the lights. 

int ledPin13 = 13; // LED connected to digital pin 13
int ledPin12 = 12; // LED connected to digital pin 12
int ledPin11 = 11; // LED connected to digital pin 11
int ledPin10 = 10; // LED connected to digital pin 10
int ledPin9 = 9; // LED connected to digital pin 9
int ledPin8 = 8; // LED connected to digital pin 8
int ledPin7 = 7; // LED connected to digital pin 7
int ledPin6 = 6; // LED connected to digital pin 6
int ground = 5; // LED connected to digital 5 "ground"

int ledPinArray[8] = {6,7,8,9,10,11,12,13};

void setup() {
// initialize the digital pin as an output:
for(int i = 0; i < 8; i++){
pinMode(ledPinArray[i],OUTPUT);
}
pinMode(ground, OUTPUT);
digitalWrite(ground, LOW);
}

{
for(int i = 0; i < 8; i++){
digitalWrite(ledPinArray[i],HIGH);
}

delay(1000); // wait for a second
for(int i = 0; i < 8; i++){
digitalWrite(ledPinArray[i],LOW);
}
delay(1000); // wait for a second
}

Step 4: Wrist Band Setup

Picture of Wrist Band Setup
I transfered my fabric with LilyPad and LEDs stitched on to an elastic band.  The band will allow people of different arm width to use the toy.

 I am using the lilypad power supply (www.sparkfun.com/commerce/product_info.php).  This device uses a AAA battery and has 3 minus holes and 1 plus hole.  Stitch Minus on the Power Supply to Minus on the LilyPad and Plus on the Power Supply to Plus on the Lilypad.  

Choose a fastener.  I chose velcro because it's easy to sew down and you can adjust for arm width

Step 5:

Picture of
 Turn on your Power Supply and make sure all the lights are flashing.

Step 6: Source Code part 1

Picture of Source Code part 1
POV works by blinking a specified set of LEDs, waiting a second, and then blinking another set of specified LEDs.  See Image Below.  Between each column we want to delay 2.5 milliseconds (ms).  To form the letter P, for the first 2.5ms nothing is on.  The next 2.5ms all the LEDs are on. The next 2.5 ms only LEDs 6 and 9 are on....).  In our code we save this letter in the following manner:

int P[] = {
1,1,1,1,1,1,1,1,
0,0,0,0,1,0,0,1,
0,0,0,0,1,0,0,1,
0,0,0,0,1,0,0,1,
0,0,0,0,1,1,1,0,
0,0,0,0,0,0,0,0};

I used this nifty website to help me figure out which pins I needed to turn on (www.repulsor.net/minipov/)

Alternatively, we can write out the entire word (to see the letters turn your screen on its side):
int lilypad[] = {
1,1,1,1,1,1,1,1, //L
1,0,0,0,0,0,0,0,
1,0,0,0,0,0,0,0,
1,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,

1,1,1,1,0,1,0,0, //i
0,0,0,0,0,0,0,0,

1,1,1,1,1,1,1,1, //l
0,0,0,0,0,0,0,0,

1,0,0,0,0,1,1,0, //y
0,1,0,0,1,0,0,0,
0,0,1,1,0,0,0,0,
0,0,0,1,1,1,1,0,
0,0,0,0,0,0,0,0,

1,1,1,1,1,1,1,1, //p
0,0,0,0,1,0,0,1,
0,0,0,0,1,0,0,1,
0,0,0,0,0,1,1,1,
0,0,0,0,0,0,0,0,

1,1,1,1,0,0,0,0, //a
1,0,0,1,0,0,0,0,
1,0,0,1,1,0,0,0,
1,1,1,1,1,0,0,0,
0,0,0,0,0,0,0,0,

1,1,1,1,0,0,0,0, //d
1,0,0,1,0,0,0,0,
0,0,0,1,0,0,0,0,
1,1,1,1,1,1,1,1,
0,0,0,0,0,0,0,0};

 

Step 7: Source Code Part 2

The Entire Code


#define NUM_ELEM(x) (sizeof (x) / sizeof (*(x)))

int lilypad[] = {
1,1,1,1,1,1,1,1, //L
1,0,0,0,0,0,0,0,
1,0,0,0,0,0,0,0,
1,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,

1,1,1,1,0,1,0,0, //i
0,0,0,0,0,0,0,0,

1,1,1,1,1,1,1,1, //l
0,0,0,0,0,0,0,0,

1,0,0,0,0,1,1,0, //y
0,1,0,0,1,0,0,0,
0,0,1,1,0,0,0,0,
0,0,0,1,1,1,1,0,
0,0,0,0,0,0,0,0,

1,1,1,1,1,1,1,1, //p
0,0,0,0,1,0,0,1,
0,0,0,0,1,0,0,1,
0,0,0,0,0,1,1,1,
0,0,0,0,0,0,0,0,

1,1,1,1,0,0,0,0, //a
1,0,0,1,0,0,0,0,
1,0,0,1,1,0,0,0,
1,1,1,1,1,0,0,0,
0,0,0,0,0,0,0,0,

1,1,1,1,0,0,0,0, //d
1,0,0,1,0,0,0,0,
0,0,0,1,0,0,0,0,
1,1,1,1,1,1,1,1,
0,0,0,0,0,0,0,0};


int ledPin13 = 13; // LED connected to digital pin 13
int ledPin12 = 12; // LED connected to digital pin 13
int ledPin11 = 11; // LED connected to digital pin 13
int ledPin10 = 10; // LED connected to digital pin 13
int ledPin9 = 9; // LED connected to digital pin 13
int ledPin8 = 8; // LED connected to digital pin 13
int ledPin7 = 7; // LED connected to digital pin 13
int ledPin6 = 6; // LED connected to digital pin 13
int ground = 5; // LED connected to digital 5 "ground"

int ledPinArray[8] = {6,7,8,9,10,11,12,13};
// The setup() method runs once, when the sketch starts

int columnDelay;
int sizeWord = 0;
void setup() {
// initialize the digital pin as an output:
for(int i = 0; i < 8; i++){
pinMode(ledPinArray[i],OUTPUT);
}
pinMode(ground, OUTPUT);
digitalWrite(ground, LOW);

columnDelay = 2.5; //wait 2.5ms between each column flash
Serial.begin(9600);
Serial.print("Number of lilypad: ");
Serial.println(NUM_ELEM(lilypad));
delay(2000);
sizeWord = NUM_ELEM(lilypad);
}

// the loop() method runs over and over again,
// as long as the Arduino has power

/*void loop()
{
for(int i = 0; i < 8; i++){
digitalWrite(ledPinArray[i],HIGH);
}

delay(1000); // wait for a second
for(int i = 0; i < 8; i++){
digitalWrite(ledPinArray[i],LOW);
}
delay(1000); // wait for a second
}*/

void loop()
{
//Serial.print("Number of lilypad: ");
//Serial.println(NUM_ELEM(lilypad));
//delay(1000);
printWord(lilypad);
delay(8); //wait a little bit between each display of the word LilyPad
}

void printWord(int wordVar[]) {

int numRows = sizeWord/8;
for(int j = 0; j < numRows; j++) {
for(int i = 0; i<8; i++) {
digitalWrite(i+6, wordVar[i+j*8]);
}
delay(columnDelay);
}

Step 8: Take Pictures!

Picture of Take Pictures!
4417265084_ed5ee6df51.jpg
 Now all you have to do is wave your arms about and take a picture!

This material is based upon work supported by the National Science Foundation under Grant No. 0855886 to Kylie Peppler. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.
Zovits5 years ago
Why did you create the ledPin6-ledPin13 variables?
They don't seem to be used anywhere.
Or is it a way to tell the Lilypad that those outputs are used to power LEDs?
quasiben (author)  Zovits5 years ago
 You're right.  I was using those variable in a previous version of the code.  I will take them out and repost.  Thanks!  For what it's worth, I am telling the Lilypad to use pins 6-13 as output using the following code:
int ledPinArray[8] = {6,7,8,9,10,11,12,13};

for(int i = 0; i < 8; i++){
   pinMode(ledPinArray[i],OUTPUT);
}

Thanks for posting such a great tutorial! I am using the LilyPad USB, which has a different numbering on the pins. I have succeeded at blinking all the lights, by changing the values in the array as such:

int ground = 2; // LED connected to digital 2 "ground"
int ledPinArray[8] = {A5, A4, A3, A2, 11, 10, 9, 3};

But when I run the rest of the program, I have only two leds blinking... I am working on understanding the loop, and I think the problem is that the ledPinArray variable isn't used in the digitalWrite command in the printWord function... and since my pins are not all numerals, this is failing for me. Can you help me get my head around how the PrintWord function should look using the ledPinArray variable?  Thanks!

Actually i have the same problem now, because I am using also the LilyPad USB for my bachelor thesis. Did you solve the problem till now? Thanks in advance :)

Can I use diffrent colours of LEDs? Or have all the 8 LEDs to be in one colour?

I can't get any of my leds to flash. Everything else turns on except the leds. did I do something wrong?
quasiben (author)  monopoly_on_372124 years ago
Did you remember to set the last pin as LOW? Do the LEDs turn on at all?
csolson quasiben4 months ago

This is after it has been plugged into the computer, correct?

yes, so sorry, I was able to figure it out. Thanks so much! this is a great instructable.

I can't get my LEDs to light up. The battery red LED comes on, the green light on the lilypad flashes but the white LED's will not turn on. What should I look at?

ugly4 years ago
I know this is an old post but can I substitute a 3v button cell for the power supply?
quasiben (author)  ugly4 years ago
Yes. I hooked up a multimeter and measured a 3mA draw for a button cell (3V CR2032) a LilyPad LED and around a 3mA draw to power a LilyPad. As a large estimate: 8*3mA=24mA+3mA=27mA. The coin cell battery has between 200and 250mAh. So you should be able to power you POV wristband between 7 and 9 hrs continuously.

This is a pretty rough estimate. The current draw will actually change over time and you can't extract all the juice in a coin cell battery. For a great discussion check out: http://www.evilmadscientist.com/article.php/throw/
nedim1554 years ago
please could u test this for me


B8(00100000),
B8(00111111),
B8(00000000),
B8(00111111),
B8(00100101),
B8(00100101),
B8(00000000),
B8(00111111),
B8(00100101),
B8(00011110),
B8(00000001),
B8(00000001),
B8(00111111),
B8(00000001),
B8(00000001),
B8(00000000),
B8(00000000),
B8(00000000),
B8(00000000),
B8(00000000)
Nolava5 years ago
 Could this be modified to make "Pixel Poi"? www.feedingthefish.com/index.htm


Alerick5 years ago
Where did you buy your LEDs?
quasiben (author)  Alerick5 years ago
The leds are from sparkfun (www.sparkfun.com/commerce/product_info.php).
SirMask5 years ago
Great tutorial.  I'm teaching my kids (homeschoolers) electronics, robotics, etc.  Lots of it is new to me, although I did teach MS office, Internet, etc at one point in a traditional school (duh K-12 jail lol).  Anyway, loving this site and your posts.   
bryanbrews5 years ago
extremely cool!  I like building circuits, but this might be over my head.
Kryptonite5 years ago
This is a very cool little project, awesome piece! 5/5.
Ward_Nox5 years ago
seems like a geeky and clever way to get a girls attention at a bar
DemonDomen5 years ago
It can't be seen with the naked eye, right? You would only see the flashing lights.
quasiben (author)  DemonDomen5 years ago
Actually, you can see this with the naked eye; you just have to move fairly fast.  It does get a bit more difficult the longer the word/image is.  For example, here are some 3D globes www.youtube.com/watch that are spinning really really fast!  And for a great electronics POV kit visit adafruit.com or www.ladyada.net/make/minipov3/
nevsmom5 years ago
Where was this when I was a teenager?! Very cool.
the_gella5 years ago
 I saw this on flickr the other day, so glad you made a tutorial. Great little project!
very cool
Bongmaster5 years ago
sweet :3