Bookscanner project

Here are some notes on my book-scanner project, inspired by This is a work in progress and will initially be a single large page and I’ll probably update it and split it into a Lessons Learned (blind alleys, problems, workarounds and eventual solutions) section at some point. Continue reading “Bookscanner project”

Talk: Beginning electronics courses

I’ve started giving a series of basic electronics courses at Makerspace – these are aimed at everyone including complete beginners – I’m avoiding maths as much as possible, the idea is to get an understanding of what’s going on in a circuit without getting bogged down in the details – your goal should be to be able to look at a schematic, ask yourself  “what’s that thing for?” and be able to make a reasonable guess

I’m making heavy use of the excellent circuit simulations at – your browser will need java enabled to use them.

The first session was very basic – the slides are in the PDF file below
– if you couldn’t make it you should be able to follow through the talk – the main goal here is to end up playing with the circuit simulation examples – poke at things, change the values of voltages, resistors, capacitors to see what happens (just click on them)

Talk: 3D photocopier

I’ve finally uploaded the PDF of the slides I was using. Note the static image on the page about how the Microsoft Kinect gets depth information from the changes in how the dots are perturbed by objects. This was originally an animated gif. You can go to the original source for that if you like.

Click here for the original blog post I got this animated gif from.

Talk: OpenWRT

OpenWRT: thats an odd name…

The story starts late 2002 when Linksys released a wireless router called the WRT54G.

Andrew Miklas noticed (from the visible names used in the internal filesystem, amongst other things) that it was using Linux, without in any way acknowledging this or making the source available. They had obvioulsy modified Linux to get it to run on their hardware. This is a violation of the Linux license, the GPL. He tried contacting Linksys who weren’t immediately co-operative, so he posted to the Linux Kernel mailing list and Linksys came under considerable pressure to release their source. Linksys then released the source, and people started rebuilding and fiddling with it. They actually had started patching the binary firmware before Linksys did this.

A number of different projects appeared, one was OpenWRT which is first named as such in Jan 2004. So its 7-8 years old.

So what is it?
In hardware terms, OpenWRT systems are designed as Internet routers. They fall into the space between something like an Arduino (8/16 bit CPUs, battery powered, no or minimal OS) and a mini-ITX PC (32-bit CPU, 100W+ power supply). Or a netbook. They run on a plugpack/wall wart, have 4-8M of flash, 8-32M of RAM, and a ~200MHz 32-bit CPU. Can run on battery, but you need a big one and it won’t last very long. Just enough hardware to do a serious Internet connection, and they always have the hardware for that.

So what is it?
In software terms, OpenWRT is a very versatile system for making embedded Linux devices that can fit in 4-8Mbytes of flash. They are not confined to Linksys routers (although a descendant of the WRT54G that will run OpenWRT, the WRT54GL is still available today in NZ for $130). OpenWRT now runs on a *lot* of wireless routers. A list can be found at

Embedded Linux means not using standard gcc libraries. OpenWRT uses a much smaller library called ucLibC. It also means not including anything you don’t need. So OpenWRT has a very extensive set of customisation options.  Its filesystem is somewhat eccentric (as it has to be to run out of a small amount of flash). The kernel is compressed (twice) and written to raw flash, the rest goes into a combination of squashfs (read-only) and jffs2 (read-write). The result is a system that they were able to fit into 2Mbyte of flash but now usually needs 4Mbyte.

OpenWRT has a package managment system; almost everything is an opkg. If you don’t use it, you can leave it out to save space.
None of this is terribly unusual for a embedded Linux distribution, but OpenWRT takes things a bit further in the way it does it. Instead of distributing a kernel and libraries for all the different CPUs and options that they support, they don’t distribute source at all. OpenWRT is a set of patches and scripts that build OpenWRT binaries, a system called Buildroot.

You can use OpenWRT in a number of ways; they provide prebuilt binaries, an ImageBuilder tool, and the ability to build a custom binary. I adopted the latter because I wanted to make a remote camera system that could be used by others; I was able to use OpenWRT to make a turnkey binary that could be easily installed and used by anyone with an NSLU2 and a UVC camera.
See for an entrypoint into the OpenWRT documentation


OpenWRT is a bleeding-edge open-source project. Documentation can be out of date or missing, things don’t always work, and you need to be prepared to use Google to search for answers. If you really can’t find answers and have a focused question there are mailing lists and forums where you should be able to get answers, but they don’t like being used as a substitute for doing your own research. OpenWRT does not run on all hardware, you need to research before buying.

Can be used as
A pretty amazing wireless router; QoS, custom hotspot, OpenVPN. Web server.
Units with USB ports open up a huge range of other possibilities: file server, music player, camera server, print server, GPS, etc.

What I did
I built OpenWRT (kamikaze) for a device called an NSLU2, which was nominally a NAS device. It wasn’t a great NAS device, but OpenWRT got ported to it and then it could do all manner of things. It has two USB ports. I bought a good quality webcam and set up OpenWRT with a package called mjpg_streamer, which takes Linux video in and feeds it out to a web page or to a file. Got it to write periodically to a file on a USB flash drive; this produced time-lapse movies. The objective was to set it up at a remote crib where we have no electricity.
The second stage was to get it to shut down to reduce power consumption; I had to patch the Linux driver for the RTC chip and do a one-wire hardware mod to get a device that could turn its own power off, and get it turned back on some time later. I submitted patches back to the Linux rtc mailing list and in due course they were blessed by Linus and went into the kernel.

