Tuesday, 18 February 2014

Phone-based document scanner


Recently  I moved home, and in the process of packing up my belongings, I realised how much of my stuff is just paper - Old notebooks, documents, paperwork, etc.

I didn't particularly want to take it all with me and I had neither the time or the inclination to sort through it all by hand, so I started looking at ways to digitise it.

A flatbed scanner would've taken far too long, and I didn't want to go buying new hardware.

My phone (Samsung Galaxy S3) has a pretty good camera. The resolution is high enough to be able to read text from a page, and it's ability to take multiple pictures in succession meant speed wasn't an issue.

Using it by hand however can be a problem. Results were too inconsistent - shakiness caused blurring, inconsistent distance meant time was lost waiting to refocus.

So I built this simple jig from some wood scraps to hold the phone at the optimal distance.



It's an improvement, but the vibration from tapping the screen to take the picture was still causing some distortion.

After some messing around with various options - IOIO board, custom camera apps, etc. I realised that when I was using a USB-OTG adapter with an external keyboard, the stock camera app would treat the enter key as a shutter button.


Rather than waste a whole keyboard on this, I remembered I had a PCB from one in my junk box that was destined for a project that never materialised.




It already had the key matrix wired to a connector from an old IDE cable, so all it took was some probing with a breadboard jumper wire to find the connections for the Enter key, and wiring in a button.

A bit of Sugru later to make the button more comfortable, and I had a quick way of digitising my old documents.

Next Steps
  • An update to the stock camera app stopped it recognising the keyboard as the shutter button. I've been using the new voice commands instead, but it's a lot slower. Maybe switch camera apps / make a new one.
  • Software to analyse all the scans I've taken to help organise. 

Friday, 14 February 2014

Moved to Blogger


I've finished migrating the site to Blogger. Microsoft's Office Live offering was good, but too focused on businesses for my need.

I aim to post at least once a week, I'll probably move away from the "complete-project-as-a-post" towards more short-form, detailing parts of projects as building blocks of larger projects.

Please note that all these projects are things I do for my own benefit & enjoyment and shouldn't be considered as tutorials or instructions. Some of the electronics projects could be dangerous if done incorrectly. Do your own research and be responsible for your own safety.

Wednesday, 12 February 2014

DIY Phone-Controlled Mains Sockets


Next Steps
  • Get it working with Wiring-Pi so that RC Switch can operate from the Raspberry Pi directly and free up the Arduino.
  • Adapt the android code to work with SSH/Pi/etc (Currently using command line via ConnectBot)

Version 2
After the original was broken (physical damage from a fall), I re-implemented with the RC-Switch Arduino library. (http://code.google.com/p/rc-switch/).

Version 1
The RF plugs I used were the Maplin Gadget range. The controller is powered by a 12V battery and allows 4 sockets to be controlled across 4 channels (so theoretically up to 16 different sockets could be used)

Each button on the controller has 3 connection points - let's call them left, top and right. all three need to be connected in order for the button press to register.

In the "On" column, the left connections on all the buttons are connected to the same line.

In the "Off" column, the left connections are connected up in the same way.

The top point on all 8 buttons is connected to the same point - this is the one that controls the little LED at the top.

The right hand side for each row is connected - ie, the right point of 1-On is the same as the right point of 1-Off.

So, the transistors need to go as follows:

1: Between the left point of one of the on buttons, to the top point of the same button.

2: Between the left point of one of the off buttons, to the top point of the same button.

3: Between the top point of one of the buttons, to the right side of either button 1 (on or off)

4: Between the top point of one of the buttons, to the right side of either button 2 (on or off)

5: Between the top point of one of the buttons, to the right side of either button 3 (on or off)

6: Between the top point of one of the buttons, to the right side of either button 4 (on or off)












The channel selection switch has 6 points. The two middle ones are grounds, and the 4 others represent each channel. Use a transistor to connect each channel to ground

Now you have 10 transisitors: 1 & 2 are On and Off, 3-6 are the switch selection, and 7-10 are the channel selection.

Connect these transistors to the microcontroller & write your software.

To operate the remote, 3 transistors need to be active.

I found the easiest way to do this was to firstly choose the channel and make that transistor active. Then choose either on or off and make the appropriate transistor active. Then finally, pick the switch to activate. I found that it's best to make the switch active for a second and then turn it off. Having the transistor remain active and "hold down the button" didn't work. If necessary, have the switch transistor pulsed a couple of times.

Remember to make sure that the transistors are deactivated after you've sent your signal.

Originally the code was written for Arduino, but has now been moved to an ATTiny2313.

Due to the number of microcontroller outputs required, a 74HC595 shift register was used. To enable serial communication, the ATTiny was connected to a Wiznet ethernet to serial module, via a MAX232 level converter.

The android software uses a simple ListActivity as the display, and reads the list items from a text file on the SD card in the below format.

// This is a comment line
11. Item Name

The numbers indicate which channel and button the device is on, the rest of the line is a plain-english description of the device. Upon selecting an item, it displays a simple dialog box asking the user to confirm their choice, before sending the command to the Wiznet device via Wifi.

Tuesday, 11 February 2014

Wacom Graphics Tablet from broken HP TX2000 tablet PC

Next Steps
  • LVDS to VGA boards have become more common since I originally did this project, I might get one and turn it into a complete external touchscreen monitor
Version 1
I acquired one of these laptops after it malfunctioned. Apparently this is a known issue of overheating.
I initially tried to fix it by reseating the graphics chip, which worked for a while, however it quickly began to malfunction again.

So I tore it apart to see if there was anything useful I could scavenge.

It's well documented that laptop screens are near-impossible to get working as standalone monitors, due to the differences in the way they communicate with the computer compared to regular screens, so instead I set about trying to make the touch screen work as a standalone tablet.

I was expecting this to be quite difficult. Turns it it's one of the easiest hacks I've ever done.

There's a 9 pin connector that connects the digitizer. In amongst those 9 pins, there's USB pins. (see this forum post for pinout image).

It's not a simple case of soldering on a full USB plug though, the tablet works at a lower voltage (3.3v) than the standard 5V.

To overcome this, putting 3 N4148 diodes on the voltage line was sufficient to drop the power to a usable level. This isn't an exact measurement, but it works.

A standard Fedora 16 desktop install comes with wacom drivers pre-installed, so the software side of things was basically plug-and-play. The only change I made was to change the pen mapping from absolute to relative, which was better suited to my monitor setup.