Friday, November 13, 2015

Hacking a Logitech MK220 wireless keyboard and mouse combo for a community computer

Recently during my stint as a Teach For India Fellow, I have been building Community Computers for use at my school. These involve creating an easy to carry box with projector, computer, speakers and wirless keyboard/mouse all stuffed in. After building one based around Intel NUC PC I decided to think of ways of decreasing cost of the Community Computers and make it more user friendly for our not so tech savvy teachers. Towards that, I thought of using an old non-HDMI VGA projector paired with a Single Board Computer APC 8750 which runs Android OS and has a VGA video output which makes pairing with an old projector possible..

If you think about it, a computer that runs Android would be more successful with teachers as compared to a Windows based PC. Teachers now days have access to smart phone so that are already comfortable with using Android. If you install appropriate apps on an Android based community computer, they can play all kind of content - videos, photos, PDFs etc. Also Android based SBCs boot fast and you don't really have to worry about viruses.

The APC 8750 supports playing of Videos and Photos from a USB flash drive that you plug into it. Here is what the result looked like:

If you notice, there is a small box with colored switches next to the wireless mouse. That box is actually a full fledged wireless keyboard hacked down to retain just the 4 arrow keys along with Esc, Space bar and Enter keys - because those are the only keys that you need to operate the Android OS on APC 8720 for playing videos and photos. It has proven to be a good idea because carrying a cumbersome keyboard to class when you only want to show videos and photos is not such a good idea. Big keyboards are prone to damage in a chaotic classrooms.

Here is how I went about hacking the Logitech MK220 wireless keyboard and mouse:

Step 1: Open up the keyboard and separate out the parts:
You can see the back side of the transmitter circuit and key membrane

Keyboard membrane (the one with silver traces on it), pressure pads sheet (made of rubber) and the transmitter.
Step 2: The membrane separates into two sheets - Top and Bottom. So the next step was to scan the sheet so as to highlight the traces for the keys that I wanted on my compact new remote. Since the length of the membrane sheets was more than what would fit in my A4 sized scanner, I had to perform the scan twice from both ends of the membranes and join the two images. While scanning the two images, I placed a black folder as their background to ensure that there was contrast between the traces of the membrane and the background which would otherwise have been white due to the white sheet usually stuck on glass facing side of the scanner lid.

Two sheets of the membrane lying on top of each other

Black folder providing contrast while scanning

Scanning in progress

Scanned the membranes from one side...

... and then from the other side because they did not fit all together at once in the scanner
Step 3: Next, I used Microsoft Paint to join the images. Then I used IrfanView to decrease their color depth to 2 colors (black and white) and then back to 16 million colors. This ensured that the contrast for the image had been maximized (each pixel was either white or black) and that I could now use the paint bucket tool of Microsoft Paint to trace the tracks on the images. The tracks were white and the background was black,

Decreasing the color depth (IrfanView) and then increasing it again (Microsoft Paint

Joined image. Decreased to depth of 2 colors only.
Step 4: Finally use the paint bucket tool to trace the tracks to the pads of keys of interest on the top as well as the bottom layer of the membrane. Then match the connecting pins to the pads on the keyboard transmitter PCB and make a list of what to pads on the transmitter PCB correspond to pressing of which key.

Step 5: Finally mount tactile switches on a PCB and assemble your own circuit for the wireless remote control. Solder wires from these tact switches to pads on the transmitter PCB corresponding the keys that the new tact switches need to proxy. Fit them all in a small door bell box, add batteries, close the box shut and you are done.

NOTE: Here is the list of various other Community Computers that I built using various other projectors and single board computers over the few months of my fellowship.

Thursday, November 12, 2015

Community Computer using Intel NUC PC

NOTE: Here is the list of various other Community Computers that I built using various other projectors and single board computers over the few months of my fellowship.

As I began my Teach For India fellowship, I got inspired by the K-Yan and decided to build my own community computer for my own class of 48 7th graders. I tried building one using a Raspberry Pi, but the results left much to be desired (Couldn't install Prezi, wasn't powerful enough, video player required commands to operate, no internal storage etc). That's when I came across Intel's Next Unit of Computing (NUC) PCs. These are small form factor PCs built for portable applications like interactive kiosks etc.

Since these PCs only have and HDMI output, I would need an HDMI capable projector. So I asked my friends for donations and went shopping and bought these:
  1. BenQ MS521p [Cheapest HDMI Projector]
    INR 30,000
  2. Intel DN2820FYKH [NUC PC]
    INR 9,340
  3. 8GB Low Voltage 1.35V SODIMM DDR3 RAM Kingston KVR16LS11/8 [For NUC PC]
    INR 3,300
  4. 2.5" SATA 500GB HDD Toshiba MQ01ABD050 [For NUC PC]
    INR 2,870
  5. HP S3000 USB Powered Speakers
    INR 729
  6. Logitech mk220 Wirless Keyboard/Mouse Combo
    INR 1,300
  7. HDMI Cable
    INR 790
So for under INR 48,500 I had managed to collect all the components:

I began by installing the HDD and RAM in the NUC PC and Installing Windows on it using a pen drive. Installing Google Drive on the PC (I have WiFi at school too), allowed me to sync stuff from my home PC to this Community Computer easily

Next I mounted all the components on a piece of plywood (I had to add in a powerstrip and phone charger to power the speakers) and voila!: I had an easy to carry community computer which took no time to setup and assemble at the start of the class because all the components were always wired together beforehand and did not need any connection and disconnection. The setup just had a single 3 core AC mains cable coming out of it. I could now go into my class, setup the projector, and show videos, photos, powerpoint slides, prezis and all kinds of content to my kids.

Carrying it around was still cumbersome and the plywood meant it wasn't sturdy enough.
Also, I had to carry the keyboard and mouse separately.

I was looking for a way to make it more compact and easy to carry.
That when Mr Rohit Garg, who owns a electronics goods and service shop here in Aundh, Pune suggested that I mount it in a casing meant for a voltage stabilizer. I gave him the current setup and this is what he came up with:

This made it immensely more sturdy. But the keyboard and mouse still had to be carried separately.
That and the ventilation was a big issue. I did not want the projector/PC's lives to be diminished just because of lack of ventilation. Rohit had made cut out for vents but somehow it did not seem enough for me. So I did away with the shell, and while I was at it, I added a lunch box to hold the projector's remote and wireless mouse. For the keyboard I added velcro (loop and hook) stickers to make it easy to stow inside the case itself. The Community Computer now had to be carried using two hands which was more comfortable. The keyboard, mouse and the projector remote are now stashed inside the community computer itself.

Community Computer frame with the keyboard and mouse stashed within it

Velcro hook stickers applied to the projector top to attach the keyboard

Velcro loops on back of wireless keyboard

Lunchbox lid attached to the community computer frame to hold the mouse and projector infrared remote
Front View

Intel has recently come up with the Intel Compute Stick. The compute stick is a cheaper replacement for the NUC PC. The stick has 32GB of eMMC storage (its like an SSD Hard Disk) and 2 GB of RAM already inside it. It retails for INR 9,800 on flipkart and comes pre-loaded with Windows 8.1:

NOTE: Here is the list of various other Community Computers that I built using various other projectors and single board computers over the few months of my fellowship.