Tuesday, December 11, 2007

Hack Keyboard into Magic Wand Clock

I got one of those magic wand clocks as a gift last Christmas, the kind that have a wand made from PCB with eight or so LEDs on it that waves back and forth with the LEDs flashing in such a way that you see text "floating in mid air", a technique called persistence of vision (POV). It was pretty cool, but I was kind of disappointed when I powered it up only to find that it was mis-calibrated so that the left and right strokes of the wand were out of sync rendering the time unreadable. Solution - bypass the internal LED control circuitry and wire in a keyboard for custom message display!

To do this I used a propeller microcontroller (from Parallax) and a few basic tools. All the required circuitry to interface with the LEDs and control the wand movement was already on the clock's PCB, I just had to run wires from the propeller to the bases of the LED-controlling transistors and run a line from the wand-detector so that I could sync. After about an hour of playing with Spin code (the unique high-level language for the propeller) I managed to get a stable field of pixels out of the hacked clock:


the pixel-field



the pixel field looking straight at it



a view of the whole set-up


Then it just took a few more hours to design an 8x4 pixel font on graph paper, enter the hex into a massive table, and program text scrolling into the propeller chip. Adding keyboard support was a no brainer, since the propeller works - just import the keyboard Spin object! Here is the result:

video
video of "Hello, World!" on the hacked device



You may download and use my code if you wish, from here (you want the .spin files).


This project was quite entertaining! Now the clock sits in my room and acts as a free-for-all message board for anyone who walks in - they just type on the attached keyboard and their message is added to the scroll!

After using the propeller with this project I would very highly recommend anyone with an interest in microcontrollers (or electronics in general) check it out! It is very powerful, well designed, and most importantly, the hobbiest/hacker community surrounding it is extraordinary!

Other POV links of note:
* U.S. Government hack of a similar clock (uses real-time linux distro)
* Spoke POV (for bicycles)
* MAKE magazine's POV toy (easy)
* POV analog and digital clocks (lots of photos)
* High Resolution POV (impressive)
StumbleUpon Toolbar Stumble It!

Friday, December 07, 2007

Software Scope Emulator with Slow Phosphor

To help with programming the scope graphics sound generating program from the last post I wrote the scope.c program to simulate an oscilloscope for testing outside the lab. I revisited the scope.c program and added a slow phosphor and a cool scrolling effect. The result is entrancing, particularly when you pipe different kinds of files into the scope.

Here are examples of various types of files piped into the new scope simulator:

Videos:

[TODO: get Google to accept my video!]
Video of C source code playing on scope


Images:
rastered bitmap images (converted from pngs automatically!)




random data (/dev/urandom)


the contents of my harddisk (/dev/sda1)




an mp3




and from the audio used in the last post:



StumbleUpon Toolbar Stumble It!