A Modular, 3D-Printed, and Cost-Effective Near-Infrared Spectrometer with Machine Learning for Commodity Plastic Identification

Authors

DOI:

https://doi.org/10.31436/iiumej.v27i3.4388

Keywords:

near infrared spectroscopy, Plastic Identification, Low-Cost Spectrometer, Machine Learning, Principal Component Analysis (PCA)

Abstract

Efficient segregation of post-consumer plastics remains a critical challenge in achieving a sustainable circular economy because current sorting technologies are limited in cost, adaptability, and accessibility for community-level use. This study presents the development of a modular, cost-effective, and 3D-printed transmission near-infrared (NIR) spectrometer that operates in the 850 nm to 1100 nm range. The spectrometer was developed using open-source tools and resources such as Theremino and Scikit-learn, as well as commercially available optical components such as a desktop webcam, a transmission grating, and an incandescent penlight. Validation of the spectrometer revealed minor wavelength deviations between theoretical and measured values. Measured values deviated by 5.1% with respect to the 546 nm mercury characteristic peak and 7.6% with respect to the 436 nm characteristic mercury peak emitted from a fluorescent lamp. This deviation is due to the low-cost optical components, but it did not impair the classification performance of the polymers. 504 plastic samples from seven material classes namely acrylonitrile butadiene styrene (ABS), low-density polyethylene (LDPE), polyethylene terephthalate (PET), polymethyl methacrylate (PMMA), polypropylene (PP), green polystyrene (GPS), and red polystyrene (RPS), together with an empty baseline reference (MT) sample were collected and processed using Principal Component Analysis (PCA), where 12 principal components were retained to capture 95% of the cumulative spectral variance. Classification performance was subsequently evaluated using Support Vector Machine (SVM), Linear Discriminant Analysis (LDA), and K-Nearest Neighbors (KNN) models. After hyperparameter tuning, both the SVM and KNN models achieved the highest held-out test accuracy (82.24%). SVM was the most reliable overall classifier, with slightly better class-balanced performance (F1-score of 82.36%) than KNN (81.98%) and LDA (73.71%). The empty baseline reference spectrum was classified perfectly with a precision, recall, and F1-score of 100%, confirming the consistency of the baseline penlight source spectrum. Materials like RPS showed greater feature overlap with GPS, and LDPE with PP. This study demonstrated that a low-cost, transmission NIR spectrometer operating between 850 nm and 1100 nm, combined with machine learning, can accurately identify commodity plastics, offering a promising community-level solution.

ABSTRAK: Pengasingan plastik pasca guna secara berkesan masih merupakan cabaran utama dalam mencapai ekonomi kitaran lestari. Kekurangan teknologi pengasingan plastik sedia ada dari segi kos, kebolehsuaian, dan kebolehcapaian gunaan di peringkat komuniti telah menjadi penyumbang kepada cabaran tersebut. Kajian ini menumpukan kepada pembangunan spektrometer inframerah dekat (NIR) jenis transmisi melalui pencetakan 3D bersifat modular, kos efektif, dan mempunyai julat operasi dari 850 nm hingga 1100 nm. Spektrometer ini dibina menggunakan platform sumber terbuka seperti Theremino dan Scikit-learn. Selain itu, komponen optik yang mudah diperoleh seperti kamera web desktop yang diubah suai, kisi difraksi transmisi, dan lampu pijar jenis pen turut digunakan. Semasa proses pengesahan fungsi spektrometer ini, sisihan panjang gelombang kecil antara nilai teori dan nilai yang diukur telah dikesan. Berdasarkan dapatan pengukuran, terdapat sisihan sebanyak 5.1% bagi puncak ciri merkuri pada panjang gelombang 546 nm dan 7.6% bagi puncak ciri merkuri pada panjang gelombang 436 nm yang dipancarkan oleh lampu pendarfluor. Penggunaan komponen optik kos rendah mengakibatkan berlakunya sisihan tersebut, tetapi keupayaan spektrometer ini dalam pengelasan polimer tidak terjejas. Sebanyak 504 sampel plastik daripada tujuh kelas bahan iaitu akrilonitril butadiena stirena (ABS), polietilena berketumpatan rendah (LDPE), polietilena tereftalat (PET), polimetil metakrilat (PMMA), polipropilena (PP), polistirena hijau (GPS), dan polistirena merah (RPS), bersama satu garis dasar rujukan kosong (MT) telah dikumpulkan dan diproses menggunakan Analisis Komponen Utama (PCA), di mana 12 komponen utama dikekalkan bagi mewakili 95% varians spektrum kumulatif. Prestasi pengelasan kemudiannya dinilai menggunakan model Mesin Vektor Sokongan (SVM), Analisis Diskriminan Linear (LDA), dan K-Jiran Terdekat (KNN). Selepas penalaan hiperparameter, model SVM dan KNN mencapai ketepatan ujian ketahanan tertinggi sebanyak 82.24%. SVM dikenal pasti sebagai pengelas keseluruhan yang paling boleh percaya dengan skor F1 sebanyak 82.36%, berbanding KNN (81.98%) dan LDA (73.71%). Spektrum sampel MT berjaya diklasifikasi dengan sempurna dengan nilai ketepatan, penarikan semula, dan skor F1 sebanyak 100%, sekaligus mengesahkan konsistensi spektrum asas yang dihasilkan daripada cahaya lampu pijar. Namun, bahan seperti RPS menunjukkan pertindihan ciri spektrum yang lebih tinggi dengan GPS, manakala spektrum LDPE pula bertindih dengan spektrum PP. Kajian ini berjaya membuktikan bahawa spektrometer NIR transmisi kos rendah yang dihasilkan melalui pencetakan 3D dan pembelajaran mesin dapat beroperasi pada julat 850 nm hingga 1100 nm dan mampu mengenal pasti plastik komoditi dengan tepat di samping menawarkan penyelesaian terbaik pada peringkat komuniti.

Downloads

Download data is not yet available.

Metrics

Metrics Loading ...

Author Biographies

Wei Jim Tan, Universiti Sains Malaysia

Tan Wei Jim earned his bachelor’s degree in Polymer Engineering in Universiti Sains Malaysia. He is currently pursuing his master’s degree in Polymer Electronics where he realizes his interests and currently specialize in mechanical design, 3D printing, and material characterisation.

Arjulizan Rusli, Universiti Sains Malaysia

Arjulizan Rusli is currently a lecturer at the Polymer Engineering Programme, School of Materials & Mineral Resources Engineering, Universiti Sains Malaysia. She received her PhD from Monash University, Australia in Materials Engineering. She has been working on processing improvement of commodities and engineering polymers for more than 10 years. She is also involved in research and industrial related projects on finding alternative plasticizers for polymers. Her current field of research interests are polymer blending, polymer plasticization and the development of materials for smart materials, packaging and 3D printing.

Muhamad Sharan Musa, Universiti Sains Malaysia

Muhamad Sharan Musa studied for a Bachelor of Engineering in Polymer Engineering at Universiti Sains Malaysia, Malaysia. He received a Ph.D. in Polymer Science and Engineering from the University of Manchester in 2018. In 2017, he worked at Synthomer Ltd. as a senior chemist. In 2021, he joined Universiti Sains Malaysia as a lecturer, academic researcher, and scientist. His research focuses on the development of polyelectrolytes for lithium battery applications and polymer colloids.

References

Macheca AD, Mutuma B, Adalima JL, Midheme E, Lúcas LHM, Ochanda VK, Mhlanga SD. (2024) Perspectives on plastic waste management: challenges and possible solutions to ensure its sustainable use. Recycling, 9(5): 77. https://doi.org/10.3390/recycling9050077

Lahl U, Zeschmar-Lahl B. (2024) Material recycling of plastics—a challenge for sustainability. Sustainability, 16(15): 6630. https://doi.org/10.3390/su16156630

Bernat K. (2023) Post-consumer plastic waste management: from collection and sortation to mechanical recycling. Energies, 16(8): 3504. https://doi.org/10.3390/en16083504

Grabska J, Huck CW, Bec KB. (2021) Principles and applications of miniaturized near-infrared (NIR) spectrometers. Chem. Eur. J., 27(5): 1514–1532. https://doi.org/10.1002/chem.202002838

Werner T, Dawoud M, Aschenbrenner D, Taha I. (2025) Cost-efficient detection of plastics from post-consumer packaging waste using selected bands in the near-infrared spectrum. Macromol. Mater. Eng., 2025: 2500143. https://doi.org/10.1002/mame.202500143

Silva WRF, Suarez WT, Reis C, dos Santos VB, Carvalho FA, Reis EL, Vicentini FC. (2021) Multifunctional webcam spectrophotometer for performing analytical determination and measurements of emission, absorption, and fluorescence spectra. J. Chem. Educ., 98(4): 1442–1447. https://doi.org/10.1021/acs.jchemed.0c01085

Straller A, Gessler B. (2019) Identification of plastic types using discrete near infrared reflectance spectroscopy. ResearchGate. https://www.researchgate.net/publication/337868860_Identification_of_Plastic_Types_Using_Discrete_Near_Infrared_Reflectance_Spectroscopy

Laganovska K et al. (2020) Portable low-cost open-source wireless spectrophotometer for fast and reliable measurements. HardwareX, 7: e00108. https://doi.org/10.1016/j.ohx.2020.e00108

Huang S et al. (2024) Broadband-spectral-responsivity of black silicon photodetector with high gain and sub-bandgap sensitivity by titanium hyperdoping. Opt. Laser Technol., 171: 110399. https://doi.org/10.1016/j.optlastec.2023.110399

Rodrigues M, Marques MB, Carvalho PS. (2016) How to build a low cost spectrometer with Tracker for teaching light spectra. Phys. Educ., 51(1): 014002. https://doi.org/10.1088/0031-9120/51/1/014002

Liebold F, Mader D, Sardemann H, Eltner A, Maas HG. (2023) A bi-radial model for lens distortion correction of low-cost UAV cameras. Remote Sens., 15(22): 5283. https://doi.org/10.3390/rs15225283

Ledesma RD, Valero-Mora P, Macbeth G. (2015) The scree test and the number of factors: a dynamic graphics approach. Span. J. Psychol., 18: E11. https://doi.org/10.1017/sjp.2015.13

Peres-Neto PR, Jackson DA, Somers KM. (2005) How many principal components? stopping rules for determining the number of non-trivial axes revisited. Comput. Stat. Data Anal., 49(4): 974–997. https://doi.org/10.1016/j.csda.2004.06.015

Neo ERK, Yeo Z, Low JSC, Goodship V, Debattista K. (2022) A review on chemometric techniques with infrared, Raman and laser-induced breakdown spectroscopy for sorting plastic waste in the recycling industry. Resour. Conserv. Recycl., 180: 106217. https://doi.org/10.1016/j.resconrec.2022.106217

Li S, Ivancic RJS, Sutliff BP, Huang D, Blázquez-Blázquez E, Martin TB, Migler KB, Audus DJ, Orski SV. (2026) Predicting properties from near-infrared spectra with machine learning for improved polyolefin differentiation. ACS Polym. Au, 6(4): 246–255. https://doi.org/10.1021/acspolymersau.5c00131

Martinez-Hernandez U, West G, Assaf T. (2024) Low-cost recognition of plastic waste using deep learning and a multi-spectral near-infrared sensor. Sensors, 24(9): 2821. https://doi.org/10.3390/s24092821

Yang Y, Zhang X, Yin J, Yu X. (2020) Rapid and nondestructive on-site classification method for consumer-grade plastics based on portable NIR spectrometer and machine learning. J. Spectrosc., 2020: 6631234. https://doi.org/10.1155/2020/6631234

Brunner S, Fomin P, Kargel C. (2015) Automated sorting of polymer flakes: fluorescence labeling and development of a measurement system prototype. Waste Manag., 49: 600-607. https://doi.org/10.1016/j.wasman.2014.12.006

Downloads

Published

2026-09-11

How to Cite

Tan, W. J., Ariff, Z. M., Rusli, A., & Musa, M. S. (2026). A Modular, 3D-Printed, and Cost-Effective Near-Infrared Spectrometer with Machine Learning for Commodity Plastic Identification. IIUM Engineering Journal, 27(3), 403–415. https://doi.org/10.31436/iiumej.v27i3.4388

Issue

Section

Materials and Manufacturing Engineering