In the present work, the effect of palladium layers thickness and porous structure of silicon on the hydrogen gas sensor was studied. Hence, simultaneous Pd/CHx/PS/Si and Pd/Si structures have been used as a sensing material to detect H2 gas. Comparison with previous study on CHx/PS/Si structure allows to understanding the effect of pores in silicon material and the contribution of palladium in detection of the hydrogen. Current-voltage and capacitance-voltage characterizations show that the porous silicon structure (Pd/CHx/PS/Si) has higher sensitivity toward H2 gas than that exhibited by silicon sensor despite the presence of palladium (Pd/Si) in both structures. On the other hand, our experiments show that the presence of Pd metal decreases the dynamic response which increases the sensitivity of the sensor. This result conducts, us to optimize the thickness of deposited Pd layer, therefore different Pd layer thickness ranging from [10 nm to 50 nm] was studied. The feature of the best optimized Pd layer deposited on the surface has been characterized by scanning electron microscopy (SEM). Finally it appears that both the catalytic property of Pd metal and the presence of pores were found to strongly influence the sensor response in terms of hydrogen sensitivity and response time.