Porous silicon is known to be sensitive to moisture. Using an aluminium-porous p+ silicon junction, we have realized a sensor which dc current increases up to two orders of magnitude in the presence of ammoniac. We have tested a series of various gases and we show that if the dipole moment of the molecule is zero, there is no effect on the dc current. To interpret quantitatively this phenomenon, we assume that the conductivity is governed by the width of a channel resulting from the partial depletion of silicon located between two pores. This depleted region is due to the charges trapped on surface states associated with the Si-SiO2 interface where SiO2 is the native silicon oxide. When some gas is adsorbed, we propose there is a passivation of the interface states (mainly dangling bonds), leading to a decrease of the depleted region, i.e. an increase of the width of the channel and thus an increase of the current. The adsorbed gas gives a dipole layer at the surface of the pore. This layer has no influence on the depleted region. It stabilizes electrons or holes at the porous Si surface, allowing a stable charge state of the dangling bonds.