We present a microspectrometer based on a tunable interference filter for infrared or visible light that scans the desired part of the spectrum within milliseconds. A single pixel detector measures serially the intensity at selected wavelengths. This concept avoids expensive linear detectors as used for grating spectrometers. The tunable filter is fabricated by a new porous silicon technology using only two photolithography steps. A Bragg mirror or a Fabry-Perot bandpass filter for transmission wavelengths between 400 nm and 8 mum at normal incidence is created by modulations of the refractive index in the filter plate. Two thermal bimorph micro-actuators tilt the plate by up to 90degrees, changing the incidence angle of the beam to be analyzed. This tunes the wavelength transmitted to the detector by a factor of 1.16. The filter area can be chosen between 0.27 x 0.70 mm(2) and 2.50 x 3.00 mm(2), the filter thickness is typically 30 mum. The spectral resolution of Deltalambda/lambda = 1/25 is sufficient for most sensor applications, e.g., measurement Of CO2 and CO in combustion processes by their IR absorption bands as will be presented.