According to a preferred embodiment of the third aspect of the present invention, the semiconductor chip is a light emitting element or a light receiving element, and the upper surface of the resin package is provided with a convex lens portion at a location corresponding to the semiconductor chip.