The response of two different types of nanostructured gas sensor to oxygen has been investigated. The first (optical) is based on the photoluminescence quenching effect of a porous silicon sample, the second on the changes of the electrical conductance v. environment of a porous silicon free standing membrane on an insulating neutral substrate. The response of both the devices to oxygen have been measured and compared. The optical based gas sensor exhibits a quenching following the Stern - Volmer model. The corresponding reactivity rate constant is found to depend on a characteristic nanodimension of the wire. The electrically operated sensor is more sensitive to oxygen and shows an opposite behavior if exposed to a reducing environment.