faisability_lego train_arduino

Hello everyone! i need some advice.I'm searching for a way to control the race of train lego with arduino.The idea is that the train need to stop at some certain points of the rail and doesn't move until we give it a signal(with remote control or push botton or something like this) Is it possible to do this with arduino ?

Yes.
People use remotes in many arduino projects.
People use motor control in many arduino projects.
People use sensors to determine when to do certain things like stop motors in trains.

Google is your friend.
I googled "arduino lego train" and found many examples that would get you started.

bety:
.The idea is that the train need to stop at some certain points of the rail and doesn’t move until we give it a signal

As far as I know a Lego train is battery powered and that means you have to consider how to communicate with the train when you want it to stop and when you want it to start.

I suspect that getting it to start is the easier part because you can just send a wireless command whenever is appropriate.

Getting it to stop at a particular place (for example at a station platform, or before a junction) will require some system to detect the fact that the train is in the right place (platform) or about to enter the wrong place (junction) and then (somehow) send a signal to make the train stop.

I have seen some large Lego train projects at model railway exhibitions but I never enquired very closely as to how they were controlled. I think the control was caused by a lever on the “ground” pushing a switch on the train. If that sort of thing is acceptable it could be combined with wireless control for re-starting.

Alternatively there could be a sensor on the ground (perhaps an InfraRed beam-break) that informs an Arduino on the ground to send a wireless STOP message to the Arduino on the train.

My recollection of the Lego trains I have seen is that they generally move at speed which must be taken into account when planning any automatic stop system. For example I suspect a touch sensor on the buffer stop at the end of a siding would be practical - the train would just bulldoze the buffer stop out of place (just like on the real railway).

Wireless control could take several forms including InfraRed, nRF24L01+ wireless modules or WiFi using ESP8266 modules such as the Wemos D1

…R
Simple nRF24L01+ Tutorial

Thank you for your reply.Actually, it seems that i need to fit the Arduino inside this train.So that i can stop the train in a certain place(block the rotation of the motor by an external command).Then,for example,install a Hall sensor at the bottom of the locomotive body - then place a magnet (or some magnets at a lot of stops) between the rails.
Still didn't find any project similar to what i search :confused:

bety:
Thank you for your reply.Actually, it seems that i need to fit the Arduino inside this train.

I had assumed you were doing that.

Then,for example,install a Hall sensor at the bottom of the locomotive body - then place a magnet (or some magnets at a lot of stops) between the rails.

That should work - unless the speed of the train is a problem - maybe too fast to be detected reliably. I have not used hall sensors so I don't know how quickly they respond.

Still didn't find any project similar to what i search

You are unlikely to find an exact match for your requirements but I suspect all the techniques you will need are covered by the examples that come with the Arduino IDE.

By the way, you will need a suitable motor driver board between the Arduino and the train motor. An Arduino cannot provide the amount of current that a motor requires. The Pololu website has a good range and similar products are available from other suppliers.

...R