A method of manufacturing a photo interrupter, comprising:
- forming a frame including a first frame part and a second frame part that are disposed at an interval to be facing each other, a connecting part integrally connecting the first frame part and the second frame part,
- the frame further comprising a positioning member including at least one positioning pin integrally provided with the connecting part, the at least one positioning pin being configured to be fitted in at least one engaging hole provided in an external motherboard;
- mounting at least one light-emitting element on a first board and attaching the first board to the first frame part of the frame;
- mounting a light-receiving element on a second board and attaching the second board to the second frame part of the frame, the light-receiving element being mounted on the second board to be facing the light-emitting element.