Context. Observations of transitions to the ground-state of a molecule are essential to obtain a complete picture of its excitation and chemistry in the interstellar medium, especially in diffuse and/or cold environments. For the important interstellar molecules H 2 O and NH 3 , these ground-state transitions are heavily absorbed by the terrestrial atmosphere, hence not observable from the ground. Aims. We attempt to understand the chemistry of nitrogen, oxygen, and their important molecular forms, NH 3 and H 2 O in the interstellar medium of the Galaxy. Methods. We have used the Odin submillimetre-wave satellite telescope to observe the ground state transitions of ortho-ammonia and ortho-water, including their 15 N, 18 O, and 17 O isotopologues, towards Sgr B2. The extensive simultaneous velocity coverage of the observations, >500 km s −1 , ensures that we can probe the conditions of both the warm, dense gas of the molecular cloud Sgr B2 near the Galactic centre, and the more diffuse gas in the Galactic disk clouds along the line-of-sight.Results. We present ground-state NH 3 absorption in seven distinct velocity features along the line-of-sight towards Sgr B2. We find a nearly linear correlation between the column densities of NH 3 and CS, and a square-root relation to N 2 H + . The ammonia abundance in these diffuse Galactic disk clouds is estimated to be about 0.5-1 × 10 −8 , similar to that observed for diffuse clouds in the outer Galaxy. On the basis of the detection of H 18 2 O absorption in the 3 kpc arm, and the absence of such a feature in the H 17 2 O spectrum, we conclude that the water abundance is around 10 −7 , compared to ∼10 −8 for NH 3 . The Sgr B2 molecular cloud itself is seen in absorption in NH 3 , 15 NH 3 , H 2 O, H 18 2 O, and H 17 2 O, with emission superimposed on the absorption in the main isotopologues. The non-LTE excitation of NH 3 in the environment of Sgr B2 can be explained without invoking an unusually hot (500 K) molecular layer. A hot layer is similarly not required to explain the line profiles of the 1 1,0 ←1 0,1 transition from H 2 O and its isotopologues. The relatively weak 15 NH 3 absorption in the Sgr B2 molecular cloud indicates a high [ 14 N/ 15 N] isotopic ratio >600. The abundance ratio of H 18 2 O and H 17 2 O is found to be relatively low, 2.5-3. These results together indicate that the dominant nucleosynthesis process in the Galactic centre is CNO hydrogen burning.