Electrical conductivity of porous silicon fabricated from heavily doped p-type silicon is very sensitive to NO2, even at concentrations below 100 ppb. However, sensitivity depends strongly on the porous microstructure. The structural difference between sensitive and insensitive samples is independently confirmed by microscopy images and by light scattering behavior. A way to change the structure is by modifying the composition of the electrochemical solution. We have found that best results are achieved using ethanoic solutions with HF concentration levels between 12% and 13%.