An ultrasonic sensor comprising: a vibration plate including a first surface and a second surface; a piezoelectric element provided on the first surface of the vibration plate, the piezoelectric element including a first electrode, a piezoelectric material layer, and a second electrode; a substrate attached to the second surface of the vibration plate, the substrate including an opening section at a position facing the piezoelectric element; and an acoustic matching layer provided in a space formed by the opening section and the second surface of the vibration plate, to propagate an ultrasonic wave generated by driving the piezoelectric element, wherein an air layer is provided in a region around the piezoelectric element, characterized in that: the substrate includes a first wall surface that is provided in parallel to the second surface of the vibration plate and is joined with the second surface, and a second wall surface (11ya, 11yb) partitioning the opening section, the second wall surface includes a vertical wall perpendicular to the first wall surface and an inclined wall that is provided between the first wall surface and the vertical wall and is inclined to the first wall surface and the vertical wall, and an angle (θ) formed by the inclined wall and the second surface of the vibration plate is greater than 90 degrees such that the cross-sectional area of the opening section increases towards the vibration plate side. a vibration plate including a first surface and a second surface; a piezoelectric element provided on the first surface of the vibration plate, the piezoelectric element including a first electrode, a piezoelectric material layer, and a second electrode; a substrate attached to the second surface of the vibration plate, the substrate including an opening section at a position facing the piezoelectric element; and an acoustic matching layer provided in a space formed by the opening section and the second surface of the vibration plate, to propagate an ultrasonic wave generated by driving the piezoelectric element, wherein an air layer is provided in a region around the piezoelectric element, characterized in that: the substrate includes a first wall surface that is provided in parallel to the second surface of the vibration plate and is joined with the second surface, and a second wall surface (11ya, 11yb) partitioning the opening section, the second wall surface includes a vertical wall perpendicular to the first wall surface and an inclined wall that is provided between the first wall surface and the vertical wall and is inclined to the first wall surface and the vertical wall, and an angle (θ) formed by the inclined wall and the second surface of the vibration plate is greater than 90 degrees such that the cross-sectional area of the opening section increases towards the vibration plate side. the substrate includes a first wall surface that is provided in parallel to the second surface of the vibration plate and is joined with the second surface, and a second wall surface (11ya, 11yb) partitioning the opening section, the second wall surface includes a vertical wall perpendicular to the first wall surface and an inclined wall that is provided between the first wall surface and the vertical wall and is inclined to the first wall surface and the vertical wall, and an angle (θ) formed by the inclined wall and the second surface of the vibration plate is greater than 90 degrees such that the cross-sectional area of the opening section increases towards the vibration plate side.