Introduction: Build a 30$ Laser Scanner

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.

Step 2: Firmware

At this point all you need to complete the hardware part is to upload the firmware to the Arduino. You will need the Arduino IDE or another sketch editor.

The firmware (a regular Arduino sketch) is available at: https://github.com/Sardau/Sardauscan

You will also need to install the AccelStepper library in order to compile it: https://github.com/adafruit/AccelStepper

· Edit configuration.h to match your wiring.

· Upload it to your Arduino

Now that the hardware is ready, test it!

· Connect to your Arduino with your IDE

· Type “Sardauscan” – the Arduino should answer “yes”

· Try the stepper: type “T R 100” – your table should turn 100 steps

· Try the laser: type “L 0 1” for the first (0) laser to fire (1) – the first laser should light up

If something doesn’t work, check your wiring and configuration.h – it should match.

Step 3: Software and Calibration

To install the Sardauscan software, go to github (see link above) and download the latest binary version. Extract it and launch the executable.

In the main interface, you will see 3 red icons – one for the table, one for the lasers and one for the camera. Click on them to connect to the hardware (right click to disconnect).

If you use the standard Sardauscan firmware the table and the laser switches are linked.

Now that the hardware is ready and the software connects to it, here comes the tricky part: calibration.

The calibration takes 3 steps:

· A manual calibration

· The build dimension

· The "Adjust" correction

Be careful during the calibration: the result quality directly depends on it.

To calibrate:

· Click the target icon and the ‘Physical’ button.

· Move your camera so that the vertical in the preview window crosses the exact center of the table.

· Click on the center of the table in the preview window. The lines will help you align the calibration object.

· Place the calibration object (see STL on Thingiverse) on the table, flat area facing the camera – use the horizontal line for help.

· Click on the first laser icon on top to light up the first laser. Align the laser line to the vertical line in the preview window.

· Repeat for all your lasers.

Build dimension:

· Click on the “build dimension” button and enter your build dimension.

Adjust:

· As a perfect calibration is difficult to achieve, especially with a higher number of lasers, the correction step will help you correct the previous errors.

· Place your calibration object on the center of the table and click “quick scan”.

· When the scan is completed you will see a top view of it. Each color corresponds to a different laser.

· The goal is to superimpose as best as possible the different laser scans: select a laser in the combo box and rotate (left mouse button), scale (middle mouse button) and pan (right mouse button) the scan.

Congratulations , your calibration is done!

Step 4: Dafuq Is This Interface ?

To be evolutive the software is designed around tasks and processes.

When you open the program you will see to the left a list of available tasks – you can drag them to the process list on the right then press the ‘Play’ icon at the bottom.

Here is a non-exhaustive list of the available tasks:

· Scan: scan an object

· Grab Pictures: take pictures of the object for use in a photogrammetry program

· Filter IQR: remove noise from the data with an interquartile range filter

· Filter median: remove noise from the data with a median filter

· Angle: merge laser scan by angle – smooth the scan and filter noise

· Bezier: smooth the data by fitting a Bezier curve

· Surface: smooth the data with a Laplace surface smooth

· Save ply: save a PLY file to use with MeshLab or any other point cloud software

· Save stl: save the STL file

Step 5: Developer Corner : Evolution ? Own Hardware ? Plugins ?

As mentionned the software is not linked to the Sardauscan build – it is made to be evolutive.

You can do almost whatever you want with plugins.

You have a magical algorithm?

Do a plugin for it !

You have a custom image acquisition hardware ?

Do a plugin !

You want to use your own hardware firmware for the table or the laser ?

Do a plugin !

You can look at the github repository, there are some plugins samples. It is really simple to code.

To use the plugin, just copy then in the "plugin" subdirectory.

Happy scanning !

Comments

author
Sardau (author)2016-03-14

Hope it will helps : A French student named Hugo Benoit-Jannin have made a calibration tutorial, i hope it will help.

https://github.com/Sardau/Sardauscan/blob/master/T...

author
YaroslavL4 made it! (author)2017-07-21

Hello,

I've built this 3d scanner and performed all the calibrations but there are some issues with my scans:
1) It's capturing only upper part of my object during a scan if scanning object is located just on a rotating plate. So I put a pad about 1" on a plate so it's located higher and now I get full height scans.

