So, for the past month I have been working on a side project called the BikePOV. If you have been reading my tweets, I’m sure you’ve picked up on my cursing, explaining and working on making it work.
This evening I finally got everything working just the right way — and it actually works!
So, first let me explain what is going on. I took an Arduino prototyping board and designed a circuit around it. Essentially I took 12 RGB (Red, Green, Blue) LEDS and soldered them onto a circuit board. I then mounted the circuit board in between the spokes of a bike wheel. The theory is that when the wheel turns, I can control the LEDs, and make them flash in a pattern that represents letters, patterns or images. This is called a POV, or Persistance of Vision.
This idea has been done before — there are pre-made kits that you can buy from a company called AdaFruit. A company called Monkeyletric also sells a POV kit for about $60 (which is MUCH nicer than my setup, but they only have pre-done patterns).
So, where did I start? The first order of business was prototyping the setup. This involved writing some really basic software for the Arduino (using the Arduino Studio in C++), and testing some theories. I tested things like if I could get the Hall Sensor to work right (a Hall Sensor, is an electic component that senses magnetic fields. This is how I know how fast the wheel is turning). I used a breadboard that was duct-taped to a bike wheel. My wife started laughing when she saw that I had carried my commuter bike up three flights of stairs to do testing.
Once I got everything tested, I wrote up a schematic. I used a program called Fritzing, which is a free app used to design circuits. It also let me visualize all the components I needed. What I ended up with was a shopping list and a printable PCB layout that I would later use to etch my PCB. I sourced all my parts from either SparkFun or Mouser.
Once everything came in, I printed the PCB design using my laser printer onto some shiny newsprint. I then ironed that design onto a copper-clad printed circuit board. Essentially, this is a siliclon board with copper on both sides. After the design was on the copper, I etched it using some chemicals. What I ended up with was my circuit board ready to put components onto it. The circuit board needed to be drilled first, then the components added, then soldered. It sounds quick when I’m writing it, but that entire process took a full weekend.
Next, I had to write the software both on the computer, and for the Arduino. I wrote the image software in Adobe AIR. This software allows you to write messages or pull in images and “upload” them to the arduino. I used the BitmapData to store what I wanted to write (a 12px tall image by 200px wide). I then stored them as Bytes and sent them across the USB to the Arduino. This will also work with the Xbee wireless transmitters (I borrowed some, but didn’t implement them yet).
The Arduino software was the easiest to program out of everything. All it did was listen for the magnet to trigger and then start painting the image. It times the magnet going around and bases how long it should keep on the LED for. The most time-consuming part of Arduino programming was writing the code to accept the images from AIR and to store them on the EEPROM (electronic hard drive).
Finally, I had to build a platform to mount the circuit board and Arduino to my bike wheel. I used a clear sheet of Plexiglass. It is not the best, but for now it will work
My entire POV cost me about $30 in parts, 40 hours of work and a few burns from a soldering iron. It was super fun to build, and with any luck I will get to try it out at a bar crawl soon. The advantage of my POV vs. others is that I don’t need to burn a new firmware each time I want to change the image — I can change it on the fly. In theory I could change it with a cell phone or really anything with a serial port.
I will be doing a full talk about this and much more at Adobe MAX. Check out my session where I will go through the code in detail, and show how it’s done!
Watch a video of the BikePOV in action.
The source code: