Cadmium sulfide (CdS) thin films were deposited onto soda lime glasses and p-Si semiconductors at various substrate temperatures (40, 150 and 275 °C) by radio frequency (RF) sputtering technique. The effect of substrate temperature on morphological, structural and optical properties of CdS thin films were analyzed by means of atomic force microscopy (AFM), x-ray diffraction (XRD) and uv–vis spectrum data. The results showed that the average roughness (Ra) of thin films increased from 2.0 to 4.0 nm and all films had hexagonal wurtzite structure. The optical band gaps of CdS thin films varied between 2.46–2.43 eV. Characteristic parameters of CdS/p-Si heterojunctions including ideality factor, barrier height, series resistance and rectification ratio were measured. It was seen that both ideality factor and barrier height values of the heterojunctions increase with the increase substrate temperature. It was attributed to increase in inhomogenity of the thin films. Furthermore, the photoelectrical parameters of CdS/p-Si heterojunctions were studied.