Monday, July 1, 2019

E-Book Reader page turn button mod

Premium E-Book readers these days (Kindle Oasis, Kobo Forma) are sporting an asymmetric design and physical page turn experience. This design makes for a great one-handed reading experience. Both these products are positioned at a premium price point, in excess of $200. Since I was otherwise happy with my Kobo Glo HD, I decided to mod it to add physical page turn buttons!



Full details on the mod are below.

Architecture

The stock reader SW responds to touches on the screen edge for turning pages forward/backward. Since there are no (known) hooks/API for the SW, the simplest way of turning pages (without actually touching) is to fake touches on the screen edge. The underlying Linux OS on Kobo E-Readers is fairly open, and it is easy to fake touches by recording the input event, and playing it back. With this, it is possible to turn pages with a simple Linux commands. Using this, the folks at mobileread forums have developed ways to remotely turn pages over WiFi. However this relies on keeping the Wi-Fi awake, and so is a battery hog, which isn't great for an E-Reader.

At first I tried looking into talking with the main processor via UART or I2C, but even this was too complicated requiring a dedicated MCU. I then thought of a more direct way, of actuating the touch screen at the page turn locations. 

The Kobo Glo HD, like many e-readers uses an optical touch screen. The optical screen relies on a string of LEDs on two sides of the screen, which create a X-Y light field, which is picked up by photoreceptors on the opposite sides. Placing a finger on the screen interrupts the light at a particular X-Y location, which is detected by the digitizer chip.

Now if we momentarily short out the LEDs corresponding to a particular X-Y location, we can fake a touch at this location. So to fake a touch on the left edge, we need to short out two LEDs, one in the middle of the long edge, and one on the left side of the short edge. For a touch on the right side, we need to short out the same LED on the long edge, but one on the right side of the short edge.

Putting it together

I decided to try this out, since it seemed simple enough. The back of the Glo HD can be pryed apart relatively easily, and removing the motherboard can be separated removing four screws plus a bunch of connectors.

On the other side of the motherboard, I saw the string of LEDs corresponding to the X and Y axes, to which I soldered a few wires:
I then put back the ereader, and connected the wires to some switches to try it out. As the video below shows, it works beautifully 😀



I did discover that you need to actuate both the X and Y axes simultaneously to register a touch. So if the X axis is actuated first, and then the Y, then it doesn't register a touch. So I needed to find a way to actuate both axis simultaneously for my final implementation. I could either use dual pole switches, but I didn't have any at hand, and was worried about non-simultaneous contact. As a cleaner solution, I wired both buttons to transistors, which short out two LEDs depending on which button is pressed (so button 1 activates transistors which short out middle-Y and left-X LED and button 2 activates transistors which short out middle-Y and right Y-LED). To drive the base of the transistors, I tapped the battery positive supply as well.




I then wired this circuit on a protoboard, and it worked as expected.




Designing a case

Now that everything was electrically complete, I decided to put it all together. At first I thought of designing a full top case replacement to be 3D printed, but got bored halfway through. Then I decided to go with a simple case to hold my circuit, which would function as a grip. The sidewall of the Kobo has a slight taper and I matched the taper on my case with this, so that the front face was flush. I didn't have any black filament, so I printed it with white ABS. I then attached it to the side of the top case of the Kobo with some ABS glue (ABS dissolved in acetone) + a couple of screws for strength.

(in retrospect, the design of the case was too boxy, and I should have probably made something more ergonomic for gripping. I may redo it when I get some black filament)

Success!

Lastly, I assembled everything together, screwing my circuit board into standoffs on the case, and attached button caps. Since the white looked distracting compared with the black Kobo, I painted it black. The black does look a bit different from the black of the Kobo, and the finish isn't great, but as seen in the video, it works perfectly, and I can comfortably use my Kobo with one hand. 


Final thoughts

I have always wondered why physical buttons are not standard issue on ereaders. After all, they can't be too expensive to add. I guess this is primarily driven by marketing and to differentiate the premium range (Oasis, Forma). As shown in my project, it can be done in less than few dollars. 

I did cut a few corners with this project. Some improvements in the mechanical design are needed (buttons are too far away, grip shape is not ergonomic), which I may improve at a later time. The ultimate goal is to complete my custom top case design, so that the buttons naturally blend into the rest of the product. 

Electrically, a simple improvement is to add a switch to reverse the connection of the left and right transistor gates, allowing to swap the forward-backward mapping of the buttons. A more ambitious goal is to stick in a low power MCU, allowing for more tricks, such as a slideshow/autoplay mode, remote page turn etc. 

Clearly, there is a lot of room to build on this idea, and I plan to pursue some of these in future, but for now for a weekend project, I'm quite satisfied with the way the mod turned out 😃



Thursday, June 27, 2019

Experiments in 3D printing

I have been interested in rapid prototyping technologies for a long time. Seeing your ideas realized into objects presents an immense opportunity for innovation. The rise of affordable rapid prototyping services has unleashed a great wave of creativity. 3D printing represents one such opportunity, drastically reducing time and costs of prototypes, compared with traditional technologies such as machining or molding. While I had used 3D printing services couple of times in the past, my interaction with 3D printing itself was more limited, mainly consisting of submitting ready-made drawings to printing services. With a goal of taking my tinkering to a next level, I decided to acquire a 3D printer.

So many choices!

