This example of using URB control system shows how to just start playing with your model railroad using Arduino and a smartphone.
It is enough to have a any classic starter railway model kit and even a schoolboy will build this scheme in a few minutes. If you have a dusty box with an old railway, then it is even more interesting.
Step 1: Arduino Details
It's just the way of the world, that without hardware, any program on Smart Phones and Tablets can not influence the reality. You need the Arduino NANO board, the Bluetooth-module HC-06 and the motor-driver L298n is connected to the rails. All arduino's details for this experiment cost less than $ 12 on online stores. If you already have any Arduino's board (like UNO, MEGA and etc.) and shields, you can also use them.
Step 2: Upload Sketch to Your Arduino
An example in this video is a typical version of robot control based on Arduino. Similar schemes you will easily find on the Internet. The only difference is that the output of the motor driver is connected to the rails, and not directly to the motor.
Before the assembly of the circuit, you need to upload to Arduino program called a sketch. Sketch for this experiment is based on the example SerialEvent from Arduino IDE. In general, all the sketches of URB project are written at such a level so that they can be easily converted for to your needs. Their complexity at level a examples Arduino IDE.
Visit Arduino.cc and install ArduinoIDE to your PC.
After it upload sketch to your Arduino board.
Step 3: Collect the Circuit Using Wires
The power divided into two branches, one for moving trains, the second for electronics and devices on the layout. Thus, with short circuits on rails and other troubles with trains, the layout control will not be affected.
To turn 5V power on your Arduino, use any charger for modern smartphones with a USB connector. The current of such chargers should be about 1 A. For the movement of trains, you can use the transformer you already have from the starter set or any DC power supply with 12V. Please note that the output current also should be about 1 A or more.
It is convenient to carry out the connection of wires between the power supply unit and the motor-driver through the power plug-screw terminals