video.mov
- Alexandre George Frédéric Boissiere
- Alvaro Julien Moya Mendez
- Clément Anatole Favre-Bulle
- Khanh Nam Le
- Kaya Merel Woo
- Noémie Egger
- Ziyad Boudalal
The LegoBeans 3D Printer is a modified Prusa i3 MK3S+ printer designed to build figures with LEGO bricks instead of the "traditional" filament used in conventional 3D printers.
To create a printable model, the user has to create a design of their figure using BrickLink Studio. BrickLink is an official application created by the LEGO team that enables virtual assembly of LEGO pieces. At the current stage, the LegoBeans printer supports 2x4 LEGO bricks exclusively.
Once the Bricklink design is completed, it has to be put into our custom conversion tool that translates the Bricklink model into the coordinate system compatible with the LegoBeans printer. The converted file is then transferred to an SD card and inserted into the printer.
The printer is navigated using the attached screen with navigation and controls similar to those found on conventional 3D printers. This enables users to move seamlessly from the digital LEGO design to automated, physical assembly using the LegoBeans printer.
For future development, the project explored the use of sensors to detect failed LEGO pickup or placement events during printing. While this approach demonstrated potential for improving reliability and error handling, the sensors used in the current implementation were not sufficiently sensitive to consistently detect these failures. Other aspects to be improved in future iterations of this project are creating more reliable dispensers and grabber in addition to creating a more versatile and robust firmware that allows for more sophisticated designs. Integrating the proposed improvements would remain an area for further development.
Here is a comprehensive list of all the elements that are needed to build our project. Note that you will need a laser cutter and a 3D printer with PETG filaments for some of the parts.
To buy:
- Prusa i3 MK3S+ (1x)
- Arduino Mega 2560 (1x)
- CNC shield (1x)
- Motor drivers (4x)
- Limit switches (3x)
- SD card (FAT32 format) (1x)
- USB isolator (1x)
- PSU 12V 10A (1x)
- 2x4 LEGO bricks (many)
- 16x16 LEGO plates (2x)
- 2x1 LEGO plates (2x)
- 2x2 LEGO brick (1x)
- 2x2 LEGO plate (1x)
- Screws
- Strong double-sided tape
To 3D print using PETG filament
Here are the .stl files for the parts that need to be 3D printed.
- The grabber
- The 2 parts used to mount the grabber on the 3D printer
- The 3 supports for the limit switches
To laser cut in MDF
Here are the .dxf files for the parts that need to be laser cutted.
- The dispensers
- The electronics box
- The LEGO bed
The grabber is used to pick LEGO bricks from the dispenser and place them on the LEGO bed at the correct position.
The shape of the grabber is designed to hold the brick securely while the printer moves, so the system stays simple, stable and efficient.
- 🧱 Grabber STL: Grabber_assembly.stl
FinlaVideoGrtabber.video-converter.com.mp4
The grabber is made of three separate parts, all 3D-printed in PETG filament.
- Print the three grabber parts with PETG filament.
- Assemble the three parts around the existing straps of the Prusa:
- Place the three printed parts around the straps.
- Use screws to join the three parts together.
- Prepare the LEGO tip:
- Take one short 2x2 LEGO brick and place it on top of a standard 2x2 LEGO brick.
- Insert this LEGO stack into its dedicated square pocket under the grabber.
- Fix it in place with a screw so that the LEGO tip is firmly attached to the grabber.
The design is fully reversible: by loosening the straps and removing the screws, the grabber can be taken off and the Prusa can be used again as a standard 3D printer.
- 📦 Electronics box DXF: open-box.dxf
The electronics box is our central hub for all the control electronics.
It is built from 4 mm MDF and assembled as a separate module before being mounted on the printer:
- Cut/laser-cut the box parts from 4 mm MDF according to the provided design.
- Assemble the MDF pieces using wood glue:
- Apply glue along the edges,
- Press the panels together,
- Let everything dry completely so the box is rigid.
- Once the box is ready, screw the box onto the right-hand side of the Prusa frame.
- Mount the Arduino Mega on the upper part of the box using screws.
- Mount the CNC shield on the lower part of the box using screws.
- Finally, proceed with the cabling: See next part "Electronics Assembly"
This layout keeps the motor cables short and tidy, gives easy access to USB and power, and stays outside of the moving area of the axes, making wiring, debugging, and maintenance much easier.
The electronics assembly follows the hereinabove schematics.
The pin layout is the following:
- CNC shield:
CNC shield pin Arduino Mega pin Enable 8 Dir X 2 Dir Y 3 Dir Z 4 Step X 5 Step Y 6 Step Z 7 +5V +5V GND GND - Limit switches:
Limit switch Arduino Mega pin X 10 Y 11 Z 12 GND GND - Smart Screen EXP1:
EXP1 pin Arduino Mega pin VCC +5V GND GND D4 38 D5 40 D6 42 D7 44 RS 34 EN 35 BEEPER 49 BTN_ENC 24 - Smart Screen EXP2:
EXP2 pin Arduino Mega pin GND GND BL 29 NRESET 28 BTN_EN1 22 BTN_EN2 23 MISO 50 MOSI 51 SCK 52 SDSS 53
To differentiate EXP1 and EXP2, look at the number of stripes on each group of cables: if there is only one, it is EXP1, if there are two, then it is EXP2. Their layout is the following:
- EXP1:
VCC D7 D5 RS BTN_ENC GND D6 D4 EN BEEPER - EXP2:
BL NRESET MOSI SDSS SCK GND (SD_CARD_DETECT) BTN_EN2 BTN_EN1 MISO
In order to know which side of the cable is the correct one, take the cable and turn it so that there is a little engraved arrow on top of it. Then the layout of the pins on the cable is the same as in the tables above, top to bottom, left to right. Here is what is meant by a little arrow:
- 🧱 Dispensers DXF: DispenserHorizontal.dxf, DispenserVertical.dxf
The dispensers pieces are laser-cut from 5 mm MDF plates.
- Laser-cut the dispensers parts from 5 mm MDF. You need to laser-cut 2 vertical dispensers and 2 horizontal dispensers.
- Similarly to the Electronics Box, assemble the MDF pieces using wood glue. Here, the order matters, as some parts need to be glued first. The rails for the LEGO (which correspond to the parts with a red arrow in the second image) have to be glued first. The other parts can then all be glued, but we have to make sure that the rails stay in the inside part of the dispenser.
- The dispensers can be then attached to the LEGO bed, as described in the next chapter. It might be easier to first fix the base part of the dispenser (as illustrated in the next image), and then assemble the dispenser with the base part already fixed.
- 🧱 LEGO Bed DXF: legobed_base_plate.dxf
The LEGO bed is the base plate on which we can start building. The bottom plate is made with 5 mm MDF. The LEGO plates are attached with strong double-sidded tape.
- Laser-cut the bottom plate from 5mm MDF according to the provided design.
- Fix the four dispensers with two screws each.
- Tape the two squared LEGO plates with strong double-sided tape.
- Attach two small 1x2 LEGO pieces to ensure perfect distance between the two LEGO plates.
- Attach the bottom plate to the machine with screws.
Once the dispensers and the LEGO bed are fully assembled, we obtain the following:
-
🧱 Limit switch STL: limit_switch_X.stl, limitSwitch_Y.stl, limitSwitch_Z.stl
Once the supports for the limit switches are printed, they can be placed on the spots illustrated in the following images:
The limit switches can then be screwed to each support. 2mm screws should be used.
The sensor is mounted on the grabber to detect pickup and placement failures of LEGO bricks. Although this component was removed in the current iteration of the project, incorporating sensors for error detection is strongly recommended for future versions of the Legobeans printer. The setup described below refers to the TOF400C sensor used in this project. However, this sensor is not ideal for very short-range measurements. For future iterations, a more distance-sensitive sensor is recommended, such as the TCRT5000 infrared sensor, which is better suited for short-distance detection:
- Sensor support STL file: sensor_support1.stl
- The sensor support is 3D printed using PETG filament.
- Attach the sensor support to the grabber using double-sided tape.
- Secure the sensor to the printed support using two screws and nuts, inserted through the two mounting extrusions on the support.
- Connect the sensor to the Arduino as shown in the wiring diagram below.
- Since the Arduino is mounted on the side of the printer and is not easily reachable with standard male-to-female jumper wires, the cables must be extended by soldering an intermediate extension cable between the connectors.
- Integrate the sensor into the firmware using the Pololu VL53L0X Arduino library
-
Download BrickLink Studio for your chosen operating system if you haven't already.
-
Create a new file and play around to build your Lego construction. Be sure to choose 4x2 standard Lego piece as this is the only one supported. The standard white bricks shown correspond to the bricks in the 2 rightmost dispensers, looking in from the side without the smartscreen. All the non-white bricks correspond to the 2 leftmost dispensers looking in from the same side.
- How to find the right 4x2 brick?
On the left hand panel, query 4x2 and choose the top leftmost one.
Note that there is a similar 4x2 brick with a hole that shouldn't be chosen.
- How to change brick colors? Click on a brick such that the edges get highlighted. Look for the color palette on the righthand side and change it to something other than white to use the 2 leftmost dispensers.
-
File > Export As > Export as LDraw. For compatibility with the conversion tool.
-
Once you have this .ldr file, you have to convert it into a .lbcode file in order to make it readable for the LEGObeanz's machine. You have two option to convert it: the user-friendly one designed for any random user, and the classic one if you feel more a terminal guy or if you want to execute everything locally. Choose one of the two options below.
-
User-friendly conversion
Open a new tab in your favourite browser and go to https://legobeans.netlify.app/. Drag and drop your .ldr file in the dashed-rectangle and click on Convert. The corresponding .lbcode will automatically be downloaded in your computer. Note that you can also directly download the house or the castle example without designing it in BrickLink Studio.

-
Conversion in the terminal
Open your terminal in theLDRConvdirectory and follow these steps:-
Create and enter the build directory.
mkdir build cd build -
Configure/generate following CMakeLists.txt.
cmake ..
-
Compile.
make
-
Execute LDRConv giving your .ldr file as argument and the name of the ouput file.
./LDRConv path/to/file.ldr output_file.lbcode
-
-
Once you have your .lbcode file, put it on an SD card and insert the card inside the LEGObeanz's machine.
-
You then need to interact with the smartscreen. Upon powering on, you'll see the option to print or calibrate, rotate the knob and click on "Calibrate" to manually calibrate the printer. Once this is done you can rotate the knob and press on "Print", then proceed to turn the dial and find the file you just put in the SD card. Once you've done this press the dial once more. You can sit back and watch your structure come to life. Note: Keep an eye out for when the dispensers run out of bricks.
Happy printing !
























