An ink jet printer comprises a print misalignment detection sensor having
a support member for supporting an LED and a PD. The support member is
mounted on a cradle holding a printing head, and is open on its
cradle-mounting side. The support member has U-shaped light transmitting
and receiving grooves respectively forming a light transmitting path from
the LED and a light receiving path to the PD. The cradle has light
transmitting and receiving path ribs, each with a semicircular recess
formed at its end. The two ends of the two light path ribs are
respectively inserted into the two light grooves so as to cause the two
light paths at the insertion positions to each have a round shape as seen
in cross-sectional view. This reduces irregular reflection of light in
the two light paths, thereby reducing noise in an output signal of the
print misalignment detection sensor.