Characterization of a neutron spectrometer based on a P-I-N photodiode