Tuesday, November 29, 2011

Digital, not Analog

I finally dug into the bowels of the Vitamaster, and found this little number. Our motor theory was wrong. Rather than depending on analog voltage input from a motor in the wheel, the Vitamaster uses what is misleadingly called an "electronic watch." I'm just glad they printed the patent number on that thing, or I may never have figured it out. Behold:

Getting this out without destroying anything proved difficult, but probably not as difficult as putting it all back together
Though patent descriptions read like dry nested story puzzles, it looks like this device is basically two rotating magnets and a reed switch, turned by that uppermost blue arm when the bike's wheel spins. Which (I assume) would mean we would actually be getting digital readings -- an on/off pulse -- and reading the pulse rate. Every time the wheel rotates, the magnets in the rotating trough pull the reed switch together, completing the circuit and thus sending a brief "on" signal once (or twice?) per rotation. Apparently mine is missing one magnet. I'm not sure if/how this affects performance.

Given my earlier (failed) attempt at reading voltage with a multimeter, this now makes more sense: A reed switch, when connected to an ohmmeter, should read either zero or infinity, depending on whether it's closed or open, respectively. I'll have to run another test tomorrow. 

Tuesday, November 8, 2011

Specifics, In General

So I (finally) hooked the Vitamaster's motor up to my multimeter, and the results were...

(drumroll)....

Nothing. Maybe it's just me, but I tried pretty much every combination and got absolutely no reading. Which probably just means I need to get a new motor. Fair enough. It is over a decade old.

But in the meantime, I've spent a lot of time thinking about how to control a video game with this thing. The thing is, there aren't a lot of games which use a gradient for motion control. In most games, you're either moving or you're not. In some, you move faster depending on the tilt of the joystick, but even then there are generally just two or three different speeds you're able to move. On top of that, joysticks are generally USB HID devices, and the Arduino is only capable of delivering a serial stream on its own. People who want to use Arduino as a USB HID device seem to pair it up with a Teensy controller, but I'm not so sure I want to emulate a joystick anyway, so I might just save the money and instead simulate mouse input. I have already successfully turned analog input into a serial stream, so writing a small program that can translate serial input into simulated mouse input shouldn't be a problem. The problem is... what game should I control?

The thing is, using a bicycle as a game controller is not practical for general usage. Kids won't be buying this thing in order to work out while they play Halo, as far as I can see. For this thing to be any amount of fun, games will have to be platform specific. While the inspiration for this whole thing came from Wii Fit (specifically the biking game, where you pretend to pedal while standing on a board), I don't see hacking the Wii Fit board as a viable solution for the current problem. I could put pressure sensitive pads or accelerometers on the pedals of the bike to simulate the steps taken in Wii Fit, but figuring out how to communicate with the Wii Fit would be brand new research, and with my level of experience, I don't see that happening by December.

So what can I do? I can start by syncing analog voltage to mouse position with the Java Robot class and demonstrate this through Dasher, which is not a game exactly, but then design a rudimentary game where player velocity is based on a mouse coordinate. After all, this is the basis of something bigger, so I'm really building some basic elements which will later be elaborated upon.