We have constructed a compact room-temperature mid-infrared spectrometer and gas sensor, based on quasi-phase matched difference-frequency generation in periodically poled ferroelectric crystals of the KTiOPO 4 family, namely: KTiOPO 4 , KTiOAsO 4 and RbTiOAsO 4 . The wide tunabilty of the spectrometer (3.1-3.75 mm) enables us to cover an entire vibrational band of gases such as methane and nitrous oxide. The high spectral resolution (B1 MHz) is used to investigate the spectral profile of the hyperfine components of a single rotational transition. The sensitivity of the described spectrometer is B75 parts per million. Applications of this technology include the detection of polluting or toxic gases, biomedical sensing, atmospheric research, volcanic monitoring and industrial process control. r