A microelectromechanical sensor includes a base, a heater provided on the base, and a sensing electrode including a sensing portion. The heater includes a heating portion. The heater and the sensing electrode are provided at different layers in a stacking direction, and the sensing electrode is electrically insulated from the heater. On a reference plane in the stacking direction, a projection of the sensing portion of the sensing electrode is entirely covered by a projection of the heating portion of the heater.