An optical sensor for detecting the housing state such as the thickness of
a substrate in the present invention is provided at supporting arms. The
supporting arms are attached to a supporting shaft. The supporting arms
are in a vertical state in a state before detection of the substrate, but
when detecting, the supporting shaft rotates to bring the supporting arms
into a horizontal state so that the optical sensor enters a substrate
housing body and is set at a predetermined detection position.
Accordingly, a space for moving the optical sensor in the horizontal
direction becomes unnecessary to reduce the space required for the
detecting operation and the like, making it possible to reduce the size
of a substrate processing apparatus in which the detecting apparatus is
incorporated.