Logitech 161A PS/2 to USB/Leonardo (t-sbc12-cpq)
by LashaG in Circuits > Arduino
664 Views, 1 Favorites, 0 Comments
Logitech 161A PS/2 to USB/Leonardo (t-sbc12-cpq)
So, on taobao.com I found this device from Logitech and in my backpack I have Logitech m570 for 5 years. I am a fan. And I am going to build keyboard and was planing to add thinkpad mouse inside, but after finding this I am going to implement in my future build. In this instruction I will show you how to use this module and how you can modify it
Supplies
you need soldering iron or jumpper wires for testing.
- Soldering iron.
- Logitech A161
- jumpper wires
- arduino Leonardo/ Pro micro/ Uno/ nano/ ESP
- PS/2 USB adapter
you can get it on this links:
https://item.taobao.com/item.htm?spm=a1z09.2.0.0.2ab82e8dM0VbMU&id=629074447560&_u=22u9lum46b93
https://www.ebay.com/sch/i.html?_from=R40&_trksid=p2334524.m570.l1313&_nkw=+T-SBC12-CPQ&_sacat=0&LH_TitleDesc=0&_odkw=logitech+a161&_osacat=0
A161 Pinout
I soldered wires to make it easy for me to use it on breadboard, you need 4 wires to use ball and buttons, using data and clock we are able to read mouse moving informations and button clicks in numbers. then I am able to modify ection it can call in computer.
Pro Micro Connection
this connection is not mandatory, you can use different pins.
GND-GND
VCC-VCC (3.3 or 5V)
Data - 3
Clock - 9
you are going to need this library: http://github.com/kristopher/PS2-Mouse-Arduino/
Using simple.ino- you can monitor serial to see what is changing when you move the ball.
I found this code somewera do not have sourse link.
inside the code you will se aray of "data" [0]-- will give you info of ection.
- 8- nothing is moving, no button is pressed
- 10- left button
- 9 - right button
- 11 - left and right together are pressed
- 40 - mouse is moving left or up while left button is pressed
- 24 - mouse is moving rigt or down while left button is pressed
- 42 - left button is pressed and mouse is moving left or up
- 26 - left button is pressed and mouse is moving right or down
if you read [1] ( left -right X access) walue will change between -7 to 7 deppends on the speed.
if you read [2] ( up -down Y access) walue will change between -7 to 7 deppends on the speed.
Downloads
Use As a Mouse
here is commands for Mouse.h library: https://www.arduino.cc/reference/en/language/functions/usb/mouse/
using this code you can move mouse and monitor it using serial.monitor, I am not using on board buttons, because it was too complicated for me to because [0] incoming data was not stable or my programing skills.
if ((data[2]!=0)||(data[1]!=0)){ // reading ball moving and converting to pixel movment
Mouse.move(-data[1]*2, data[2]*2, 0); // (0,0,0)==(x,y,scroll)
Mouse.move(-data[1]*2, data[2]*2, 0);
}
you can use Mouse.h library to send more comands to computer
becouse mouse was slow I multipled it by 2 to make it faster
// -data[1]*2<< here I am reversing incoming x acces data to make it to go wright side
Downloads
PS/2 to Usb
I can not get this adapter by the time I am uploading this project, if I get my hands on it I will update this project. I hope it will work better with the buttons, but I like an idea of using leonardo, or pro micro , becouse I can modify speed and extra extons, I am going to add 4-6 buttons for custom extions.