Abstract A p-ZnO/n-Si thin film heterojunction is fabricated on an n-type Si substrate by pulsed laser deposition (PLD). The crystallinity of the junction materials and surface morphology are examined by an X-ray diffractometer (XRD), scanning electron microscope (SEM) and cross-sectional transmission electron microscope (TEM). The current–voltage ( I– V) characteristics of the p–n heterostructure show nonlinear diode like behavior. Zinc oxide doped with urea as nitrogen source shows p-type conductivity, which is further confirmed by its moisture sensing ability. The moisture sensitivity of the heterostructure shows the increase of resistance due to decrease of hole concentration and thus reveals the p-type conductivity of nitrogen doped ZnO film. Nitrogen doped p-ZnO/n-Si thin film heterojunction shows almost linear variation of resistance with relative humidity (RH) in the range 30–97% with a response and recovery time of 12 s and 36 s respectively at normal atmospheric temperature and pressure.