This LEGO Hogwarts Express Train Is Powered by Magic (and the IoT)

Ben Hoad converted a Harry Potter LEGO kit into a HomeKit-controlled train that docks to charge when not in use.

JeremyCook
almost 6 years ago

Ben Hoad is a huge fan of LEGO and apparently Harry Potter, so naturally he set out to build a Hogwarts Express train with bricks — powered by "magic" and/or IoT. The idea here is that while LEGO does make a very nice model of this whimsical train, it doesn't come with an electric motor or even tracks.

The tracks problem was an easy enough solution, as it fits on standard LEGO gauge. Beyond that, Hoad set out on a year-long quest to augment the train with not only an electric motor, but also smartphone control and Qi charging. All of this was done without modifying actual LEGO pieces, though there was a connector that "may" have been snipped for interfacing along the way.

The project is based on a Wemos/Lolin D1 Mini ESP8266 board for WiFi capabilities, while human interface is accomplished via Homebridge as a smart switch on the Apple HomeKit framework. It's able to automatically stop at the proper position for inductive charging, using a Hall effect sensor on the train and rare earth magnet embedded on the track.

It's a fascinating build journey, outlined in Hoad's post here. Code and printable files are available on GitHub, either for inspiration or if you want your own LEGO Hogwarts Express, perhaps for the holiday season.

JeremyCook

Engineer, maker of random contraptions, love learning about tech. Write for various publications, including Hackster!

Latest Articles