Persistence of vision – 2 principles and how to build
April 3, 2011 14 Comments
After the initial success with persistence of vision or POV, I made a PCB just to do the job. Please look at the middle of this page for some details:
Principle of operation:
How does the POV tell its speed and when to start displaying?
There is a sensor (typically Hall Effect magnetic switch or photogate) on the rotating board to sense where to start displaying. You have to display the same message at the same spot several times a second to get persistence of vision. Speed of the rotation is calculated by the rotating board, using time difference between two subsequent sensor readings. It’s like if there was 250 ms of time between subsequent triggers from the sensor, the speed is 1/250ms=4Rev/s
How does the POV display numbers and letters?
If you have recently made some purchase, bring out your receipt. You may notice that some of your receipts look rougher than others, seemingly made up of dots:
The left receipt shows characters made up of 5*7 dot matrix while the right receipt shows smooth characters (maybe the dots are too small to see).
What happens inside of the printer that produces the left receipt was that there is an ink ribbon placed in front of the blank receipt and a column of 7 pins is brought near the ribbon. The 7 pins can move quickly in and out. When a pin moves in it presses the ink ribbon against the blank receipt, making a dot on the receipt. When it pin moves out of the place, the ink ribbon is not pressed against the blank receipt. If you look at the capital T on line one, the pins are controlled by a microcontroller which tells the top pin to punch, then moves the pins one space to the right, top pin to punch, move to the right, tells all pins to punch, move to the right, tell top pin to punch, move to the right, tell top pin to punch. This way a “T” is made with two single dots on the top, seven dots in a column, two more single dots on the top again.
This way, a single column of pins makes characters, then characters make words, and then sentences. A persistence of vision display follows the same principle with a single column of LEDs “printing” in air. When the rotation is fast enough, at least around 2RPM, then the repeated information results in persistence of vision in human brains and the images magically appear. If I lived in the “Terminator” time, I would use such a display, not a dog, to tell who’s human who’s not. If you ever construct such a display, try taking a picture of what’s said, you’ll find it hard but still possible to take a picture of the complete message.
Here is another picture of my POV display acting as a clock:
How the electronics works
I am using an Arduino to control the POV display that I made from 8 LEDs and a 74HC595 shift register, and a Hall Effect switch. The Arduino senses the rotation from the Hall Effect switch passing underneath a magnet (see there’s a ruler in the picture stuck on top of a poll?). Once sensed, it spits out the information to be displayed in columns of LEDs to the shift register. With a shift register, you can expand the number of LEDs to a number larger than the number of Arduino pins, without increasing the number of pins needed to control them. You only need 3 pins to control a series of shift registers, which translates to dozens of LEDs.
Here is a good tutorial on Arduino website to learn shift registers:
The arduino turns on the appropriate LEDs representing the first column of a character and waits for a short period of time, say 1ms, then it changes the LEDs to represent the next column, and wait and next.
How to make this display
List of hardware:
You will need the following parts in order to make the display:
One reliable rotation stage such as a computer case fan or my fancy Pasco rotation stage (improper assembly may result in injuries so do it carefully and don’t sue me)
One Arduino board (UNO or RBBB with a tiny breadboard)
Some wires and headers
Assemble the hardware:
First solder the parts together indicated below. If you use a perf board, situate your 595 in the middle with the pins that are connected to their neighbors. You need to spread out the LEDs. You’re much better off using the breakout board. Make sure you observe polarity of the LED, long leg is positive.
Here is the breakout board:
Here is when everything is soldered on:
To solder on the Hall effect sensor, face the narrow face of the censor away from the board and insert it into the 3-pin spot and solder. The bend the pins zig-zag so the sensor is further lifted up to sense a magnet.
Power the thing with 5V and GND indicated on the board and measure the output of the trig pin. Make sure you get the right magnetic poll to trigger the switch. It stays high until the correct magnetic poll is brought near enough to it. Once tested, secure the magnet on something that will hang directly above the sensor.
To test the LEDs, use the sample code from the Arduino tutorial:
If everything works, load the following code. Before you rotate your stage, you need to be sure everything is secured. Power Arduino with the 9V battery at Vin (positive) and GND pins. Turn on your rotation to at least 3RPM. Darken your room if possible.
To be continued…
Load the software to Arduino:
To be continued…