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.

<p>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</p>
<p>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 </p><p>thanks again for the great support</p><p>Brian</p>
<p>Hi, thanks for sharing. I'm trying to make this, and did get the hardware set up. Uploaded the FW and started it. But the buttons doesnt do much. Only the &quot;RIGHT&quot; button works and makes the stepper move CW. All the other buttons seems inactive. Any suggestions to what I could've done wrong? I'm using the same hardware as you. Arduino Mega 2560, LCD Keypad shield and a Smartstepper.</p>
<p>Hard to say, but I would guess your buttons are connected to different pins than mine. I would make sure the shield is lined up properly and seated firmly. If the shield was off by a row some of the buttons might still work but the LCD probably wouldn't. If the LCD is working then the shied is probably lined up correctly.</p><p>I think there is a sample sketch out there for the LCD shield which you could use to test the buttons as well.</p>
Thank You for the quick reply. I'm quite sure it's seated properly and is aligned. The 5v, ground and vin pins is matched at least. <br><br>But perhaps my display shield is another iteration with a slightly different pin layout. I'll check. :-)
<p>Hm .. the pins are exactly the same. </p><p>This code works fine: http://www.dfrobot.com/wiki/index.php?title=Ardui...</p><p>So I think it must be the values in &quot;static int RIGHTKEY_ARV = 0;&quot; because they look different. But if it update the values in the DFR.key file nothing works. Do you have any suggestions?</p>
<p>Hooray! I changed the threshold from 5 to 50, and now it reads the buttons fine!</p>
<p>I have the same issue with only the right button working for CW, What threshold and where did i have to change to get all the other buttons working? Thanks!</p>
<p>It works!</p>
<p>Awesome. You are way deeper in the code than I ever went so I am glad you could figure it out.</p>
<p>So, if I'm understanding, I would need a camera that responds to IR remote control codes, right? </p>
<p>Super cool !! I wrote a new code becaused i used the AH_Polulu library and a A4988 stepper-driver. And write a reset for the stepcounter. Its a really really nice 3d-scan love it !!! If someone need the code please write me</p><p>(sorry for the bad english ......im from germany</p>
<p>What the differences I need to make to make it to work with a4988, I would really appreciate to look at your code </p><p>thanks</p>
<p>I have modified the code a little bit.</p><p>There was an odd issue with the code when it took a picture the moment as it was moving the motor.</p><p>i have modified the code so that the motor will move wait so the object settles then will take a picture and wait and will then move the motor again.</p><p>The problem was that the pictures were getting blurry because it was taking the picture as the object was moving.</p>
<p>Hi, first of all thanks for the sheer idea of this. i have hooked everything up with an small arduino uno and i just had to adjust the pins.</p><p>I have a question regarding the code.</p><p>You are initializing the steppermotor with 200*64 steps per Rev.</p><p>what is the meaning of the *64?</p><p>I am using a nema17 steppermotor with 50 steps in 1/8 stepping mode and i had to use 200*32... (One revolution works perfectly with this value.)</p><p>I just dont know what the value *64 is doing. Would you please explain to me?</p>
<p>Awesome, I'll go your way. Just a Nikon DSLR, hmm, can you please specify model, lenses, .... I really would like to achieve your results. thx for answering in advance</p>
<p>Any modern DSLR body will work. The lens depends a lot on what you want to shoot. I shot the screw scan with a 40mm micro-NIKKOR (which is Nikon talk for a macro lens). It is affordable (as these things go) and works great for regular photography as well. But I would start with what you've got. Try a few scans with a point and shoot or even a smart phone and process them with 123d catch or memento. See if you enjoy it before you drop the bucks on fancy gear (not that I don't like fancy gear).</p>
<p>I did as you suggested and dived into the topic. Now I invested into 2nd hand equipment. But the D80 does not work in sync with the stepper. Which time value do I have to increase to give enough time to the D80 to shoot before the stepper moves? </p>
<p>Super cool !! I wrote a new code becaused i used the AH_Polulu library and a A4988 stepper-driver. And write a reset for the stepcounter. Its a really really nice 3d-scan love it !!! If someone need the code please write me</p><p>(sorry for the bad english ......im from germany</p>
<p>Super cool !! I wrote a new code becaused i used the AH_Polulu library and a A4988 stepper-driver. And write a reset for the stepcounter. Its a really really nice 3d-scan love it !!! If someone need the code please write me</p><p>(sorry for the bad english ......im from germany</p>
<p>WORK IN PROGRESS. I'm still having the same issue with the set up. No matter what setting, it rotates, twice , dividing the setting in two, per rotation, then it steps one. While I'm recruiting help ... I added a case, walmart fishing dept. under 4$. I also took my long IR led &amp; wires off, and mounted an IR on the left side of the case. The cardboard lid is just a template and a temporary safety precaution. This is my first Arduino Project, which include many other firsts ... but First things first... I have to resolve this 2 revolutions +1 step problem. </p>
<p>Hi Shapespeare,</p><p>Thank you for sharing, I have everything working, except the postWait time is not working in the auto Mode, Can you please help me.</p><p>Thank you</p>
<p>Not sure what's wrong, but you only need post wait if you are taking relatively long exposures.</p>
<p>Hmm cause right now it takes the picture as soon as it begins to rotate.</p><p>I've changed the preWait and it works fine. </p><p>the manual mode works fine.</p><p>const long preWait = 2000; </p><p>const long postWait = 5000; </p><p>//This interrupt based time delay allows us to still receive keypad input during the delay</p><p> currentTime = millis();</p><p> if (waitFlag == 0) // advance stepper and start wait timer</p><p> {</p><p> startWait = millis();</p><p> waitFlag = 1; // start preshutter wait</p><p> lcd.setCursor(9,1);</p><p> lcd.print(&quot;Exp#: &quot;);</p><p> lcd.setCursor(13,1);</p><p> lcd.print(stepCount);</p><p> digitalWrite(19, LOW); //activate stepper driver</p><p> myStepper.step(stepsPerRevolution/stepChoices[stepIndex]); //advance stepper</p><p> digitalWrite(19, HIGH); //deactivate stepper driver</p><p> }</p><p> if (waitFlag == 1) // when preshutter wait expires trigger shutter</p><p> {</p><p> if (currentTime - startWait &gt;= preWait) //wait time has expired</p><p> {</p><p> Camera.shutterNow(); // trigger shutter</p><p> startWait = millis(); // restart wait timer</p><p> waitFlag = 2; // initiate post shutter wait</p><p> stepCount ++; </p><p> }</p><p> if (waitFlag == 2); // wait after triggering shutter before moving motor</p><p> {</p><p> if (currentTime - startWait &gt;= postWait) //wait time has expired</p><p> {</p><p> waitFlag = 0; //done waiting</p><p> }</p><p> }</p>
<p>grt thgks.</p>
<p>According to instruction, you will have to install a ballast resistor on LED.</p><p>Here is an advice on how to define its characteristics.</p><p>Resistance (R) = (Input voltage &ndash; LED voltage) / LED current.</p><p>I used L-934F3C, 940nm, 20 mA, 1.2 - 1.5 V. Arduino board supplies 5v. So the calculation is the following: (5v - 1.4v) / 0.02A = 180 ohm</p>
<p>Cool. Thanks</p>
<p>Could anyone share .stl of adapter for stepper to hold the subjects?</p>
<p>Check step 3. I uploaded the stl for a very simple holder which connects the stepper motor with a pin. I made it for scanning insects. It is very simple to make your own holders. If you haven't done any 3d modelling this would be the perfect first project.</p>
<p>Thank you!</p>
<p>Has anyone tried this with a Raspberry Pi 2? Just curious. I'm trying to put mine together now. Also, is it possible to bypass the Easy Driver altogether? All I have is a stepper hat for the RPI 2, I'm not sure how to hook up a stepper hat and a ribbon cable/cobbler together.</p>
<p>If you have a stepper driver for the rasPi that should work fine. The design is really simple and it should be easy to make your own version with whatever hardware you have.</p>
<p>I thank Shapespeare for good instruction!</p><p>There are some issues of Nema connection that could be useful for other followers.</p><p>I use Nema 17HS3430. Standard connection according to the fritzing schematic does not work. In my case the motor did not turn properly, just twitched. Eventually I found out that coil A is not first and second wires but first and third (red and green). Accordingly, coil B is second and fourth wires (blue and yellow). When I have changed the connection, the motor started to rotate. By the way, it rotated in wrong direction, so I had to switch A and B coils at easy driver pins. Finally, it works properly.</p><p>I&rsquo;d like to note also that 940nm IR led may be used instead of 950nm. In my case it works.</p><p>There is a problem of automatic scan, and I do not know how to fix it. When I push Select button the object is fully rotated and captured by camera. But the device does not want to make the second circle when I push the Select once again. All other buttons function properly. So to make new photos at different angle I disconnect power and then press Select. Any ideas how to fix this problem?</p>
<p>Good Job. Your case is even more elegant than mine! There doesn't seem to be a universal standard for steppers. Luckily there aren't that many permutations and other than plugging and unplugging the driver when it is running it is difficult to fry anything by doing it wrong.</p><p>Rather than unplugging the power to reset the system for another scan you could use the right-most button which should work as a reset (it essentially does a power cycle just more conveniently)</p>
Thank you for advice on how to reset the system!<br>Elegant case will arrive soon )))
<p>Awesome! I just finished mine and it works great. Tip: make sure the wires for your IR LED are long enough. I made mine ~1ft long and immediately had to lengthen them. (Basically, consider the distance you need between the Arduino and your camera body.)</p>
<p>Sweet. Now when you get some good scans put them up on Sketchfab so we can all see.</p>
<p>Could you possibly add which pins of {thing a} go to pins of {thing b}? your fritzing chart isn't clear to me</p>
<p>i am also not using an EasyDriver motor driver and am generally unfamiliar with stepper motors.</p>
<p>Sorry the fritzing ended up so small. These are the default pins, but they are easy to change in the Arduino sketch.</p><p>Pin 19: Enable pin. This is optional, but it turns off to stepper between movements. We don't really need holding power so this keeps the motor cool and quiet.</p><p>Pin 20: Step pin. This triggers the driver to step the motor.</p><p>Pin 21: Direction pin. This determines the direction the motor turns. For this application you don't really care which direction it turns so this one doesn't matter much.</p><p>Other than that you will need to hook up the unregulated power and ground to the driver and hook the motor to the driver. </p><p>These connections should be pretty standard for any stepper driver you choose. The firmware defaults to full step mode as most drivers will run full step by default. This is about the simplest stepper circuit imaginable so it is a good one to start with. Hope this helps.</p>
<p>awesome, thanks!</p>
<p>@Shapespeare: I imagine that i can make a playable copy of a vinyl record with such a gadget. Could it be possible? What do you think?</p>
<p>Theoretically possible, but not easy. It would require extremely high magnification. I have heard of very old records which were either broken or too fragile to risk playing being scanned with a special laser scanner. I think they extracted the sound digitally from the scan rather than printing a new disc, but that would theoratically be possible too.</p>
<p>I am noticing one thing right off that would probably make better and more complete scans more quickly, if you carried it thru. The picture sweep is great, but you could get a lot out of a second sweep at a 90 degree angle.</p>
<p>Yeah, you can set it up however you want. I do larger objects on a light tent. Whatever it takes to get a clean background so you don't need to mask the images.</p>
<p>This is great!</p><p>Here's something that might help: &quot;stitching together&quot; (CEMENTing) multiple exposures of the same subject matter:</p><p><a href="http://wearcam.org/orbits/">http://wearcam.org/orbits/</a></p>
<p>Interesting work. I'm not sure how the current batch of photogrammetry software would take to it. I know that some programs are quite particular about knowing the details of your lens (deduced from exif data) so they can correct distortion. Your algorithm could help this, or make the program die horribly because it wasn't expecting it.</p>
<p>Does Agisoft use exif data to correct distortion?</p>
<p>It is my understanding that it does, but you can use images without exif data (such as rendered focus stacks) and it works okay too.</p>
<p>Does Agisoft use exif data to correct distortion?</p>

About This Instructable




Bio: I make custom copper signs, metalwork and prototypes. I am one of the hosts of the "3d Printing Today Podcast", available on iTunes.
More by shapespeare:Create a Voronoi Version of AnythingMake Minecraft heart cookies with help from a 3d printer3d scan anything using just a camera
Add instructable to: