Combustion

Hydrocarbons are compounds that contain only carbon and hydrogen.  Methane (CH4) is an example of a hydrocarbon.  Combustion of hydrocarbons is used to heat our homes because hydrocarbons are readily available, and energy is released in the reaction of hydrocarbons with oxygen.

Combustion of hydrocarbons gives rise to water (H2O) and a carbon-containing product that varies with the amount of oxygen available.

Formation of soot (C) requires two oxygen atoms per CH4 molecule.

CH4(g) + O2(g)  C(s) + 2H2O(g)
Soot is one of the possible carbon-containing products of incomplete combustion of methane (or other hydrocarbons).

Formation of carbon monoxide (CO) requires three oxygen atoms per CH4 molecule.

2CH4(g) + 3O2(g)  2CO(g) + 4H2O(g)
CO is the other possible carbon-containing product of incomplete combustion of methane (or other hydrocarbons).

Formation of carbon dioxide (CO2) requires four oxygen atoms per CH4.

CH4(g) + 2O2(g)  CO2(g) + 2H2O(g)
Complete combustion of methane (or other hydrocarbons) gives CO2.

 In practice incomplete combustion generally gives either CO or a mixture of CO and soot (elemental carbon). 

The image shows (from left to right) the effect on the flame of a bunsen burner of increasing the amount of oxygen available to mix with the natural gas.   In number 4 sufficient oxygen is available for complete combustion of the natural gas.