Este Proyecto Fin de Grado presenta el desarrollo de un sistema IoT orientado a la adquisición y análisis de espectros en el rango visible e infrarrojo cercano (Vis/NIR). La motivación principal del proyecto surge de la necesidad creciente de contar con soluciones portátiles, económicas y versátiles para realizar análisis espectrales en sectores como la agricultura, la industria alimentaria y la investigación medioambiental. La espectroscopía Vis/NIR ofrece una vía no destructiva para la caracterización de materiales, sin necesidad de procesos químicos invasivos ni laboratorios especializados.
El objetivo del proyecto ha sido diseñar, desarrollar e implementar un sistema completo capaz de adquirir datos espectrales mediante el sensor AS7265x, procesarlos con un microcontrolador ESP32, transmitirlos a una plataforma IoT para su seguimiento y, posteriormente, analizarlos mediante técnicas de Machine Learning. Se ha buscado una solución modular y de bajo coste, facilitando su adaptación a distintos casos de uso.
Durante la realización del proyecto se han abordado múltiples áreas técnicas: desde la programación embebida, la gestión de comunicaciones Wi-Fi y MQTT, hasta la implementación de un servidor web para configuración remota y la integración de una pantalla OLED para mostrar información en tiempo real. En paralelo, se ha desarrollado una aplicación web basada en Streamlit que permite cargar conjuntos de datos espectrales, entrenar modelos de clasificación suspervisada y realizar predicciones automáticas sobre nuevas muestras.
Uno de los principales hallazgos del proyecto ha sido comprobar que, si bien el sistema diseñado es funcional en cuanto a la recolección, visualización y envío de datos, la calidad de los espectros obtenidos con el sensor presenta limitaciones importantes, entre ellas la baja resolución espectral, que impide obtener resultados robustos para la clasificación precisa de materiales. A pesar de ello, el sistema ha permitido establecer una base sólida sobre la que continuar investigando.
En cuanto a las conclusiones, se destaca que el sistema desarrollado cumple con los requisitos planteados. La arquitectura modular del software, junto con la interfaz web de entrenamiento y predicción, abre la puerta a futuras mejoras tanto en precisión como en funcionalidades. También se ha reflexionado sobre su impacto social y ético, concluyendo que iniciativas de este tipo pueden contribuir a democratizar el acceso a la tecnología y apoyar el cumplimiento de varios Objetivos de Desarrollo Sostenible.
En conjunto, este trabajo demuestra la viabilidad de integrar tecnologías innovadoras en soluciones IoT inteligentes, sentando las bases para futuras aplicaciones en entornos reales.
Abstract:
This Bachelor’s Final Project presents the development of an IoT system for the acquisition and analysis of spectral data in the visible and near-infrared (Vis/NIR) range. The main motivation for the project stems from the growing need for portable, affordable, and versatile solutions for performing spectral analysis in sectors such as agriculture, the food industry, and environmental research. Vis/NIR spectroscopy offers a non-destructive approach to material characterization, without the need for invasive chemical processes or specialized laboratories.
The objective of the project was to design, develop, and implement a complete system capable of acquiring spectral data using the AS7265x sensor, processing it with an ESP32 microcontroller, transmitting it to an IoT platform for monitoring, and subsequently analyzing it using Machine Learning techniques. A modular and low-cost solution was sought, facilitating its adaptation to different use cases.
During the development, multiple technical areas were addressed: from embedded programming, Wi-Fi and MQTT communication management, to the implementation of a web server for remote configuration and the integration of an OLED display to present real-time information. In parallel, a web application based on Streamlit was developed that allows uploading spectral data sets, training supervised classification models, and making automatic predictions for new samples.
One of the main findings of the project was that, while the designed system is functional in terms of data collection, visualization, and transmission, the quality of the spectra obtained with the sensor presents significant limitations, including low spectral resolution, which prevents obtaining robust results for the accurate classification of materials. Despite this, the system has established a solid foundation for further research.
Regarding the conclusions, it is highlighted that the developed system meets the requirements. The modular architecture of the software, together with the web interface for training and prediction, opens the door to future improvements in both accuracy and functionality. Their social and ethical impact has also been reflected upon, concluding that initiatives of this type can contribute to democratizing access to technology and supporting the achievement of several Sustainable Development Goals.
Overall, this work demonstrates the feasibility of integrating innovative technologies into smart IoT solutions, laying the groundwork for future applications in real-world environments.
Este Proyecto Fin de Grado presenta el desarrollo de un sistema IoT orientado a la adquisición y análisis de espectros en el rango visible e infrarrojo cercano (Vis/NIR). La motivación principal del proyecto surge de la necesidad creciente de contar con soluciones portátiles, económicas y versátiles para realizar análisis espectrales en sectores como la agricultura, la industria alimentaria y la investigación medioambiental. La espectroscopía Vis/NIR ofrece una vía no destructiva para la caracterización de materiales, sin necesidad de procesos químicos invasivos ni laboratorios especializados.
El objetivo del proyecto ha sido diseñar, desarrollar e implementar un sistema completo capaz de adquirir datos espectrales mediante el sensor AS7265x, procesarlos con un microcontrolador ESP32, transmitirlos a una plataforma IoT para su seguimiento y, posteriormente, analizarlos mediante técnicas de Machine Learning. Se ha buscado una solución modular y de bajo coste, facilitando su adaptación a distintos casos de uso.
Durante la realización del proyecto se han abordado múltiples áreas técnicas: desde la programación embebida, la gestión de comunicaciones Wi-Fi y MQTT, hasta la implementación de un servidor web para configuración remota y la integración de una pantalla OLED para mostrar información en tiempo real. En paralelo, se ha desarrollado una aplicación web basada en Streamlit que permite cargar conjuntos de datos espectrales, entrenar modelos de clasificación suspervisada y realizar predicciones automáticas sobre nuevas muestras.
Uno de los principales hallazgos del proyecto ha sido comprobar que, si bien el sistema diseñado es funcional en cuanto a la recolección, visualización y envío de datos, la calidad de los espectros obtenidos con el sensor presenta limitaciones importantes, entre ellas la baja resolución espectral, que impide obtener resultados robustos para la clasificación precisa de materiales. A pesar de ello, el sistema ha permitido establecer una base sólida sobre la que continuar investigando.
En cuanto a las conclusiones, se destaca que el sistema desarrollado cumple con los requisitos planteados. La arquitectura modular del software, junto con la interfaz web de entrenamiento y predicción, abre la puerta a futuras mejoras tanto en precisión como en funcionalidades. También se ha reflexionado sobre su impacto social y ético, concluyendo que iniciativas de este tipo pueden contribuir a democratizar el acceso a la tecnología y apoyar el cumplimiento de varios Objetivos de Desarrollo Sostenible.
En conjunto, este trabajo demuestra la viabilidad de integrar tecnologías innovadoras en soluciones IoT inteligentes, sentando las bases para futuras aplicaciones en entornos reales.
Abstract:
This Bachelor’s Final Project presents the development of an IoT system for the acquisition and analysis of spectral data in the visible and near-infrared (Vis/NIR) range. The main motivation for the project stems from the growing need for portable, affordable, and versatile solutions for performing spectral analysis in sectors such as agriculture, the food industry, and environmental research. Vis/NIR spectroscopy offers a non-destructive approach to material characterization, without the need for invasive chemical processes or specialized laboratories.
The objective of the project was to design, develop, and implement a complete system capable of acquiring spectral data using the AS7265x sensor, processing it with an ESP32 microcontroller, transmitting it to an IoT platform for monitoring, and subsequently analyzing it using Machine Learning techniques. A modular and low-cost solution was sought, facilitating its adaptation to different use cases.
During the development, multiple technical areas were addressed: from embedded programming, Wi-Fi and MQTT communication management, to the implementation of a web server for remote configuration and the integration of an OLED display to present real-time information. In parallel, a web application based on Streamlit was developed that allows uploading spectral data sets, training supervised classification models, and making automatic predictions for new samples.
One of the main findings of the project was that, while the designed system is functional in terms of data collection, visualization, and transmission, the quality of the spectra obtained with the sensor presents significant limitations, including low spectral resolution, which prevents obtaining robust results for the accurate classification of materials. Despite this, the system has established a solid foundation for further research.
Regarding the conclusions, it is highlighted that the developed system meets the requirements. The modular architecture of the software, together with the web interface for training and prediction, opens the door to future improvements in both accuracy and functionality. Their social and ethical impact has also been reflected upon, concluding that initiatives of this type can contribute to democratizing access to technology and supporting the achievement of several Sustainable Development Goals.
Overall, this work demonstrates the feasibility of integrating innovative technologies into smart IoT solutions, laying the groundwork for future applications in real-world environments. Read More


