Live data from Hacker News

Can Lego City Powered Up trains be automated?

bricks.stackexchange.com

51–60 of 80 posts

Re: Can Lego City Powered Up trains be automated?

#52

On a related note, Lego is cancelling Mindstorms. So if you were dreaming up an advanced train city with Mindstorms as the brain you'd better stock up now. https://www.theverge.com/2022/10/28/23428766/lego-discontinu...

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

Lego spike.

It is part of their education line.

https://www.lego.com/en-se/product/lego-education-spike-prim...

Re: Can Lego City Powered Up trains be automated?

#53

The motivation of using a special device to untether from the app as being ‘to reduce screen time’ seems tenuous at best. Is using an app to program in a block language to control real trains in a customizable city really ‘screen time’? And even if it is, is it automatically bad ?

The quote from the answer suggests a slightly different motivation than reducing screen time.

> I use a setup similar to the above to allow an automated train to run around my son's city without the need to have a screen nearby the whole time.

It’s a criticism that I hear regularly of the requirement to use an app for various of the motorized Lego kits: Having a phone in hand often leads to the result that the kids stop controlling (or even building) the kit and rather start playing on the phone. It’s also a bit an expensive thing to hand to your six year old so they can control their Lego train.

Re: Can Lego City Powered Up trains be automated?

#54
I added my Lego Rollercoaster on Home Assistant[0] a little while back. Nothing fancy, just cut a Power Functions extension wire to put a relay in-between and an ESP board to control it. On one side I had the power pack and the other the motor. Would have loved to switch out the power pack for a constant power source but never got to it.

If you're looking to do some Power Functions (PF) hackery, there are some interesting articles that cover the wiring and working of PF gadgets more in detail[1][2].

[0] https://twitter.com/iamkeraf/status/1274433444446113792 [1] https://www.hackster.io/Notthemarsian/take-control-over-lego... [2] https://www.philohome.com/pf/pf.htm

Re: Can Lego City Powered Up trains be automated?

#55

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

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.

Re: Can Lego City Powered Up trains be automated?

#56

The motivation of using a special device to untether from the app as being ‘to reduce screen time’ seems tenuous at best. Is using an app to program in a block language to control real trains in a customizable city really ‘screen time’? And even if it is, is it automatically bad ?

The quote from the answer suggests a slightly different motivation than reducing screen time. > I use a setup similar to the above to allow an automated train to run around my son's city without the need to have a screen nearby the whole time. It’s a criticism that I hear regularly of the requirement to use an app for various of the motorized Lego kits: Having a phone in hand often leads to the result that the kids s…

[deleted]

Re: Can Lego City Powered Up trains be automated?

#57
post #48

Is there any way to use the Flipper with these trains?

I couldn't find an off the shelf Flipper module, but the Lego Powered Up BLE protocol is fully documented by Lego: https://lego.github.io/lego-ble-wireless-protocol-docs/ So it shouldn't be too hard to add one. Keep in mind that as noted in this article, the default Powered Up Hub behavior is as a "passthrough pipe" to the host device, so just using a Flipper might be a bit obnoxious.

Gotcha. I was hoping there was a primitive subghz protocol. That would be fun.

Re: Can Lego City Powered Up trains be automated?

#58

On a related note, Lego is cancelling Mindstorms. So if you were dreaming up an advanced train city with Mindstorms as the brain you'd better stock up now. https://www.theverge.com/2022/10/28/23428766/lego-discontinu...

My child is starting Lego robotics courses and I was confused by the change. As close as I can tell WeDo, PoweredUp/Boost and Spike all operate similarly. The core is a hub consisting of a STM32 microprocessor with a BLE module, power management, options for internal lights and accelerometer, and varying count of IO to servos, motors and sensors. With certain kits some of motors are built in. They all use the same new proprietary connector but the usual folks are making converters for EV3 and PowerFunctions.

While Lego promotes use of their proprietary apps, other bluetooth shims can facilitate connections. I was able to connect to a Boost hub without issue using MIT's Scratch website to execute instructions. As far as I can tell, only Spike can operate untethered by BT with the default firmware.

I've been integrating some BBC Microbit with Geekservo Lego compatible microservos and the overall experience is similar. Lego throughout is easier to integrate but doesn't lend itself to as much customization/experimentation. Using the MIT Scratch IDE is similar to MS Makecode used for Microbit. Compose your blocks, flash your microprocessor. Some things I like about Makecode are GitHub integration and the ability to seamlessly move between blocks, JS and Python.

There isn't enough IO and connectivity for any Mindstorm or new Lego MCU to make an advanced train city. You'd be better off with ESP8266 on ESPNow mesh operating glue-your-own or Geekservo units.

Re: Can Lego City Powered Up trains be automated?

#59
post #26

Automating my Lego trains was my first introduction to programming, back in the late 1980s using GW-Basic. (When I was about 8 years old.) I had several stations on a looped track, and controlled the train position by switching on the power to the motor for a certain time. At first I used a photodiode taped to the CRT monitor (and controlling the motor by lighting up a square in the corner of the screen), later I upg…

In 1999-ish, my two brothers and I got a box of relays and some reed sensors and solenoids (for track-switches) embedded in lego blocks.

We're all engineers now, the box is treasured and still works. Finding a PC with a parallel port has become challenging though.

Re: Can Lego City Powered Up trains be automated?

#60
post #26

Automating my Lego trains was my first introduction to programming, back in the late 1980s using GW-Basic. (When I was about 8 years old.) I had several stations on a looped track, and controlled the train position by switching on the power to the motor for a certain time. At first I used a photodiode taped to the CRT monitor (and controlling the motor by lighting up a square in the corner of the screen), later I upg…

In 1999-ish, my two brothers and I got a box of relays and some reed sensors and solenoids (for track-switches) embedded in lego blocks. We're all engineers now, the box is treasured and still works. Finding a PC with a parallel port has become challenging though.

One idea is: https://hackaday.com/2017/05/05/converting-parallel-port-cnc...

Plus there are a bunch of off the shelf solutions on Amazon (YMMV).

Post reply on HN