Easy way to get 15 free YouTube views, likes and subscribers
Get Free YouTube Subscribers, Views and Likes

Lego trains random controlled and automated by Arduino

Follow
AlmightyArjen

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:
  / almightyarjen  
Or directly through PayPal:
https://paypal.me/arjenhartsuiker

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: http://www.almightyarjen.com/equipment'>http://www.almightyarjen.com/equipment

Subscribe to my channel:
https://www.youtube.com/subscription_...

Like this kind of stuff? Check out some of my most awesome projects:
Huge layout with 9 running trains:
   • Lego train layout 3.0: HUGE Lego setu...  
Lego train set up high in the mountains:
   • Lego train controlled by Arduino set ...  
Fully automated Lego train coal terminal:    • HUGE Lego train coal terminal fully a...  
25.000 Brick Lego train station:    • Huge Lego train station MOC of 25000 ...  
Automated Lego train level crossing with the Terminator:    • Lego train level crossing 10128 autom...  
Random controlled Lego trains:    • Even bigger Lego 9 volt train dream l...  
Automated Lego train rail crossing:    • Lego train rail crossing fully automa...  

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

Check out my Facebook page for regular updates:
  / almightyarjen  

And ofcourse my Work In Progress channel:
   / almightyarjenwip  

For more background information, check my website:
http://www.almightyarjen.com

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!

posted by brx2h