While it was obvious that I wanted a 3D printer, I was absolutely perplexed by the wide variety of choices. Should I go for a kit build or a ready made one? Should I get a new one or a used one? Should I get a compact user friendly machine, marketed at beginners and children, or should I get a more advanced (and complicated) one? The next several weeks were spent glued on to various 3D printing sites, trying to figure out what fits my needs the best. I decided against going with a beginner oriented printer (these are often named mini or jr etc.), since I was comfortable with tinkering with the printer. I also wanted to print a number of filaments (such as ABS, PETG) and not just PLA, while many entry level printers are PLA only. Having decided that I wanted at-least a mid-range printer, the next question was whether to get something new (either assembled or in kit form) or a used one. I kept monitoring Craigslist for the next week or two, but noticed most of the printers are either several generation old or pretty much as expensive as a new model. I think this is natural, given that a 3D printer is quite a niche product, not many people would be selling them. I was trending towards buying a Creality Ender 3 in kit form, until I found a used Qidi Tech I at the price I was looking for. The Qidi came with dual extruders (allowing for multi-color or multi-material prints) and represented a better deal than the Ender 3. It did need some TLC, as the previous owner had given up on it after a clogged extruder and decided to sell it. As I was comfortable with tinkering and repairs, to me this looked like a better deal (with the opportunity to learn more about the machine :-)). Thus I finally bought the Qidi Tech I

My first 3D printer!

The Qidi Tech I is a Flashforge Creator Pro clone, coming with the same metal frame and acrylic hood. It even works with the Flashforge slicer (while Qidi provides a slicer of their own as well). The previous owner had not used it much (just 78 hours) and for the price, it was a steal. The nozzles were clogged when I got it, but nothing which a bit of tinkering couldn't fit. Thus with a couple of hours of servicing, I was ready to start 3D printing!

First 3D print

Once I had serviced the printer, I was ready to start printing. To test out the dimensional accuracy of the printer, I decided to duplicate a padlock key. Using a pair of calipers, I got all the relevant measurements of the key. To build the CAD, I use Tinkercad, a free online tool from Autodesk. Once the CAD was built, I used the stock QIDI slicer to generate the G-Code for my model. The stock slicer, while works, does have some limitations, and somewhat a clunky interface. I will probably use a better slicer for more advanced prints. The final key came out dimensionally accurate, and I was able to easily operate the lock with it,

 Some more prints

For cutting my teeth on some more 3D printing, I decided to print some more parts.  I have an old vaccum cleaner, which except for a broken brushroll cap, was otherwise in excellent shape. I spent an afternoon modeling the broken parts, and the vacuum works pretty well with the replacement parts I printed.

Final thoughts

I was willing to get my hands dirty, I got a really good deal on a used printer. After servicing it, it's hard to tell that it was it was ever used. The 3D prints are an excellent quality with great dimensional accuracy. I haven't tried the dual extruder feature yet, but will be experimenting with this in the coming future. Some other upgrades I plan are a glass bed, and possible upgrades to the hotend. Overall, I am very happy with my 3D printer purchase, and plan to tinker a lot with it. 



Saturday, February 17, 2018

Tinkering with MicroPython

I recently came across a neat embedded project, MicroPython, which is a port of the Python language to ARM microcontrollers. The possibilities offered by this are amazing in my opinion. Python is used extensively by folks outside of the embedded world, software engineers, data scientists etc. By allowing embedded system programming in Python, MicroPython opens the doors for a large audience to try their hands at tinkering hardware. In addition Python being an interpreted language, you can execute any code on the device interactively, through a serial prompt on your host machine. Again this frees up the time spent in compiling code, writing FW etc, as one can simply try out new things on the device on the fly.

Super excited about this project, I decided to order a PyBoard. This is a STM32 based reference board for the MicroPython project. The MicroPython is an open source project and has been ported to a number of platforms, some of them are listed here. Since the PyBoard is the reference platform, I decided to start with this, as I figured this would have a better level of community support and compatibility. Couple of days later, I had received my PyBoard, neatly packaged in an anti-ESD bag. My first thought on seeing it was it sure is small 😊. After unpacking the board and soldering a bunch of headers, it was good to go.

Hello, World!


Every programmer starts with a Hello, World! program, or in embedded systems, a blinky LED program. On the pyboard, this is the simple script below:


from pyb import LED led = LED(1) while True: led.toggle() pyb.delay(500)
And this is the pyboard running it...


More experiments = More fun


After the blinky LED program, I tried to interface the pyboard with an 8x8 led matrix, driven by a max7219. I found a library to control an led matrix with MicroPython here, but since it could only draw single pixels, I decided to extend it with a font to draw characters. If you want to tweak the library, the datasheet for the max7129 can be found here. Here's the led matrix displaying a simple hello world program...

The library and the test program can be found here.




Future experiments


Currently I'm in the process of writing some more libraries for the pyboard to interface with various modules I have. Planning to create something useful with the pyboard in the coming weeks...




Sunday, February 11, 2018

Hello, World!

Hi there, welcome to my blog. A little bit about me - I am an electrical engineer who loves to build stuff. I absolutely can't get enough of tinkering and making things; mostly electronics, some woodworking as well. I have decided to chronicle my various projects, experiences and thoughts in this blog.

As of writing this post (02/18), I work as a hardware engineer at a major electronics manufacturer and live in the SF Bay Area. Living in the SF Bay Area is an amazing experience if you are an engineer and like to build stuff. I am really fortunate to have worked with and learnt from some of the smartest and coolest minds, and I do hope I'm able to share something smart and cool with you!