Compact surface plasmon resonance (SPR) sensors are highly demanded due to their small size, low cost, and wide application scenarios compared with benchtop sensors. To realize high-precision spectral or angular analysis, most compact SPR sensors need spectrometers or rotation stages, which increase the cost of the device. We demonstrate a low-cost and compact SPR sensor by utilizing a single grating as a coupler and a disperser. The polychromatic light emitted from a light-emitting diode was coupled to surface plasmon modes by a grating made from a digital versatile disc-recordable disc. The light was dispersed by the same grating and collected by a linear charge-coupled device. The real-time detection of the SPR spectra and the resonant wavelengths was realized by homemade software based on the laboratory virtual instrument engineering workbench. By measuring different concentrations of glucose solution and sodium chloride solution, we obtain a high refractive index (RI) resolution of 5.52 × 10 −5 RI unit. This compact SPR sensor can be applied in the areas of food safety, environmental monitoring, medical diagnosis, and so on.