Table of Contents

Train Control System

Introduction

The project represents an automatized system for trains control. It features a control position for the train using InfraRed sensors and Ultrasonic sensors. To simulate the detection of various trains, a RFID reader is used. This way, the railroad switches will move accordingly. Once at the train station, loading and unloading of the freight are carried out using Braccio. The transportation of goods is simulated using some RFID tags, automating the switching of the railroad.

Motivation

I had a few starting components for the control system as well as for the train modelling. I thought it would be a challenging and interesting project, mostly because I couldn't find many resources regarding the automatization of train models and seemed a unique idea. Most of the projects that you can find online are some digital sets containing a remote controller and a digital station, thus making them very easy to use without the necessity of a technical background.

Hardware Diagram

Hardware Design

Schematic: Schematic

The schematic for the project was created using the Schematic of MEGA2560_Rev3 and the Pinout Mega2560rev3. Also, for the Uno part, the schematic is here and the pinout is here.

The schematic contains 5 main systems.

Hardware Description

alongside a power supply of 12V, 0.5A DC.

Decision Making

At first, I thought that an Arduino Uno was enough. Quickly I realized that using Braccio not only consumes all of my PWM pins but also overlaps with the RFID scanner. So I used an Arduino Mega instead. To be fair, initially I wanted to add two more infrared sensors and another servo to symbolize an intersection between cars and railway, but cable management and wire connectivity quickly became a problem, so that was the main reason I wanted an Arduino Mega. Also I didn't think that it would improve the project as it just adds a few sensors and one servo. Having both an Arduino Uno and a Mega got me thinking that I could do I2C communication between them in order to learn something new. I also thought that I could use interrupts to signal Braccio to start to move and that's what I did.

Software Design

The full code can be found on GitHub

Libraries used in the project:

The trains keeps going until a sensor halts it's movement. Its motion is controlled based on feedback from two sensors:

When the train reaches the end and is detected by the ultrasonic sensor, it automatically reverses direction and moves backward. If the infrared sensor at the starting point detects the train’s return, the train stops and waits for further action. At this point, the Braccio robotic arm is triggered via I2C communication (with the Arduino Mega acting as the master and the Uno as the slave). Braccio then performs the following sequence:

The new RFID card is then scanned by the RFID sensor, which determines the appropriate track the train should take next based on the card’s data.

Bugs and difficulties encountered along the way of building such a challenging project:

Youtube videos

Two videos can be found here and here. The first one describes the components and the interaction between them and the second one describes how does the whole project work.

Conclusions and Concepts

.