The online detection of fertilizer solution information is a crucial link in the implementation of intelligent and precise variable fertilization techniques. However, achieving simultaneous rapid online detection of multiple fertilizer components is still challenging. Therefore, a rapid detection method based on spectrophotometry for qualitative and quantitative identification of four fertilizers (typical N, P, and K fertilizers: KNO3, (NH4)2SO4, KH2PO4, and K2SO4) was proposed in this work. Full-scan absorption spectra of fertilizer solutions at varying concentrations were obtained using a UV–visible/near-infrared spectrophotometer. By assessing the linear fit between fertilizer concentration and absorbance at each wavelength within the characteristic band, the characteristic wavelengths for KNO3, (NH4)2SO4, KH2PO4, and K2SO4 were identified as 214 nm, 410 nm, 712 nm, and 1708 nm, respectively. The identification method of fertilizer type and the prediction model of concentration were constructed based on characteristic wavelength and the Lambert–Beer law. Based on the above analysis, a four-channel photoelectric sensor was designed with four LEDs emitting wavelengths closely matched to characteristic wavelengths for fertilizer detection. A detection strategy of “qualitative analysis followed by quantitative detection” was proposed to realize the online detection of four fertilizer types and their concentrations. Evaluation of the sensor’s performance showed its high stability, with an accuracy of 81.5% in recognizing fertilizer types. Furthermore, the relative error of the sensor detection was substantially less than ±15% for the fertilizer concentrations not exceeding 80 mg/L. These results confirm the capability of the sensor to meet the practical requirements for online detection of four fertilizer types and concentrations in the field of agricultural engineering.