|
arduino IDEArduino
|
Laptop Touchpad Controlled Model Railroad
Supplies:
For this project, you will require:
- An Arduino microcontroller compatible with Adafruit Motor Shield V2(UNO, Leonardo, etc)
- An Adafruit Motor Shield V2
- A PS/2 touchpad
- 4 wires with male Dupont connectors on one side(To connect the touchpad to the Arduino board)
- 2 wires each for connecting track power and turnouts(3 max) to the motor shield
- A 12-volt DC power supply with a current capacity of at least 1A.
Step 1: Get the Ps2 Library
Download the folder of the ps2 library from here. Move the downloaded folder to the desktop as it will be easier to find. Open the Arduino IDE and click Sketch>Include Library>Add .ZIP Library... and then select the ps2 folder from the desktop. The library will be included and you now be able to use the ps2 library.
Step 2: Figure Out the Connections of the Touchpad
If you have a Synaptics touchpad like the above one, the pad 'T22' is +5V, 'T10' is 'Clock', 'T11' is 'Data' and 'T23' is 'GND'. You can also solder the 'GND' wire to a large exposed copper as shown above.
Click on the above image to know more. If you have a different touchpad, try searching for its part number on the internet with 'pinouts' or you can ask the r/Arduino community on Reddit if you get stuck.
Step 3: Test the Touchpad
Make sure the correct connections are made to the touchpad. To test the touchpad, upload the ps2 mouse code on the Arduino microcontroller from Examples>ps2. Connect 'Clock' wire to D6, 'Data' wire to D5, GND to GND, and +5V or VCC to +5V pin of the Arduino board respectively. Reconnect the Arduino board to the computer and open the serial monitor. If you see the numbers changing as you move your finger across the touchpad, the touchpad is working properly and you can proceed.
Step 4: Program the Arduino Microcontroller
You can get the code from here.
It is recommended to go through the code before uploading it to the Arduino microcontroller to understand what all is going on.
Step 5: Set Up the Layout
Set up a layout to test the track power and all three turnout controls. Make sure all track joints are made properly and the tracks are clean. Cleaning the tracks and locomotives' wheels periodically is recommended to prevent the locomotives from stalling.
Step 6: Install the Motor Shield on the Arduino Board
Carefully align the pins of the motor shield with the female headers of the Arduino board and push the shield on top of the Arduino board. Make sure the shield fits securely on the Arduino board and no pin gets bent.
Step 7: Connect Track Power and Turnouts to the Motor Shield
Make the following connections:
- Connect the track power to the output connector of the shield labeled 'M1'.
- Connect the turnouts to the rest three output connectors 'M2', 'M3', and 'M4'.
Make sure all the wiring connections are done correctly and are not loose.
Step 8: Connect the Touchpad to the Setup
Connect the touchpad to the Arduino board by making the following connections between the touchpad and the Arduino board:
- +5-volt or 'VCC' to +5-volt of the Arduino board
- 'GND' to 'GND' of the Arduino board
- 'Clock' to 'D6' of the Arduino board
- 'Data' to 'D5' of the Arduino board
Step 9: Place the Locomotive(s) on the Track
Place a locomotive to be tested. You can also place multiple locomotives as per your wish.
The use of a rerailing tool is recommended. Make sure the locomotives are properly placed on the tracks to prevent derailments.
Step 10: Connect the Setup to Power and Turn It On
Connect the 12-volt power supply to the setup and turn it on.
Step 11: Test the Controls
Test all the controls. Refer to the above video to understand the controls.
I hope you enjoyed making this project. Please consider voting for this. Thank you.
Laptop Touchpad Controlled Model Railroad
- Comments(0)
- Likes(1)
- ElectroMaker Jul 06,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
-
8usability
-
10creativity
-
9content
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...
-
-
-
-
-
-
3D printed Enclosure Backplate for Riden RD60xx power supplies
154 1 1 -
-