The compressed gas pressure type powder foam viscosity sensor is designed. The gas flows from top to bottom. The sensor is set at the gas flow area, but when particles or dust pass through the gas, it will form aggregation in the powder blocking area, but when it gathers in the diffuse area, it will affect the light source received by the constant power receiving sensor, and then affect the output of electrical signal.