A 3D printable microscope and translation stage
  • OpenSCAD 84.3%
  • Python 15.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Julian Stirling 751c5b3e31 Merge branch 'changelog-for-v7beta6' into 'master'
Generate changelog for v7.0.0-beta6

See merge request openflexure/openflexure-microscope!563
2026-11-24 11:00:10 +00:00
.gitlab/issue_templates remove duplicate steps in release checklist 2026-10-28 20:21:54 +00:00
build_system Merge branch 'pipeline_id' into 'master' 2026-03-05 22:57:28 +00:00
ci_docker/scad_jobs Spelling fixes 2026-01-11 17:59:08 +00:00
docs update supplier link for o-rings 2026-11-11 21:32:53 +00:00
openscad Merge branch 'adjust-range-of-motion' into 'master' 2026-11-04 18:30:48 +00:00
rendering Merge branch 'sangaboard-solder' into 'master' 2026-10-29 15:39:05 +00:00
.codespellrc Spelling fixes 2026-01-11 17:59:08 +00:00
.gitattributes Docs: Sangaboard v5 + illumination PCB info 2024-08-01 08:49:29 +01:00
.gitignore Refactor docstrings in utilities. Remove redundant/unused modules. 2025-08-10 18:58:44 +01:00
.gitlab-ci.yml compact ci gltf jobs 2026-06-27 22:31:30 +01:00
.pylintrc Relax line length rules for build system due to paths. Fix whitespace 2025-07-17 15:09:32 +01:00
archive_stls.py Compress all-stls.zip properly 2024-01-29 10:43:39 +00:00
build.py Add upright optics modules 2026-05-18 21:48:48 +01:00
CHANGELOG.md Generate changelog for v7.0.0-beta6 2026-11-24 10:16:29 +00:00
check_stls.py Spelling fixes 2026-01-11 17:59:08 +00:00
ci_version_string.py Apply 1 suggestion(s) to 1 file(s) 2025-07-24 10:42:00 +01:00
compare_hashes.py Spelling fixes 2026-01-11 17:59:08 +00:00
COMPILE.md Remove mac-specific part of COMPILE.md, add mac-specific logic in build.py 2020-06-10 13:43:43 -04:00
generate_changelog.py Update changelog for v7-beta3 release, tweak README 2024-11-29 11:54:04 +00:00
License Update license to CERN-OHL-S 2023-05-11 09:48:04 +01:00
lint_build_system.py Further update of pylint options, and fix warnings found by newer pylint 2024-03-14 12:42:03 +00:00
okh.yml Update license to CERN-OHL-S 2023-05-11 09:48:04 +01:00
README.md Spelling fixes 2026-01-11 17:59:08 +00:00
render.py Merge branch 'gear-insert-nut-tool' into 'master' 2026-09-08 22:36:34 +00:00
requirements.txt Update requirements and ci images 2024-03-14 12:04:54 +00:00

OpenFlexure Microscope

The OpenFlexure Microscope is a 3D printable microscope, including a precise mechanical stage to move the sample and focus the optics. There are many different options for the optics, ranging from a webcam lens to a 100x, oil immersion objective.

3 views of the microscope

The trick of making a microscope out of a webcam has been around for a little while, and produces good results. However, getting a nice mechanical stage to focus the microscope and move around on the sample is very difficult. This project is a 3D printable design that enables very fine (sub-micron) mechanical positioning of the sample and the lens, with surprisingly good mechanical stability. It's discussed in various media articles.

If you use the OpenFlexure microscope in your work please consider citing one of our papers:

Building a microscope

For up-to-date build instructions, STL files, and pre-built Raspberry Pi SD images, please head to the build a microscope page.

Instructions

The latest release of our assembly documentation can be found from the build a microscope page on our website. The editable instructions are Markdown format (built using GitBuilding), in the docs folder of this repository. If you have a problem accessing the images after cloning the repository see the section on LFS files below.

Printing it yourself

