Live data from Hacker News

Can Lego City Powered Up trains be automated?

bricks.stackexchange.com

71–80 of 80 posts

Re: Can Lego City Powered Up trains be automated?

#71
In the past, the LEGO trains had a port on the motor to pull power from the tracks so you could run things like lights or small motors for effects.

There was no protection on the direction the power was going, so you could attach it to a motor port of an RCX brick. And therefore you had a programmable brick on the tracks. Side effect was that now the rails are also now powered so every train starts to move...

Re: Can Lego City Powered Up trains be automated?

#72

It's a shame they got rid of metal tracks and went to batteries. If you're rich you can buy new replacements: https://shop.fxbricks.com/pages/fx-track Or try to buy old stock on ebay etc.

I didn't know I was sitting on something so valuable XD.

It's been nearly 20 years since I last pulled out my LEGO trains... That and the Rokenbok.

Re: Can Lego City Powered Up trains be automated?

#73

I used to make all kinds of cool projects with lejos ( https://lejos.sourceforge.io/ ) and am now a bit tempted to get the new toys and test out the Python interface. Would be nice if Lego actually invested more time into making a standard programming interface for advanced users.

I tried spinning up lejos for the RCX again a few years ago, but you do have to find a JDK 1.5 bundle somewhere.

Re: Can Lego City Powered Up trains be automated?

#74

Earlier quoted context omitted.

I have train set 182 [1] from 1975, bought at Harrod’s in the UK and brought back to the US for a family friend who passed it on to me. It’s still in the box with styrofoam liner. [1] https://brickset.com/sets/182-1/Train-Set-with-Motor

If it was never used it is worth a fortune.

Oh, it was definitely used, but appears to be all there. It's notable in that the set comes pre-assembled and in the styrofoam packing, which is how I received it. I can only imagine what new would look like.

Re: Can Lego City Powered Up trains be automated?

#75
post #17

Earlier quoted context omitted.

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 we…

Please, please, tell us more about the behind the scenes system keeping all that running.

Re: Can Lego City Powered Up trains be automated?

#77

Quoted post unavailable.

The question was about not using any of the built-in capabilities because they require the use of an app on a connected device which the poster thinks would be a distraction for their kid.

The answer offers some options that will work without a connected device.

Sometime it’s useful to at least visit the linked article before posting what amounts to an ad

Re: Can Lego City Powered Up trains be automated?

#78
Yes, you can automate LEGO trains with Pybricks. See https://beta.pybricks.com/

Pybricks lets you run MicroPython scripts on the hub. Once loaded onto the hub, you can just start the script again by pressing the button. No constant connection required.

You can even add sensors that count the track sleepers so you can get a constant speed no matter the load. Here's a demo with code.

https://pybricks.com/projects/sets/city/60198-cargo-train/sp...

You can also automate the switches so you can get pretty creative with your layouts:

https://www.facebook.com/Pybricks/videos/989683888156075

With enough supporters, we may eventually even add a block-coding language as an alternative to MicroPython.

Re: Can Lego City Powered Up trains be automated?

#79
post #66

Earlier quoted context omitted.

Isn't it being replaced with something newer and better?

I think the real replacement is the Raspberry Pi Build HAT that allows to connect LEGO Powered Up/Boost/Robot Inventor sensors and motors to a Raspberry Pi. https://www.raspberrypi.com/news/raspberry-pi-build-hat-lego...

Now that does look interesting!

Given the Powered Up (train set) remote works over bluetooth and I understand can be made to work with a Technics Hub by flashing with the Pybricks firmware, I'd been wondering whether it's possible to control the hub using a RPi but over bluetooth instead of the wired HAT connection. Is this possible?

Re: Can Lego City Powered Up trains be automated?

#80
I would suggest to add some Train protection system (or even ETCS if you're motivated) on your Lego railway https://en.wikipedia.org/wiki/Train_protection_system

You can see that in some railway engineering firms.

There have been train protection systems for decades, to stop trains when something is unusual (over-speed, incapacitated driver, running a red light,...), when railways aren't fully automated yet.

You can also encode information next to the tracks, and pick it up with the train ! This kind of system was a prerequisite for high speed trains. Drivers can't read signs at cruise speed, so they are replicated on their dashboard. A fun but edgy automation would be to encode cards against humanity near the tracks, and to randomly route the train, to generate text.

Post reply on HN