A Christmas-themed LEGO train engine and coal car

ESPHome Powers Festive Lego Train Set

While the basic concept of LEGO bricks might have changed little since the mid-20th century, some components such as motors and sensors are still affected by technological progress and end up obsolete and unsupported. [Travis] ran into this problem when he was building a festive train setup and realized he didn’t have the speed controller to match his train engine. Without that part, the engine would only run at full speed and derail as soon as it hit a curve. The official speed controller had been discontinued and was hard to find, so [Travis] had to resort to building his own.

The basic components needed were an H-bridge driver to operate the motor and an ESP8266 to generate PWM signals. In order to keep the bricky appearance of the train engine intact, [Travis] hollowed out a few cheap imitation LEGO bricks to house the electronics. He also cut out slots for JST connectors, which are far more convenient to work with than LEGO’s brick-style connectors.

Two imitation LEGO bricks with electronics insideThe ESP8266 runs ESPHome, which enables [Travis] to control the entire setup using Home Assistant. The train is programmed to run a few laps at the top of the hour and play choo-choo sounds from a mini MP3 player hidden in the coal car. That car also holds a standard AA battery holder to power the system, which makes it easy to swap the batteries without having to partially disassemble the train.

There are various ways to control LEGO creations using standard computer platforms: we’ve seen the ESP32 powering a LEGO tank, for instance. If you need a bit more computing power, there’s even an official LEGO Raspberry Pi HAT.

Continue reading “ESPHome Powers Festive Lego Train Set”

Simple Hacks To Make LEGO Train Track Out Of Other Pieces

LEGO trains are fun to play with, but as with any model train, you so seldom have enough track to fulfill your greatest desires. YouTuber [brick_on_the_tracks] has come up with some creative ideas of his own to make track compatible with Lego trains using other techniques.

TRAINED LEGO PROFESSIONALS! DO NOT ATTEMPT IN REAL LIFE!

The most straightforward is to use the LEGO fence piece, first released in 1967. They can be laid in two rows, four studs apart, and they’ll serve as perfectly functional train track. It’s a 100% legal building technique as per the official LEGO rules, too. Official track pieces can be linked up by placing them on a 1-stud-high booster. [brick_on_the_tracks] argues that it’s up to nine times cheaper than using official track, but it depends on how you’re building your layout, and you need to take into account the need for a base plate.

On the sillier side of things, it’s actually possible to use mini-figures as track, too. Again, it’s a 100% legal technique, though the trains don’t run as smoothly compared to the fence track. It’s very amusing, though, and could be a fun addition to a build you’re taking to a local LEGO convention.

If you’re really strapped for cash though, you can go as far as using cardboard. It’s not legal in the LEGO world, and it’s pretty basic, but you could literally make up a layout using nothing but a craft knife and pizza boxes. We’ve actually featured other LEGO train hacks before, like this neat automatic decoupler design.

Continue reading “Simple Hacks To Make LEGO Train Track Out Of Other Pieces”

Decoupling Lego Trains Automatically

Lego train sets were introduced almost 50 years ago, and since then, one thing has been constant: the trains connected with magnets. While this is a supremely simple means of connecting locomotives to rolling stock, there is one big disadvantage. Building decouplers – devices that will separate one car from another – is difficult.

Now, with a clever combination of racks, gears, and wedges, trains can disassemble themselves. They can even do it with an Arduino.

wedgeThis decoupler works by effectively wedging cars apart from each other. With a motor from an old Lego Technic set, a few gears, shafts, and a rack, a device can be constructed that fits between the rails of a track that raises into the undercarriage of rolling stock.

Because this rolling stock is moved around with a locomotive, all that’s needed to separate two halves of a train is to move the locomotive forward. Yes, it does mean that the connection with the weakest magnet is disengaged – not necessarily the connection you want to decouple. However, with only one car and a locomotive, there’s only one connection to break. Simple enough.

This Lego decoupler can be further improved with an Arduino, a few ultrasonic sensors, and an IR detector to make a fully automatic decoupling siding for a Lego train layout. You can see all this below operating with a full state machine that perpetually switches rolling stock behind a locomotive.

A great use for Legos.

Continue reading “Decoupling Lego Trains Automatically”