Every project needs a good name, and given the nature of this particular endeavor I can't think of anything that would top The FrankenKindle. Now all I need is a theme song...
This week marked a huge milestone for the project. The two large page turning buttons on the V.Reader device were used to control the page turn functionality of the Kindle 3. And, wonder of wonders, it worked!
Here's a quick rundown of the components in the video (skip to the end to see the actual test).
(WARNING: Nerdspeak ahead. Skip to the bottom if you value your sanity. You've been warned...)
We'll be using seven buttons in total from this device, although for this test only the two large arrow buttons on the front panel were used to turn individual pages. They are simple dry-contact switches, which means that when they're activated it's basically the same as touching two wires together to make a connection. Two wires were used per switch, and are routed back to the microcontroller on the breadboard.
For simplicity's sake I chose to use the Teensy++. It's a USB-powered device based on an 8-bit AVR microcontroller, which allows easy connection to the PC for programming and also provides a convenient 5V supply to the rest of the circuit. In addition, it is compatible with the Arduino environment which dramatically simplifies the programming phase. This particular unit is overkill for this application but we're hip-deep in the prototyping phase here so the emphasis is more on making it work than making it efficient. That will come later.
This is the multiplexer I chose, mainly because it's cheap, intended for digital signals, and has a breakout board already. If multiplexers confuse you, just think of one of those old-school telephone operators sitting in front of a giant switchboard. They take a jumper cable and connect two signals together so they can communicate. That's exactly what happens here.
Let's look at the left-hand circuit for starters. The short version is that pin 7 (called "1D") may be connected to any one of the four pins above it, pins 3, 4, 5 or 6 (1S4, 1S3, 1S2, or 1S1, respectively). The signals IN1 and IN2 control which connection is made, and 1EN and 2EN enable it. The EN signals allow the connection circuits to be handled independently, basically making this into a dual single-pole, quadruple-throw switch. Each chip, then, should allow up to eight distinct connections to be made.
That's fantastic, except the breakout board supplied by SparkFun doesn't break out the 1EN and 2EN pins, so any connection made on one side of the chip is mirrored on the other. 1D and 2D are still distinct, but they cannot be controlled independently. If 1D is connected to 1S3, then 2D must also be connected to 2S3. This limits us to only four independent connections per chip, rather than eight. (Yes, the two switch systems are electrically isolated, but since it is not possible to independently control them, half of the switch becomes useless for this application.)
Further, since I can't enable or disable the connection I must reserve one combination as a "home" and make sure it's not used. The reason for this is simple - each connection simulates a key press event on the Kindle. We must have a state where no keys are pressed, and the only way to do that with this chip as SparkFun sells it is to reserve one of the switch combinations and not connect it to the Kindle at all. As such, out of eight possible connections we are only able to use three.
Fortunately I decided to buy spares, so I should have enough on hand to complete the first run of the FrankenKindle. Eventually I'd like to make this project more user-friendly however, and this issue will need to be addressed. It will likely require creating a custom PCB for the project.
As detailed in a previous post, two hacks were used to improve the functionality of the Kindle for this application, Jailbreak and Launchpad. When a key is pressed on the V.Reader, the Teensy sees that and uses the multiplexer to mimic pressing the specific key sequence to fire the Launchpad script, which will turn an individual page. (Whew!) This same procedure could be used without the software hack, but it would only be able to jump between chapters, not individual pages.
(This concludes the nerdspeak - welcome back!)
Enough talk - here's a short video showing how it works. Apologies for the horrible sound quality.