loading

Introduction

This instructable will guide you to build a 3D scanner for less than $30, or even $12 if you already have a USB webcam.

Seeing the price tag and limitations of commercial scanners I decided to challenge myself to build my own. It had to be cheaper and easy for anybody to build one using a 3D printer.

Result

The "Sardauscan" is a laser scanner, comparable to other professional laser scanners but for less than 20-30 times the price, and it has twice the number of lasers.

My design principles were:

· Keep it simple

· Keep it low cost

· Make it evolutive

· Provide a complete solution

The scanner is completely open source and open hardware:

· The "Sardauscan" software is written in C# - the full source code is available.

· You can write plugins for your own hardware or for your tasks.

The software allows you to scan, smooth, build meshes and export to various formats.

How does it work?

The principle of a 3D laser scanner is simple.

· A picture of the object is taken without any lasers firing

· One laser is switched on and another picture is taken

· Computing the difference between the two images, a laser trace (profile of the object) is obtained

· By knowing the positions of the camera and laser you can derive the 3D coordinates of all the points on the profile

· You do the same for all the lasers, turn the table and repeat the process until the table has made a full revolution

And there you go, you have a complete point cloud representing your object.

Step 1: What do you need ?

Here is the list of all the parts you need to build the scanner:

· A bunch of M3 (16 and 20 mm)

· A bunch of M4 (12 and 20 mm)

· 1x Arduino nano (Chinese copy, $4) http://www.befr.ebay.be/itm/NEW-Nano-V3-0-ATmega32...

· 1x Chinese Stepper Motor (28BYJ-48) and controller (ULN2003) (5$) http://www.befr.ebay.be/itm/Uln2003-Stepper-Motor...

· 1-4x Line laser 5v ($2.5$ piece) http://www.befr.ebay.be/itm/251688838898?ssPageNa...

· 1x Hercule HD Twist ($15) http://www.befr.ebay.be/itm/Hercules-HD-Twist-5-0...

· 20x20 profile (can be printed : there are plenty of STLs on the net)

