# DIY 3D Scanner

## by SuperMakeSomething, published Mar 14, 2016

DIY 3D Scanner Mar 14, 2016

## Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.

Print Thing Tag

# Summary

Get started on making your own 3D Scanner with these STL files! A full set of instructions is available in Super Make Something Episode 8!

You will need to print the following components:

1x scannerBase
2x stepperMountingPlate
1x shaftCoupler
1x carriage
1x constrainingPlate
1x turntable

For a full set of instructions, check out: https://youtu.be/-qeD2__yK4c

view more

# All Apps

Auto-magically prepare your 3D models for 3D printing. A cloud based 3D models Preparing and Healing solution for 3D Printing, MakePrintable provides features for model repairing, wall thickness...

Kiri:Moto is an integrated cloud-based slicer and tool-path generator for 3D Printing, CAM / CNC and Laser cutting. *** 3D printing mode provides model slicing and GCode output using built-in...

KiriMoto Thing App

With 3D Slash, you can edit 3d models like a stonecutter. A unique interface: as fun as a building game! The perfect tool for non-designers and children to create in 3D.

Quickly Scale, Mirror or Cut your 3D Models

Thanks for the datasheet you sent ... but I am confused on the 4800 and 20, what is the point of the function equation of 4800 and 20

Thanks.. :)

I get the source code at a video on youtube but there is no explanation in the video.

can you help me explain it this source code.

float analogRead = volts (pin);

If (volts >= 80 && volts <= 500) {
float distance = (4800)/(volts-20));
return the distance;

What is the meaning of (4800)/(volts-20));

Thank you very much your help. ..

I would like to know how to convert analog into the distance (cm) on the IR SENSOR SHARP 10-80 cm

thanks..

Hello.. I am very impressed with your video. I wanted to ask two things:

1. can I use the IR SENSOR SHARP 10-80 cm
2. is there any Activator sensors and objects other than motor stepper

Thanks

1.) You should be able to use a 10-80cm sensor, however you will need to increase the distance from the turntable and the scanner itself. Also, you may not get as good of a resolution for smaller objects using this sensor if you are reading the values in using an Arduino, as all of them output a value between 0-5V, and the microcontroller has a 10 bit ADC. This means that it can only return values in a range between 0-1023, regardless of the range of your sensor.

2.) There are no limit switches on this scanner. A complete bill of materials can be found in the description of the YouTube video.

6 days ago - Modified 6 days ago

I would like to know how to convert analog into the distance (cm) on the IR SENSOR SHARP 10-80 cm

thanks..

The output of the sensor/what the Arduino reads will be the same. It will report a value between 1023 and 0, which corresponds to the output voltage of the sensor that is between 5 and 0 V. In the Arduino code, I set up an equation that converts this number to a real-world distance. I did this using the datasheet for the sensor.

You will need to do a similar thing for the 10-80cm sensor using the data on page 5 of this datasheet: http://www.sharpsma.com/webfm_send/1489

Hope this helps!

I looked at your source code, can you explain from this source code :

(senseDistance,0.0,1023.0,0.0,5.0)

thanks..

This line takes the variable senseDistance, which is reported to the Arduino as a value between 0 and 1023, and maps it to the range 0 to 5, which is the voltage output by the scanner. I then use this voltage to calculate the real-world distance using the equation I constructed from the graph on the datasheet.

I get the source code at a video on youtube but there is no explanation in the video.

can you help me explain it this source code.

float analogRead = volts (pin);

If (volts >= 80 && volts <= 500) {
float distance = (4800)/(volts-20));
return the distance;

What is the meaning of (4800)/(volts-20));

Thank you very much your help. ..

This is the conversion between the reading to the real-world distance. It says that if the reading is between 80 and 500, it is valid. If it is valid, then it uses the equation (4800)/(volts-20)) to calculate the real-world distance. You will need to come up with this equation for your sensor. A good place to start is to fit a line to the plot in the datasheet of your sensor that I sent the link to previously.

Thanks for the datasheet you sent ... but I am confused on the 4800 and 20, what is the point of the function equation of 4800 and 20

Thanks.. :)

The equation represents a line that best fits data points collected from the scanner for reported sensor outputs between 80 and 500. The numbers you are asking about are coefficients of this line. The line is an equation that lets me plug in values reported by the sensor and calculate the real-world distance this output corresponds to. Since each sensor is different, you will need to calculate your own coefficients for this using linear regression.

More information about linear regression can be found here: https://en.wikipedia.org/wiki/Linear_regression

Linear regression can be easily performed in MATLAB if you have access to it. More information about performing linear regression using MATLAB can be found here: https://www.mathworks.com/help/matlab/data_analysis/linear-regression.html

Can you please explain how to open the scanned text file in matlab and how to work with it to get the final .stl file for printing.

Sure! Make sure that both the .txt file and surf2stl.m script are in the same directory as the processScanDistance.m script.

Make sure that the filename on line 23 of the processScanDistance.m code matches the filename of the txt file. You should now be able to run the code. After everything completes, you should have an STL file in the same folder as your MATLAB code, ready for printing.

Please, post some of your scanned STLs

Hello,

Great build n video.
was piecing together Pria, prias,? 3d printer.
sorry writing on tab n away from home.
I have arduino Mega i believe as well. i have a copy of the Arduino Mega you referenced.
Is the pinout the only alteration i need.
is the code you provide usable r do i need some alteration.
Thanks,

Thanks! I actually used an Arduino Pro Micro for this project. A Mega should work this project as well, since it does not use any of the specialized capabilities of the ATMega32u4 microcontroller found on the Pro Micro board, but you would have to run jumpers to the appropriate connections on the PCB instead of plugging the Mega into the PCB directly. The pinout between the Micro and Mega would likely be different. Pinouts for both microcontrollers with pin labels and their capabilities (MOSI, MISO, etc.) are listed online. When connecting your project, I would pull up images of both pinouts and connect things to the Mega using this information to match what is shown in the video.

Sep 9, 2016 - Modified Sep 10, 2016

Hai,
I get an error when compiling arduino with Scannercode

cc1.exe : error :-fno-fat-lto-objects are supported only with linker plugin
exit status 1
fout bij het compileren van board Arduino/Genuino Mega or Mega 2560
What am I doing wrong

I found it, I have arduino reinstalled and compileerd the program, only one error "error opening scn000.txt"
How can I fix this please?????

Sep 10, 2016 - Modified Sep 10, 2016
SuperMakeSomething - in reply to Sembot

I believe the compilation error is because you are using an Arduino Mega, not a Pro Micro like I used, so the pinout may be different. Specifically, I think that the pins that your SD card reader is connected to might not be correct for this Arduino, as SD card devices are often relying on the SPI or I2C interface. If you are not using the scanner PCB from the video and an Arduino Pro Micro, my best advice would be to double check your SD card reader's documentation and make sure that it is connected to the right pins on your Arduino Mega. This diagram will hopefully help: https://arduino-info.wikispaces.com/file/view/Mega2-900.jpg/421499040/Mega2-900.jpg

Sep 11, 2016 - Modified Sep 11, 2016
Sembot - in reply to SuperMakeSomething

Hai ,

thanks for the info, I now use an Arduino Uno with a small modification to the source code
MOSI pin 11
MISO pin 12
CLK pin 13
CS pin 10
On the Z-axis
pin18 is A0
pin19 is A1
On my monitor screen, I get " Initializing SD Card ... initialization success "
So far so good i think
Is it intended that i see the data from the scan on the monitor screen or not, I do not see it
Thank you to help me
I have not jet connected the power of 12 Volt

This is automatic write on de sd card
8.16
8.16
8.08
8.08
8.08
8.16
8.08
8.16
8.08
8.08
8.16
8.08
8.08
8.16
8.08
9999.00
7.84
have the sd card read on the PC , I counted 247 numbers between two 9999.00

That's excellent! Sounds like everything is working -- congrats again!

Hai,

I have made as you see, thank you for sharing this project
Is there a free download MatLab software ???????
Or any other software possible to see the scan, perhaps in Processing ????

Kind regards

You can download a trial version of MATLAB from www.mathworks.com. Alternative/open source programs similar to MATLAB are Octave, Scilab, Freemat, and Sage. These may work as well, but I have no experience with them.

Alternatively, the code should be easy to port to something like Processing. While the STL conversion scripts may not work, I believe that you should be able to pretty easily generate a point cloud plot using Proecssing's built in functions. If you do end up going this route, please let me know! Again, congratulations on your awesome build!

If i may ask what material did you use abs or pla? , how many top and bottom layers? , how many vertical shells? and how much infill?

I printed everything in PLA. I believe I used 3 bottom and top layers, but don't know how many vertical shells. Infill was at 20%.

Do you have all the materials for the construction of the scanner?

I am interested in this project

Definitely! The components list for the parts needed to make the 3D Scanner can be found in the YouTube video description.

Please let me know how your scanner turns out once you complete it!

OK perfect, but
some pieces can not find them. Your me you can sell ?

Hello I have a question

Top