|
arduino IDEArduino
|
Simple Automated Model Railroad Loop With Yard Siding
Video:
Supplies:
For this project, you will require:
- An Arduino microcontroller board compatible with the Adafruit motor shield v2
- An Adafruit motor driver shield v2(Learn more about it here)
- An expansion shield(Optional but recommended to expand the power and ground pin connections for the sensors.)
- Two 'sensored' tracks
- Two sets of 3 male to female jumper wires(To connect the 'sensored' tracks to the Arduino board.)
- 4 male to male jumper wires(2 each for connecting the track power and the turnout to the motor shield's output terminals.)
- A 12-volt DC power source with a current capacity of at least 1A(1000mA)
- An appropriate USB cable (To connect the Arduino board to a computer.)
- A computer(To program the Arduino microcontroller.)
Step 1: Program the Arduino Board

You can get the Arduino code from here.
Make sure you have the Adafruit motor driver shield v2 library installed in your IDE. Go through the Arduino code to get an idea of how it works and how you can modify it in the future to experiment with the setup.
Step 2: Make a Test Layout

Make sure all the rail joints are properly made and the track's rails are cleaned to prevent the train from derailing and/or stalling.
Step 3: Install the Motor Shield on the Arduino Board

Install the shield carefully on the Arduino board by aligning the pins of the shield with the headers of the Arduino board. Do it gently and make sure no pins of the shield get bent.
Step 4: Connect the Track Power Feeder and the Turnout Wires to the Motor Shield



Connect the output terminals of the shield marked as M1 to the track power wires and those marked as M4 to the turnout wires. Make note that the setup is compatible with only two-wire solenoid-type turnouts.
Step 5: Connect the 'sensored' Tracks to the Arduino Board



Install the expansion shield on the motor shield and connect each sensor's GND and VCC pins to the GND and +5-volt headers of the shield. Then make the following pin connections:
- Connect the output pin of the first sensor to the input pin A0 of the Arduino board.
- Connect the output pin of the second sensor to the input pin A1 of the Arduino board.
Step 6: Place the Train in the Siding

Place the train in the yard siding to prepare for the test run. Use of a rerailer tool is recommended to ensure that the locomotive and the rolling stock are placed properly on the tracks to prevent derailments.
Step 7: Connect the Arduino Board to Power

Connect the 12-volt DC power source to the Arduino board either through the power terminal block of the motor shield or the female barrel jack connector of the Arduino board. Before turning on the power, make sure all the wiring connections are made correctly and none of them are loose.
Step 8: Turn on the Power and Watch Your Train Go
After turning on the power if the turnout switches the wrong way or the train starts to move in the wrong direction, reverse the polarity of the respective wires connected to the motor shield's output terminals.
Step 9: What's Next?
If you have reached this far, you might want to relax a bit and enjoy your project. But if you want to do more stuff then you can try to modify the Arduino code and experiment with the setup to do something new. Whatever you do, all the best!
Simple Automated Model Railroad Loop With Yard Siding
- Comments(0)
- Likes(1)
-
ElectroMaker
Aug 25,2021
- 1 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
-
9design
-
7usability
-
10creativity
-
10content
More by KushagraK7
-
Raspberry Pi Pico RC Vehicle
SuppliesA Raspberry Pi Pico(Almost any microcontroller can be used here, but the Pico offers great f...
-
Stepper Motor Controlled Stepper Motor Without Microcontroller!
Step 1: Watch the VideoWatch the video to get a full understanding of the project and learn how to t...
-
Automated Model Railroad Layout Running Two Trains
I made an Automated Model Train Layout with Passing Siding a while back. Upon request from a fellow ...
-
Program the Raspberry Pi Pico With the Arduino IDE
The Raspberry Pi Pico is a recently launched product in the family of microcontrollers and its load ...
-
Reuse an Old Laptop's Touchpad to Control a Computer!
PS/2 laptop touchpads are among the coolest user interface devices to use with a microcontroller. Th...
-
Automated Model Railroad Layout With Reverse Loops
In one of my previous projects, I showed how to make a Simple Automated Point to Point Model Railroa...
-
Use a Stepper Motor As a Rotary Encoder
Rotary encoders are great for use in microcontroller projects as an input device but their performan...
-
Keyboard Controlled Model Train(PS/2 Interface)
Using Arduino microcontrollers, there are a lot of ways of controlling model railway layouts. A keyb...
-
Stepper Motor Speed and Direction Control Without a Microcontroller
In one of my previous projects, I showed you how to control a stepper motor's speed using a 555 time...
-
Smartphone Controlled 4X4 Robot With ESP8266
SuppliesFor this project, you will need:An ESP8266 microcontroller(Node MCU)A dual H-bridge motor dr...
-
Touchpad Controlled Digital Servo Motor
Here is a quick and simple project where we control a digital servo motor with the slide of our fing...
-
Smartphone Controlled Model Railroad With an ESP8266
IntroA while back, I made a project where a stepper motor's position is controlled using a smartphon...
-
Simple USB Volume Controller with Arduino
This project uses a rotary encoder connected to an Arduino Leonardo to control the audio volume of a...
-
Motor Speed and Direction Control with a Web-Server using an ESP01
Supplies:For this project, you will need:An ESP01 microcontroller(You can use any ESP8266-based micr...
-
Wi-Fi Controlled Stepper Motor With an ESP Microcontroller
Step 1: Get All the Required StuffFor this project, you will need:An ESP8266 microcontrollerA Steppe...
-
Simple Automated Model Railroad Loop With Yard Siding
Video:Supplies: For this project, you will require:An Arduino microcontroller board compatible with ...
-
Laptop Touchpad Controlled Model Railroad
Supplies:For this project, you will require:An Arduino microcontroller compatible with Adafruit Moto...
-
Control a Stepper Motor with a Slide of Your Finger
Supplies:An Arduino microcontroller boardA PS/2 touchpad from a laptop(Try to get one with a Synapti...
-
-
AEL-2011 Power Supply Module
322 0 1 -
AEL-2011 50W Power Amplifier
296 0 1 -
-
-
Custom Mechanical Keyboard
565 0 0 -
Tester for Touch Screen Digitizer without using microcontroller
230 2 2 -
Audio reactive glow LED wristband/bracelet with NFC / RFID-Tags
236 0 1 -
-
-







