3D Printable 3D Scanner Using Intel Realsense D435

1,603

43

28

Introduction: 3D Printable 3D Scanner Using Intel Realsense D435

For a school project a co-student (Wouter Drost wouterdrost01@gmail.com) and I (Sander Boelen s.boelen@hotmail.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.

Supplies:

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)

- Glue

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:

https://drive.google.com/file/d/13C6lw7JpJqJhClPOJ2-UYpganLNdpdcL/view?usp=sharing

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.

Be the First to Share

    Recommendations

    • Pi Day Speed Challenge

      Pi Day Speed Challenge
    • Trash to Treasure Contest

      Trash to Treasure Contest
    • Sculpt & Carve Challenge

      Sculpt & Carve Challenge

    28 Comments

    1
    Nickjallday
    Nickjallday

    Question 10 days ago

    Would a larger scanner top be feasible if you just installa a longer 2020 profile?

    1
    wouterdrost01
    wouterdrost01

    Answer 10 days ago

    It probably could be larger. We chose ~20 cm, because it is a bit more than the minimum distance of the realsense. The closer the distance is, the more details you can scan from the top of the object. If you want to experiment, you'll need to change the bounding box in the python script (the bounding box is used to filter out everything that isn't on the turntable).

    1
    Nickjallday
    Nickjallday

    Reply 10 days ago

    I appreciate it! My daughter's Barbie's have become differently abled after an encounter with our Australian Shepherds. She's asked me to print them superhero robot arms so they can walk and play games again like regular Barbie's, but also defend themselves from the K-9s. I am having a hard time modeling prosthetic barbie limbs without a rough 3d model to go off of. hahaha this project looks perfect but I think it may be a bit to small to capture a barbie. going to try and scale the bed to 225mm (the size of an ender3 bed).

    0
    SanderBoelen
    SanderBoelen

    Reply 9 days ago

    I don’t
    think a bigger turntable itself would be needed. I would recommend a longer extrusion
    profile and changing the camera stand so it’s a bit higher as well. You should take
    in consideration that the grain in the images go up exponentially with the
    distance, so I wouldn’t go unnecessary big, however the D435 shouldn’t be a
    problem when going a bit bigger since the accuracy is pretty good. You would
    also need to change some things in the software, I don’t know how experienced
    you are with this part but if needed I can help you if you reach out to me.
    Also if you really want the rotating table to be bigger I can change the
    original part for you so you keep the right gear module and such. Would like to
    see our scanner used for your application, keep us up!

    1
    Nickjallday
    Nickjallday

    Reply 9 days ago

    I’ll keep you posted, I modified the top plate file. the gears are the same essentially I just made the plate bigger 227.5mm (just enough to fit on my printer). Probably going to print the stand in two parts and make a few spacer to raise it up. Seems like the simplest solution.

    image.jpg
    1
    Nickjallday
    Nickjallday

    Reply 8 days ago

    So it would appear my motor doesn't steps per mm are to high to make it turn on it;s own. I need to investigate further.

    0
    SanderBoelen
    SanderBoelen

    Reply 8 days ago

    I replied to the email you sent me where I answered all your questions. Nice to see a picture of you replicating our project in your way!

    0
    Nickjallday
    Nickjallday

    Reply 6 days ago

    Thank you! I was able to make an extension that was 40mm higher and 10 degree less forward slant for the D435 to cover the bed area decently.

    So I've tried to give it a stab. and I can't find where the distance from the camera to the plate center (Y45cm), adjust the viewable area (X25cm) across, and height (Z25cm) high. But my python skills are novice at best i've only ever used it to writer log file parcers for work really. So i can't find which .py file/line that would be located. I've got a few suspisions but i don't want to break your program Lol

    The plate is actually 22.7cm wide, It appears the bed is about 1.5cm off center in the program image. (meaning of the ~23cm bed the camera see .5cm off the left and 1.5cm off to the right past the bed. Is this normal, and is it going to interfere with the scan? I do know the cameras on the D435 aren't centered just wasn't sure so I figured id ask.

    image0.jpeg
    0
    SanderBoelen
    SanderBoelen

    Reply 6 days ago

    If you just make a backup before changing the code you should be fine. I personaly use the spider editer for python which works super user friendly. This gives line numbers on the left side. You should go to the following lines to change the things you asked for:
    93 - replace 0.258 for your y distance (0.45)
    94 - replace every 0.13 with 0.18 (x/2 but I would advise a bit more so you can scan objects sticking out) also replace the 0.2 in the end with the scanning height, (although I think your scanner cant scan a lot higher than the 0.2 with spacer you used)
    165 - replace 0.165 with your camera height (0.25) (since your spacer is 6 cm I think your height needs to be 0.225)
    167 - replace 112.5 with your camera angle relative to vertical (102.5)
    183 same as line 94, so replace every 0.13 with 0.18, but keep the 0.01 in the end

    The camera being offcentered is what we found out too! It should be adjusted for in the code, if you have problems with this you can change the offset value on the end of line 163 and line 164 (the value of 0.035 is the value I found to work best for me)

    0
    Nickjallday
    Nickjallday

    Reply 5 days ago

    Thank you again for the help!

    I added some variables to make messing with the 3d scanner.py easier. I'm doing something wrong Lol I'll look some more into it tonight.

    I adjusted the spacer it's now a 105 degree angle, i modeled your setup with a 30cm 2020 profile and my setup with a 47cm rod and determined the differences not sure where bed center is suppose to measured to but i made some assumptions and measured to the tip of the cam screw holder on yours and it was 7mm less than what was stated in your program. So i added 17cm to that value to get my bed center value.

    2021-02-27 16_04_15-Window.png
    0
    Nickjallday
    Nickjallday

    Reply 5 days ago

    For a sanity check, i built the scanner you your specs.

    30cm 2020 profile, and used the included camera mount, and default 3d scanner.py settings. Not sure what's going wrong here.

    2021-02-28 09_55_21-Window.png2021-02-28 09_54_46-Window.png
    0
    SanderBoelen
    SanderBoelen

    Reply 4 days ago

    Based on your photos I think your scanner turns the opposite direction of mine. If you look top down, it should be rotating clockwise (as seen in the video as well) if this is not the case it merges the pointclouds wrong. To fix this you can go to line 21 in the arduino code and replace "myStepper.step(steps);" with "myStepper.step(-steps);" so it does minus the amount of steps and turns the other direction. Think that should solve it. If not take a closer look if the table actualy turns a full 360degrees in total. Maybe your stepper skips steps or has another internal ratio or something. If that doesn't work, I will help you out on teams/discord if you want. Just let me know your timezone/place you live and the times you are available. I am pretty freely available so we will make that work for sure!

    0
    Nickjallday
    Nickjallday

    Reply 3 days ago

    Thanks! changed the Arduino code.

    So I Redid some of the things to keep your same camera angle. all I've done now is I'm still using the 10mm Rod but 47cm total length and i put adapters at the very end so they interface with the camera stand and frame as the 30cm 2020 profile would. and I made a new extension that keeps the same angle 112.5 but is now 10cm tall. Soooooo I've made the following changes:

    line 93: self.distance = 0.428 - self.backDistance # subtract the difference from 30cm of .258 from 47cm (.47-(.3-.258))
    line 94: self.bbox = o3d.geometry.AxisAlignedBoundingBox((-0.15,-0.15,0),(0.15,0.15,0.3)) # 30cm scan-able X/Y Area 30cm Z
    line 165: self.z = 0.265 # (Add 10cm to .165)
    line 183: self.bbox1 = o3d.geometry.AxisAlignedBoundingBox((-0.15,-0.15,0),(0.15,0.15,0.01)) # 30cm scan-able X/Y Area

    Trying to figure out if these are correct, RecFuson reflects a few different numbers.

    I also made a mark on the turn table, it apears to make a complete circle but it stops and rotates once past the original mark. Though this looks intentional though.

    2021-03-01 13_05_56-RecFusion Pro.png
    0
    Nickjallday
    Nickjallday

    Reply 3 days ago

    I was able to get yoda to scan by changing the direction of the plate like you suggested. Still unable to get anything to scan when i try and scale the scanner. I really do apperciate the help.

    0
    SanderBoelen
    SanderBoelen

    Reply 1 day ago

    Hey, sorry for the late response. If I understand correctly you are able to scan with the scanner on the original scale right?

    Can you describe the problems you encounter when scanning larger objects? Does it seem to be off in the calibration, or does it not work at all? For debugging I would try to use fewer pictures per scan, so you don't have as many frames interfering with each other. You should also always use the pointclouds for debugging, not the STLs since those can give a weird output if the pointcloud isn't correct.

    0
    DarynC2
    DarynC2

    7 days ago

    Where could I get the MF-6402411 Stepper motor with ULN2003 Driver in the US? My google-fu isnt up to par recently and only showing sellers out of country. Thanks! Cool project by the way, cant wait to get one built up, I just got a D435.

    0
    wouterdrost01
    wouterdrost01

    Reply 5 days ago

    Any stepper motor that works with the standard arduino stepper library should work fine. There isn't anything in our code that specifically needs this stepper. You'll probably have to design a new part to clamp it in the scanner. We're from the Netherlands, so we can't say anything about part availability in the US unfortunately.

    Keep us posted if you do decide to build one!

    0
    Nickjallday
    Nickjallday

    4 weeks ago

    There's no .exe in the main program?