Use micro:bit as a remote controller for your train.
Scratch 3.0 extensions bring together different hardware devices and allow for them to be programmed interactively. In this example program, we are using micro-bit as a remote controller for the train. Micro:bit's A and B buttons are used for inputting steering decisions and its LED array displays them. We are also using accelerometer's features to control movement and the wagon coupler: the train drives/stops every time you jump with micro:bit in your hands and when you shake it, the coupler's releases the wagon.