Thermal runaway of lithium batteries is a matter of great concern to relevant scholars. The gas pressure during the charge and discharge control process of lithium batteries is directly related to the performance of lithium batteries. Relevant scholars have been pursuing a method that can safely monitor the internal gas pressure of lithium batteries. Based on the characteristics of optical fiber sensors such as small size, anti-electromagnetic interference, and intrinsic safety, this paper designs and prepares an optical fiber gas sensor that can be used to measure the internal gas of lithium batteries. The measurement range of the sensor is 0-240kPa, and the resolution of the sensor is 0.5kPa, the sensor's accuracy reaches 5kPa, which can be used as a feasible detection method for gas generated during the working process of lithium batteries.