Electrical and optical characterization has been performed on several superconducting single photon detectors (SSPDs) consisting of meanders made of ultrathin NbN films. The NbN films, with thickness ranging from 150 nm to 3 nm, were deposited by dc magnetron sputtering on MgO substrates kept at temperature T = 400C. This deposition process carried out at low temperature opens the way of monolithic integration with other photonic devices. The superconducting properties of NbN films and the critical design parameters that affect the quantum efficiency (QE) have been optimized. In particular, by measuring the switching current distribution of each stripe of the meander the process uniformity has been studied. Optical measurements on the fabricated SSPDs showed a QE approximate to 20% at 4.2 K for photons with a wavelength of 1300 nm.