Sunday, February 9, 2014

Turning pages without moving too much, How to build a remote for the nook simple touch or NST

Waouh un deuxieme article! et totalement inutile pour 99% des gens! ... je l'ai mis là pour qu'il reste en ligne alors que les forums peuvent être capricieux... Mais il s'adresse surtout aux lecteurs des forums dédié au modèle de liseuse assez versatile que j'utilise.
C'est donc un article en anglais sur comment j'ai fabriqué une télécommande pour pouvoir lire mes bouquins sans avoir a tourner la page sur ma liseuse... Cela ne fonctionne que sur le NOOK de Barnes and Nobles, on ne peut pas faire ça sur un kindle ou un kobo (en tout cas pas à ma connaissance) je n'ai donc pas pris la peine de le traduire en Français (personne n'a cette liseuse en france pour la bonne raison qu'elle n'est pas en vente ici...), s'il y a des intéressés qui ne lisent pas l'anglais, laissez moi un commentaire ou un mail et je prendrais le temps.
Si vous voulez vous lancer dans la version anglaise, cliquez sur le drapeau anglais à droite
Undemanding as reading can be, my Nook e-reader made my reading a much easier activity (light weight, one handed page turns etc) that even made it prefereable to most traditional books. But since I can be very lazy I still couldn't help thinking how nice it would be to just relax in my bed with my hands tucked behind my head and still be reading and turning pages...

