Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!

Classic LEGO Train Set Gets an ESP32 Christmas Upgrade

Jan got a LEGO 4511 train set as a child. More than 15 years later, he pulled it out of storage and upgraded it with ESP32 control.

Cameron Coward
12 months agoKids & Family / Robotics / Vehicles

Way back in 2005, Jan received a LEGO 4511 train set as a Christmas gift. That nifty little kit is an electric model railroad, but with LEGO’s trademark blocky user-assembled twist. Jan played with that train set for years, but eventually he got older and it ended up in storage for a decade, like the bittersweet beginning of a Pixar movie. Fast forward to the present and Jan is all grown up with some maker skills under his belt. With holiday cheer in his heart, he utilized those skills to give the LEGO 4511 train set a Christmas ESP32 upgrade.

Like most model railroads, the original LEGO 4511 train set worked by supplying DC power to the train engine through the rails. One rail is positive and the other is ground. The train engine has a DC motor that completes the circuit and the controller lets the conductor adjust voltage, thereby increasing or decreasing speed. To move the train backwards, the controller reverses the polarity through the rails.

Jan’s upgrade completely alters that entire operating principle. Instead of receiving power through the rails, the upgraded train is self-contained. It carries its own lithium battery pack to power the original DC motor and an ESP32-based NodeMCU development board controls that through a DRV8833 dual H-bridge drive. Jan paired the 18650 lithium battery with a battery management system and a TP4054 charging module. A dash of WS2812B RGB LED lighting gave the train that coveted Christmas flair.

The user can control the train with their smartphone through a Bluetooth connection. That’s done with a simple terminal app that sends JSON serial commands. Jan also integrated a kind of brick-based positioning system, so the train can stop at predetermined physical locations that trigger a touch sensor. That lets the train automatically leave the bar station and move along until it reaches the thirsty customer station, where it can stop long enough for people to grab their shots.

Jan wanted this upgraded train to deliver shots, but found that their weight overloaded the small LEGO motor. In the future, he plans to give the train more oomph and additional power to go along with that.

Those challenges should give Jan an excuse to play with his LEGO train set for at least another holiday or two.

Cameron Coward
Writer for Hackster News. Proud husband and dog dad. Maker and serial hobbyist. Check out my YouTube channel: Serial Hobbyism
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles