The OpenSpectrometer project aims to bring low cost, high accuracy spectroscopy to everyone.
Simple, but functional spectrometer on a 3D printed base with +/- 1 nm accuracy. Carriage allows diffraction grating to rotate allowing you to observe a wide range of wavelengths from UV ~400 nm all the way to the IR ~900 nm.
Standard settings, nothing special. More walls for rigidity is better. The LensCap needs to slide in the slot so depending on your tolerance this may need adjusting or sanding.
Any webcam, if you want IR then make sure it is suited for this or remove the IR filter yourself.
You need a lens to focus the image onto the camera sensor, a CCTV Zoom Lens with M12 Thread worked for me, but depends on your webcam.
Assembly
See images, self explanatory but may need to print and add some of the spacers into the LensCap before pushing the diffraction grating in to give more tension to hold in position.
Operation
Free software: https://www.theremino.com/en/downloads/automation (search "Spectrometer" on this page)