Hacker News new | ask | show | jobs
by preinheimer 1287 days ago
As someone who likes lego and programming, I love this answer. But I hate how hard lego has made it.

Yes, with some work you can make your train stop and go. But I don't think there's a good track switching solution that's lego only and automated. There's an aftermarket motor thing that connects with USB. The lego only attempts end up unwieldy and usually lacking in reliability (e.g. https://rebrickable.com/mocs/MOC-11841/1963maniac/train-trac...)

The Duplo trains ship with pretty neat functionality out of the box: lights, whistle, brick reader that activates an action when it sees a certain brick. You can't recreate this with lego with just a single power brick, as it's four things: sensor, light, motor, sound. Lego train can only do two.

5 comments

The PyBricks that the SO questioner self answers with is actually quite capable of doing this, and runs Python to boot.

I wish this was the default interface that LEGO provided but I’m thankful for the PyBricks team creating a solution.

It is a shame that Lego Duplo and Lego trains aren't compatible. One of my favourite demos of the sheer awesomeness of Lego is connecting a 2x4 Duplo with a 2x4 Lego block. Any way round. If you've never tried this, do it now :-)
So, while this is uhhh, off track, Legolands and such have some kind of automation, though, presumably, those are bespoke solutions and are not available to regular consumers.
> Legolands and such have some kind of automation, though, presumably those are bespoke solutions

I can vouch for that! I can say - with great confidence - that the best job I ever had was in Legoland, Billund while I was in high school. The job: keep the outdoor small models running from 15:30 when the real engineers left, until park closes. Then leave a note about the stuff I couldn’t fix myself.

The electronics were industrial PLCs wired to a control computer, and the mechanics inside the models were made from industrial type stuff that you might see on a robot, conveyor belt or the like.

Most of the models (trains, cars, cranes etc.) were built on a metal chassis or skeleton.

Fond memories of getting paged by the system with “ALARM: Cars, Norway” to discover that a kid had dropped her soft ice on the highway ;)

Please, please, tell us more about the behind the scenes system keeping all that running.
The Legoland trains are basically model trains wearing a Lego skin. They're also a different "scale" than the "Lego toy" trains.
Huh! I never noticed. It makes some sense when you think about parts-wear.
Lego motors are designed for about 100 hours of service life.
Wow, that's not much... my kid would probably hit that within a month. (I just replaced the motor in a Bachmann Thomas that wore out in about the same amount of time.)
That's why they're not fussy about replacing the few that wear out, the average use is frequently after the first purchase and then it drops off sharply so I guess they decided it wasn't worth designing around long usage. In the older trains you could replace the little motor easily, with the newer ones (starting with the infamous 'red' motor a long time ago) that practice ended and you have to replace the entire unit.
The motors for the trains are better than that because they're designed for continuous use (somewhat) but yeah, at the end of the day Lego is a toy.
Possible
I remember in middle school doing some programming on the Apple 2 in the logo language and using a lego motor to essentially schedule moving the car to the park and then making a motorized lego swing spin around.

I think this is the first time i saw the wonder of programming, sad that its harder to do this now.