An imaging unit includes: an imager that receives and photoelectrically converts light from a target to be captured a branching unit that branches a signal from the imager into two signals a first converter into which one of the two signals is input to convert the input signal into an optical signal a second converter into which the other of the two signals is input to convert the input signal into an electric signal a first output unit that outputs the optical signal a second output unit that outputs the electric signal a detector that detects a unit connected to the imaging unit and a controller that causes the first output unit to output the optical signal if the unit detected by the detector is the control unit, and causes the second output unit to output the electric signal if the unit detected by the detector is the inspection unit.