A vibrating device comprising: a dome-like cover disposed so as to include a detection field of an optical detector element; a cylinder-like vibrating body to which the cover is fixed; and a piezoelectric element that is fixed to the vibrating body and vibrates the cover via the vibrating body, wherein the vibrating body includes a cylinder portion having a first end portion positioned near the cover and a second end portion positioned opposite to the cover, a cylinder-like first connection portion that is connected to the first end portion of the cylinder portion and formed as a cylinder having an inside diameter larger than that of the cylinder portion, a first ring-like portion that is connected to the first connection portion at a position near the cover and has an inside diameter smaller than that of the first connection portion, the cover being connected to a surface of the first ring-like portion that is proximate to the cover, a second connection portion that is connected to the second end portion of the cylinder portion and formed as a cylinder having an outside diameter smaller than that of the cylinder portion, and a second ring-like portion that is fixed to a surface of the second connection portion that is opposite to a surface to which the cylinder portion is connected and that has an outside diameter larger than that of the second connection portion, and the piezoelectric element is fixed to a surface of the second ring-like portion that is opposite to the surface fixed to the second connection portion. a dome-like cover disposed so as to include a detection field of an optical detector element; a cylinder-like vibrating body to which the cover is fixed; and a piezoelectric element that is fixed to the vibrating body and vibrates the cover via the vibrating body, wherein the vibrating body includes a cylinder portion having a first end portion positioned near the cover and a second end portion positioned opposite to the cover, a cylinder-like first connection portion that is connected to the first end portion of the cylinder portion and formed as a cylinder having an inside diameter larger than that of the cylinder portion, a first ring-like portion that is connected to the first connection portion at a position near the cover and has an inside diameter smaller than that of the first connection portion, the cover being connected to a surface of the first ring-like portion that is proximate to the cover, a second connection portion that is connected to the second end portion of the cylinder portion and formed as a cylinder having an outside diameter smaller than that of the cylinder portion, and a second ring-like portion that is fixed to a surface of the second connection portion that is opposite to a surface to which the cylinder portion is connected and that has an outside diameter larger than that of the second connection portion, and a cylinder portion having a first end portion positioned near the cover and a second end portion positioned opposite to the cover, a cylinder-like first connection portion that is connected to the first end portion of the cylinder portion and formed as a cylinder having an inside diameter larger than that of the cylinder portion, a first ring-like portion that is connected to the first connection portion at a position near the cover and has an inside diameter smaller than that of the first connection portion, the cover being connected to a surface of the first ring-like portion that is proximate to the cover, a second connection portion that is connected to the second end portion of the cylinder portion and formed as a cylinder having an outside diameter smaller than that of the cylinder portion, and a second ring-like portion that is fixed to a surface of the second connection portion that is opposite to a surface to which the cylinder portion is connected and that has an outside diameter larger than that of the second connection portion, and the piezoelectric element is fixed to a surface of the second ring-like portion that is opposite to the surface fixed to the second connection portion.