Raspberry Pi Trackpad From Salvaged Trackpad Plus Arduino

Old laptops are easy to find and many have a trackpad with a PS/2 interface hardwired into the guts of the laptop. [Build It] wanted one of those trackpads for use in the DIY Raspberry Pi laptop he’s working on. But the Raspberry Pi has no PS/2 input, and he read that a PS/2 to USB adapter wouldn’t be reliable enough. His solution? Wire the trackpad to an Arduino and have the Arduino convert the trackpad’s PS/2 to USB.

After removing a few screws, he had the trackpad free of the laptop. Looking up the trackpad’s part number online he found the solder pads for data, clock and five volts. He soldered his own wires to them, as well as to the trackpad’s ground plane, and from there to his Arduino Pro Micro. After installing the Arduino PS/2 mouse and the Mouse and Keyboard libraries he wrote some code (see his Instructables page). The finishing touch was to use generous helpings of hot glue to secure all the wires, as well as the Arduino, to the back to the trackpad. By plugging a USB cable into the Arduino, he now had a trackpad that could plug in anywhere as a USB trackpad. Watch [Build It] put it all together step-by-step in the video below.

Want something else to do with a trackpad. How about combining sixteen of them into an awesome MIDI controller like [Scott] did?

39 thoughts on “Raspberry Pi Trackpad From Salvaged Trackpad Plus Arduino

    1. “and he read that a PS/2 to USB adapter wouldn’t be reliable enough. His solution? Wire the trackpad to an Arduino and have the Arduino convert the trackpad’s PS/2 to USB.”

      1. That’s a pretty dated article and full of irrelevant information. It’s true that many PS/2 devices were both USB and PS/2 and the adapters that came with them were simply wiring adapters. Obviously those won’t be of any use here. A commercial PS/2->USB converter made for using a PS/2-only device on a USB machine is exactly what he reproduced with an Arduino. I’m not sure why the Arduino is any more useful – but I’m sure it was fun to do and that’s important too. Adapters (https://static.grainger.com/rp/s/is/image/Grainger/14C376_AW01) can be found for under $6 and they should work fine.

  1. All the usual sized trackpads we have/had (in workshop spares) are PS/2 compatible, however the over-sized ones are some bespoke configuration that is meant to hook up to an embedded controller (EC) GPIO.

    Dell trackpad and keyboard for the socketable* type keyboards have the keyboard and trackpad go to the EC, however the data lines are electrically compatable with PS/2 for the keyboard and possibly the mouse even though the schematics state they are both parts of the same the EC. The keyboard also has an extra IRQ line off the EC daughterboard to trigger something (Or is it part of the PS/2 keyboard spec?)

    Might have to locate an older (GM945 era) inspiron with said keyboard if I could find one under $10-ish at the boot market, but first to find a datasheet for one to be sure and to experiment on what I got as spare.

    *Examples: latitude E6400, precision M4400 etc and some of the older full metal inspirons.

  2. I found some scrap laptops, and I got curious about the touchpads. I’ve never implemented it because I’m thinking about how to house the trackpad. But I guess I looked up the IC number, and I found a datasheet. It was a couple of years go, but memory says I came across a datasheet for a USB trackpad. It makes sense, a lot of desktop computers no longer have PS/2 and I thought they went away from laptops before that. Why cause a need for PS/2 internally? I even have laptop-like keyboard, with trackpad and the “joystick” gizmo in between the keys, and it’s USB so why generate PS/2 to begin with?

    So maybe it’s must a matter of finding more recent laptops in the junkbox.


  3. For a long time, HackaDay wasn’t about your average hack, but specifically the clever ones (in a broad sense)… Now this quick and dirty set-up looks straightforward and effective, but is not so great, neither as a tutorial nor as a DIY story, and seriously lacks of basic “shared knowledge” ethics…
    What we got here is another “look what I’ve done myself ! now do the same steps, without thinking much, and you’re done”, which should have been more suitable on a personal blog and (more honestly) titled : “How I turned my old laptop’s trackpad and made it a customizable USB device in 5 minutes (thanks to the Internet and Arduino community)”.

    First this is presented as a generic tutorial to do this with any trackpad, but lots of things are specific to some Synaptics models. Curiously enough, the name “Synaptics” is never mentionned in the written tutorial (you can only see it if you look closely at the picture ans the prints on his trackpad’s circuit).
    Then, in the short “Why Does This Work” (without the question mark), we are just roughly told that the trackpad is PS/2 and then the Arduino converts it to USB… yeah, can’t argue with that, this is why it does work, isn’t it ?! :))

    The guy wrote “find 4 solder pads on our trackpad, these are pretty easy to find as they are labeled T10 (data), T11 (clock) and T20” but no, their respective functions are not printed on the board, so how did he found that ?
    The provided Arduino sketch’s code, totally uncommented (so I had to figure out) is full of commands sent to the trackpad via PS2, but what are they, and where did he found them ??

    The problem is not only that this won’t learn someone “how to fish” (to get an idea of how you could find all this by yourself), but you won’t learn how the guy found it either, probably to keep the “magic”… and a magician never reveal their secrets, right ?
    Sadly, nothing magical here, but citation of any source material is nowhere to be found.. a mere oversight ? However, all the interesting comments were diligently removed from the original code that (with 5 minutes of Google proper magic) can be traced back exactly to this forum post from 2011 : https://forum.arduino.cc/index.php?topic=54058.msg387983#msg387983

    At the complete oposite, original code’s author was smart and generous enough to join the fully commented code excerpt (in its own words, “for future prosperity”) that summarize its research about PS2 commands required for this Synaptics chipset (with a link to the full protocol documentation), and in its own (far less boring) DIY KaossPad project on Instructables, he also had the good taste to point to the blog where the different pads numbering of Synaptics touchpad were previously discussed, All this in just a few lines of text…
    But without them, author of this “dumb” usb trackpad tutorial probably would’nt have a first clue on how to do it in the first place. Then, visibly proud of his “work”, he produced a tutorial, with many pictures and a verbose video, but won’t tell a word about where or from whom he found the most useful information for it, shared by the community, and the major part of the provided sketch ?! Common’ Mr Dufresne, you can do better, respect your readers, the community and (what’s left of) the blog reputation, do your homeworks and try to promote better project, with the right spirit too !

    1. Hi, this is the guy who wrote what you have made out to be a dirty simple tutorial that’s not good enough for your gifted mind. You miss the old days when you could only just barely look down on the projects posted on hackaday, now everything is too simple for your incredible intellect. I’m an 18-year-old high schooler from South Africa who, to be honest, don’t fully understand how the PS/2 interface works im so sorry that the editor wrote a piece about my dumb ass project that offended your superior mind. My intention was to not create a project that was”dumb” “simple” or “dirty” but rather to try my best to share just a bit more knowledge with the community that I love and that has shared so much with me but clearly you did not receive enough information about my project and I’m sorry about that but its time you get off your high horse and realise that some people my actual not know everything you know and may actually find this just a bit helpful. Honestly, i don’t think my project is whats wrong with hackaday i think you and people like you are the problems, instead of bashing me why don’t you add a helpful comment.
      P.S making fun of me because I left off a question mark? It’s time to grow up buddy.

      1. Hello Dante, first what I didn’t meant :
        “quick and dirty” : nothing insulting here in the context of this expression (especially when immediately followed by “straightforward and effective”)
        “without a question mark” : and that’s perfectly fine, I was not making fun of you at all, I just mentionned it, without comment or irony, to respect your original text and show this was an affirmation (or are the punctuation-related words now banished, or be called a grammar nazi ? sshh)
        “dumb” : was between quotes, and meant as “simple” or “rough” in constrast to a more in-depth technical explanation that would have been possible.

        You complained on the form, but replied nothing about the substance and the specific things I’ve pointed.. In fact, I don’t how the PS2 protocol actually works too, and I’m probably not a lot more advanced than you in electronics. I only took the time to understand your project and its components first, then to verify and explain my points (not in the form a a single bloated paragraph of resentful rant) and it wasn’t meant as some gratuitous attack. I was more worryied with things like the abscence of reference to original code author, which objectively is a concern, even if I listed other points that are problematic too in my opinion (like presenting it like a generic solution, despites potential incompatibilities with other trackpad models).

        Original code was easy to find, it took me no more than 5 minutes with some copy/paste of some lines of your sketch and a web search by date to find it, so the excuse of “I cannot know everything, I’m young, etc..” doesn’t really stand. From the search results, it appears you’re not the only one who reproduced it, but most versions kept the comments at least, because without them, the code simply looks cryptic.
        If you love the community and sharing so much, why didn’t you look for it before publishing ? And why publish this code without its existing comments ?
        Anyway, I sincerely hope the URL to the original code author’s post which comes with the missing commented PS2 commands (and a link to the Synaptics protocol documentation) will be helpful enough for you, and for other readers, that’s why I gave it too.

        However, the thing is I’ve never criticized you as a person (or “bashed you” or call you “dumb-a..” names like you imply) only your tutorial. I can’t deny that some aspects are helpful, and that some people will enjoy it. Personnaly, I was disappointed by it for the reasons I explained, and by HaD blogger who, imho, should have look at the project more extensively.
        Now you are kind of rude and a bit agressive, with some repeated nasty irony on my presumably “gifted mind” and “incredible intellect” and “superior mind”, maybe your polite way to “not-calling” people dumb ? (to be fair, I was ironic too about the “magic”, central but mysteriously unexplained aspects of your hack).

        Honestly, the end of your message really sounds like a fanatized child of some random dictatorship of the last century, when you say “you and people like you (who miss the old days) you are the problems”. Since age seems to have its importance for you, I must admit I’m 32 and found that HaD was better even three years ago, when I started to read it. On a sidenote, young farts antagonizing older people (that they will become themselves a few years later) is nothing new.

        Your work is what it is, feel free to publish it, it is public so is subject to public debate.Yet I’m free to criticize it (and I tend to praise a lot more often) publicly and anyone is free to disagree with me. If you can’t take *argumented* criticism of your published work and only want to hear positive feedback, that is you problem, not mine, but I would never ever call you an “indulged narcissist” for it. Sorry to remind you of these obvious things, and that I hurted your feelings with my opinions, now if I may quote you : get off you high horse, it’s time to grow up buddy !

        1. Hey, malak, piss off already you elitist dick.
          You are the problem here, not Dante. Get off your high horse and click that close button on your browser if you don’t like what you see.

          As an electrical engineer of over 15 years, and a maker/hacker for nearly double that, I for one found the article interesting and useful.

        2. I feel I have to comment here.. I wrote that code that Dante is using, it was a quick and dirty test of something.. had I known it would wind up here I would have commented the code.. but its a small piece of code, its not hard to figure out.. had it been a few hundred lines then sure, comments would have helped, but cut the kid some slack. I’m pretty sure most of the people commenting here are older than 27 and have a few years experience.. this is a high school kid.. HaD community should be helping the younger ones not berating them for not commenting code someone else wrote.. rant over

        3. Malaka, First the code I provided was not written by me but in fact was written by someone I know on a different group, I took his code that he let me use and adapted it for my own used by adding a few lines and adding the mouse library, making your pathetic rant about me stealing code and not giving credit very untrue. The reason my project may have, to you, lacked substance is because I don’t fully understand everything about how the USB and PS/2 protocol works, I don’t want to spread misinformation about a subject I don’t fully understand and so in my project I only explained areas I fully understood, I’m sorry if that this does meet your standards but you’re just going to have to get over yourself and accept that it’s here.

          1. ” making your pathetic rant about me stealing code and not giving credit very untrue.”
            Pathetic rant ?? Clearly, you must confuse with your own previous reply. I simply gave an opinion with arguments and even proofs, and look at the replies that I get… so much for the debate !

            And is it “very untrue” that any form of credit or source citing is still nowhere to be found in your tutorial ? But let me do that for you (my pleasure, since you’re so nice), here is where your pad labels informations is coming from : http://sparktronics.blogspot.com/2008/05/synaptics-t1004-based-touchpad-to-ps2.html

            Now your friend come here to say he’s the author of code copied “from some Internet source”. That’s very funny, but the problem is that it’s easy for anyone to search and find that 60 your 70 lines of code (with same variable names, minus useful comments removed) were already in the sketch of this Instructable from 2009 : https://www.instructables.com/id/The-5-Karduinoss-pad/

            The only news in all of it is that is now perfectly fine and approved to write “piss off already you elitist dick.” in the comments. Thanks HaD !
            PS : where is the Raspberry Pi in this project ? Oh yeah, only in the top title here, of course ! You’re the best, change nothing !

      2. Dante, you’ve done something useful and learned a bit along the way so you should be proud of that. Don’t let malak get under your skin, I’m sure he didn’t have any malicious intentions but he just expressed his criticism that he wanted to be constructive more harshly than necessary. Once you strip away the barbs and prose, criticism can be useful so take what you can use to improve yourself and ignore the negative. Learning how to both receive and give criticism in a beneficial manner and communicate effectively are important skills that not everyone has down perfectly so if you encounter someone who seems insulting just take the high road and thank them for giving their opinion and try to get some positive out of it. I’m still learning how to handle this too as I’m still a bit wet behind the ears. We are all human so a little understanding and benefit of the doubt goes a long way.

  4. TLDR:

    But if its as most arduino projects these days he linked some PS2 library with a USB library with a bit of code in the middle to transform. Hardly earth shattering. Id be more impressed if he bit banged the PS2 protocol out the GPIO header on the PI. I’m sure by now someone has already done that too.

    Funny thing would be is if the touchpad supported USB from the get go. A lot of USB/PS2 input devices made over the past 2 decades do. So long as you hook up the power and data pins to the right pads, the devices recognizes it is on USB and switches from PS2 to USB mode. That is how a lot of the existing PS2 to USB adapters on the market work, they are simply dumb pin converters and the device being plugged in auto detects what bus it was just plugged into and switches into the appropriate mode.

    1. Double checked that, Unfortunately, the touchpad used was exclusively PS/2 as the laptop was over 7 years old however I did take a look at using the PI’s GPIO headers but ultimately I scrapped that idea because I intended to use the trackpad on a few different devices some of which don’t have available GPIO headers

    1. Does the tablet still work, or literally just the touchscreen and associated hardware? If the tablet still works there are certainly many ‘use tablet as input device’ apps for it.
      Tell us what model it is and the target device please… :)
      It might be as simple as having the correct USB connection and downloading a driver.

      If it is a really old touchscreen than there are several articles on HaD:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s