Fork me on GitHub

Project Notes

#193 PoV Shake Stick Kit

Build and investigate an AT89S52-based “shake stick” kit

PovShakeStickKit_build

PovShakeStickKit_demo

Notes

I picked up a PoV shake-stick kit for a few dollars recently. I’m interested in doing some persistence-of-vision projects, so I was intrigued to find out how this one worked. I’d seen some articles - like Matthew Norman’s blog post - on the kit but nothing that really got down to the inner workings.

Building the kit is very simple. The AT89S52 comes pre-programmed, and it only took about half an hour build the kit. It worked perfectly straight off the bat.

Then for the fun part - sleuthing out it’s provenance and internals..

Origins

Things started to get interesting when I found this archive.

If I can trust it as original work - and it does seem so - then it is the documentation and code from a student project that appears to be the first prototype of what eventually has turned up on many online sites as a standard kit.

The project was by Zheng Zhong Xing 兴向荣 (aka zhengzhongxing39) studying Control Technology and Instruments/Principles and Applications at a Chinese University (though I can’t tell which one). Dates are ambiguous - the initial project may have been in 2009, and work on the sources revisited in 2012/2013. It’s pure conjecture, but perhaps 兴向荣 dusted off the project after completing Uni to help kick-start a business.

The write-up is fascinating (and funny); I can picture a hard-working student persevering when all manner of things going wrong, while battling unreasonable school expectations and schedules. To translate and paraphrase some choice phrases:

  • “Since unfamiliar and having no experience with drawing software application … beginning was a big ugly mess” (drawing the “fonts”)
  • “… soldering was troublesome, with lots of changes and no solid basic skills, so burned out the first board”
  • “regardless of the teachers strongly recommending assembly language, I used C language” (since studied in earlier course)

Some of the specific design decisions and changes made along the way:

  • initial tests with Mercury switches were not that good because they would seize or otherwise fail. Replaced with a vibration switch like this component, which is what appears in the kits for sale. The original Mercury switch mount remains in the PCB design however;-)
  • experimented with various power supplies. It’s now 3V (2xAAA) in the kit.
  • uses the AT89S52 processor, programmed using Keil C51 compiler. The PCB retains an ICSP header for re-programming.

Hats off to 兴向荣 for carrying the project through to successful demonstration. I can’t remember producing anything as “finished” when I was at Uni!

At it seems he/she went on to commercialise the project and start an electronics business - you can find this kit and many others in the 兴向荣电子 taobao store, which appears to have been founded by zhengzhongxing39.

So how does the PoV work?

It’s quite simple:

  • the vibration switch triggers an interrupt handler on INT0 as the stick is waved back and forth
  • it ignores every second interrupt i.e. triggers in only one direction
  • the interrupt triggers the display of the words/graphic with a delay between each column of data
  • the main loop scans for the display selector switch input - when clicked, it cycles to the next messages for display.

I’ve translated and expanded the operating details in one of the example source files in annotated_source.c. The source is not identical to that pre-loaded in my kit (it has some different display patterns).

The interrupt handling is identical to Keil’s 8051 /INT0 External Interrupt Example Program.

Here’s what it looks like displaying a heart (my photo/my stick!):

PovShakeStickKit_demo

Construction

Here’s my transcription of the circuit. The subsystems break down quite simply:

  • power supply and power indicator LED
  • 16 LEDs in common-anode configuration are directly driven by the microcontroller.
  • A 1N4007 diode on the anode steps down the voltage for the LEDs, obviating the need for current-limiting resistors.
  • S3 pulls down P3.7 and is used to switch the words/image being displayed
  • a gyro vibration switch triggers INT0 on P3.2 and is used to synchronise the PoV display (as you wave it back and forth)
  • an Atmel AT89S52 (on a 12MHz crystal) runs the program. ‘nuff said!

The Schematic

PovShakeStickKit_parts

The Build

Credits and References

About LEAP#193 8051LED
Project Source on GitHub Project Gallery Return to the LEAP Catalog

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

LEAP is just my personal collection of projects. Two main themes have emerged in recent years, sometimes combined:

  • electronics - usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting
  • scale modelling - I caught the bug after deciding to build a Harrier during covid to demonstrate an electronic jet engine simulation. Let the fun begin..
To be honest, I haven't quite figured out if these two interests belong in the same GitHub repo or not. But for now - they are all here!

Projects are often inspired by things found wild on the net, or ideas from the many great electronics and scale modelling podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know (or send a PR!). See the individual projects for credits where due.