Introduction: 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. The sliding and tapping finger gestures can prove to make controlling stuff in a quite simple and fun way. In this Instructable, let's combine one with a USB HID Arduino microcontroller to take control of our computer with a slide of our finger. Let's get started!
Step 1: Watch the Video
Watch the video to understand how this works and know the keyboard functions.
Step 2: Get All the Required Stuff
We can start with the basic version of this project where two keyboard shortcut functions can be controlled via the finger movement on the x and y axes respectively. The multifunction version will allow us to use more than two keyboard shortcut functions where the x-axis movement will control the function and the y-axis movement will switch between the functions.
For this project, you will require:
- A USB HID-compliant Arduino microcontroller(Leonardo, Micro, Pro Micro).
- A PS/2 touchpad(One from Synaptics is recommended as it is known and tested).
- 4 wires(Bare wires with a male connector on one side to connect the Arduino board to the touchpad).
For a multifunction controller, you will additionally require:
- A 7-segment LED display(Common cathode one, i.e, having the common terminal -ve)
- A 220Ω resistor.
- 9 wires(To connect the LED display to the Arduino board).
Step 3: Identify the Wiring Connections of the Touchpad
Search online for the part number of the touchpad being used. If you get stuck, you can get help from the r/Arduino community.
On most of the touchpads, especially the Synaptics ones, the following copper pads correspond to the each of the connections of the onboard chip:
- T22 ~> +5-volt
- T23 ~> GND
- T10 ~> Clock
- T11 ~> Data
Step 4: Program the Arduino Microcontroller
I would recommend starting with the basic version of the code to become familiar with the controls and tweak with the settings to suit your future requirements.
Step 5: Connect the Touchpad to the Arduino Board
As the copper pads of the touchpad are already known, we can connect the 5-volt and GND input of the touchpad to the +5-volts and GND header pin of the Arduino board.
The Clock pin will be connected to pin A0 and the Data pin will be connected to pin A1 of the Arduino board.
Luckily, this board had a large enough ribbon connector to allow male jumper wires to be connected. You can solder wires to the required copper pads and if you want cleaner wiring as in the 4th picture, you can use a ribbon cable and solder wires on it as shown in the 3rd picture.
Step 6: Connect the Setup to Your Computer
You can skip this step for now if you are doing the multi-function version of the project.
After connecting the setup, on moving the finger across the touchpad in the x-axis, you should be able to control the left and right arrow keys and moving the finger along the y-axis, you should be able to control the up and down arrow keys.
Step 7: Connect the 7 Segment LED Display to the Arduino Board
Connect the common pin of the display through a 200Ω resistor to pin D9 of the Arduino board. Then make the following connections:
LED display pin ~> Arduino board pin
A ~> D2
B ~> D3
D ~> D5
E ~> D6
F ~> D7
G ~> D8
The pin 'DP' of the LED display will not be used.
Step 8: Connect the Setup to the Computer and Test It
After connecting the setup to the computer, on sliding the finger along the y-axis as in the video will cause the number on the LED display to increment/decrement depending on the direction of finger movement. There are a total of 15 functions, of which 14 are for computer control(The function 0 is reserved for LED display's brightness control but can be changed by modifying the Arduino code).
While being in function 0, on sliding the finger along the x-axis will cause the brightness of the LED display to vary, depending on the direction of finger movement. The other 14 functions are explained in the Arduino code. Feel free to change them to suit your requirements.
Step 9: Volume Control
The Arduino microcontroller emulates the pressing of Page Up and Page Down keys with Ctrl key to raise and lower the volume respectively. In order for this keyboard shortcut to work, you would need to download the 'Volume.exe' file from here(It's safe) and put it in the startup system folder so that it runs every time the computer is booted up.
You can check this for help.
Step 10: Customize the Code
Try making changes to the code to do more stuff other than controlling the computer, add more functions, or change the existing ones. There are a lot of functions left to make use of.