Monday, May 6

I built a book scanner!

My Better Half and I likes books - like them so much that we are running out of space in which to put them, not to mention the hardship of packing five books for a two week vacation. So we - well, mostly she - hatched a plan to get our book digitized and readable on either our ebook readers or on our tablets.

Digitizing books can be tricky though - the easy solution would be to hack the spines off and feed them through a document scanner, but there is two major issues with that plan: First, a fair number of our books are hard-to-impossible to get. Second, that's barbarism and just not something you do to books. A different approach was clearly needed.

A dedicated bookscanner that don't require you to mutilate your books are quite costly - if you want one of those you better be prepared to put a second mortgage on your home - but luckily there are dedicated tinkerers on the Internet that are more than willing to share their home-brewed designs. One such group is over at, who both have as a goal to put a book scanner in every hackerspace, and have come up with a simple, rugged and more or less fool proof design. One of the guys from there lives in Europe, and have started a business ( selling kits with almost all the bits you'll need to build one.

As these things often do, it took longer from the box arrived until it was ready than I had planned for - part was down to timing (it arrived just before I had to be out of town for a few weeks) and part of it boils down to me not being quite as good with Linux as I had led myself to believe - more on that later.

The hardware for the kit is several kilograms of CNCed Baltic plywood - painted and ready to go - along with a small heap of screws and other odds and ends.The electronics consists of two Canon PowerShot A2200 (came with the kir), and one of my old Eee 701 running Ubuntu 12.04. On the Eee I run a sh-script which talks to the chdk-firmware in the cameras; it handles zooming in, setting the ISO, taking pictures, downloading to a SD card in the Eee and deleting the photos off the cameras.

One thing that wasn't in the kit was a good handle - it came with one that I consider unsuitable for our use. However, a threaded rod, some nuts and washers, and a bike handlebar fixed that...

Then it was just a matter of mounting the light, the cameras and installing the software on the old Eee.

Yeah, about that...

The Eee is an old little Linux Netbook, so the first hurdle was installing Ubunto 12.04 on it and then uninstalling pretty much every app that came with it. Once that was done I could download and run the various scripts that controls the cameras - only to find that they would not zoom in as they should.

Headscratching... lots of it, both for me and the guy I bought the kit from (a very likeable guy, and very, very helpful).

My Better Half and I was discussing buying a new computer just for scanning (either Linux or Windows - software exists for both), when i out of desperation decided to reorder two steps in the script. And while it shouldn't make no never-mind, it did fix it - the cameras zoomed in happily enough and snapped away.

The Eee only handles the camera triggering script and the downloading from the camera. Post-processing is done on our desktops, using a very nice (and free) piece of software called ScanTailor, which is custom made for this sort of things. The output from ScanTailor can be OCRed to produce searchable text, and/or turned into a PDF or other format ebook.

Output from camera (reduced size):

After processing (reduced size and quality for uploading):

So there you have it - one homebuilt and working bookscanner!

PS: Some build these with a mechanical trigger instead of a software trigger, but the downside then is that you'll have to unmount the cameras each time.

Thursday, January 31

Experiments with 3D printing

Or rather, learning the skills to describe an object in OpenSCAD.
difference ()
   union ()
     intersection ()
       translate([-25, -15, -10]) cube([50, 30, 10]);
       translate([-25, 0, -25]) rotate ([0, 90, 0]) cylinder (h=50, r=25, $fn=100);
     translate([-15, 0, -5]) cylinder (h=8, r=3, $fn=100);
     translate([15, 0, -5]) cylinder (h=8, r=3, $fn=100);
   cylinder (h=25, r=3, center=true, $fn=100);
   translate([-22.5, -13, -11]) cube([45, 3, 10]);
   translate([-22.5, 10, -11]) cube([45, 3, 10]);
If I can manage to describe an item - such as this simple baseplate for a DE razor - as a collection of cylinders, boxes and arches, it can in theory be made on a 3D printer or CNC machine.