First Light: Building the OpenFlexure Microscope
9 min read
When you hear the phrase home lab, you probably picture a rack. Blinking drive bays in a cupboard under the stairs, a second-hand enterprise switch, a fan noise the rest of the household has learned to tolerate. The word has been quietly annexed by computing, and that tells you something about which kinds of curiosity we have made cheap.
My home lab has no servers in it. It has a microscope I printed.
In my last post I argued that the barriers to entry which collapsed for electronics have not collapsed for biology, and that the hobbyist is the person left out. This post is the first attempt to do something about that rather than complain about it. I built the OpenFlexure Microscope: an open-source, laboratory-grade, motorised microscope made of about 200 g of plastic, a Raspberry Pi, and a camera module. Then I pointed it at a leaf and at my own hair, and looked at what came back.
What follows is a record of what I actually did: the parts I bought, the places where I departed from the official instructions, and the questions about my own build that I cannot yet answer.
Why this instrument
The OpenFlexure Microscope came out of the University of Bath. A conventional microscope stage moves on bearings and rails, which are expensive because they must be machined to tolerances a 3D printer cannot hold. OpenFlexure does not try to print a bearing. It prints a flexure: a deliberately thin section of plastic that bends. There is no sliding surface anywhere in the mechanism, so there is no friction to overcome and no backlash to fight, and most of the moving structure comes off the bed as a single piece.
The performance that falls out of this is the part I found hard to believe. With the geared stepper motors fitted, the project reports steps well below 100 nanometres, and a stage that holds position to within a few microns over several days.2 That is a machine whose smallest movement is roughly a thousandth of the width of the hair I photographed with it.
There are several versions of the build. I chose the low-cost microscope, which replaces a laboratory objective with a trick: you unscrew the lens from a Raspberry Pi Camera Module v2, turn it around, and push it into a printed spacer so that it sits a short distance in front of its own sensor. Reversed and separated, a wide-angle phone-style lens becomes a microscope objective. The documentation gives the resulting field of view as roughly 750 × 560 µm, comparable to a 20× objective.1
I want to be precise about why this mattered to me more than the price. A microscope with an RMS-threaded objective is still, in the end, a microscope that depends on a part you must buy from an optics supplier. The low-cost build depends on nothing but a camera module and a printer. It is the version of the instrument that could be made in a bedroom anywhere.
Sourcing the parts

Almost everything came from AliExpress. The camera is the exception: a Raspberry Pi Camera Module v2, bought second-hand on eBay for £15, because it is the one component the low-cost build genuinely depends on and the one worth not gambling on.
The small parts came to a little over thirteen pounds altogether: £3.27 for twenty M3×25 bolts in 316 stainless, £2.94 for a hundred M2.2×6 mm pan head screws, £1.99 for a hundred warm white 5 mm LEDs, £1.74 for ten FKM O-rings, £1.34 for a set of stainless washers and hex nuts, 99p for ten M3 nuts, and 97p for the 200 mm fifteen-pin ribbon cable the camera module needs.
Read those quantities rather than the prices, because they are the more interesting number. The microscope needs one LED. The smallest quantity of warm white 5 mm LEDs available to me was a hundred of them, for £1.99. The marginal cost of the LED in my microscope is therefore about two pence; the cost of being permitted to buy one at all was £1.99. The same is true of the screws, the nuts, the washers and the O-rings.
That is a smaller version of the argument I made in my last post. What sets the floor on a hobbyist build is the minimum quantity the supply chain will sell you, together with the fact that nobody packages components for someone building exactly one of something. I now own ninety-nine spare LEDs.
The spares drawer from oesimracing.com covered some of the odds and ends; the consumables of one hobby turn out to be the consumables of the other.
Three departures from the bill of materials
I did not build the microscope the project describes. I built the one I could afford and source, which is a different thing, and the honest version of this post records where the two diverge. All three substitutions are routes the project itself documents on its customisation page, so none of this is my invention — it is me taking the escape hatches that were left open.3
The first and largest departure is the motor controller. The project's own Sangaboard is a dedicated PCB, and I replaced it with an Arduino Nano clone driving the ULN2003 boards that came bundled with the stepper motors. The OpenFlexure control software expects to talk to a Sangaboard over a serial link, so the Nano has to run firmware that answers to the same commands. What made the swap possible at all was the published protocol: anyone can build a board that speaks it, which is the practical meaning of open hardware once you are standing at a workbench holding the wrong parts.
The second is the illumination. In place of the project's LED PCB I soldered a warm white 5 mm LED in series with a 150 Ω resistor, because I already owned both and because the project's own workaround page expects precisely that.
The third is trivial, but worth recording for anyone repeating this: my Nano clone has a USB-C socket, so the link to the Raspberry Pi is an ordinary USB-A to USB-C cable carrying power and serial together.
Assembly
The first real job is the three 28BYJ-48 geared steppers. Each takes a printed pinion, pressed onto the flattened motor shaft.



