I. Project Introduction
Bilibili Demo Video: https://www.bilibili.com/video/BV1BrH9ecEnd/?vd_source=cb3035aabee93b98268db84a2ab962fc
GitHub Open Source Address: https://github.com/Li-Dongze/stm32_paw3395_mouse
This project is a wired mouse based on the STM32F103C8T6 microcontroller. It uses the PixArt PAW3395 photoelectric sensor and communicates with the computer using the HID protocol. The nylon shell is 3D printed using LCSC's Monkey 3D printing technology. Project
Functionality:
Normal Mouse Functions: Cursor movement, left and right buttons, middle button, scroll wheel, DPI switching (LED flashes 3 times when DPI is switched).
Extended Functionality: Two custom buttons (interfaces reserved), not added in this example.


II. Motivation
I recently encountered an ADNS3080 optical flow sensor while working on digital image processing. It can generate black and white pixel images by taking close-up photos. After further investigation, I discovered that the sensor used in mice operates on the same principle, so I decided to make one myself. Adhering to the principle of doing it right, I chose the then-popular PAW3395 mouse sensor. For the main controller, I opted for the STM32F103C8T6, which was the most readily available.
III. Software Implementation
: Refer to the open-source GitHub address (detailed explanation available): https://github.com/Li-Dongze/stm32_paw3395_mouse
IV. Hardware Implementation:
The hardware is relatively simple, essentially consisting of an STM32 minimum system board + PAW3395 driver circuit + button and scroll wheel circuits, along with PCB and 3D shell adaptation. All details are included in the project file.
PAW3395 Purchase Link: [Taobao] http://e.tb.cn/h.gLP9ganzQMI5ptR?tk=80Nq3TwZ967 MF7997 "PAW3395DM-T6QU Gaming Mouse Sensor Optical Sensor PixArt Original Genuine Mouse Chip"
Click the link to open directly or search on Taobao to open directly.
Encoder Purchase Link: [Taobao] Limited Time Offer: ¥2 Off for Orders Over ¥20 http://e.tb.cn/h.gp8mxdU94VIInpI?tk=tyQa3TwZaDx MF3543 "TTC Kailh Mouse Wheel Encoder 7/8/9/10/11/13MM Razer Viper SENSEI G403G603G703"
Click the link to open directly or search on Taobao to open directly.