The present invention concerns a digital sensor for monitoring the wear of lining material of a disc brake. The sensor is to be attached to the end of an adjusting shaft of an adjusting mechanism, which mechanism is used for adjusting the position of brake pads in relation to the brake disc. The sensor has two or more code parts of which one is rotated continuously by rotation of the adjustment shaft. The code parts have paths of codes to be read by detectors placed on a PCB. The PCB has circuitry to relate the position of the sensor to the wear of the lining material.