2) In order to get high quality 3d objects I'm scanning the same object several times from a different prospectives, and after loading resulted .ply files into MeshLab I noticed that object scan acquired in standing position and scan of the same object lying on a side can't be matched. In standing position object is too tall and in lying position it looks more native but it's shorter and can't be aligned. So probably, only changing of dimensions of resulted scans could help with aligning them into one complete object. Any thoughts?

3) I'm using AUSDOM AW615 HD Camera and as it's bigger than camera from original design I lowered it and designed a new mount for it. I also added supporting columns to get it steady, as stability is important for successful calibration.

asAny suggestions?

IMG_20170721_231437021.jpgIMG_20170721_231446447.jpg
author
hoangde2610 (author)2017-06-24

Hi Ferretti, thanks for nice project.

Btw, do you have any idea to smooth top part of the result? Or i done something wrong?

a.pngb.png
author
Goodini (author)2017-06-18

Hi Sardau!

This is a wonderful project. Thank you.
Now I'm doing it.
Please tell me, what is the accuracy of the scan? It is very important for me.
Thank you in advance.

author
Sardau (author)Goodini2017-06-18

Hello.

it is impossible to give a accuracy: it depend of the resolution you use ( and the webcam), the size of your build and most importantly the precision of the build and of the calibration.

Sardau

author
FG10 made it! (author)2017-05-22

Why I didn't see my object's coordinate?. Everytime see like this picture, when i import my file. Someone help me?

Untitled.png
author
dsikar made it! (author)2017-05-07

3D printed all parts, including profile and t-slots. Followed BOM to the letter, including camera. Worked first time. Great documentation.

31123801981_7551c06927_o.jpg
author
Janice Morgan made it! (author)2017-05-07

Hello Sardau,

I build your nice 3D scanner more or less according to your specs. You did a really good job in developing this. It took me a while to get all the components, primarily from China and in the meantime I printed all the 3D parts. Now its all put together and tested - it so far all (technically) looks and works well. I'm at the calibration and last physical adjustments and looking for some nice stuff to scan.

3DlaserScan.JPG
author
KhalidT10 (author)2017-05-05

Is there a document describing the theory behind the calibration?

author
JohnK178 (author)2017-04-07

Hi. Can you tell me where to get the printable table top?

author
daveinhull (author)2017-03-15

Hi,

Excellent project and I'm well on with my build. I have a quick question.

I have got the 20x20 extrusion as recommended, but the 120mm piece seems to be too long for holding the camera/laser mechanism; the one in the picture seems to show the mechanism a lot closer than if I use a120mm piece. Is the height critical and if so what would be the right length?

Many thanks

author
anwaralgacemy (author)2017-03-11

Hi

please i need help:: how to recover the color of my model.

I uploaded my model in .xyz in to meshlab and i got good result , but there no color

how i recover the color of my model

please any suggestion or guidance i will really appropriate

thank you

author
Sardau (author)anwaralgacemy2017-03-11

Hello,

the xyz file only store x y ans z informations of points. it doesn't store the color informations.

author
anwaralgacemy (author)Sardau2017-03-11

thank you for your cooperation..

which file format you suggest me to export from sardauscan??

that help me to get the color information in meshlab

thank you

author
MichałR23 (author)2017-02-23

Hi!

I have arduino UNO board and it
doesnąt response on serial commands. After I open serial monitor and
tzpe there "Sardauscan" it should response "yes", but it doesn't. Sketch
is compiliing fine. Does anybody have same problem? It doesn't
communicate with sarduscan application.

In compiling I have only this warning:

"

In file included from C:\Users\Misia\Desktop\STEPSTICK ARDUINO PROBA\2\Sardauscan-master\FirmWare\FirmWare.ino:1:0:

sketch\SerialCommand.h:51:2: warning: #warning "Warning: Building SerialCommand without SoftwareSerial Support" [-Wcpp]

#warning "Warning: Building SerialCommand without SoftwareSerial Support"

^

sketch\SerialCommand.h:60:0: warning: "SERIALCOMMAND_HARDWAREONLY" redefined

#define SERIALCOMMAND_HARDWAREONLY

^

sketch\SerialCommand.h:47:0: note: this is the location of the previous definition

