A thermal flow sensor comprising: a semiconductor substrate; a cavity portion provided in the semiconductor substrate; a dielectric film provided on the semiconductor substrate so as to cover the cavity portion; a thin layer area formed as a result of the dielectric film covering the cavity portion; a heating resistor provided in the thin layer area on the dielectric film; a first temperature-sensitive resistor provided in the thin layer area on the dielectric film, a resistance value of the first temperature-sensitive resistor varying depending upon temperature; a heating controller that controls temperature of the heating resistor on the basis of temperature of the first temperature-sensitive resistor; a second temperature-sensitive resistor provided near the heating resistor, a resistance value of the second temperature-sensitive resistor varying depending upon temperature; and a flow rate detector that detects a flow rate of a fluid on the basis of temperature of the second temperature-sensitive resistor; characterized in that the heating controller controls the temperature of the heating resistor on the basis of a first reference temperature, which is a target temperature of the first temperature-sensitive resistor, and a second reference temperature, which is a temperature of the first temperature-sensitive resistor set at a temperature higher than the first reference temperature; wherein the heating controller comprises: a first temperature controller that brings a temperature of the first temperature-sensitive resistor close to the first reference temperature; and a second temperature controller that holds temperature of the first temperature-sensitive resistor at a temperature equal to or lower than the second reference temperature; and wherein the second temperature controller comprises a determining unit that receives signals based on the temperature of the first temperature-sensitive resistor and determines whether or not the temperature of the first temperature-sensitive resistor is equal to or greater than the second reference temperature; and the second temperature controller comprises a limit unit that limits either power to be supplied to the heating resistor or a power indication value on the basis of a temperature difference between a temperature of the first temperature-sensitive resistor and the second reference temperature. a semiconductor substrate; a cavity portion provided in the semiconductor substrate; a dielectric film provided on the semiconductor substrate so as to cover the cavity portion; a thin layer area formed as a result of the dielectric film covering the cavity portion; a heating resistor provided in the thin layer area on the dielectric film; a first temperature-sensitive resistor provided in the thin layer area on the dielectric film, a resistance value of the first temperature-sensitive resistor varying depending upon temperature; a heating controller that controls temperature of the heating resistor on the basis of temperature of the first temperature-sensitive resistor; a second temperature-sensitive resistor provided near the heating resistor, a resistance value of the second temperature-sensitive resistor varying depending upon temperature; and a flow rate detector that detects a flow rate of a fluid on the basis of temperature of the second temperature-sensitive resistor; characterized in that the heating controller controls the temperature of the heating resistor on the basis of a first reference temperature, which is a target temperature of the first temperature-sensitive resistor, and a second reference temperature, which is a temperature of the first temperature-sensitive resistor set at a temperature higher than the first reference temperature; wherein the heating controller comprises: a first temperature controller that brings a temperature of the first temperature-sensitive resistor close to the first reference temperature; and a second temperature controller that holds temperature of the first temperature-sensitive resistor at a temperature equal to or lower than the second reference temperature; and wherein the second temperature controller comprises a determining unit that receives signals based on the temperature of the first temperature-sensitive resistor and determines whether or not the temperature of the first temperature-sensitive resistor is equal to or greater than the second reference temperature; and the second temperature controller comprises a limit unit that limits either power to be supplied to the heating resistor or a power indication value on the basis of a temperature difference between a temperature of the first temperature-sensitive resistor and the second reference temperature. a first temperature controller that brings a temperature of the first temperature-sensitive resistor close to the first reference temperature; and a second temperature controller that holds temperature of the first temperature-sensitive resistor at a temperature equal to or lower than the second reference temperature; and wherein the second temperature controller comprises a determining unit that receives signals based on the temperature of the first temperature-sensitive resistor and determines whether or not the temperature of the first temperature-sensitive resistor is equal to or greater than the second reference temperature; and the second temperature controller comprises a limit unit that limits either power to be supplied to the heating resistor or a power indication value on the basis of a temperature difference between a temperature of the first temperature-sensitive resistor and the second reference temperature.