Reading of Sensor Signals with Automatic Selection of Sampling Frequency
DOI:
https://doi.org/10.31861/sisiot2023.1.01010Keywords:
temperature, humidity and light sensors, frequency sampling, Fourier spectrum, PythonAbstract
The correct selection of sampling frequency when reading signals from sensors ensures high quality of digitized data and saves memory when storing such data. The complexity of automatic selection of the sampling frequency is explained by the fact that this frequency depends on the frequencies of the useful signal, which are not always known. Therefore, in the work the computer system for reading signals from temperature, humidity, and lighting sensors with automatic selection of the sampling frequency based on the Fourier spectrum analysis of the signals was developed. Signals from digital sensors (DHT22) are transmitted directly to the Raspberry Pi3 microcomputer. Signals from analog sensors (LM335M, light sensor) are fed to the Arduino Uno device. An algorithm for the analysis of Fourier spectra of one-dimensional signals has been developed, which is designed to determine the optimal sampling frequency and decimation coefficient of signals read from sensors. Based on the initial signals, their Fourier spectra are calculated, and by analyzing the spectra, the maximum frequency of the useful signal and the optimal sampling frequency are determined. Specified sampling frequency according to the sampling theorem is calculated as a double value of the maximum frequency of the useful signal. Decimation (thinning) of the signal is performed with a coefficient determined by the ratio of the initial and specified sampling frequencies. To assess the quality of the signal after decimation, the decimated values were interpolated by splines. The root mean square error of interpolation was calculated. Experimental testing of the developed tools for reading and analyzing signals from temperature, humidity and lighting sensors was carried out. In all considered cases, the sampling frequency is determined correctly. The resulting sampling rates can be used for decimation of signals or for subsequent reading of signals from sensors.
Downloads
References
G. Ferri, G. Barile, and A. Leoni. Electronics for Sensors. MDPI, 2021. doi: 10.3390/books978-3-0365-1241-9
S. Fernandez, “Discretization Accuracy of Continuous Signal Peak Values in Limited Bandwidth Systems”, Computacion y Sistemas. vol. 25, no. 1. pp. 173-183, 2021. doi: 10.13053/CyS-25-1-3889.
J.A. Santoyo-Ramon, E. Casilari, and J.M. Cano-Garcia, “A study of the influence of the sensor sampling frequency on the performance of wearable fall detectors”, Measurement, vol. 193. pp. 1-12, 2022. doi: 10.1016/j.measurement.2022.110945
S. Palani, Principles of Digital Signal Processing. Springer Cham, 2022.
S.V. Balovsyak and Kh.S. Odaiska, “Automatic Determination of the Gaussian Noise Level on Digital Images by High-Pass Filtering for Regions of Interest”, Cybernetics and Systems Analysis, vol. 54, no. 4, pp. 662-670, 2018.
Digital-output relative humidity & temperature sensor/module DHT22. [Online]. Available: https://datasheetspdf.com/mobile/792211/Aosong/DHT22/1
DHT22 Raspberry Pi Humidity Temperature Sensor Tutorial. [Online]. Available: https://www.youtube.com/watch?v=IHTnU1T8ETk.
Raspberry Pi 3. [Online]. Available: https://www.raspberrypi.org/products
Photosensitive resistance sensor, module16in1, sensor kit. [Online]. Available: www.weikedz.com.
Arduino. [Online]. Available: https://www.arduino.cc.