This paper presents a compact fiber-optic sensor based on a fiber Bragg grating (FBG), partially bonded with thick polyimide (PI) films, for the simultaneous measurement of humidity and temperature. Half of the grating was attached to the PI film, while the rest of the grating remained bare. When the sensor was exposed to humidity and temperature changes, a significant non-uniform stress distribution was introduced along the entire grating. The chirp effect occurs, which causes the main peak of the spectrum to split into different peaks. Depending on the wavelength shift of these different peaks, simultaneous measurement of temperature and humidity could be achieved by solving a matrix equation. This is the first time that such a thick PI film-based FBG sensor has been used for humidity and temperature monitoring. The benefit of the approach is that the sub-millimeter thickness of the PI film is at least one order of magnitude greater than that of the traditional PI coating used in such sensors. The proposed sensing structure with PI films enhances the sensor response to both humidity and temperature significantly. The humidity and temperature sensitivity are achieved as 13.70 pm/%RH and 19.12 pm/°C , respectively, in the experiment.