Custom LEGO Motor Driver
Fall 2018


This is a custom motor driver circuit board that I developed to to control two LEGO DC motors using a custom microcontroller like an Arduino instead of the official LEGO robot hub. By doing this, I can utilize the LEGO building platform to make robots and customize them further by developing my own firmware and integrating third-party sensors.

This project might not be the most impressive among others on my website, but it is particularly special for me as this is the first PCB I designed with surface-mount electronics. This is also one of the projects that prompted me to dive deeper into the realm of mechatronics and to develop more complex projects in the following years.

Two versions of my design (green and purple)

Robot in action :)

Details

For LEGO robotics systems such as the LEGO® Education SPIKE™ Prime Set, The motors have a special connector that plugs into the LEGO® Technic™ Hub. The first thing I did for the robot was to reverse-engineer the hub and motor to find the exact part number for the connector they are using, so that I can order my own copies online and incorporate them into my design.

SPIKE™ Prime motor (left) and the Technic™ hub (right). Image source: https://education.lego.com/

I designed my board based on the DRV8833 Dual H-Bridge Motor Driver IC from Texas Instruments. The designed was done in KiCad EDA, a free, open-source tool ideal for students and makers to design hobby electronics.

Schematic (left) and board layout (right) designed in KiCad

After the designs were made, I outsourced the board fabrication to professional PCB manufacturers. The most exciting part of the project for me comes after receiving the blank PCBs.

Utilizing my skills as a mechanical engineer, I transferred and modified the PCB design files to laser-cut my own stencil from thin Kapton film and used that to apply solder paste to my PCB. Then, I placed the components with my (at that time) shaky and clumsy hands. Finally, I soldered the boards using an infrared reflow oven, hand-soldered the connectors, and ran tests with the board to make sure everything works.

For the second batch of the boards, I decided to try out the assembly service of the PCB manufacturer, which involved uploading the bill of material and pick-and-place documents generated in KiCAD. I then communicated with the vendor directly regarding components sourcing, design feedback, and finalizing the service. After receiving the shipment, I added the through-hole components myself.

Testing the PCB with breadboard and jumper wires