A capsule type medical device, including: a capsule shaped casing which can be ingested to within the living body an electrical stimulation device which comprises a plurality of electrodes which are used for applying electrical stimuli to living body tissue an electrode selection device which selects an electrode from among the plurality of electrodes, to apply an electrical stimulus a contact detection device which electrically detects the electrode which is in contact with the living body tissue and a control section which controls the various devices.