optical sensor may vary for example including two infrared light emitting diodes 22 23 with slightly differing wavelengths e g 1300 cm 1 and 1425 cm 1 each separately driven by drivers 24 25 these wavelengths correspond to a peak absorption and adjacent low absorption region for hydrocarbons the output of the photodiode detector 26 is converted into a differential signal by circuit 27 in the manner of a correlated double sampling circuit by amplifier 28 and processed as in the system described with respect to fig1 e g by an analog to digital converter 10 fig3 shows yet another embodiment of an optical sensor in this case a fabry perot grating 30 on the surface of a 1425 cm 1 laser diode 31 which is coated with a material which selectively absorbs hydrocarbons 32 the presence of the concentrated hydrocarbons 33 in this surface layer 32 reduces the reflection efficiency of the reflection grating 30 and thus increases the lasing threshold of the laser diode 31 this threshold is measured by a dynamic analysis of the startup transient fig4 shows a schematic diagram of a microcontroller based system 40 which provides functionality and safety features for a barbecue or grill the system provides a combustible gas sensor system 43 and a carbon monoxide sensor system 41 which detect potentially hazardous levels of these gases as described above in the event of hazardous levels an audible and or visual alarm 51 is generated under control of the microcontroller based system 40 a flame out detector 42 is also provided which may also be used to generate an audible and or visual alarm 51 or alternately used to trigger a relight of the flame by.