The motors then mount to the body, each one driving a column that pushes against one leg of the flexure stage. There is no lead screw you would recognise, no rail, no bearing — the motor turns a gear, the gear turns a threaded column, the column presses on a piece of plastic, and the plastic bends by a controlled amount.

The body then sits on the stand, which doubles as the enclosure for the Raspberry Pi.

The electronics

This is the least glamorous photograph in the post. Three driver boards, one Nano clone, a loom of jumper wire, a soldering iron borrowed from a sim racing project, and a sheet of cardboard standing in for a bench. There is no PCB in this picture that was designed for a microscope.
The illumination is one of those ninety-nine spare LEDs — a warm white 5 mm diode — with a 150 Ω resistor in series. The resistor is the only thing standing between a two-penny component and a dead one, so it is worth doing the arithmetic rather than trusting a number someone posted on a forum:
I = (Vsupply − Vf) ÷ R
The difficulty is that I do not know the forward voltage. A hundred LEDs for £1.99 do not arrive with a datasheet, and warm white diodes are generally quoted somewhere between 2.8 V and 3.4 V. So rather than pick a number and present it as fact, take the current across that whole range at both rails the Raspberry Pi offers. From the 5 V rail, a 2.8 V diode draws 14.7 mA and a 3.4 V diode draws 10.7 mA. From the 3.3 V rail, those same two diodes draw 3.3 mA and almost nothing at all.
Those four figures are the reason to run the LED from the 5 V rail, and the reason has nothing to do with brightness. At 5 V, my ignorance about the forward voltage moves the current by about a third — annoying, but the lamp works either way. At 3.3 V, the headroom left over after the diode drop is the same size as the uncertainty itself, so the identical ignorance becomes the difference between a usable lamp and a dark one. A resistor-limited LED is only predictable when the supply sits comfortably above the forward voltage.

Illumination is the compromise I am least comfortable with. A commercial microscope uses a Köhler system that spreads light evenly across the field and keeps the lamp itself out of focus. A bare LED does not. You can see the consequence in my images: the centre is brighter than the edges.
There is a second consequence I chose by accident. Warm white is a phosphor blend weighted toward the red end, and in a microscope the lamp becomes the illuminant against which every colour in the sample is judged. Every micrograph below carries a yellow cast contributed by my LED. For leaf cells this is harmless. For anything stained, where colour carries the measurement, it would matter, and a neutral or cool white diode out of the same hundred-pack would have been the better choice.
First light
Astronomers call a new telescope's first image first light. I am borrowing the phrase.

The software runs on the Pi and serves a control page over the network, so the microscope has no screen, no eyepiece and no proprietary driver. You open a browser, and the image arrives in a window on any machine in the house.
You drive the stage with the arrow keys. Tap one and the field shifts by a small, consistent amount; hold it and the view pans smoothly. Nothing springs back when you let go, and nothing needs nudging twice to land where you meant it. The flexure design predicts all of this: with no sliding surfaces there is no stiction to break and no backlash to take up. Even so, I had expected plastic to feel approximate. I spent twenty minutes afterwards moving a leaf around the field for no reason beyond enjoying how precisely it went where I put it.
The first sample was a leaf.


I had drawn stomata in a textbook. Seeing them on a machine I had printed and soldered was different: until that moment I had taken the existence of the structure on authority.

The hair is also the beginning of a calibration check, and I want to do this properly rather than assert that the microscope works. The documented field of view for this optics module is about 750 µm across the long axis.1 A human hair is typically 50–100 µm in diameter. Measured off the image, the shaft spans almost exactly a tenth of the frame width, which puts its diameter at about 75 µm. That lands inside the expected range, so on this evidence the optics are behaving roughly as specified.
One image is not a calibration, though. The rigorous version is a stage micrometer — a slide with a ruled scale on it, a few pounds — photographed and measured the same way. That is on the list.
What comes next
A precision positioning stage with steps below 100 nanometres now sits on my desk, and I made it out of filament, a second-hand camera module and parts bought by the hundred from AliExpress.
The microscope was the proof — to myself, mostly — that the open-hardware route is real and that I can walk it. The instrument I actually want does not exist yet in an accessible form: a plate reader, the machine that reads optical density across a 96-well plate and underpins an enormous fraction of everyday biology. There is an OpenFlexure for microscopy. There is no OpenFlexure for plate reading.
That is the next build, and it will be a harder one, because this time there are no instructions to follow.
Sources
- 1. Assemble the basic optics module — OpenFlexure Microscope assembly instructions — the reversed Pi Camera lens and the ~750 × 560 µm field of view.
- 2. The OpenFlexure Microscope — project page — the flexure mechanism, sub-100 nm steps, multi-day stability, and the ~200 g of plastic.
- 3. Customisations and alternatives — OpenFlexure Microscope assembly instructions — the documented Arduino Nano route in place of the Sangaboard, and the LED-and-resistor workaround for the illumination PCB.
- 4. Low-cost microscope — OpenFlexure Microscope assembly instructions — the full build sequence I followed.
- 5. The OpenFlexure Microscope is released under CC BY-SA 4.0.