A process of building an optical sensor for analysis of a target sample gas analyte comprising an optopair, the optopair comprising at least one radiation source and at least one radiation detector respectively having emission and responsivity spectra, wherein the at least one radiation source is an LED and the at least one radiation detector is a photodiode, said optopair being able to compensate for the effect of temperature variation on its signal, the process comprising the following steps: a. identifying the target sample gas analyte; b. establishing the wavelengths that define the shortest, longest, and maximum spectral peak wavelengths of the target sample gas analyte absorption band; c. using the shortest, longest and maximum spectral peak wavelengths to determine the material systems for the LED and the photodiode respectively; d. determining the spectral characteristics of the LED and photodiode materials and the temperature dependencies of said spectral characteristics; e. identifying a peak frequency ω 0 E for the LED emission spectrum and a peak frequency ω 0 R for the photodiode responsivity spectrum by: minimising the temperature dependence of the optopair signal as characterised by the parameter K in the equation: K ≡ S max T S min T − 1 in which T is temperature and S max and S min are absolute maximum and minimum values of S in the temperature range of interest for use of the optopair, and where S is the optopair signal being expressed mathematically by the following function S T ∼ ∫ − ∞ ∞ E T ω R T ω F ω dω in which E ( T,ω) is the normalised LED spectrum, R ( T, ω) is the normalized photodiode responsivity spectrum and F ( ω) is the spectral transmission function of any band pass filter comprised within the optopair; wherein E(T,ω) is modelled based on the data on the LED spectrum and its temperature dependence obtained in step (d); and wherein R ( T, ω) is modelled based on the data on the photodiode spectrum and its temperature dependence obtained in step (d); wherein the result of the minimization process are the identified peak frequencies ω 0 E and ω 0 R which determine designs for the LED and photodiode of the optopair respectively, by their relation to the LED active region composition and the photodiode absorber composition; and f. finalizing the optopair design and fabricating same. a. identifying the target sample gas analyte; b. establishing the wavelengths that define the shortest, longest, and maximum spectral peak wavelengths of the target sample gas analyte absorption band; c. using the shortest, longest and maximum spectral peak wavelengths to determine the material systems for the LED and the photodiode respectively; d. determining the spectral characteristics of the LED and photodiode materials and the temperature dependencies of said spectral characteristics; e. identifying a peak frequency ω 0 E for the LED emission spectrum and a peak frequency ω 0 R for the photodiode responsivity spectrum by: minimising the temperature dependence of the optopair signal as characterised by the parameter K in the equation: K ≡ S max T S min T − 1 in which T is temperature and S max and S min are absolute maximum and minimum values of S in the temperature range of interest for use of the optopair, and where S is the optopair signal being expressed mathematically by the following function S T ∼ ∫ − ∞ ∞ E T ω R T ω F ω dω in which E ( T,ω) is the normalised LED spectrum, R ( T, ω) is the normalized photodiode responsivity spectrum and F ( ω) is the spectral transmission function of any band pass filter comprised within the optopair; wherein E(T,ω) is modelled based on the data on the LED spectrum and its temperature dependence obtained in step (d); and wherein R ( T, ω) is modelled based on the data on the photodiode spectrum and its temperature dependence obtained in step (d); wherein the result of the minimization process are the identified peak frequencies ω 0 E and ω 0 R which determine designs for the LED and photodiode of the optopair respectively, by their relation to the LED active region composition and the photodiode absorber composition; and minimising the temperature dependence of the optopair signal as characterised by the parameter K in the equation: K ≡ S max T S min T − 1 in which T is temperature and S max and S min are absolute maximum and minimum values of S in the temperature range of interest for use of the optopair, and where S is the optopair signal being expressed mathematically by the following function S T ∼ ∫ − ∞ ∞ E T ω R T ω F ω dω in which E ( T,ω) is the normalised LED spectrum, R ( T, ω) is the normalized photodiode responsivity spectrum and F ( ω) is the spectral transmission function of any band pass filter comprised within the optopair; wherein E(T,ω) is modelled based on the data on the LED spectrum and its temperature dependence obtained in step (d); and wherein R ( T, ω) is modelled based on the data on the photodiode spectrum and its temperature dependence obtained in step (d); wherein the result of the minimization process are the identified peak frequencies ω 0 E and ω 0 R which determine designs for the LED and photodiode of the optopair respectively, by their relation to the LED active region composition and the photodiode absorber composition; and f. finalizing the optopair design and fabricating same.