#define SERIALCOMMAND_HARDWAREONLY 1

^

In file included from sketch\SerialCommand.cpp:26:0:

sketch\SerialCommand.h:51:2: warning: #warning "Warning: Building SerialCommand without SoftwareSerial Support" [-Wcpp]

#warning "Warning: Building SerialCommand without SoftwareSerial Support"

^

sketch\SerialCommand.h:60:0: warning: "SERIALCOMMAND_HARDWAREONLY" redefined

#define SERIALCOMMAND_HARDWAREONLY

^

sketch\SerialCommand.h:47:0: note: this is the location of the previous definition

#define SERIALCOMMAND_HARDWAREONLY 1"

author
anwaralgacemy (author)MichałR232017-03-03

Hi dear MichalR23

did you fixed the problem because i facing the same problems

please guide me how to solve this problem

thank you

author
MichałR23 (author)anwaralgacemy2017-03-03

Hi,

there is a critical bug in line with "identfication" function. There is "tification" instead of "identification" word. Find it and change it. Moreover You must have serial monitor/ide closed when want to connect with software.

author
anwaralgacemy (author)MichałR232017-03-11

thank you really

i solved the problem , my arduino nano was damaged i replace with new one and it work perfect.

thank you again

author
Sardau (author)MichałR232017-02-23

hello, check your baudrate ( see configuration.h it is set to #defineSERIAL_BAUD115200)

author
MichałR23 (author)Sardau2017-02-23

Yes, it is set to

#define SERIAL_BAUD 115200

I didn't change anything in your Firmware, so I don't know where is the problem :/

author
anwaralgacemy (author)2017-03-01

hiii sardau

I am using I have arduino NANO board

my stepper motor is rotating only counter clock wise when i adjust from the turning table, it does not rotate in clock wise.

and when i start to scan the stepper motor does not rotate...

please help me

author
samirabaza made it! (author)2017-02-08

Still frustrated in calibration and the motor back lash.

but it is functional

3d scanner feb 2017.jpg20151214_000418.jpg20151214_000426.jpg20151214_000856.jpg20151214_000905.jpg20151214_000920.jpg20151214_000926.jpg20151214_000929.jpg
author
Sardau (author)samirabaza2017-02-08

motor backlash ? ... the backlash must not be very important, the motor only rotate in one direction.

author
samirabaza (author)Sardau2017-02-10

due to acceleration, deceleration and table inertia , the angle is not always accurate when I turn it 4x90 degrees it never arrive to the same point again
one more thing.
I managed to calibrate laser 1 and 2
I do not know how to calibrate laser 0 and laser 3
and please would you release some process files as a reference or guide for us.

thank you for this nice project and your reply to my comment

temp_347577536.jpgtemp_276281638.jpgtemp_1919492879.jpgtemp_1835072742.jpg
author
Sardau (author)samirabaza2017-02-23

i don't tink your laser position and/or build dimention are correct.

author
hoangde2610 (author)2017-02-11

if i use laser Φ15mm. Do i need to adjust your laser_holder.stl file?

author
Andi23456 (author)2017-02-03

Thank you for the great work. But I had problems with the calibration and I wanted to use it in Linux. So I decided to make a firmware that understands the G-Codes of Horus 3d Scanning software from BQ (https://github.com/bqlabs/horus). It works just with two lasers, but it has an auto calibration mode. The scan results are really good and the calibration works just fine. And it works in windows or Linux. If you are interested in the changed firmware I can share it.

author
Sardau (author)Andi234562017-02-07

nice. yes please share.

having all the feature of the horus for 1/3 of the price. i think poeple will be interested.

me to to try the horus software ;)

author
Andi23456 (author)Sardau2017-02-09

Ok, here is the link to the code:

https://drive.google.com/file/d/0BwQz2ycUnr3IU1UtV...

The program is kept very simple. I changed the Sardauscan firmware code to understand just the basic G-Codes. Only turning the table and turning the lasers on and off is implemented (speed adjustment does not work) but it is enough for scanning with Horus.

I made a video of a scan:

author
samirabaza (author)Andi234562017-02-07

please do
same problem here with the software

author
ThoT1 (author)2017-02-03

can you just use one Line laser 5v?

author
JamesS51 (author)2017-01-26

Apologies if this has already been asked, but I could not see it, does it need to be that particular camera, or would anything do?

author
csomaroo (author)2017-01-18

Greetings from South Africa :)

I am building my scanner ...
I have only 2 line lasers for my build will that matter?

if it is fine do i need to change it anywhere else ?

author
JerryS133 (author)2017-01-12

Does the direction of the turntable matter? Mine goes CCW, and your demo shows yours going Clockwise. Also does the sequence of the lasers matter? If so what is the sequence? Thanks... yours was my very first 3D print project, and it turned out pretty nice. Will post a pic when everything is tuned.

author
Sardau (author)JerryS1332017-01-12

BTW, my laser sequence is clockwise too.

author
Sardau (author)JerryS1332017-01-12

Hello,

yes the direction of the turntable matter. (otherwise you could have symetric object)

the order of laser isn't important.

author
tcurdt (author)2017-01-06

What algorithm do you use to turn the images into a point cloud?

author
Sardau (author)tcurdt2017-01-07

hello,

it is explained in the introduction of this instructables: just after the title "How does it work?".

you can find all the code on github

author
anwaralgacemy (author)2016-12-03

hello Sardau

I am willing to use sardauscan laser Scanner, kindly may asked how to get the turning table (table_AXLE.stl), I all the STL files of the design is available except the file for table_AXLE. stl.

Also I want to build the circuit in schematic, what software you recommended me as I need to show my lecturer that project circuit function well in software first before I build the hardware part, I tried to use Proteus for building the circuit, unfortunately I didn't find the liner laser in the Proteus library and the type of stepper motor that you use for this project

any suggestion or guidance is highly appropriated

thank you

author
andyp108 (author)anwaralgacemy2016-12-21

They look like these stepper motors that are very cheap from Amazon. https://www.amazon.co.uk/KOOKYE-28BYJ-48-4-Phase-S...

They come with the stepper driver board and are pretty cheap. I've used one in the past and have to say the steps aren't very reliable (also noted by other). There must be better types out there!

author
Sardau (author)anwaralgacemy2016-12-03

hello,
the stl is this one https://github.com/Sardau/Sardauscan/blob/master/STL/table_AXLE.stl glued on a round shaped ikea mirror painted in black (but you can use whatever you want)

if you prefere, someone have made a stl for the whole table http://www.thingiverse.com/thing:1859020


for the program i can't help you, i'm a little bit "old school" for schematics, i use paper and pen ;)
but for the purpose of this instructable, i've used http://fritzing.org/home/ and photoshop.

author
anwaralgacemy (author)Sardau2016-12-07

Dear Sardau

Really thank you for your best cooperation and your kindness

thank you very much

author
JohnMonty (author)2016-12-03

hi. What is m3 and m4 any links or help would be apriciated

author
Sardau (author)JohnMonty2016-12-04

M3, M4 are the metric size of the screws and bolts. (the diameter of the screws in mm)

author
teegobbs (author)2016-10-01

hi starting this build

are bearing size ?

624ZZ: ID 4mm OD 13mm Width 5mm ?

author
SebastianT50 (author)2016-08-26

i tried to calibrate anyhow on myself for over a month now but still my head wont understand different things and to be honest i have the "schnauze voll"

when i start the correction matrix what should sit on the table?

beforethat at first i turn the lasers to little thing in the middle with flat surface to camera. making the lasers match with vertical line in the middle. if i understand right should the correction matrix show me the shape of scanned thingi but my results are weird. all 4 lasers show different crap....

author
lamasL314 (author)2016-08-13

OK, before I attempt to make this I have a few questions.
1) Does this kind of thing have enough accuracy to get exact angles for things like prototyping that everything has to fit?
2) The extra two lasers are for improved accuracy right?
3) Do you know if getting a better camera would improve shape accuracy, or is it purely for color or whatever?

author
ScottR134 (author)2016-07-26

How hard would it be to scale up the project to capture point cloud data of the interiors of buildings?

author
AdalbertoC made it! (author)2016-07-18

Now gonna try to calibrate ....

2016-07-18 19.55.13.jpg
author
AdalbertoC made it! (author)2016-07-18

Now gonna try to calibrate ....

2016-07-18 19.55.13.jpg

About This Instructable

238,135views

1,777favorites

License:

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