raphnet.net banner

Leds and persistance of vision

Buy Me a Coffee at ko-fi.com


There was an article named Glowstick a Go-Go in Make Magazine volume 1 which talks about a led bar which displays each line of an image one by one very quickly. If you move the led bar fast enough (left-right using your hand) you can see the picture like it's floating in the air.

A few co-workers (see Etienne's blog at http://www.naid.net) and me thought that this was very cool so we decided to make some experimentation using the same concept.

goto top

Version 1

Fixed scan rate, no sync. Moved manually.
I used the PCB from an old project which had an Atmega8 MCU, an uln2003 and 7 high intensity red leds.

The MCU uses it's internal clock circuit. The 7 leds are controller by PORTD. To control the leds, I just write a value to PORTD and wait using a busyloop.

Here is the code (compiled with avr-gcc):

Problems, solutions and possible improvements:

goto top

Version 2

Fixed scan rate, no sync. Moved by a bicycle wheel.

After we tried the first version of this experiment, a friend showed me a webpage with pictures of a stable image displayed on a bicycle wheel and text on a bicycle wheel, using the same technique as we do. We instantly decided to do the same thing. (Big thanks to Nic for the bicycle :))

No code changes were necessary for this, but I changed the text for a few old school low resolution videogames pictures.
on bike on bike2

Problems, solutions and possible improvements:

goto top

Version 2.1

Fixed scan rate, synchronised. Moved by a bicycle wheel.

sync In order to display the pattern always at the same place, I added a position sensor made from a relay coil, a magnet and an amplification circuit.

The magnet is fixed on the bicycle frame and the coil is inside the wheel. Each time the magnet passes near the coil, a small voltage is generated by the coil. The amplification circuit boosts this voltage to an acceptable level for the MCU.

A small code change was required to make this work correctly. Now, the MCU waits for a pulse, scans the picture one time and wait for another pulse. The picture is now always displayed at the same place:
Problems, solutions and possible improvements:

goto top

Version 2.2

Fixed scan rate, synchronised. Moved by a bicycle wheel.

I replaced the on-board red leds by a few green leds installed on a strip of perforated pcb. This has 2 advantages:

I have also done some code improvements:

With the new code, it is possible to calculate the wheel's speed:

I had not enough time available to do it, but it will be easy to display the bicycle speed in Km/H instead...

Problems, solutions and possible improvements:

goto top

Version X

This is not a real version, it's just a place where we write down our ideas.

MCU code ideas:
Hardware setup ideas:

goto top


I cannot be held responsible for any damages that could occur to you or your equipment while following the procedures present on this page. Also, I GIVE ABSOLUTELY NO WARRANTY on the correctness and usability of the informations on this page. Please note, however, that the procedures above have worked in my case without any damages or problems.

Now you cannot say that I did not warn you :)

goto top

Any trademarks used on this site are the property of their respective owners.
Copyright © 2002-2022, Raphaël Assenat
Website coded withWebsite coded with vimLast update: January 7, 2020 (Tuesday)