A biosensor includes light emitting elements and a light receiving element disposed on a principal surface of a wiring board a light shielding portion disposed between a light-emitting-element sealing portion and a light-receiving-element sealing portion a base medium having light transmitting properties, disposed in parallel with the wiring board with the light shielding portion therebetween an adhesion layer having light transmitting properties, configured to bond the base medium with the light-emitting-element sealing portion, the light-receiving-element sealing portion, and the light shielding portion and a first electrocardiograph electrode attached to a principal surface of the base medium. The refractive index of the base medium is set to be higher than that of the adhesion layer, and a surface of the first electrocardiograph electrode which is adjacent to the base medium is roughened so that stray light passing through the base medium will be scattered.