A sensor faucet has three systems that can fail independently: power, sensing and the valve that actually opens. Working through them in that order finds the fault quickly, and most repairs are a part rather than a fixture.
Power first
Battery models are the most common source of "the faucet stopped working" calls. Batteries sit in a box under the sink or in a housing near the spout, and a low battery often shows as a blinking indicator or as a unit that triggers intermittently before it stops entirely.
Mains-powered units have a transformer or an adapter, and the failure points are the supply, the connector and the control module. Before replacing anything, confirm the unit has power at the point the manufacturer specifies. A sensor faucet with no power is not a failed sensor, and treating it as one wastes a part.
Sensing second
The sensor window sits behind a lens that collects soap film, hard-water spots and cleaning residue. A dirty lens scatters the infrared beam and the unit either ignores hands or triggers at nothing. Cleaning with a soft cloth and a mild solution is the first step; abrasive cleaners and scratching damage the lens permanently.
Reflections cause false triggers. A shiny sink bottom, a stainless backsplash or an object left in the basin can bounce the beam back and hold the valve open. If the faucet runs continuously only in certain conditions, look at what changed in the basin before looking at the electronics.
The solenoid and the water path
When the unit clicks but nothing comes out, the electrical signal is working and the valve is not. The solenoid opens the water path, and its diaphragm can be held shut by debris or fail with age. Many models have a small inlet filter or strainer ahead of it, and a clogged filter produces weak or absent flow even with a healthy solenoid.
The aerator at the spout is the other restriction. A sensor faucet with good pressure at the supply and a weak stream at the spout is usually a clogged aerator or filter, not a failing valve.
Calibration and adjustment
Some sensor faucets have a detection range or a mode adjustment, set by a button, a remote or a sequence at the sensor. If the unit triggers from too far away or only from very close, the setting may have changed rather than the hardware failed. The manufacturer's instructions define the sequence, and guessing at it can leave the unit in an unusable mode.
Repair or replace
Most commercial sensor faucets are designed to be serviced: power module, sensor, solenoid, filter and aerator are separate parts. Replacement becomes the better answer when the control module is obsolete and unavailable, when the body is damaged, or when the unit is a sealed domestic model with no serviceable parts.
On the call, say whether the unit is battery or mains powered, whether it clicks, and whether the flow is weak or absent when it does trigger. Those three answers usually identify the part before anyone arrives.