A diffractometer is a measuring instrument for analyzing the structure of a material from the scattering pattern produced when a beam of radiation or particles (such as X-rays or neutrons) interacts with it.
A typical diffractometer consists of a source of radiation, a monochromator to choose the wavelength, slits to adjust the shape of the beam, a sample and a detector.
Plenty of companies manufacture "all in one" equipment for X-ray home laboratory, such as Rigaku, Malvern Panalytical, Thermo Fisher Scientific, Bruker, and many others.
X-ray diffractometer instruments can be used for a variety of purposes including imaging crystal structures, phase determination, and identifying unfamiliar substances for use in crystallography, inspection, and pharmaceutical research for drug efficacy.
[2] A novel use of x-ray diffraction involves studying the surface of Mars to determine if it ever supported life.