Modern spectroscopes , such as monochromators , generally use a diffraction grating , a movable slit , and some kind of photodetector , all automated and controlled by a computer . Modern spectroscopes generally use a diffraction grating , a movable slit , and some kind of photodetector , all automated and controlled by a computer .