A housing watertight mechanism includes, a case member, a lid member configured to be fixed to the case member, an annular elastic member interposed between a first edge portion and a second edge portion, and compressed in an attaching and detaching direction to fill a space between the first edge portion and the second edge portion when the lid member is fixed to the case member, a first portion formed in the elastic member, and a second portion formed in the elastic member, disposed on a side on which the space between the first edge portion and the second edge portion is broadened when the elastic member is compressed in the attaching and detaching direction, and having a larger size in the attaching and detaching direction than a size of the first portion in the attaching and detaching direction.