Project tutorial
How to Design a LEGO Compatible Servo Holder in FreeCAD

How to Design a LEGO Compatible Servo Holder in FreeCAD © GPL3+

This is part of a Lego themed series of tutorials.

  • 5 respects

Components and supplies

PlastInk - White PLA Filament (1.75mm) 1kg

Necessary tools and machines

About this project

1. Import the macro

Let us start with importing  the macro that we'll use to make the bricks. Just follow the steps below.

  • Make a new macro in FreeCAD.
  • Go to the Macro menu.
  • Click on “Macros…”.
  • Click create in the panel that opens.
  • Enter a name of your choosing, for example “LEGO” and click OK. A text editor will open on the screen.
  • Open the file you downloaded from Thingiverse with a text-editor and copy the code with ctrl+c.
  • Paste the code into the text-editor inside FreeCAD and click on the X on the tab with the name LEGO.FCMacro down near the edge of the screen. It will ask you if you want to save the document. Answer "Yes".
  • Now you can find you LEGO macro in the Macro panel found in the Macro menu.

2. Make the bricks

We need two 2x4 LEGO pieces on top of each other to make the base for our servo holder.

  • Open the Part design workbench from the workbench drop-down menu.
  • Click on the LEGO.FCMacro in the macro panel and then on "execute".
  • You will see a 2x4 standard brick on the screen.
  • Click on the object named "LEGO" in the Model tab
  • Then go to the "Data" tab down in the left corner and change the units X and units Y values to X = 4 and Y = 2.
  • Make another brick of the same size.

3. Positioning the Bricks on top of each other

To position the bricks we will use the data tab that is located in the bottom of the ”Combo view“ panel. The combo view panel is the panel on the left side of the screen.

  • Click on one of the bricks and enter the data tab in the combo view panel.
  • Doubleclick on the title that says “placement”.
  • Doubleclick on “position”.
  • Doubleclick on “Z” and enter 9.6mm.

4. Make a box to fill the hole inside of the bricks

  • Create a new sketch on the xy-plane. Offset it by the amount of space you want for the knobs on the bottom of the brick. 2 mm will do just fine.
  • Draw a box that is 15.3*31.8 mm.
  • Draw a diagonal line through the box from point to point like this.
  • Add a symmetry constraint by first clicking on the points in the corners of the box and then clicking on the midpoint.
  • Exit the sketch and click on the tasks tab in the combo view panel.
  • Choose pad (your sketch should be selected).
  • Enter 16mm under length in the “pad parameters” and press ok.

5. Join the pieces

  • Go to the “part” workbench. From the drop down menu at the top middle of the screen.
  • Select all three bricks, “Lego” and “Lego001” and the box which is called “Pad” they should be under under the “view” tab in the “combo view” panel.
  • Click on the make union tool. You can find it in the toolbar that is shown in the picture below. And you’ll have one solid piece instead of two. Here is a video of how you do it ← YOUTUBE VIDEO.

6. Make the hole for the servo

  • Go to the Part design workbench.
  • Click on the side of your new piece (the union of the 3 pieces).
  • Click “create sketch” under the “tasks.
  • Make a rectangle that is a little bit bigger than the bottom of the servo. This is to compensate to compensate for the expansion of the plastic: 0.1 mm on each side should work. This size will do just fine:  23.6 x 12.6 mm.
  • We also need to add some extra space for the cable on the servo. Make a slit on the side of the rectangle you just drew. Like in the picture below.
  • Click Close in the Tasks panel.
  • Click on pocket in the task panel and choose the “through all” under the pocket parameter in the Tasks panel.
  • Click OK and you should have a hole through the brick.

7. Make a groove for the cable

  • Create a sketch on the short end of the brick.
  • Draw a something like the the figure in the picture below.
  • Close the sketch.
  • Go to the tasks tab and click on pocket.
  • Choose Dimension, below that input 5 mm and click OK.

8. Adjust the thickness of the outer edge on the bottom

To make the brick fit perfectly on top of a Lego brick we will have to adjust the bottom edge of the piece.

  • Rotate the camera to the bottom of the piece, by pressing the “5” on your keyboard.
  • Click on the face on the outer edge of the piece.
  • Go to the Tasks tab in the combo view panel and click on “Create sketch”.
  • Draw two rectangles on inside the other.
  • Use the external geometry tool to make references for the rectangles.
  • Use coincident constraints between the rectangles and the external geometry like this ← YOUTUBE VIDEO .
  • Click close in the tasks tab.
  • click on pocket in the tasks tab and input 2 mm under length in pad parameters.
  • Click OK.

9. Extend the cylinders on the bottom

On the bottom of the brick there are cylinders that we need to extend to get a good print, since these will be touching the print bed in the 3d printer.

  • Rotate the camera again to the bottom of the brick with the 5 button on your keyboard.
  • Click on one of the circular edges of the cylinders.
  • Use the external geometry tool and click on each of the outlines of the circular edges, inside and out.
  • Make two circles with the circle tool (you should be in the Parts design workbench).
  • Click on one of the circle and one of the external geometry circles (they should be purple).
  • Click on the equal sign in the constraints toolbar, to make the circles the same size. Like this ← YOUTUBE VIDEO.
  • Click on the center points on both of the circles you just made, that are equal in size.
  • Repeat this process for the other circle and for all of the edges of the cylinders, like this.
  • Exit the sketch and click on pad in the Tasks tab.
  • Input 0,375 mm under leng in the Pad parameters and click on OK.

10. And your piece is done!

Now print your piece standing up with the side with the open cylinders facing downwards, like in the picture below.

Use the same settings as in the previous tutorial.


Created by


Are you kengdahl? Claim this project and add it to your profile.

This is mine

Posted by

Arduino scuola
  • 32 projects

Published on

November 29, 2016

Members who respect this project


and 3 others

See similar projects
you might like

Similar projects you might like

3D Printed LEGO Compatible Arduino Micro Casing

Project tutorial by kengdahl

  • 10 respects

A Lego Compatible LED Brick

Project tutorial by kengdahl

  • 1 comment
  • 11 respects

Lego Compatible Name Display

Project tutorial by Lunchbox Electronics

  • 6 respects

Simple Arduino Based Lego Power Function Receiver

Project tutorial by Arduino_Scuola

  • 1 comment
  • 5 respects

3D Printing: Using The Skirt Feature To Get Perfect Prints

Project tutorial by kengdahl

  • 5 respects

Materia 101: A Tutorial About Avoiding Warping

Project tutorial by kengdahl

  • 1 respect
Add projectSign up / Login