The Arduino platform has found its way to powering projects ranging from flood monitoring systems, toys for toddlers, safety equipment, and advent calendars to taxi-calling buttons, capacitance meters, solder paste dispensers and reflow ovens, and even signal generators and analysers. Where it can really excel, though, is in offering the functionality of full scale industrial supervisory control and data acquisition (SCADA) systems in a format accessible to the hobbyist - which is great news for model enthusiasts.
The YouTube channel Arduino Lego Trains completed a ten-part video series on the use of an Arduino Mega to control a model train layout using the motorised train sets from the popular plastic building brick company. Beginning ten months ago with a simple introduction, the series has progressed through controlling trains via light, infra-red and ultrasonic sensors, displaying timetables through an LCD screen, controlling junctions, and even automatically coupling and decoupling trains from their carriages. While it's easy to dismiss Lego projects as kids' stuff, the video series offers a great introduction to SCADA technology and the Arduino platform and its concepts can be easily scaled up to industrial levels.
The Arduino Lego Trains channel isn't the only source of information for those looking to use Arduino boards to control model layouts: Model Railroading with Arduino, formerly known as the OpenDCC Project, offers add-on hardware and software libraries for controlling trains based on the popular digital command control (DCC) format, while French-speakers will find Locoduino an excellent resource. Other individuals' projects have been published on modelrail.otenko, Hackaday, Zapmaker, and even in a handout from the Extra 2011 West convention.
See the full power of an Arduino Mega unleashed in the final video for this series of Arduino for Lego Trains. Learn about interrupts and how to use them for sensors, use the enum variable for a finite state machine, and gain tips on power management for running multiple trains at once.