Spacer resin pattern layer which precisely aligns a light-emitting element or a light-receiving element relative to both a waveguide pattern layer and electrical circuit pattern layer from the semiconductor wafer level. The cartridge type sensor includes a cartridge having the same shape as that of each recording medium stored in a cell, an optical reader for reading a medium identification code, and a medium detector for detecting the presence or absence of a recording medium in a target cell. The adapter is insertable into a guide of the component carrier.