LEGO Trigger Harnesses the Power of Objection Detection AI Inside of a 2x4 LEGO Brick

Level up your LEGO set with an ESP32 and tinyML to detect objects and perform actions.

James Lewis
2 years agoAI & Machine Learning

Dutch designer and technologist Ruben van der Vleuten solved the precarious problem of keeping LEGO Joker out of the Batcave with LEGO Trigger, objection detection, and tinyML.

"I’m having a design background and therefore I might approach this a bit differently than people with a purely EE background. For me this was an exercise to challenge myself to make a very small board that could run ML models embedded to be integrated into a small device." — Ruben van der Vleuten

LEGO Trigger is a two-by-four LEGO brick with custom electronics inside. The 14 x 29 millimeter PCB contains an ESP32-S3 system-on-chip (SoC), 8 MB Flash chip, and battery management IC. One side of the brick has an opening for an OV2650 camera, and the other has a USB-C port for power and data. Van der Vleuten says the bill of materials comes to a scant five dollars!

Getting started with LEGO Trigger takes only three steps: Train, Build, and Play. First, you must use the camera to capture images of the object you want LEGO Trigger to detect. Then, you use a mobile application to assign actions to the trigger, such as activating an actuator. Then, it is time to play! You can build LEGO Trigger into a LEGO masterpiece or use it standalone.

Even though LEGO Trigger uses machine learning for object detection, it does not require an Internet connection. The ESP32-S3 performs the machine learning inference on-chip using tinyML.

TinyML provides machine learning models that run on limited-resource microcontrollers. Its solutions are ideal for embedded edge, always-on, and battery-powered devices. The library is efficient enough to run on 8-bit microcontrollers but is very popular on 32-bit processors, including the ESP32 family of SoCs.

Protecting a LEGO Batcave is not the only use for LEGO Trigger. Van der Vleuten is eager to hear your ideas on combining this idea to build user interactions and not just with LEGO bricks. For example, you could use it to start a tea-making robot when it detects that your teacup is empty.

Van der Vleuten does not (currently) plan to sell the LEGO Trigger electronics. You can build one using the Creative Commons-licensed EAGLE Design Files and BoM from the LEGO Trigger project page.

James Lewis
Electronics enthusiast, Bald Engineer, AddOhms on YouTube and KN6FGY.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles