Page 1 of 2

Raspberry Pi + LCD + footswitch

Posted: 20 Aug 2013, 12:37
by ben_steinberg
Hi all -- this is a long overdue posting about the system I set up for controlling two Canon A2200s. The basic hardware is a Raspberry Pi with a 20x4 LCD screen and footswitch for minimal user I/O; I rewrote Mark Van den Borre's test_keypedal.sh in Python, and am running it as a daemon; the Raspberry Pi acts as an access point, and exposes images and instructions via a web page.

The code is at https://github.com/bensteinberg/diy-bookscanner, where there's somewhat more information. Some of it is a little hand-wavey, though, and I'd be happy to go into more detail, here or there or both.

Image

Re: Raspberry Pi + LCD + footswitch

Posted: 21 Aug 2013, 09:14
by daniel_reetz
The "book case" is fantastic. This is really wonderful work, thank you for doing it and posting it here!

Can you comment on two things:

1. The total cost of the system (and any quick thoughts on how to make it in the cheapest possible way)
2. Raspberry Pi vs other, more expensive computers

OK, 3 things... does the RPi have any shot-to-shot time limitations? How fast can you go?

Really jazzed about this. I'm in Argentina talking to Wikimedia Foundation and Scann about some of their scanning projects. Affordable systems like this should save them a lot of time and effort. And they are already producing the "Hackerspace Scanner" locally!

Re: Raspberry Pi + LCD + footswitch

Posted: 21 Aug 2013, 09:16
by daniel_reetz
The "book case" is fantastic. This is really wonderful work, thank you for doing it and posting it here!

Can you comment on two things:

1. The total cost of the system (and any quick thoughts on how to make it in the cheapest possible way)
2. Raspberry Pi vs other, more expensive computers

OK, 3 things... does the RPi have any shot-to-shot time limitations? How fast can you go?

Really jazzed about this. I'm in Argentina talking to Wikimedia Foundation and Scann about some of their scanning projects. Affordable systems like this should save them a lot of time and effort. And they are already producing the "Hackerspace Scanner" locally!

Re: Raspberry Pi + LCD + footswitch

Posted: 21 Aug 2013, 10:14
by ben_steinberg
Cost: The total cost of the system, including the DIY scanner kit, was around 1000USD. How, you ask, did I get that figure, when the Raspberry Pi is only $35? Parts and supplies include:
  • glass
  • sandpaper
  • spraypaint
  • two Canon A2200 cameras (~$200)
  • two 8GB SD cards ($14)
  • Raspberry Pi ($35)
  • LCD ($18)
  • footswitch ($7.50)
  • wireless adapter ($13)
  • USB hub ($22)
  • realtime clock ($9)
  • power adapters for the two cameras ($32)
  • miscellaneous bits and pieces: wires, circuit board, buttons, velcro straps, other things I'm forgetting ($??)
Adding in shipping, that comes out to something like 400USD without the kit.

Other computer possibilities: It would have been much easier to use a laptop (and cheaper, assuming you already have one) to trigger the cameras with the keyboard: in that scenario, you don't have to move the files from the triggering computer to the post-processing computer. However, my goal here was to produce an appliance, a stand-alone device that would not require the user to show up with a computer configured in any particular way. With this scheme, the user needs a computer to collect the files, but it only has to have wireless capabilities and a browser.

The Raspberry Pi is well suited to this task, but underpowered for manipulation of graphics; rotating a book's worth of images, a task that takes seconds on my laptop, took almost an hour on the Pi.

I presume you'd need something more powerful than the Pi for this, but it would be great to have the images displayed on a screen during the shooting session, possibly allowing in-session cropping (I think the Internet Archive's system does something like this, with two PCs, one controlling each camera).

Speed: I shoot a two-page spread every six or seven seconds, which seems like a very useful speed.

I should add that the camera power adapters are crucial components; I don't have to remove the cameras to swap batteries, or fuss with recharging, and they eliminate (?) the possibility of the cameras shutting down in the middle of a session. The only caveat is that I had to drill out extra space in the mounting slots to accommodate the plugs, and, not thinking carefully, drilled them so that the cameras are centered on their panels -- what I should have done is drilled them so that the lenses are centered. As it is now, images on each side are displaced up or down a bit.

Re: Raspberry Pi + LCD + footswitch

Posted: 22 Aug 2013, 13:04
by vitorio
This seems like a great base to build on for my scanner. Thanks for documenting your work!

I will probably swap the RPi LCD for a proper HDMI LCD instead, as those are in no short supply at a hackerspace, and it opens up the option for a preview window, which will be nice for making sure the book is centered.

Rather than support wifi, I will probably set up something where someone can insert a USB flash drive and it'll copy all the files to it, and continue to manage post-processing as a separate step.

I worry a little over the longevity of a footpedal; maybe a regular keyboard to start.

Thanks again!

Re: Raspberry Pi + LCD + footswitch

Posted: 30 Aug 2013, 13:48
by ben_steinberg
Thanks, Vitorio!
I like the USB flash drive idea. The only caveat is that if the Pi has no network connection, it can't get the correct time and timestamps will be wrong -- unless you add a real-time clock to the system. It's not expensive or complicated, but it is an extra step.

Re: Raspberry Pi + LCD + footswitch

Posted: 30 Aug 2013, 17:00
by daniel_reetz
FYI, there is a crew of great folks from Latin America working on your script now-more soon.

Re: Raspberry Pi + LCD + footswitch

Posted: 08 Sep 2013, 23:57
by shesgottageek
@Ben,

Thanks for this post, and the work you've done with the Pi. I'm working on a foam board build (the original used Pentax I/R triggering) but want to use Canon A4000s and was considering how I might use my Raspberry Pi to do it.

One question for you though, regarding the timestamp issue. If you set the time/date on the Canons, do you need to have the network connection for the Pi?

Re: Raspberry Pi + LCD + footswitch

Posted: 09 Sep 2013, 16:32
by ben_steinberg
You're welcome! Is your foam board build based on the one at http://veesmee.com/fbbs/?

I wanted the timestamp to be correct on the Pi so that I could name the image file directories with a date-time; that way, the directories would sort correctly and convey meaningful information to the user: "oh, that's the session I shot yesterday". I suppose if you had good timestamps on the files from the cameras but not on the Pi, you could do the same thing.

Here's another reason to want good timekeeping on the Pi: I am running a cron job to delete image files older than 7 days (so as to keep the disk uncluttered, and as a gesture toward patron privacy -- the device might be used in a public or semi-public context). This wouldn't be possible without either the clock or a network connection.

(Note that I'm not using timestamps for sorting the files -- I'm relying on filenames, which isn't ideal. If you could ensure that both cameras kept perfect time, you could sort left and right into a perfect sequence without using the filenames.)

Re: Raspberry Pi + LCD + footswitch

Posted: 17 Nov 2013, 23:50
by vitorio
The Austin Hackerspace scanner is back online, with a Raspberry Pi controlling the cameras. The script is heavily modified from Ben's original.

http://atxhackerspace.org/wiki/Book_Scanner is updated with instructions on its use. In short, it's an off-the-shelf Raspberry Pi, HDMI monitor, USB keyboard, everything, and it boots right into the script.

You tap a key on the keyboard to trigger the cameras, you hit Escape when you're done, you plug in a USB stick, it downloads all the photos (it leaves them on the cameras' SD cards while you're taking them, instead of intermittently downloading them to the Pi), then it deletes the photos from the cameras, and you repeat.

The source code is a bit of a mess, and we still don't have AC adapters wired up, but I'll be cleaning it up, documenting it fully, and putting it online over the next several weeks.