Arduino + Laptop Touchpad

Introduction: Arduino + Laptop Touchpad

Yes, this is more or less your average touchpad that one can find from inside a laptop. This model, like majority of touchpads out there operates with PS/2 standard. This means that it can be directly plugged in to a PS/2 connector and with proper drivers, function as a mouse.

As it happens the PS/2 communication is not that difficult to achieve with an Arduino board. Kristopher has written an Arduino/Wiring library that offers all the functionality that we need at this point.

I will be using the MAX7219 Led Controller too and for this one can use LedControl library , written by Eberhard Fahle.

Step 2: Coding - Part I

Here are both the TouchPad and the 8x8 Ledmatrix hooked up to Arduino. Touchpad uses the 5 and 6 pins on Arduino and the MAX7219 utilizes the pins 10, 11 and 12. What goes were can be easy seen inside the code.

First test - Direction and buttons

TouchPad reports the movement of the finger. One gets a pair of coordinates that indicated the amount of movement and the direction from the last position. For example -12, 2 would mean a swipe towards 10 o'clock and the X-axis movement being faster.

I hope that you found this short tutorial useful. If you ever find this material useful, please, share your findings and projects with us. Either by registering here to Allthemods.com or by visiting Metku.net . Thanks.

cool, i have an old laptop touchpad and tried connecting it io a usb port, it worked but i forgot which pins go where and didn't even use an arduino, so now i am going to do this with the pad cool ible

i have a question if u have 5 pins coming from the mouse and two goes for power(and ground) and two goes for data where does one go (the nc or the data or the clock) i'm sorry i couldn't see it in the code as i'm just learning the arduino and i'm getting a friend who does c coding to help me later on in my project

Wire labeled +5v goes to bottom row, marked as power/Power Supply. There the pin marked as 5v. The two wires market as GND coming from mouse are connected to the pin Gnd in the power section on Arduino. The wire marked as NC doesn't need to be connected anywhere, just leave it be.

thanks man this helped a lot but i have one more question when u tap the pad does this send a different signal to the arduino from when u use the left button to click because i have something like a menu selection in mind like the left and right buttons to scroll and the tap to enter

Well, if the PC already has a PS2 connector, you can just plug the touchpad in and it would work. And yes, you could route the data from the Arduino to PC via the USB port if needed. With a simple program on PC side one could control the mouse, alter the volume etc. with this thing.

Arduino can not be used as an HID device. It can't be operated as a mouse or a keyboard on its own. If you swap the Arduino for example to a Teensy, you could just plug the device to the USB port and the computer would recognize it as a mouse without any additional software on the PC side.

Read through this quickly (don't use arduino so didn't understand much) and I was wondering if it is possible to use this without the attached hardware.

I have seen the touch screen digitisers for sale on ebay etc.and they look very simple, only four wires.I assumed it was just V+, V- and two analogue readings which would give you the X and Y positions?

Do you know much about these? or if it is possible to interface with it on it's own?

I believe this link gives a good idea about the technology:http://www.touchscreenguide.com/touchscreen/res.html#4w

It would be fairly easy to use these touchscreen films with microcontrollers that have ADC in them. I haven't done it myself but there are tons of material in the net on how to do this. But then again, it should not be impossible to use the signal the film gives with purely analog circuitry too. Just to check which half of the film was pressed to see if the user selected the left or the right side etc... some comparators, opamps...