How a computer mouse works and what’s inside

A computer mouse is an input device that is used to control the cursor on a computer screen. It allows the user to move the mouse pointer across a surface and perform various functions by clicking and moving buttons. A program running on a computer, in response to mouse movement, produces an action on the screen that corresponds to the direction and distance of this movement

The mouse device consists of several main components:

Optical or Laser Sensor: An optical mouse uses an LED to illuminate the surface in front of it, while a laser mouse uses a laser beam. Sensors analyze reflected light or laser light to detect mouse movement.
Ball or wheel: present in most mechanical computer mice. They allow you to move the cursor on the screen by scrolling the mouse across the surface.
Moving Elements: These components are responsible for responding to mouse movements. Inside the mouse there are balls or optical sensors that record the movement of the mouse on the surface.
Buttons: A mouse usually has two standard buttons: left button and right button. They serve to perform functions such as selection, drag and drop, and context menus. Additional buttons can be added to perform specialized functions.
Connectivity: Modern mice can be connected to a computer using a wired USB connection or wireless technology such as Bluetooth or RF (radio frequency) connection.
The operation of the mouse consists of the following steps:

Mouse movement: When the user moves the mouse across a surface, sensors record this movement and transmit data about its movement to the computer.
Moving the cursor: Based on mouse movement data, the computer moves the cursor on the screen according to this data.
Mouse Buttons: When the user presses mouse buttons, the mouse sends a signal to the computer, which causes certain functions to be performed, such as making a selection or opening a context menu.
Thus, a computer mouse is an important and common input device that allows users to control the cursor on the screen and perform various actions.

Here are the insides of a regular computer mouse that connects to the computer using a USB cable

A wheel is attached to the encoder. An LED shines into the lens and the light hits the surface and is reflected into a special chip-matrix sensor, which is a simple video camera with a signal processor. This video camera constantly takes pictures of the surface and processes them, so the camera calculates the direction of movement mouse. The LED acts as a backlight for the video camera.

Turn the matrix sensor over and you will see a hole in it where the image from the surface, focused by the lens, enters.

Open this video camera chip and you will see a crystal with a sensor. This is a processor with a video camera

This is what a semiconductor chip looks like under a microscope

And here is a matrix sensor-video camera in the form of a square on a crystal

Bluetooth computer mouse Logitech RBQ124 about 15 years ago. The battery inside and for charging the mouse was placed in a special glass. The mouse was supplied with a program where you can select modes for the buttons. Made on an Atmega32L microcontroller

In this mouse you will also see a video camera chip and the backlight is an infrared laser. This is a Bluetooth laser mouse