See my blog posts at and subsequently for more details.


Talk: 3D printing

Here’s some references from the 3D printing talk:

First of all Thingiverse where you can find 1000s of things to build and make


The “reprap host” slicing application can be downloaded from

you’ll need a working Java runtime to use it.
You need to download the config file for our working reprap from:

install it in ~/.reprap (or wherever else reprap host stores stuff on your computer). To slice:

  • press ‘load STL’ to load an object
  • drag the loaded object a little on to the be – about 1 square diagonally
  • press the green ‘Print’ button

always quit and restart reprap host between objects – put the resulting ‘.gcode’ file on a USB key and bring it in to print


There’s also a design guide to help you make stuff that prints well:

OpenSCAD – the 3D CAD program I was using is available at:

Instructions for repairing bogus STL files:
You can also use netfabb

Competition: Clothesline Racing

As announced at last night’s meeting we’re having a competition: Clothesline Racing

The basic idea is to build a device that will travel from one end of a clothesline to the other and back again – there will be (chocolate) fishy prizes. The clothesline will be strung outside, as level as we can and fairly taut – but will probably dip a little in the middle.

The rules we’ll be using will be the same as those listed below:

with some minor (largely metric) changes – we’ll have a 30m line (if we can find somewhere that we can set it up – so plan for 30m), it’s 3.5mm wire, the weight limit is 2kg and the volume limit is a 1/2m cube.

We’ll also have some contest categories for those still in school The contest will be held in 2 months – probably July 2nd weather permitting. In the mean time, so you can test out your entries, we’ve set up a short course in the Makerspace – it’s about 1/3 the length of the one we’ll use on the day and only has one end stop – hang your racer above the sink end send it across and back again. We ask that you don’t test here entries that will make a mess – that water rocket, the contraption with baking soda and vinegar, they’ll be OK outside on the day, but please not in the makerspace.

This is something for which everyone should be able to hack together an entry – for some ideas here are some things that others have tried.

Talk: Introduction to JavaScript & Web Development

Learn the basics of JavaScript, HTML and CSS in web development to build a simple to-do list webapp.

The second Thursday night software topic I held was another introduction to JavaScript, this time focusing on the web development side. This included a crash course in HTML and CSS, with a little bit of jQuery (a popular JavaScript library).

We had a smaller turn out this time (around a dozen), thanks to school holidays and the Easter break. But everyone there got actively involved and asked a lot of great questions. Many thanks to Anne (who helped set up) and Paul (who typed for me) who helped me get through the night with a broken wrist.

The slides I started off with are available here. They act as an introduction to the talk and to basic HTML, CSS, JavaScript and programming concepts.

The rest of the talk was learn-by-example and learn-by-doing. We built a web page that provided a simple to-do list webapp.

The code is listed below in the resources. Note that to view the code in your browser for these examples (or any webpage), right click on the page and select “View Page Source”. Or you can just save the page and open it in your favourite text editor.

As usual, there was a lot covered in this talk. And some of the code in the printed handouts (the new stuff in step 4) wasn’t covered, but leads on from what I did cover.


Resources from this talk:

Additional resources:

Talk: Introduction to JavaScript & Firefox Add-on Development

Learning the basics of JavaScript and Firefox add-on development by building two simple Firefox add-ons.

Last Thursday (7th April) we held the second of our Thursday Night Sessions, which was the first of my software topics: A Very Basic Introduction to JavaScript and Firefox Add-on Development.

We had ~25 people show up, from kids to IT professionals – most with a laptop in hand (and Firefox installed). For many of them, this was their first time programming; for others, it was their first time using JavaScript. By the end of the night, everyone had made their first two Firefox add-ons.

The slides I started off with are available here. They act as an introduction to the talk and to basic JavaScript and programming concepts.

The rest of the talk was learn-by-example and learn-by-doing. I walked everyone through using Mozilla’s Add-on Builder – a webapp that lets you easily code and test Firefox add-ons using the new Add-ons SDK.

Add-on Builder

We built two add-ons:

  • Wikipedia Button – An extremely simple add-on that adds a button to the bar at the bottom of your browser, with the Wikipedia logo. Clicking it will open Wikipedia in a new tab.
  • Translate Selection – A less-simple add-on that adds a “Translate Selection” item to your context menu (right-click menu). When you select some text, right click, and select “Translate Selection”, the text you selected will be translated into English (using Google’s translation service).

This was a 2 hour talk, which included me walking around to talk to and help individuals/small groups. I covered a lot in this talk – so try not to get too intimidated by it. Just keep playing around, and keep learning. In my next software talk (21st April), I’ll be sticking to the basics of JavaScript – this time, we’ll be using it in a web page. And feel free to come in to the workshop on Saturdays (1pm to 5pm) – I’ll be happy to answer any questions.

Resources from this talk:

Additional resources:

Electronic Badge project

Today we sorted and bagged the components for the Electronic Badge project – 40 kits, ready for people to start building them.
The (draft) build instructions are available here:

Today we sorted and bagged the components for the Electronic Badge project – 40 kits, ready for people to start building them.

The (draft) build instructions are available here:

Assembled, they look like this: