Build a DIY Desktop 3d Scanner With Infinite Resolution.




About: I am one of the hosts of the "3d Printing Today Podcast", available on iTunes.

If you already have a camera then this project will cost less than $50 to complete. If you like to shop on AliExpress you can probably build it for around $30. If you like to support your local middleman, more power too you, but it will cost a little more. The giant screw shown above was made from a regular drywall screw captured using this scanner and a Nikon DSLR.

Desktop 3d scanning has made great leaps in recent years but it still has great limitations. Scanner hardware is built around a specific scan volume and resolution. You can get decent results, but only if your object fits that sweet spot. If your object is too small, or too detailed or your scanner is just having a bad day your scan will look like a potato. Luckily there is another approach. Photogrammetry uses a set of regular 2d photographs taken from all angles around an object. If a point on an object can be seen in at least three pictures then its location can be triangulated and measured in three dimensions. By identifying and calculating the location of thousands, or even millions of points the software can build up an extremely accurate reproduction. Unlike a hardware based scanner there are no size or resolution limitations to this process. If you can photograph an object you can 3d scan it. It works from molecules to galaxies, or it would if they would ever approve my Hubble time.

The limiting factor with photogrammetry is the quality of the photographs and thus the skill of the photographer. Photos must be well exposed and in razor sharp focus. They must also be spaced around the object so they capture every part to be scanned and they overlap enough that the software can figure out where each shot belongs. With large objects this can be done manually with some practice, but it is virtually impossible to do it well with a small object. This scanner automates the process.

Step 1: How It Works

A high quality photogrammetry scan requires high quality photos of the subject from all angles. The easiest approach for scanning small things is to rotate the subject while photographing it. This scanner uses a stepper motor controlled by an arduino board. The stepper turns the object by a fixed amount and then an infra red LED fires off fiendishly clever series of blinks which mimics the camera's wireless remote. The camera being rather gullible and wishing to please takes the picture.

An lcd display shield with a set of buttons allows the user to control the arduino. Using the buttons the user can select the number of pictures to be taken per revolution. The scanner can run in automatic mode where it takes a picture, advances the stepper and repeats until it has completed a whole revolution. There is also a manual mode where each push of the button takes a picture, advances the stepper and waits. This is useful for scans where each picture needs to be framed and focused manually.

Step 2: Some Tips on Shooting for Photogrammetry

When photogrammetry software detects a feature in a photograph it tries to find that feature in other photos and records its location in all the shots it appears. If the feature is part of the object which is rotating we get good data. If the feature detected is on the background and is not moving while the rest of the object is it can cause a implosion of the time space continuum, at least as far as your software is concerned. There are two solutions. One is to move the camera around the object so the background stays in sync with the movement. This works well for large objects but it is much more difficult to automate. The easier solution is to keep the background featureless. This is easy to do for small objects. holds a sheet of regular paper like a photo studio sweep which presents a seamless white background. Combine this with proper lighting and you are well on your way to featureless backgrounds. Another tip is to over expose your images by a stop or two. This allows you the capture more detail in the shadows of an object while simultaneously burning out the background so any remaining background features vanish in the blazing white.

Step 3: What You Will Need

An arduino. Any arduino will work. I used a mega because it has pins which aren't covered by the LCD shield which makes it easier to wire.

A SainSmart 1602 LCD Shield which provides a display and a bunch of buttons to control the scanner.

A stepper motor driver (I am using an Easy Driver) This allows the Arduino to drive the stepper motor. Any stepper driver should work because we are not asking much of it except to drive the stepper which is what they do for a living after all.

A NEMA 17 stepper motor which turns the scan subject. With a larger stepper motor (with an appropriate driver and power supply) this scanner could be could scaled up scan parts of that giant robot you found in the junk yard.

A 950nm IR led which fires the camera. You could probably salvage one from an old tv remote if you are the kind of person who finds that sort of thing entertaining.

Some type of power source for the arduino and stepper motor. A 9v wall wart works fine, a 9v battery works in a pinch but the battery needs to be fresh. The stepper won't work when powered solely by a USB port.

I have attached 3d printable files for the case I made. It is extremely elegant and sure to make the rounds of Pinterest due to its beauty and innovative style. Although it would be foolhardy to attempt to equal a design this classic please feel free to come up with your own, lesser, homage. and let me know if you do because I would love a nicer looking case.

Step 4: Hooking It Up

Hooking the pieces up is pretty straightforward provided you have the eyes and fingers of a 10 year old. If you don't perhaps you can find one to help you, or at least lend you their eyes and fingers. The plan shows the pins I used in the firmware, but this is very simple and you can switch them around to whatever works best for you. The EasyDriver board is mounted on the lid of the case so it gets better ventilation. I had planned to put a heat sink on it, but it doesn't seem to need it. We aren't pushing the stepper very hard. Astute observers may notice that we are powering the EasyDriver off of the unregulated power terminal of the Arduino. Probably not the best practice, but unlikely to cause the time-space continuum to implode because we aren't drawing much power. Similarly I included a ballast resistor on the LED just because everyone who knows more than me says I should. Since the LED only sends out brief pulses it doesn't have much time to cook itself under the whopping 5v the board is putting out, but follow your own conscience here. A 9v wall wart is the best power supply, but a fresh 9v battery works too, but it won't last long. If everything else is working except the stepper check the battery because the arduino will work on a partially drained battery, the EasyDriver will not.

You can download the fritzing schematic from

Step 5: Loading the Firmware

Download the firmware sketch and open it in the Arduino IDE. The firmware is configured by default to work with Nikon cameras. If you are using a different brand you will need to change the configuration on line 47. The scanner implements Sebastian Setz's Multi Camera IR Control library so it can work with almost any brand of camera which works with an IR remote. If you are using a Leica or a Hassablad you can probably afford to hire Mr. Setz to write the driver for you.

The controls are as follows:

SELECT: Start/Stop automatic scan.

LEFT: Manual mode. Trigger exposure and advance one unit clockwise.

RIGHT: Step one unit clockwise without triggering camera.

DOWN: Step one unit counter clockwise without triggering camera.

UP: Cycle through options for number of exposures per revolution.

Don't ask me why I laid it out like this. It made sense at the time. The sketch is pretty simple so it should be easy for you to customize if you need to.

If you get a compiler error from the DFR_Key library try installing version 1.1. It has the DFR_Key library in the download package.

Step 6: Making Your Scan

Lighting is critical for photogrammetry. I use 3-4 JANSJÖ desk lamps from Ikea to light the subject. These lamps are very easy to position, and put out a lot of light. They have small heads which makes it easy to light small subjects. They are LEDs so they put out very little heat. You can improvise diffusers with regular paper and tape and not worry about setting the secret laboratory on fire. Plus they are $10 each! I also sometimes use a cheap LED ring light on the camera lens which provides nice diffuse light, but since it is attached to the filter ring of the lens it tends to get in the way with macro shots where the subject is almost touching the lens.

I use a $25 macro rail from Amazon to aid in positioning the camera. It is about a rigid as an overcooked raman (surely that is the proper singular form) Provided the macro rail doesn't actually collapse under the weight of your terribly expensive and impressive camera (and don't blame me if it does) and assuming your aren't holding your photo session in the middle of a hurricane the noodle like flexibility doesn't really matter much because you aren't actually touching the camera when you make the exposure.

Frame your subject so it fills the picture as much as possible. Make sure as much of the image is in focus as possible. After you finish a revolution reposition the camera vertically. Shoot as many revolutions as you think you need to capture the object.

Step 7: Process Your Scan

You currently have many choices for Photogrammetry software, but there are a few options which clearly lead the pack:

Agisoft Photoscan is the best commercial package which is remotely affordable. The $180 standard version is adequate for this type of scanning. Be warned that photogrammetry is very computationally intensive so it (and you) will be happiest running on the most powerful machine you can muster. If you are running your grandma's 486 and are pissed that Microsoft no longer supports XP this will end poorly for you.

Autodesk Memento is a close runner up. It sometimes does better than Agisoft if you have low quality photos, or not many of them. It has better tools for processing after the scan is made, but less control of the scan itself. Memento is cloud based which is nice if you have an old slow computer, but can be annoying if you get the feeling you could process your scan faster on your hampster powered Babbage engine. It is currently free, but may not always be so.

123d Catch is Autodesk's consumer level photogrammetry package. It has the advantage that you can manually align photos which can help salvage a bad scan with not enough overlap between the shots. But the number of photos you can upload is limited so that makes it difficult to scan something very detailed. And just because you can manually align photos does not mean that it is an amusing way to spend your spare time.

Step 8: Where to Take It From Here

So make yourself a scanner. Take out a second mortgage on the secret lair and buy a really expensive and impressive camera, or at least a decent point and shoot with a macro mode. Find a innocent looking dead bug, scan it and use it as the basis for your army of giant robotic monsters, scheduled to take over the world any day now.

If you want to learn more about photogrammetry and 3d printing check out the "3dPrintingToday Podcast", available on iTunes and wherever fine podcasts are given away. We talked about the creation of this scanner in show #111. We talk about awesome 3d printing tips and tricks and stuff in all 125 (and counting) episodes.

11 People Made This Project!


  • Barbeque Challenge

    Barbeque Challenge
  • Beauty Tips Contest

    Beauty Tips Contest
  • Paint Challenge

    Paint Challenge

237 Discussions


3 years ago

I uploaded version 1.1 on the same download page as before. It has DFR_Key included in the download package. It compiles and installs on my system using Arduino 1.6.7 (of course the old version did too). Hopefully this will fix the issue some of you have been having

4 replies

Reply 1 year ago

Hi there and thank you for you amazing work!

I had a hard time making some clone board and screen work and looking deeper I found that the ADC key filter in DFR_Key, and in general the DFR lib, did not work for me. Digging into the sample LCD code on DFR's wiki

I found a different ADC routine that solved my problem. Take a look, it might help you simplify things a bit and provide a more robust ADC method.

Again, awesome work!


Reply 9 months ago

Hello, NikosN14! It could be nice if you can explain what you have changed to make it work! I also have some 3rd party boards and no success. Can I ask for your code that works?


Reply 6 months ago

Try these values:

static int UPKEY_ARV = 98; //that's read "analogue read value"
static int DOWNKEY_ARV = 255;
static int LEFTKEY_ARV = 410;
static int RIGHTKEY_ARV = 0;
static int SELKEY_ARV = 639;
static int NOKEY_ARV = 1023;

Seems to work for me. I haven't set it all up. just plugged in the display, but the buttons seem to do their thing.


Reply 3 years ago

thanks i'll try that and let you know how i get on --- I also looked at the arduino forums and it seem there has been a change in layout of the Dir structure, the libraries now go in two places one for included libraries and one for user libraries this may also be part of the problem I'll post my results when i get to them later to-day

thanks again for the great support



Question 1 year ago on Step 5

I´ve bought an Arduino mega 2560 from China. i´ve flashed the scanne firmware 1.1 but the display shows first. Shakespear Scan, then switched to

steps : 25

stop ,

nothing else.

i´m missing EXP1 in the lower right.

The button Right shows : CW steps

The button RST resets the scanner to the first display picture: Shakespearscan

Do i need an Original Arduino mega 2560 or what shall i do to get it running ?



2 answers

Answer 4 months ago

Hey, did you figure this out? I have exactly the same problem


Reply 6 weeks ago

It's probably the resistor on de lcd shield, it uses only one analog input to read 5 buttons with different voltage dividers(exclude the rst button). Creat a sketch to read the analog reading of A0, write every number of each button (+-1 error) then modify the library of the shield, I'm sure that you will find that tutorial somewhere on the internet ( It's been a long time since i done this project


Question 2 months ago

Hi Shakespeare! You're project looks very cool and I do need it for my prototyping project. I'm electro-savvy but new to Arduino/programming, and I'm using Arduino 1.8.9 (Windows 7). I'm getting stuck on the DFR-Key problem that you mentioned has been a popular issue. I've tried both of your firmware versions, but the IDE keeps telling me "no matching function for call to 'DFR_key::DFR_key()'". Is there any consensus about what's causing this (at least in most cases)? I've imported both files into the IDE and have confirmed that they're in the library folder in 'my documents'. And I can see that the function definitely exists in the included libraries - but since I'm not a programmer I don't know if syntax is perfectly formed. Or maybe the IDE isn't seeing the library even though it's imported (bug?)? Thanks for any assistance you (or anyone here) might be able to provide!!


1 year ago

The analogue read value in DFR_Key.cpp for a DF ROBOT 1602 LCD Keypad

static int UPKEY_ARV = 100; //that's read "analogue read value"
static int DOWNKEY_ARV = 250;//
static int LEFTKEY_ARV = 405;//
static int RIGHTKEY_ARV = 0; //
static int SELKEY_ARV = 642; //
static int NOKEY_ARV = 1023;


1 reply

Reply 4 months ago

Thanks! I think this is what i needed. I’ll try it tomorrow.


Question 4 months ago

Hi. Now I'm finally at the end of this project. All I have left is attaching the IR diode. I wanted to first test it out without soldering it on, but can't get it to work. Maybe I already burned the diode =O
I have these specs: 1,5-1,6 V, 60 mA (120 mA max @ 10 % duty cycle).
The diode you mention you run off of 5V and with a resistor, but it seems I need to drop the voltage 3.4 volts not to burn it out?
I did a quick ohms law calculation(using 3.5 volts to get my 1.5 volts) with 60mA it gave me a resistance of 56 Ohms to use as a resistor. Does this seem appropriate?

Kyler EllisonF

Question 10 months ago on Step 5

I cannot get the multi CameraIR library to work. I've uninstalled and reinstalled it to IDE about 20 times, restarted my computer, double checked that it is in the right folder location and it is - no matter what I do it always says it cannot find the library - that there is no such file or library. Hitting the banging head on table point; any help would be much appreciated.

2 answers
LetoA1Kyler EllisonF

Answer 6 months ago

I was just wondering. Does the include line look like this:
#include "multiCameraIrControl.h"
or this
#include <multiCameraIrControl.h>

shapespeareKyler EllisonF

Answer 9 months ago

I'm sorry, that's beyond my area of expertise. I would check the paths again, but I'm sure you've done that.


Question 7 months ago

Shapespeare, congrats for the project, I am going to assemble the machine!
I ask to every good guy a good tip:
Consider that I must buy a macro lens for my Nikon d5100, would you choose the
Nikon AF 60mm f/2.8 D Micro?
It seems to be a very good lens (cheap, a used one for $300), but without AF motor inside. Having no AF motor in the d5100 I would be stacked to manual focusing.
I wonder about troubles in getting perfect deep focusing while the stepper goes on, the object is rotating, the IR is firing...
Would it be a big issue? Please post your opinion, thanks


7 months ago

Hello ,
Very nice project! thums up!
Have You considered a photgrametry software like :
- capturingReality

I am looking for a best solution and was considering Agisoft at the first time but later on got to know the software listed above. I am wondering if some of You could give recommendations?


1 year ago

So I have a Nikon D3100 I will be using for this. I built out the Arduino project and it works great at the stepping of the motor. But, I've learned that Nikon did ont include an IR sensor starting with the D3100! So I ordered a cheap, wired manual switch for it (less than $20 of Amazon) and will take it aware and wire it into the Arduino project to fire off the camera. Should arrive today so wish me luck.

1 reply

Reply 8 months ago

I too have a Nikon Camera. The D5600. I have the appropriate hard wire remote to use instead of the IR sensor. I wish you luck-- with your hard wire option-- I know it's a lil late lol. Did you finalize the code and project to work without a IR Led?? If so, would you mind sending me the entire final revised code you used for said hard wired shutter control-- instead of using the IR Led. I only see one image you uploaded with your comment and I am a little confused on how to follow your instructions. Would truly appreciate it. Email: 


3 years ago

This is so cool to see this process! How did you create you screw after you scanned it in? It looks like it was made out of wood.