Advertisement

Lego trains random controlled and automated by Arduino

Lego trains random controlled and automated by Arduino Lego train automation video that shows a setup with one big loop on which multiple trains are running. The loop has six side tracks where Lego trains can be parked.

My channel revenue has gone down 80% due to algorithm changes and COPPA. Please consider supporting me on Patreon:

Or directly through PayPal:


Each side track has its own Arduino controller. This Arduino controller decides wether a passing Lego train is stopped on the side track or not. This is done based on the following variables:

1. time(distance) with previous trains: this prevents trains running into each other as a result of different speeds
2. maximum time a side track can be empty has exceeded

A train is started again based on the following variables:
3. maximum time a side track can be occupied has exceeded

The values for variables 2 and 3 are randomized to give the system a more natural feeling. Next to that, these values are used since side tracks are grouped with another side track, which form a "station".

Each side track controller is connected to two sensors, a motorized switch and a signal. When a train is approaching the side track, it is detected by sensor 1. In case the system decides that the approaching Lego train must be stopped, the motorized switch is set to the side track and the system waits for the train's arrival. Next to the side track is sensor 2. When sensor 2 detects the train, the switch is set to straight ahead, the signal is put to red and the train is stopped.

For starting a train the system checks first when the last train has passed by. Based on this, it calculates if there's enough time between the train if the train on the side track would be started. If not, the system waits with starting the train.

All the equipment I use:

Subscribe to my channel:


Like this kind of stuff? Check out some of my most awesome projects:
Huge layout with 9 running trains:

Lego train set up high in the mountains:

Fully automated Lego train coal terminal:
25.000 Brick Lego train station:
Automated Lego train level crossing with the Terminator:
Random controlled Lego trains:
Automated Lego train rail crossing:

Check out the playlist of my best Lego videos so far:


Check out my Facebook page for regular updates:


And ofcourse my Work In Progress channel:


For more background information, check my website:


The AlmightyArjen Youtube channel is about Lego train related videos. I sometimes automate Lego trains, or make a stop motion video or I just setup a huge Lego train layout in the living room. Do you have (reasonable) video suggestions? Please let me know!

Lego Trains,Lego,Lego city,Train,Trains,Treno,Zug,Railway,Track,12,Volt,Rail Transport,7740,7755,7730,7725,7760,7823,7839,7815,7819,eisenbahn,Legos,vintage,old,station,classic,freight,Arduino,Uno,Duemilanove,Mega,atmega,robot,automated,design,diecimila,star,wars,Railroad,Steam,Express,Railways,Diesel,Almighty,Arjen,lego train videos,almightyarjen,microcontrollers,Lego train automation,Lego train set,Lego train station,Lego train track,railroad,railway,legotrain,legotrein,toys,

Post a Comment

0 Comments