Two main kinds of touchscreen
Early touchscreens, and some still found in older ATMs, ticket machines and cash registers, are resistive. They have two thin flexible layers separated by a small gap. When you press hard enough, the layers touch and complete a circuit at that point, and the device works out where. These screens respond to anything that presses, such as a finger, a stylus or a gloved hand. They tend to be less clear and less suited to light touches or multi-finger gestures.
Almost all modern phones and tablets use capacitive screens, which sense the electrical properties of a finger rather than pressure. That is the main focus here.
The idea of capacitance
Capacitance is the ability of an arrangement of conductors to hold electric charge in an electric field. Two conductive surfaces separated by an insulator form a simple capacitor. If something else that conducts electricity comes close, it disturbs the field between them and changes the capacitance.
The human body conducts electricity reasonably well, because it contains water and dissolved salts. A fingertip touching or hovering very near the glass therefore alters the electric field around nearby electrodes in a tiny, measurable way. The screen does not need any force. This is why a light touch works, and why a plain piece of plastic or a dry fingernail does not.
The layers under the glass
A typical capacitive display includes a transparent grid of electrodes layered close to the surface, beneath a protective glass or similar cover. The electrodes are made from a clear conductive material so you can see the display through them. One common arrangement has rows running in one direction and columns running at right angles, separated by a thin insulating layer. At every point where a row crosses a column, there is a small capacitor.
The grid sits on or within the display stack, near the pixels that make the image. Technical designs vary between manufacturers.
Mutual capacitance and finding a touch
In the most common approach, a controller chip sends a small electrical signal along one row at a time and listens for the signal on each column. When no finger is present, the controller sees a certain baseline level at each crossing. When a fingertip comes near a crossing, it takes away some of the electric field that would otherwise reach the column electrode, and the measured signal drops slightly.
By scanning every crossing many times per second, the controller builds a map of which points changed. A fingertip is larger than the spacing between electrodes, so it affects several neighboring crossings by different amounts. The controller compares these amounts and calculates the center of the touch, which allows it to find a position more finely than the grid spacing.
Some simpler designs measure how each individual electrode changes, called self-capacitance, which is good at sensing a finger that is nearly touching but can mix up the positions of multiple fingers. Many devices use both methods.
Multi-touch
Because the controller builds a map of the whole screen, it can find several separate touch areas at once. Software tracks each one from frame to frame and notices when they move closer together (a pinch) or farther apart (a spread), or when two fingers slide together (a scroll). Early smartphones popularized these gestures, and the history of such devices is covered under early smartphones.
The controller must also decide what not to count. Resting your palm on the screen while writing with a stylus, a drop of water, or a case pressing at the edge can look like touches, so the controller and software include filtering, sometimes called palm rejection, to ignore them. Water on the surface is a known weakness, and many screens behave erratically when wet.
From signal to action
Once the controller has located a touch, it sends the coordinates and size to the operating system many times each second, often around 60 to 240 times, depending on the device. The operating system turns these streams of points into events. A short touch in one place is a tap. A touch that stays in place is a long press. A touch that moves is a drag or swipe. The app receives these events and responds, such as by scrolling a page or opening a link.
The delay between your finger moving and the display updating is called latency. Manufacturers work to minimize it, because a screen that follows a finger closely feels more responsive.
Why gloves and fingernails may not work
Ordinary gloves insulate your finger, so the electric field is not disturbed enough to register. Special gloves have conductive threads woven into the fingertips. Some screens can be set to higher sensitivity so that thin gloves work. A stylus designed for capacitive screens has a conductive tip, and some active styluses contain electronics that communicate directly with the screen, which can allow finer detail and sensing of pressure.
Screen protectors and thickness
A thin screen protector usually leaves the field strong enough for the screen to work, though very thick or poorly fitted protectors can reduce sensitivity. The cover glass itself is a compromise between being thin enough for the field to pass through and strong enough to resist scratches and cracks.
Beyond phones
The same principle is used in laptop trackpads, car dashboards, kiosks and many appliances. Touch interfaces are also important in assistive technology, since gestures and larger on-screen controls can help some people who find physical buttons difficult, although for others a touch-only design creates barriers, so designers often provide alternatives such as voice control or physical buttons.
Key points
A capacitive touchscreen is a transparent grid of electrodes under the glass. A fingertip changes the electric field at nearby crossings, a controller measures those changes many times a second, and software converts the map of changes into taps, swipes and pinches. Because it senses conduction, not pressure, light touches work but most gloves do not.