A sensor device for welding, comprising: a sensor unit including at least a detection unit configured to detect a detection light beam generated by a projection device, and reflected from surfaces of workpieces to be welded together, the sensor unit using data obtained from the detection light beam at the detection unit, being configured to measure states of the workpieces or a distance to the workpieces using the detection light beam detected with the detection unit, wherein the states of the workpieces include the shapes of the workpieces before or after they are welded together, the molten state of a welded portion, which has been melted, formed on the workpieces, and/or the shape of the welded portion; a case body adapted to house the sensor unit, the case body having formed therein at least one pass-through portion (36a, 36b) that passes the detection light beam directed toward the detection unit; and a protective cover including a protective plate that transmits the detection light beam, the protective cover being attached to the case body such that the protective plate covers the pass-through portion, being characterised in that: the protective cover has formed therein a gas flow channel that passes a gas to be blown to the protective plate, the gas flow channel having formed therein an outlet port that passes the detection light beam and discharges a gas having flowed through the gas flow channel, the gas flow channel has formed therein an accumulator between the protective cover and the case body, the accumulator being adapted to have accumulated therein a gas flowing through the gas flow channel, and the accumulator has formed therein vent holes through which gases are allowed to flow out toward the outlet port, wherein the vent holes are slits, and wherein a wall face of the gas flow channel on the side of the workpieces that faces the slits has formed therein guide grooves that in use guide gases having flowed out through the slits toward the protective plate. a sensor unit including at least a detection unit configured to detect a detection light beam generated by a projection device, and reflected from surfaces of workpieces to be welded together, the sensor unit using data obtained from the detection light beam at the detection unit, being configured to measure states of the workpieces or a distance to the workpieces using the detection light beam detected with the detection unit, wherein the states of the workpieces include the shapes of the workpieces before or after they are welded together, the molten state of a welded portion, which has been melted, formed on the workpieces, and/or the shape of the welded portion; a case body adapted to house the sensor unit, the case body having formed therein at least one pass-through portion (36a, 36b) that passes the detection light beam directed toward the detection unit; and a protective cover including a protective plate that transmits the detection light beam, the protective cover being attached to the case body such that the protective plate covers the pass-through portion, being characterised in that: the protective cover has formed therein a gas flow channel that passes a gas to be blown to the protective plate, the gas flow channel having formed therein an outlet port that passes the detection light beam and discharges a gas having flowed through the gas flow channel, the gas flow channel has formed therein an accumulator between the protective cover and the case body, the accumulator being adapted to have accumulated therein a gas flowing through the gas flow channel, and the accumulator has formed therein vent holes through which gases are allowed to flow out toward the outlet port, wherein the vent holes are slits, and wherein a wall face of the gas flow channel on the side of the workpieces that faces the slits has formed therein guide grooves that in use guide gases having flowed out through the slits toward the protective plate. the protective cover has formed therein a gas flow channel that passes a gas to be blown to the protective plate, the gas flow channel having formed therein an outlet port that passes the detection light beam and discharges a gas having flowed through the gas flow channel, the gas flow channel has formed therein an accumulator between the protective cover and the case body, the accumulator being adapted to have accumulated therein a gas flowing through the gas flow channel, and the accumulator has formed therein vent holes through which gases are allowed to flow out toward the outlet port, wherein the vent holes are slits, and wherein a wall face of the gas flow channel on the side of the workpieces that faces the slits has formed therein guide grooves that in use guide gases having flowed out through the slits toward the protective plate.