· optional 3x 4mm roller ($0.3 piece) (624 bearings

Total: from $26.5 (1 laser) to $35 (4 lasers)

About the 2020 lengths: this is not really important. The only constraint is to have the camera seeing the whole table.

For example, here are the lengths I used for my build:

· 2 x 140mm

· 1 x 120mm

· 1 x 250mm

What to print

All the STL files can be found on Thingiverse:

http://www.thingiverse.com/thing:702470

· 1 x arm_left.stl

· 1x box.stl

· 1x box_door.stl

· 1x box_arduino_clamp.stl

· 1x arm_right.stl

· 1x CORNER.stl

· 1x MOTOR_MOUNT.stl

· 1 to 4 x laser_holder.stl

· 1X Camera_HOLDER_LOWER_PART.stl

· 1x Camera_HOLDER_UPPER_PART.stl

· 1x center_axe_MINIMAL.stl OR 1x table_AXLE.stl (OPTIONAL)

· 3x roller_baseV2.stl

· you can print 12x M4_tslot_nut.stl if you use a 20x20 profile and you don't have any

Remarks:

· The 2020 profiles are just here for ease of use. You can use whatever you have: wood, metal, …

· If you want to use another camera, you will need to adapt “Camera_HOLDER_UPPER_PART” to match it

· The bearing are optional. They are only necessary if you want to scan heavy objects or don't have a perfectly flat table

· The build is simple, just look at the pictures. You can't do it wrong

· Put the motor at the center, place the 3 profiles around and screw them. Place the corner, screw, put the arms, screw, …

· There is a hole for each screw, you can’t get it wrong.

· For the wiring, please refer to the diagram.

<p>Hope it will helps : A French student named Hugo Benoit-Jannin have made a calibration tutorial, i hope it will help.</p><p><a href="https://github.com/Sardau/Sardauscan/blob/master/Tutoriel.Sardauscan3d.pdf" rel="nofollow">https://github.com/Sardau/Sardauscan/blob/master/T...</a></p>
<p>Has anyone made a troubleshooting guide for calibration/tuning?</p><p>Quite a long list of comments to go through.</p>
I am having an issue with the build dimensions. I guess I'm not understanding how to find those measurements like the angles of the 4 lasers, and X,Y,Z axis. I did rough measurements of the bed height and distance from center of bed to where the camera sits(LifeCam HD5001) but my test scans are all over the place. Any help would be greatly appreciated. I searched back quite a ways and didn't see anything that would help me.
<p>see the capture : in red this is the angle. but if you are more confortable with x y z position, you can set it directly.</p><p>pay attention at the angle sign. (the minus and plus, show you the sign)</p><p>note that 1mm is a huge value.</p>
<p>ok thanks, I think I got that part fixed. Now I'm having an issue with the laser picking up things in the background. Is there a way to limit where the laser light ends at the top of the model, or to tell the program to ignore anything above/beyond the scanner plate?</p>
<p>play in the tune page (and exposure of the camera) to remove noise in laser detection.</p><p>and you can set the table height and diameter in the config file ( button in the title bar)</p>
<p>I'm having some calibration issues with this. I have aligned the lasers, centered the camera, and yet when I scan, I get a pretty clear view of the table, the table support, and a massive random cloud where the calibration teardrop should be. Anyone point me to a forum for some more info?</p><p>If it helps, I've tried dropping to one single laser, only succeeded in turning the table support into a total screw up as well (from what the camera sees), I've made sure the laser is vertical and centered, and the camera is a 720p logitech. I've tried a couple tables, one glossy, the rest matte. The correciton step, once I do a quick scan, looks like a misformed star, and when I had four lasers operating, none of them were even similar. All were random with spikes and dips. I have no idea what I'm doing wrong, but it's driving me crazy.</p>
<br><br>First of all in the tune view, you mist get a clean line in the last view.<br>if you get one. it can be a problem of triangulations. this mean the compatiation are incorect, due to wrong position entered for camera or laser (buid dimention view).<br>havent you inverted the sign for the lasers ? (+xx&deg; instead of -xx&deg;)<br>
<p>Thank you so much for responding!</p><p>Double checked my dimensions, they're accurate to within a few millimeters. Tried inverting (going + instead of -), same issue. The only thing I'm curious about, does it matter that my camera sits about 20-25 mm higher than the lasers?</p>
<p>the height of your camera is not imporant, if the height is correct in the build page (btw 1 or 2 mm is a great deal for the precision !)</p><p>have you a clean red line in the &quot;tune page&quot; ? if not, the laser line is not well detected. and you can get huge error due to noise. (play with teh theshold principaly, or the camera exposure. these 2 give the best result)</p>
<p>Hello Sardau,</p><p>I build the Scanner and I can use the Serial Monitor to turn the Laser's on and off, I also can turn the table. </p><p>Now my Problem is, that the Programm &quot;Sardauscan&quot; isn't able to use my Arduino Uno. The Camera works but I can't add the Laser's and the Table.. Everytime I choose my Arduino Uno on COM 3 the &quot;ok&quot;-Button stay's gray. (as you can see in the screenshot). Clicking on the little blue Plug on the right side didn't change anything (I've been clicking that thing for hours..) </p><p>btw: the tutorial from Hugo Benoit haven't help.. </p><p>Hope you can help.. It is very important :S</p><p>Sorry if you don't get whats my problem is (probably caused of bad english ^^)</p><p>Greetings from Germany! :)</p>
<p>(the procedure at this moment is realy simple : i create a standart .net SerialPort, send &quot;Sardauscan?&quot; and wait for a &quot;yes&quot;. if i don't get it, the ok button stay grey)</p><p>the Sardauscan software doesn't allow to change the baudrate for now. have tou cange the baudrate in the firmware ?</p><p>ps: i got some problem with chineese nano clone, i must click severa time to actualy connect (maybee a com link initialisation problem, i dunno)</p>
<p>The funny part is, when i tiped &quot;sardauscan&quot; in th serial monitor it returned &quot;yes&quot;.</p><p>Now after trying some stuff (changing the baudrate, changing the COM-Port, etc.), it suddenly worked. I think the problem was, i had the serial monitor running, while i was trying to connect sardauscan with the Arduino. Maybe the Arduino was just overfloatet with tasks and informations. So I closed the serial monitor and it just worked.</p><p>Maybe some people had the same issue and now they can fix it ^^.</p><p>But thank you for the answer.</p><p>Btw. awesome project!</p>
<p>Sardau</p><p>i have the same problem. with table and laser. the baudrate is ok, com-port also.</p><p>I started Sardauscan.exe, table and laser not working?</p><p>If i click on the usb icon the leds blinked on the arduino.</p><p>What i do it wrong</p><p>pcbakker </p>
<p>I have the same problem with table and laser, what should I do, please???</p>
<p>you can have only one connection to a serial port. (one application at a time)</p>
<p>yeah I already knew that, but I haven't thought that it is a different serial port ^^</p><p>Thanks for the help! :)</p>
Hello -Sardau I have a problem is the stepper motor does not move this what is the problem?But Stepper controller is working Lights is flashing?
<p>hello,</p><p>read the readme in the firmware.(or the comment in the configuration.h)</p><p>or just 5-6 comment below </p>
<p>Hello,</p><p>I can't find any hercules hd twist in Romania.</p><p>Can I use Canyon CNR-WCAM43G camera or MS Lifecam VX-2000? If not, can you suggest me a good one?</p><p>Thanks</p>
<p>as said before :</p><p>&quot;if you redo a upper holder, you can use whathever webcam you want except wide angle one. just be sure that your camera is vertical, no tilt, pan or yaw.&quot;</p>
<p>how did you find the co-ordinates (x,y,z) of the laser line?can you please attach the code you have used to find the co-ordinates.</p>
hello, <br>by trianglulation.<br><br>all the code is in the gitup link.given in the instructable: see the task &quot;scan&quot; in source.
<p>actually i didnt understand the highlighted part in the code.</p><p>how did you convert the pixel distance into real world values?</p><p>thnx :)</p>
<p>this code is to rotate the 3d points : when the table have turn, your object is rotated, your coordinate have change. so you must do the inverse rotation of the points to get the all in the same coordinate...</p>
<p>i think it is this code you must understand to convert 2d laser line to 3d world</p><p>it is the triangulation part.</p><p><a href="https://github.com/Sardau/Sardauscan/tree/f7856a15cb1bb3d16da0ea5c7cc6ef8d926d5e59" rel="nofollow">Sardauscan</a>/<a href="https://github.com/Sardau/Sardauscan/tree/f7856a15cb1bb3d16da0ea5c7cc6ef8d926d5e59/Sardauscan" rel="nofollow">Sardauscan</a>/<a href="https://github.com/Sardau/Sardauscan/tree/f7856a15cb1bb3d16da0ea5c7cc6ef8d926d5e59/Sardauscan/Core" rel="nofollow">Core</a>/LocationMapper.cs</p><p>public Point3DList MapPoints(List&lt;PointF&gt; laserLocations, Bitmap image, Color defColor)</p>
<p>actually i didnt understand the highlighted part in the code.</p><p>how did you convert the pixel distance into real world values?</p><p>thnx :)</p>
<p>Hello, I finished building this a few weeks ago, loaded the firmware and my table motor wasn't working. I tried changing the half-step and revolution-step values and it still wasn't working. The stepper motor controller board didn't seem to be powering, I fried the Arduino board as well messing with it. I have a new Arduino and stepper controller but when I tried to compile in the Arduino program I get the error &quot;C:\Users\Mike\Documents\Arduino\Scanner\FirmWare.ino:1:27: fatal error: SerialCommand.h: No such file or directory&quot;</p><p>Anyone know why I'm getting this error now? I tried downloading the sardauscan software again and starting fresh and still get this error.</p><p>-Mike</p>
<p>I am not able to get scans. How can i get the laser line to be just the height of the object? What is Threshold ? What is minimum and maximum width? Can you please help me out.</p><p>Thank you.</p>
Hello Dear Sardau, what is the effect of using more than one laser beam on 3d scanner's speed like your 3d scanner???
here is a part of a earlyer question about the fact of using 4 lasers:<br> <br> <em>Scan time increase, difficulty of calibration increase ( a lot !!!) , but there are many advantages.<br> <br> 1 You get the profile of the object from differents perspectives ( one part hidden for a laser, can be seen from another).<br> <br> 2 You also have more points in your point cloud, so better resolution.<br> <br> the biggest advantage in my opinion : Associated with the &quot;angle&quot; and &quot;laser&quot; task, you can use the different laser scan as samples over the same position.<br> the task &quot;laser&quot; take all the profile (scan line) from each laser at same posion and make a average =&gt; reduction of noise, increase of accuracy (and smoothness)<br> the &quot;angle&quot; task do the same but instead of taking one scan line from each laser, it take all the scanlines whitin a given angle</em>.
<p>Hello Sardau,</p><p>.. Must say a great project. I made the entire project but I have a question. What does this line mean? :Type in &quot;Sarduscan&quot; and Arduino will say &quot;yes&quot;.</p><p>I tried to do it with Serial Monitor of Arduino but nothing happens.</p><p>Also, I cannot understand y are we connecting laser 4 with digital pin 13?</p><p>Is there any error in the above code? If yes please post the updated link.</p><p>Thank you for presenting us with a cheap and effective 3D scanner</p>
<p>hello,</p><p>it is a little trick to identify com ports :</p><p>the command &quot;sardauscan&quot; is my way of identify a com port as a scanner : the software ask &quot;sardauscan&quot; and if it get &quot;yes&quot; he know that these com is a sardauscan scanner ;)</p><p>so to test if the firmware is correct, you can type &quot;sardauscan&quot; in the arduino ide to see if it respond correctly.</p><p>if nothing append if you type &quot;sardauscan&quot; ( and click send off course). this mean the firmware is not installed on the board. </p><p>ps: if you get something unreadable, it is the baudrate in the serial monitor that is not set correctly to 115200.</p><p>for the laser on pin 13, i use this pin mainly for debug purpose : the laser blink when the scanner is plugged or when the arduino reset. it is not realy important, you can choose whatever pin you want if you set it accordingly in the configuration.h.</p>
<p>can someone help me? my project went great but i wonder if anyone has a configuration.h made up to just turn on laser 0.</p>
just replace<br>#define LASER_COUNT 4<br>by<br>#define LASER_COUNT 1<br><br>but you can also select the lasers on the Scan task &quot;litlle gear&quot;.
<p>sorry also stupid question time. lol</p><p>is laser 0 to laser 3 supposed to start from right to left if standing behind the camera?</p>
you choose. <br><br>the only thing important is to have each laser position correct in the Sardauscan software.
<p>I have found all of the components on aliexpress.com for 11.95 grand total if anyone was looking for an even lower price. Just purchased my parts now:<br></p><p><a href="http://www.aliexpress.com/item/1PCS-Nano-3-0-controller-compatible-with-nano-CH340-USB-driver-NO-CABLE-for-Arduino-NANO/32473529871.html" rel="nofollow">1 x 1PCS Nano 3.0 controller compatible with nano CH340 USB driver NO CABLE for Arduino NANO V3.0</a></p><p><a href="http://www.aliexpress.com/item/5V-Stepper-Motor-with-ULN2003-Drive-Test-Module-Board/2055113391.html" rel="nofollow">1 x 5V Stepper Motor with ULN2003 Drive Test Module Board</a></p><p><a href="http://www.aliexpress.com/item/Free-Shipping-Focus-Adjustable-Laser-Head-5V-Laser-Line-Red-Dot-650nm-5mW-Module-New-Hot/32571450258.html" rel="nofollow">4 x Free Shipping Focus Adjustable Laser Head 5V Laser Line Red Dot 650nm 5mW Module New Hot</a></p><ul><li>Subtotal(3 Items):US $11.95<li>Shipping Cost to United States:US $0.00<li>All Total:<br> <strong>US $11.95</strong><br> </ul>
<p>I've been struggling for a long time now, but I'm getting really weird results. It seems like it's scanning two items, there are two &quot;rings&quot; of point clouds, one too big and one too small. The real object is just a tube. I'm using a Trust Webcam Pro because the cam you mentioned wasn't available anymore. Is there something not right in my settings? Could you guide me on this?</p>
that mean your laser aren't well aligned, or you build dimention or laser position/angle are incorect. (or lasers didn't cross at the exact axle of rotation of the table).<br><br>you must be very very very precise.<br><br>when it is as correct as you can physicaly archieve. you can do the correction matrix.<br><br>try with only one laser at first, doing calibration with 4 lasers when you aren't fluent with the calibration is a nightmare and can be very frustrating.
<p>Made it using arduino uno (have included connections), the only thing I printed was the table quide mounts the rest I used marine ply and box tube. I used a Lifecam HD3000 because I found it difficult to get the original here in Australia, but I don't know if I need to alter anything in the software. Everything works great but I can't seem to get a proper scan, I could not get the stepper motor to turn at first so I had to use the alternate settings recommended in config.h. As you can see I am trying to to scan a simple jar but getting a wierd picture, I wish I could read more on 3D scanning and or Sardauscan to leard more about the settings. I have tried numerous setting have failed to improve the scan, I'm degining to think I am doing something basically wrong if any one can help I would appreciate it. Anyway thanks very much for your great design I hope you don't mind me tweaking it a little.</p>
<p>did you ever got it working with the UNO and Lifecam HD3000?</p>
<p>These type of scan is due to the fact that each laser give a different result.</p><p>you can go to the correction page : launch a quick scan.</p><p>there you can see a superposition of each laser scan (view from the top, one color for each laser).</p><p>if the scan does not superpose correctly (and by the look of the result it is the case).</p><p>that mean that the computation of this laser is not correct. </p><p>the cause can be </p><p>- wrong XYZ laser position in the Dimention page.</p><p>- Wrong laser aligment (not crossing exactly at the center of rotation, litle bit tilted, etc) =&gt; physical page</p><p>- camera tilted, rotated, pan, of wrong XYZ position, vertical center not crossing the center of rotation of the table, etc</p><p>I also realise that configuration/calibration with 4 laser is way way to complicated to archieve and very few can archieve a good calibration. </p><p>as soon as i have time, il will work on a semi or full automatic calibration. But it is not a easy task, especialy without any comunity help.</p><p>in the mean time,</p><p>you can try to use only one laser (by changing the configuration.h in the firmware). it is much easier to calibrate and understand what append. </p><p>When you become fluent with the change and calibration, you can add other laser, but be aware that the calibration difficulties are exponential with number of lasers.</p><p>ps: you can see here in the comments many usefull informations to help your calibration.</p>
<p>Nice work! I used an arduino uno instead of a nano with only one (red) laser. I am also using a different (cheaper) camera, which is found by Sardauscan004. But I am using the samen stepper motor as you are. When I load the code to the arduino and start sardauscan004 the lasers work fine when I connect to the arduino. The table, however won't turn, even though I'm sure I connected it right (pin 2, 3, 4, 5). When I load up my own code, the stepper does turn.</p><p>Could it be the arduino still? I'm not sure how to proceed. Could you advise?</p>
<p>What's the camera model you used? in US the hercules HD twist is super expensive.</p>
<p>hello, if your own code work, check the difference. especialy check the declatation of the stepper. there must be some difference.</p>
<p>I tried the trick you described in the readme:</p><p>#define HALFSTEP 4<br>#define REVOLUTION_STEP 2048</p><p>And I downloaded the accelstepper through the link you provided. So if I'm correct I'm running version 1.3. Any tips?</p>
<p>Disregard. I opened configuration.h in notepad++ and edited it while at the same time having configuration.h opened in the arduino IDE. So the arduino IDE took the unedited version which was still in its memory I guess.</p>
<br><p>Hello.<br><br> I bought following stepper motor:</p><p><a href="http://www.ebay.de/itm/271566159276?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT" rel="nofollow">http://www.ebay.de/itm/271566159276?_trksid=p20603...</a></p><p>everything is connected correctly. But the Motor will not turn. it shines no LED on the driver. How to check the driver to function?<br><br> the stroke of the line laser is only 1CM long. how can you extend the line?</p><p>rotating the focus makes the line just out of focus.</p><p><a href="http://www.ebay.de/itm/401017199949?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT" rel="nofollow">http://www.ebay.de/itm/401017199949?_trksid=p20603...</a></p><br>
​for the motor, try the &quot;tips&quot; in the frirmware (see configuration.h and of Readme file). if it don't work, verify that the jumper on the driver is on 5v. try with external power. Or maybee a defect motor/driver, of a 12v motor. try with external power.<br>for your laser it is very strange... maybee it is a different laser, or the lens in the cap is misplaced.

About This Instructable

173,345views

1,559favorites

License:

More by Sardau:Build a 30$ laser Scanner Sardauscan sub-30$ Opensource 3d laser scanner 
Add instructable to: