Introduction: 3D Printable 3D Scanner Using Intel Realsense D435
For a school project a co-student (Wouter Drost firstname.lastname@example.org) and I (Sander Boelen email@example.com) made a 3D scanner using an Intel Realsense D435 depth camera. Our goal was to make a scanner for hobbyists and educational purposes. With commercially available 3D scanners costing around €1000+ we wanted to stand out by making our scanner cheaper so it's more accessible to a broader group of people. Due to the D435 resolution our goal was not to make 3D scans to be able to perfectly replicate machine parts with tight tolerances. This scanner would be for making scans to derive parts from (like scanning a can of beer to make a beer holder) or to 3D print replicas of scanned items (for example for making miniature items for in a dollhouse). This would make 3D printing more accessible to more people since a lot of people are not able to make their own 3D models. With this 3D scanner, even kids are able to make their own STL files by tinkering whatever they want and then 3D scanning it.
The total costs of this project will be around €250 (the main cost will be the camera) and consists out of the following parts:
- Intel Realsense D435 (with USB-C cable)
- Arduino Uno (with USB-B cable)
- MF-6402411 Stepper motor with ULN2003 Driver
- 7 male-female jumper cables
- Skateboard/Fidget spinner ball bearing (8mm (inner diameter) x 22mm (outer diameter) x 7mm (width))
- 20x20mm extrusion profile 30cm
- M4 bolts and nuts (screw heads prefered)
- Camera mount bolt
- 3D printed PLA parts (minimal 150*150 print bed required)
Step 1: 3D Printing All Parts
All parts for the 3D scanner can be 3D printed in PLA on basic 3D printers without brims or supports. For all parts 3 wall layers, 0.2mm layers and at least 15% infill is recommended.
For the camera stand there are multiple variants available. Since my own 3D printer can't make the stand in 1 part its split in 2 parts (without support needed). When a printer with a print bed longer then 220mm is used, the stand can be printed in 1 part (support needed). All parts found in the parts folder are given names which clearly show what parts should be printed in which case.
Step 2: Arduino Wiring
The wiring to the Arduino should be connected as shown in the picture above using male-female jumper cables.
5V to +
GND to -
D8 to IN1
D9 to IN2
D10 to IN3
D11 to IN4
Step 3: Assembly
When all parts are printed and the Arduino is wired up it is time to start assembling the 3D scanner.
1. Start by pressing the small gear on the stepper motor.
2. Place the Arduino, Stepper driver and Stepper motor inside the frame. When the Arduino or the Stepper driver don't stay in place by themselves it is possible to glue them in or keep them in place using double-sided tape.
3. Use 2 M4 bolts to lock the Stepper motor in place.
4. Press the ball bearing inside the ball bearing holder.
5. Assemble the ball bearing holder on the frame using 4 M4 bolts. Pay attention to the orientation since the ball bearing isn't symmetric. The middle of the bearing should align with the middle of the frame. (It might also be handy to put the cables underneath the ball bearing holder to keep them in place)
6. Connect the USB-B cable to the Arduino.
7. Slide the extrusion profile into the frame and secure it using glue.
8. If the camera stand in 2 parts is chosen, connect the 2 parts using 2 M4 bolts and nuts.
9. Put 2 M4 nuts in the nut holder.
10. Slide the nut holder into the bottom groove of the extrusion profile with the nuts facing up.
11. Slide the extrusion profile into the camera stand.
12. Drive 2 bolts in the bottom of the camera stand into the nuts inside the nut holder. Be careful not to tighten the bolts to strong!
13. Secure the camera on the stand using the camera mount bolt.
14. Press the turning top inside of the bearing.
15. Connect the USB-C cable to the camera.
Step 4: Installing Software
1. Download the required software:
2. Unpack the "3D scanner.rar"
3. The "Main program" folder should be placed on a location from where you want to run the scanner. Make sure to keep all the files in the same folder.
4. "Arduino 3D scanner.ino" script should be uploaded to the Arduino.
Step 5: Using the 3D Scanner
Execute the "3Dscanner.exe" file to start the program. From here on everything should be straight forward on how to use. Enjoy!
To change the code you can use the "3D scanner.py" file, which is the source file for the program.
Participated in the
First Time Author Contest
2 months ago
hello so i finished printing and uploaded the Arduino script and when i run the software the screen is just black nothing happens, the camera works when i test it in the RecFusion Pro but nothing happens when i run the 3d scanner software even the motor dont run
Reply 7 weeks ago
do you have the correct com port? is so, make sure nothing else is using or pulling from that com port. i have had issues with cura pulling from the com port. try closing all other windows before starting scan
Reply 2 months ago
There could be 2 problems. The first one is that the arduino setup is not working, this is easily checked by checking whether it rotates in multiple steps. The second one could be that you didnt select the right COM port. You can change this in the python Code.
Question 2 months ago
thank a lot for the inspiration about 3d scanner. but, I want to know how to modify 3D scanner.py if I don't wanna use arduino to rotate the object and just use manual rotation using rod ? and I'm using intel realsense d435i now
Answer 2 months ago
You could use a python interpreter like spyder. I would not recommend going this way since the program needs precise angle rotations to know the object location. It does not just randomly spin. The d435i should not be a problem, however you might need to change some settings in the python code.
Question 2 months ago on Introduction
I am having problems with your main program, 3Dscanner. The program runs but there is nothing on the small screen. I know that the D455 is working ok. Any help would be appreciated.
Answer 2 months ago
Question 2 months ago on Step 5
the camera doesnt seem to turn on, it blackscreebs'
Answer 2 months ago
Question 1 year ago
Hi, Thanks for this project
I have an Intel D455 and the image is not centered. How can I change the code and which parts ?
Answer 1 year ago
You can take the .py file and change it. I don't know the exact lines from my head and I can't look it up since I am on vacation. You should be able to find the lines somewhere in the other comments. Otherwise you'd have to wait a few more weeks for me to be able to look it up. Hope you get it to work!
Ps. It might also be possible to change it in the camera settings btw, but I never looked into that, but it might be worth a try.
Reply 1 year ago
Hello, thanks a lot for this project and your answer, I'm currently working with Charles trying to get the d455 to work, sorry I didn't see your message earlier.
I'm having trouble compiling the py file for now, did you use a specific version of python for this program ?
This is my error message:
ImportError: Module use of python38.dll conflicts with this version of Python.
Reply 3 months ago
Hey, you could run the source file on Linux OS, where you can install a few more modules for the python source file(like open3d). And give the Arduino COMport as \dev\ttyA***, where it depends on the computer. On my computer, the Arduino was connected to \dev\ttyACM0.
To see the different \dev:
Command: ls \dev\tty*
After this Intel realsense 435i camera and Arduino got connected with the source code.
If you get any other error you can just comment(i.e, use #) on the respective line in the source code. And the code works great...
Question 6 months ago
thank you for the great project. I built it, but with an Intel Realsense D435i. What settings do you need for a successful scan? Thank you for your reply. Greetings Frank
Answer 6 months ago
I responded to your email with an explaination how to get your scans better!
Reply 4 months ago
Hello, thank you for this tutorial. I am exactly in the same case. how can I optimize the quality of the reconstruction? in your opinion, how to scan larger objects?
Reply 4 months ago
first check if the rotation is in the same direction as in the video. If its not, change it in the arduino code. Then you can calibrate the camera location in the python code. If you want to scan larger objects, you can try making a stand which places the camera further away and higher. You can adjust its position in the python code
Reply 4 months ago
Thank you for your answer.
my first problem is the following: I did not entirely follow your tutorial for the manufacture of the turntable. Also, at the end of the scan, the plate to be made only 270°. I imagine that suddenly the angle parameters are not good. What parameters can I vary in arduino code or python code?
Reply 6 months ago
1 year ago
3dscanner.exe file can't open. Instead of .py file is opened