POV

With POV, Persistence Of Vision, you can take a bike wheel and make it into a display with just a few LEDs. Check out this video to see what we mean.

In this project, you will make one of these displays yourself. Wave it with long strokes or even hold it while running to display a text, a statement or a picture. The effect is most visible in a dark place so if you are running, make sure not to run in to a tree or a friend.

Materials

  • 1 Arduino Uno board
  • 1 Education Shield
  • 5 LEDs
  • 5 220 ohm resistors
  • 5 black jumper wires
  • 5 colored jumper wires
  • 1 9V battery
  • 1 power plug

Instructions

  1. Attach the shield onto the top of the Arduino board.
  2. Connect five LEDs across the breadboard gap.
  3. Connect a 220 ohm resistor to digital pin 2 and connect the resistor to the long leg of the first LED.
  4. Connect each of the digital pins 3 through 6 to a corresponding LED following the same method.
  5. Connect the short leg of the LEDs to GND using black jumper wires.
  6. Connect the Arduino assembly to the computer and upload example POV.
  7. Unplug the Arduino assembly and connect a 9V battery with a power plug to the Arduino’s power socket.

Code

Find the code in File>Examples>EducationShield>Block3-Magic>Projects>POV

How it works

  • The EducationShield library is included.
  • The VU-meter variables are declared, ledPins[], pinCount and vuMeter.
  • The variables that has to do with displaying the message are declared. rowCount will be used to keep track on what row number to blink, rowLength is the width of the message and delayTime is how long time each row is displayed, in milliseconds.
  • The message pattern is defined in a two dimensional array, message[5][22]. The message is displayed with 5 LEDs, and is 22 rows long.
  • The message pattern is defined in a way to make it easy to visualize. For each LED there are 22 zeros and ones. A 1 represents an LED turned on, and a 0 represents an LED turned off.
  • In setup(), the VU-meter is configured and initialized.
  • In loop(), an if statement checks if rowCount is equal to rowLength. If it is, it means that the whole message has been displayed.
  • To reset, rowCount is assigned the value 0.
  • If rowCount and rowLength is not equal, the message will be displayed.
  • A for loop loops for as many times as the value of pinCount, the amount of LEDs you are using.
  • In each loop, an if statement checks if message[i][rowCount] is equal to 1.
  • In the first loop, both i and rowCount are equal to 0, so message[i][rowCount] is not equal to 1 and the LED on the index number i is turned off.
  • In the second loop, i is equal to 1 and rowCount is equal to 0, so message[i][rowCount] is not equal to 1 and the LED on the index number i is turned off.
  • When the for loop has finished, rowCount is increased with 1.
  • The program pauses for as many milliseconds as the value of delayTime.
  • Again, if rowCount is equal to rowLength, rowCount is reset to 0.
  • This time when the for loop runs, i is equal to 0 and rowCount is equal to 1, so message[i][rowCount] is equal to 1 and the LED on the index number i is turned on.
  • When the for loop is finished, rowCount is again increased with 1.
  • The program pauses for as many milliseconds as the value of delayTime.
  • loop() continues to loop.

Troubleshooting

  • Refer to the illustration and double check your connections. Make sure the shield and jumper wires are firmly connected. Check the LED polarities to make sure they are consistent and properly wired.
  • Make sure the battery is connected properly so the ON LED on Arduino is on. Test with Arduino connected to the computer and 9V battery disconnected. If it works with the USB cable but not with the battery, there could be something wrong with the battery, change for another one.
  • If the VU-meter does not work correctly, see the VU-meter reference for debugging

Experiment further

  • Try different messages, with different lengths.
  • Change the message to a pattern or a drawing.
  • Take a photo of yourself waving the POV. Check out the cool effect!