NB : This is an article about building a remote for a rooted Nook Simple Touch (and probably the nook Glowlight as well). It will not work on a device that doesn't have root access (like a factory default nook or a kindle or a kobo)  or one tha doens't have USB host mode (if you have a nook but haven't got usb host mode all the info for that is found on this wiki) don't hesitate asking questions in the comments if need be.
Reading without holding the book was easily solved, I bought a flexible smartphone stand from a chinese website (I was living in China at the time but you can probably find this kind of thing anywhere) and modified it to take a wider device such as an e reader. sorted.

Reading without touching the book however was a bit trickier, I first thought about buying a microcontroler (essentially an arduino) with an usb port and building a usb remote from that (I'd seen a few articles online about people building usb buttons including an "awesome button" which when pushed would insert a synonym of the word awesome in the text). I knew I could do it but it would cost me at least 15€ and many hours of learning how to program the thing. And then I thought, hey a regular keyboard can probably turn pages too... So I set up the USB driver and the USB host utility I found on the xda developpers forum board  (my everlasting gratitude to the authors) see here for usb host mode. I launched coolreader (which is my reader app of choice and found that what I needed was the up arrow and the down arrow, much like browsing a website or anything else on a computer. (it does'nt work on the stock reader app so if you want to build this remote you need to use coolreader)

I had my remote, now I just needed to make it smaller and get rid of the 106 extra keys on it... 
(yes I'm afraid I actually counted them)

So first I took my usb keyboard appart to figure out how that works, I expected an electronic board with a lot of little buttons soldered on it. It turns out it's much cooler than that : you get three transparent imprinted plastic sheets with different circuits on the bottom one and the top one. When you press a key, contact is made between the top and bottom sheets at this particular point. 

the middle sheet its just to prevent contact between the other two

The top sheet (if you pretend the keyboard is in normal position, its overturned in the pictures) has 8 circuits and the bottom one has 18 all leading to a connector each that's attached to the controler board (so the controller board has 26 connectors in all.

If you picked a random key and followed the circuit of the top sheet to the controler board, you would end up on one of the 8 connectors (and it you did the same thing on the bottom sheet you would end up on one of the 18 connectors.

so lets say we give a name to each connector we get

A1 A2 A3...A8 = top sheet connectors and

B1 B2 B3...B18 bottom sheet connectors

Each key of the keyboard connects an A number to a B number, so "F5" is A2/B7 and "SPACE" is A6/B12

Say you want a one-key keyboard for the space bar, all you need to do is to solder a button to make contact between A6 and B12.

That's it for the theory, but how do you know which connectors the keys are linked to?

Down the rabbit hole: decoding the matrix
(the keyboard matrix is the referencing of each key as a connection of 2 circuits)

Every keyboard is different,  so you will need to take the red pill and decode that matrix... 

I tried to take my electronic sheet and follow the circuit to the controler with the naked eye, but it's really too small so I only hurt my eyes, and ended up confusing the circuits. So I scanned each sheet in high definition, improved the contrast then zoomed in and traced the circuit with the pen tool (on the gimp or photoshop)*.

*if you don't have a scanner you can use this program Keyboard Matrix Mapper to try every combination of connectors with a paperclip until you find the ones you need, there is about 170 possible combinations, good luck ;o) 

The program is useful anyway to check you have the right key (if SPACE is the key you want you can just use wordpad to check you've got it but if it's UP it's easier with a program that tells you "up" if you find the right connection)

I got that (A numbers)
you can see the up and down keys on the left (view from the bottom of the keyboard)

And that (B numbers)

you can also see remnants of my earlier attempts (and mistakes) at manual mapping (in green) 

Combined diagrams
the yellow dots bottom left are the up and down keys (remember the keyboard is seen from the bottom so they're on the left.

This picture shows you the other side of the controler board with the familiar LEDs.

SO! Now I know that :

UP =  B13(red) /A6(black)
DOWN =  B14(red)/A4 (black)

I soldered my buttons on the controler board, adding a plug in between so I could easily change to a different remote if I decided to build one, maybe a foot triggered button who knows where laziness will take me next :o)  I suppose you could as well rig it to a motion or noise detector to turn the page when you whistle (probably annoying but why not...)

I had a phone plug lying around so I used that for the connection to the actual remote, that's the big grey thing in the picture. (and I couldn't quite resist using a phone line to bypass the matrix)

the usb cable colours are wrong please don't use them as reference!

I used hot glue to keep my soldering in place (didn't think to take a picture before gluing it sorry)

Then you need to connect your device to an OTG adapter before pluging it into the nook, OR what I did  was directly soldering a micro usb cable in there: take any micro usb to regular usb cable, cut the regular usb end, solder both black wires from that cable together to make it OTG) and then match it colour for colour to the usb cables soldered to your controler (or to the wires that go into the plug connected to the controler as was the case for mine.

On this picture the GND and Sense black cables are soldered together on the micro USB side of the cable but you can just as well join them on the other side (saves the trouble of opening up the micro usb plug)

Even if you replace the cable,  I still strongly recommend buying an otg adapter as most times the nook won't go to host mode unless you connect the adapter with nothing else attached  (see troubleshooting section of the Host mode link above)

The remote itself :

Anything will do as long as it's a button of any kind attached to a cable with twice as many wires as buttons on your remote... what I used was the buttons on an old phone, which  I cut away from the board: and the phone cable (be careful as some phone cables only have 3 wires, mine had 4 so all good)


The red dots are were I drilled and then soldered the wires.

I had a piece of transparent plastic and a metal plate I turned into a small case that fits snugly in the hand

ready to roll! you can see that the USB Host utility has picked up the remote (as a qwerty keyboard) and the key that has been pushed (dpad_DOWN).
Its better to close coolreader before pluging the remote and start it again once it's recognized, otherwise it fails to reload the book (I think it may be because the book is on the sd card and not the internal memory).

I put a shortcut to task manager on my homepage to kill coolreader if I forgot to close it before plugging the remote and it gets frozen on the "loading document" page.

This project looks like a lot of work compared to the end result, but let me tell you it was well worth the trouble. It's a awesome reading experience especially when you are tired or when your arms are sore!

That's all folks!
 I hope this has been useful to some of you! (if you do it please give me your feedback!) and don't hesitate posting questions either here or on the xda thread I created (if anything's not clear...)

No comments:

Post a Comment

Did you know? Posting comment reduces the risks of getting struck by lightning!

Le saviez vous? Poster des commentaires réduit les risques d'être frappé par la foudre!