A gastroscope has an insertion tube with a distal end, at which a sensor is located. The sensor has a first electrode produced of an acid-resistant noble metal, and a second electrode produced of silver. An electrical voltage is applied between the first and second electrodes, and a change in an electrical variable is measured between the first and second electrodes, when ammonia is present. The gastroscope allows screening of gastric acid and the tissue of the stomach lining for Helicobacter pylori in a manner that is gentle for the patient.