Kushagra Keshari

y%20Loop.jpg 

Arduino microcontrollers have great potential to be used in model railroading for layout automation. Their low-cost and a huge community around it makes it a good tool for hobbyists, especially beginners.

If you want to get started in model railroad automation then this might be a good place to start.

Starting with the layout

Here, we are going to build a simple oval loop:

IMG_1307.JPG 

This loop will have a 'sensored' track at an appropriate location in the layout as shown. This will allow the Arduino microcontroller to 'know' when the train has crossed this section of the track to carry out the programmed sequence. Automation almost always requires some sort of feedback mechanism. 

The feeder track will provide power to the locomotive on the layout.

Driving the train/locomotive

For providing power to the rails, we will use an L298N motor driver module:

IMG_1308.JPG 

Out of the 6 inputs the input pins 'IN3', 'IN4', and 'ENB' are used for direction and speed control. The direction of the current in the track is controlled via the pins 'IN3' and 'IN4'. Connecting 'IN3' to the digital HIGH signal(+5-volts) will cause the current to flow in one way and connecting 'IN4' to the digital HIGH signal will cause it to flow in the opposite direction. If none or both are connected to digital HIGH, no current will flow.

A PWM signal generated by the Arduino microcontroller is fed to the pin 'ENB' which controls the track voltage and hence the speed of the train/locomotive.

The 'brains'

We can use almost any Arduino board but an Arduino UNO is recommended for beginners.

IMG_1313.JPG 

It 'reads' the state of the 'sensored' track and controls the speed of the train/locomotive by adjusting the duty cycle of the PWM signal being sent to the input pin of the motor driver('ENB') as the program uploaded into its memory.

Complete info

You can learn how to build this project here.

You can watch the project in action here:

 

 

If you plan on making this project, all the best!

Reply 0
Reply