Configure your microscope hardware and download the STL files through the microscope STL configurator page. The assembly instructions contain instructions on print settings and putting it together.

If you've built one, let us know. You can let us know on our forum, add yourself to the wiki page of builds, or submit an issue marked as a build report. This is a really helpful for us even if you don't suggest improvements or flag up problems.

Come join us!

Most of the development of this design has been done as part of various research projects - if you would like to join our research groups in Glasgow or Bath, and you have funding or are interested in applying for it, do get in touch. Check the jobs sites for the Universities of Glasgow and Bath, or findaphd.com, to see if we are currently advertising any vacancies. The team is bigger than Glasgow and Bath, there are contributors in Cambridge, Dar es Salaam, and beyond.

Kits and License

This project is open-source and is Released under the CERN Open Hardware License, strongly reciprocal, v2.0 or later (CERN-OHL-S-2.0) (CERN-OHL-S, see the License file). The OpenFlexure Project doesn't sell micrscopes, but several companies do, you can find a list on our website.

Get Involved!

This project is open so that anyone can get involved, and you don't have to learn OpenSCAD to help (although that would be great). Ways you can contribute include:

  • Join our forum
  • Share your microscope images (of both microscopes and what you've seen with them) on social media - you can mention @openflexure on Twitter, @openflexure.bsky.social on BlueSky, or have us add you to our map.
  • Suggest better text or images for the instructions.
  • Improve the design of parts - even if you don't use OpenSCAD, STL files or descriptions of changes are helpful.
  • Fork it, and make merge requests - again, documentation improvements are every bit as useful as revised OpenSCAD files.

Things in need of attention are currently described in issues so have a look there if you'd like to work on something but aren't sure what.

Developing

If you want to play with the OpenSCAD files or change the documentation, you should fork the repository. You can edit the documentation online in GitLab, or clone the repository if you want to edit the OpenSCAD files. You will need to clone the whole repository as the OpenSCAD files are dependent on each other.

Changelog

The changelog can be generated using python generate_changelog.py. In future, this should be used to keep the changelog up to date for each new release.

Development environment

We mostly use VSCode to edit the OpenSCAD files, and then use OpenSCAD with the editor hidden and the "automatic reload and compile" option ticked. This is much nicer for a big multi-file project like the microscope than relying on OpenSCAD's built-in editor, and also works nicely with version control.

Automatic builds

The build system is based on Python and Ninja, see compiling for more details.

Release flow

We use GitLab CI to manage builds and deployment.

The CI will build STL files that will remain on GitLab for 1 week when:

  • A merge request is submitted
  • A merge request is modified

The CI will build and deploy STL files and documentation to build.openflexure.org when:

  • A build is manually triggered from GitLab web
  • A release is tagged

The build server will mark a release as "latest" (build.openflexure.org/openflexure-microscope/latest) when a release is tagged, with a full semantic version and no suffix. For example:

  • v6.0.0 will replace "latest"

However, incomplete semantic versions will not replace latest. For example:

  • v6.0.1-beta.1 will not replace "latest" (pre-release suffix)
  • v6.1 will not replace "latest" (no patch version specified)
  • 6.0.1a will not replace "latest" (non-standard suffix)

LFS files

This repository stores images using Git LFS. This means that cloning the repository without Git LFS installed will only download placeholders for the images. Follow these instructions to install Git LFS.

With LFS installed Git will download the latest version of the images used in the documentation. If they are still missing try running:

git lfs fetch
git lfs checkout

Other repositories relating to the Openflexure Microscope are in the OpenFlexure GitLab group. Particularly useful ones are:

Repositories for compatible motor controllers:

A number of other related projects include:

Some OpenFlexure repositories still remain on Richard's Github.

Compiling from source

If you want to print the current development version, you can compile the STL from the OpenSCAD files - but please still consult the documentation for quantities and tips on print settings, etc. You can use Ninja build to generate all the STL files (run pip3 install -r requirements.txt and then ./build.py in the root directory of the repository). More instructions are available in COMPILE.md.