A A A Volume : 44 Part : 2 Proceedings of the Institute of Acoustics Autonomous noise monitoring system based on digital MEMS microphones: development of a smartphone application for remote communication Felipe Ramos de Mello1, Acoustical Engineering, Federal University of Santa Maria, Santa Maria, Brazil William D’Andrea Fonseca2, Acoustical Engineering, Federal University of Santa Maria, Santa Maria, Brazil Paulo Henrique Mareze3, Acoustical Engineering, Federal University of Santa Maria, Santa Maria, Brazil ABSTRACT Noise monitoring is a useful diagnostic tool for making better decisions in noise control projects and understanding the sonic behavior of a place. Traditionally, sound pressure levels are measured using a sound level meter (SLM), usually for a limited time frame. However, recently much interest has arisen in developing wireless sensor networks that work continuously, especially using cost-effective embedded systems. In this sense, digital micro-electrical-mechanical (MEMS) microphones are a great promise in creating such devices due to their low-cost, high-quality, and integrated analog to digital converter. This paper presents a noise monitoring system based upon digital MEMS microphones, Arduino compatible microcontrollers (Teensy and ESP32), and an Android app. The app connects with the system via Bluetooth for configuration and control. Once a measurement is set up and running, the system acts autonomously, saving data into an SD card. By the end of the assessment, it is possible to wirelessly retrieve the saved data and upload it to an online spreadsheet. The device was deployed in an office and measured for one hour, with all data being successfully retrieved. Ultimately, the system could be applied to indoor noise monitoring and used to assess the effectiveness of noise control projects, for example. Keywords: Smart cities, Internet of Things, Teensy 4.0. 1. INTRODUCTION In modern days, a great percentage of the population lives in cities and urban centers [1]. Therefore, a higher concentration of people are living and working in buildings, circulating in public spaces, and using motor vehicles for transportation. This, in turn, leads to an increase in noise levels, which interferes with life quality and can cause serious health problems in humans and animals [2]. On top of that, noise complaints are becoming more frequent, yielding city managers to come up with strategies to regulate and inspect noise emission [3–5]. In this regard, agencies and public departments have created laws, rules, and guidelines to establish acceptable community noise levels (e.g., WHO, European Commission, Conama). In Brazil, for example, the standard ABNT NBR 10151:2019 establishes procedures for measurement and evaluation of sound pressure levels (SPL) on inhabited areas (both external and internal), as well as limits for SPL as a function of land use and occupation [6]. The majority of those guidelines use LAeq, Lden, and Lnight measurements as their main evaluation parameters. For instance, WHO’s Environmental Noise Guidelines for the European Region recommends a yearly average of 70 dB LAeq,24h for all leisure noise sources combined and correlates health outcomes such as cardiovascular diseases, effects on sleep, and cognitive impairments to Lden, and Lnight values [2]. Usually, to evaluate environmental noise, measurements are carried out on demand by an acoustician, or technician, using a standardized Sound Level Meter (SLM, according to IEC 61672 [7]). This approach is expensive1, time-consuming, and not feasible for high space discretization. In addition, someone must carry out the evaluations in person, which constraints both the assessment period and the number of evaluation points. Furthermore, in Brazil is common to use those kinds of measurements to calibrate sound maps and environmental noise simulations. 1 Standardized SLMs can cost from $1500 to $20000. To overcome the aforementioned disadvantages, much interest has arisen in developing Wireless Acoustic Sensors Networks (or WASN) for noise monitoring, especially using low-cost devices (see these works [8–10]). This field of research considers two types of devices ([11]): Those that measure only sound pressure levels; and Those that are capable of source identification and/or separation. This paper presents a cost-effective prototype for autonomous noise monitoring based on digital MEMS microphones and readily available electronic components. The device is capable of measuring Equivalent Continuous Sound Pressure Levels with A, C, and Z frequency-weightings, instantaneous time-weighted SPL (Fast and Slow), as well as SPL in Fractional Octave Bands (1/1 and1/3), storing everything into an SD card. Additionally, it has a wireless connection, allowing for communication with smartphones, for example. Finally, to configure, control, and retrieve data from the device, an Android application was developed. The app can read files from the device’s SD card and send them to an online spreadsheet for data visualization and further analysis. The system is intended for continuous indoor noise monitoring (such as in condominiums, buildings, schools, etc.), enabling communities to closely inspect their noise levels and act accordingly and can also be used as a portable SLM. Furthermore, this research aims to contribute to the implementation of WASNs in Brazil, as the country has no published work or projects in this regard (at least to the authors’ knowledge). Ultimately, this is a follow-up to the paper entitled MEMS digital microphone and Arduino compatible microcontroller: an embedded system for noise monitoring, presented at Internoise 2021 [12]. The next sections are organized as follows. Section 2 describes the hardware used, software, and algorithm validations. Section 3 detail the used components and their interconnections. Section 4 outlines the Android application development and its features. Section 5 shows the result of a test deployment in which the system measured for one hour and data was successfully retrieved and uploaded. Finally, Section 6 sums everything up and delineates future works. 2. HARDWARE AND SOFTWARE This section briefly describes the system’s main hardware and software. Section 2.1 outlines the MEMS microphone technology and its characteristics. Section 2.2 addresses the microcontrollers used for processing and data transmission (Teensy 4.0 and ESP32, respectively). Section 2.3 describes the prototype features. Ultimately, Section 2.4 outlines previous tests used to validate the implemented algorithms (see [12]). 2.1. Digital MEMS microphones MEMS microphones are acoustic transducers built into silicon chips using semiconductor technology. Those techniques allow for the construction of really small and affordable devices that comprise an acoustic transducer, a signal conditioning circuit, and, in digital models, an Analog-to-Digital Converter (ADC) (see Figure 1). Concerning the microphones acoustic characteristics, they usually have a flat frequency response ranging from 80 Hz up to 10 kHz2, an adequate Signal-to-Noise Ratio for environmental noise evaluation [11], and are very robust against climate changes (having almost no sensitivity drift over time). 2 May vary depending on the model and mounting position. Among the digital models, there are three communication protocols available: Pulse Density Modulation (PDM); Inter-IC Sound (I2S); and Time-Division Multiplex (TDM). In short, PDM streams 1 bit signals at a very high sampling rate that must be converted to a Pulse Code Modulation (PCM) format for further processing — which can be very CPU-intensive for most microcontrollers [13]. The I2S protocol, in turn, already transmits data in the PCM format, usually at a sampling rate up to 48 kHz. Both PDM and I2S are capable of sending stereo signals through a single data line. Finally, the TDM protocol is very similar to the I2S but is intended for multichannel streaming of data (up to 16 microphones can share the same data line). For more information regarding MEMS microphones, please check [14–16]. Figure 1: Block diagram of MEMS microphones. On the left, an analog model. On the right, an I2S digital model. 2.2. Teensy 4.0 and ESP32 microcontrollers The core processing unit of the developed system is the Teensy 4.0 microcontroller (MCU), an Arduino compatible, small-sized, and cost-effective MCU. Its main features include an ARM Cortex M7 (running at 600 MHz); a floating-point math unit (64 and 32 bits, FPU); and compatibility with the I2S protocol. Moreover, this MCU comes with an extensive open-source audio library containing a well-structured audio pipeline suited for multiple simultaneous input/output and flexible signal routing. The Teensy Audio Library is object-oriented. That way, all audio tasks are handled by specific objects responsible for input reading, streaming, processing, output streaming, etc. Furthermore, being open-source, it is possible to create new objects that integrate seamlessly into the pipeline. In addition, the library offers a Graphic User Interface (GUI)3 that helps users to easily create new audio projects by interconnecting functional blocks (representing audio objects, see Figure 2 (b)). The interface has a list of all available objects, a brief documentation of each and allows the user to export the project as an Arduino sketch. 3 Audio System Design Tool, available at https://www.pjrc.com/teensy/gui/. ESP32 is a family of low-cost Arduino compatible microcontrollers with integrated Wi-Fi and Bluetooth (both classic and low-energy). They have become quite popular among the Internet of Things (IoT) community for their processing power, features, and ease of use. This project uses a DOIT ESP32 DEVKIT V1 board to add wireless communication capabilities to the system. Figure 2 (a) depicts both the Teensy 4.0 and ESP32 boards and Table 1 compares popular Arduino compatible boards — for more information see the references [17, 18]. Table 1: Hardware comparison between the prototype used and other Teensy and Arduino boards. Figure 2: On the left, Teensy (on top) and ESP32 (on bottom) boards dimensions. On the right, a print of Teensy’s audio library user interface. 2.3. Measurement capabilities For this project, three proprietary Teensy Audio Objects were implemented, each responsible for tasks such as frequency-weighting, fractional octave band analysis, and sound pressure level calculations. Specifically: AudioFilterFrequencyWeighting: this object is responsible for applying the frequency weighting via Infinite Impulse Response (IIR) filters. It has options for A and C weighting curves. AudioAnalyzeOctaveBands: This object is responsible for the fractional octave band analysis. It uses a band-pass IIR filter bank to evaluate equivalent continuous sound pressure levels in1/1 and1/3 octave bands. Filters were implemented according to IEC 61260:1-2014 [19]. AudioAnalyzeSPL: this object is responsible for SPL calculations. It returns Leq, time-weighted SPL (Fast or Slow), maximum time-weighted SPL, and peak SPL. All objects receive a stream of 128 audio samples (Teensy’s default) for computations. The frequency-weighting object streams an output of 128 filtered audio samples, while both AudioAnalyzeOctaveBands and AudioAnalyzeSPL returns calculated values when available (see Figure 7 for a detailed data flow). The user can define the log interval (both the rate at which SPL data is returned, as well as the time period for Leq integration) and which fractional octave band uses for calculations. The firmware is programmed to return SPL values in all frequency weightings (A, C, and Z). Moreover, fractional octave band analysis doesn’t support frequency-weighting (however, it can be added in post-processing). 2.4. Algorithm validations Finally, as described in [12], a series of tests were held to evaluate the implemented filters’ responses using the appropriate standards, particularly: IEC 61672:2013 (parts 1 and 2) for the time- and frequency-weighting filters [7, 20]; and ANSI/ASA S1.11-2014 (part 1), IEC 61260:1-2014, and IEC 61260:2-2016 for the fractional octave band filters [19, 21, 22]. In short, all filters comply with Class 1 standards. Some of the results are shown in Figures 3 (a) and (b). For more details regarding the methodology, performance tests, and results, please check [12]. Figure 3: On the right, A frequency-weighting filter and Class 1 acceptance limits. On the left, 1 kHz 1⁄3-octave bands test with 30 runs: mean and confidence intervals (shaded area) for 99.73%. Complete results can be verified in [12]. 3. THE PROTOTYPE This section describes the prototype components and data flow. Section 3.1 lists and describes the hardware and its interconnections. Section 3.2 addresses the device’s frequency response correction. Section 3.3 summarizes the data flow inside the system. 3.1. Components To capture sound, the developed prototype uses the Sipeed MSM261S4030H0 breakout board, which contains an I2S digital microphone. This board was chosen mainly due to its availability in the Brazilian market. Some of its specifications are shown in Table 2. As stated in Section 2.2, two microcontrollers handle the calculations and data transmission (Teensy 4.0 and ESP32, respectively). Both are powered with 5V using a breadboard power supply, which can be supplied by a simple 6.5V ˜ 12V power supply(connected to a wall socket) or a portable power bank. An Arduino SD Card module and a 2 GB card are used for data storage. Finally, Figure 4 contains pictures of (a) the components inside the box and (b) the assembled prototype. Table 2: MEMS microphone Sipeed MSM261S4030H0 technical specifications [23]. Figure 4: Pictures of the prototype. 3.2. Frequency response correction To guarantee a fair reading across the spectrum, the prototype frequency response was measured through a comparison method on an anechoic chamber (above 100 Hz, using an exponential sine sweep) and a pressure cavity (below 100 Hz, using a stepped sine sequence)4 — see Figure 5. Both measurements used a Bruel & Kjær Type 4189 measurement microphone as reference (cite). More details regarding the methodology, procedure, and results are going to be published in future work. 4 For more details regarding the pressure cavity, see [24]. From the measured frequency response, a correction curve was created (Figure 6 (a)). From this curve, a 513 taps Finite Impulse Response (FIR) filter was generated in Matlab, and its coefficients were imported into Teensy 4.0. For the filter implementation, Brian Millier’s convolution audio object was used. The object uses the fast convolution (via FFT) overlap-add algorithm — more information can be read in [25]. The correction filter’s frequency response is shown in Figure 6 (b). Figure 5: Measurement setups for the prototype frequency response. Figure 6: Prototype’s frequency response and implemented correction filter. 3.3. Data flow Figure 7 illustrates how data circulates in the system. First, the MEMS microphone captures the sound and sends it to the Teensy 4.0 board via I2S. Inside Teensy, the signal frequency content is adjusted via the frequency correction FIR filter. Next, the signal is routed to two paths. On one side, it passes through the frequency-weighting filters (A, C, and Z), and then the SPL is calculated. On the other, the signal goes through the fractional octave filter bank, and the Leq of each band is measured. Finally, all SPL data is saved into the SD card, and the broadband values are also sent to ESP32, that in turn sends the user-specified values to the smartphone app via Bluetooth Low-Energy (more details on Section 4.1). Figure 7: Data flow diagram. 4. SMARTPHONE APPLICATION In order to control, configure, and retrieve data from the noise monitoring device, an Android application was developed using the MIT App Inventor platform. This is a web-based tool that allows the user to easily design and deploy Android apps through a block-based approach, in which each block relates to a specific function or set of instructions5 (see Figure 8). The app comprises three main screens, responsible for the following: Screen 1: real-time data visualization and a button to start a new measurement (when connected to the noise monitoring device); Screen 2: measurement and system configuration; and Screen 3: data retrieval from the SD card and upload to an online spreadsheet. 5 For more information, check http://ai2.appinventor.mit.edu/ A Bluetooth connection is used for communication between the noise monitoring device and the app. As described in Section 2.2, the ESP32 board is responsible for establishing the Bluetooth server and acts as a mediator linking the smartphone with Teensy 4.0, where the Sound Pressure Level program is running. The following Sections show in detail each Screen feature (Section 4.1) and the spreadsheet used to save and visualize the retrieved data (Section 4.2). Figure 8: MIT App Inventor interface and program example. 4.1. App features Figure 9: Screen 1, control and realtime visualization. Connection and connection status buttons: here the user can connect to the system via Bluetooth Low-Energy connection (BLE). SPL display: allows the user to monitor a few SPL parameters (chosen in Screen 2). Values showed here are not saved in the smartphone and are just for visualization. Measurement setup: shows the configurations set up by the user, as well as a “time-elapsed” display. Control buttons: allows the user to start a measurement, access the configuration screen (Screen 2), or access the file retriever screen (Screen 3). Figure 10: Screen 2: system configuration. Set log interval: adjusts the rate at which the SLM algorithm returns data. This parameter is also used as the integration period for Leq calculations. Set display: sets which SPL parameters are going to be shown on Screen 1. Here, the user can choose between one of the three frequency-weightings (A, C, or Z) for the Leq, SPL (Lp), and peak SPL (Lpeak) individually. Measurement name: allows the user to define a measurement name. If no name is inserted, the default is MSnum (“num” being the number of measurements on the SD plus one). Set measurement duration: how much time the system should run. Set fractional octave bands: sets which fractional octave band is going to used for calculations (1⁄1 or 1⁄3). Figure 11: Screen 3: file retriever and uploader. Connection and connection status buttons: here the user can connect to the system via Bluetooth Low-Energy connection (BLE). Files to retrieve: lists the files saved into the prototype’s SD card and allows the user to select which one to retrieve. Retrieve button: starts the file retrieving process. Upload: upload the retrieved file to a Google Sheets spreadsheet. 4.2. Online spreadsheet A special spreadsheet was created in Google Sheets to receive data from the Android Application. In order to do this, a simple script was added via the Apps Scripts extension, following the instructions present in [26] — see Code 1. When deploying the script, an URL ID is created, which is used by the Android app to access the spreadsheet. Code 1: Script used in the Google Sheets spreadsheet to enable remote data upload. 5. DEPLOYMENT A test deployment was held in an office to verify the system’s behavior. The prototype was set to measure throughout an hour, returning values every one second, saving SPL and Leq values with A, C, and Z frequency-weightings and Fast time-weighting (SPL only), as well as Leq in 1⁄3-octave bands. By the end of the measurement, data was successfully retrieved from the SD card via the Android app and properly sent to the online spreadsheet. Measured results are shown in Figure 12. Figure 12: Deployment test measured levels. 6. FINAL REMARKS AND FUTURE WORK This project was the first step into an autonomous and wireless setup. The system is working as expected, and the hardware offers a very promising performance. However, for the future, improvements must be developed, specifically: Design of a more rugged and reliable data transmission setup; Design of a more robust smartphone application, using professional tools such as Android Studio; Implementation of online and real-time data transmission into a web server; Design of an efficient and redundant power supply setup; and Real-life deployment. ACKNOWLEDGMENTS The authors want to thank all the support from the Acoustical Engineering Program at the Federal University of Santa Maria (UFSM, Brazil), as well as its scholarship programs FIPE and FIEX, which assisted this project. REFERENCES United Nations. 68% of the world population projected to live in urban areas by 2050, says UN. Online, New York, May 2018. URL https://www.un.org/development/desa/en/news/population/2018-revision-o f-world-urbanization-prospects.html. Access on April of 2022. World Health Organization. Environmental Noise Guidelines for the European Region. WHO Regional Office for Europe, Denmark, 2018. ISBN 978-928905356-3. URL https://www.euro.who.int/__data/as sets/pdf_file/0008/383921/noise-guidelines-eng.pdf. L. Cardoso. The politics of noise control in são paulo. Journal of Latin American Studies, 49(4):917–945, dec 2016. doi:10.1017/s0022216x16001978. D. MacCutcheon. Negative responses to urban residential noise as a social rebound effect of increasing population density: Legislative challenges and auditory territoriality. Noise & health, 23:35–41, 2021. ISSN 1998-4030. doi:10.4103/nah.NAH_45_18. H. Tong and J. Kang. Relationship between urban development patterns and noise complaints in England. Environment and Planning B: Urban Analytics and City Science, 48(6):1632–1649, jun 2020. doi:10.1177/2399808320930247. Acústica — medição e avaliação de níveis de pressão snora em áreas habitadas — aplicação de uso geral. Standard ABNT NBR 10151:2019, Associação Brasileira de Normas Técnicas, 2019. IEC. Electroacoustics – Sound level meters – Part 1: Specifications. Standard IEC 61672-1:2013, International Electrotechnical Commission, 2013. International standard. J. Farrés. Barcelona noise monitoring network. In EuroNoise 2015, Maastricht, NL, May 2015. E. Vidaña-Vila, J. Navarro, C. Borda-Fortuny, D. Stowell, and R. M. Alsina-Pagès. Low-cost distributed acoustic sensor network for real-time urban sound monitoring. Electronics, 9(12):1–25, 2020. ISSN 2079-9292. doi:10.3390/electronics9122119. S. Santini and A. Vitaletti. Wireless Sensor Networks for Environmental Noise Monitoring. In 6th GI/ITG KuVS Fachgespraech Drahtlose Sensornetze, pages 98–101, Aachen, Germany, Jul. 2007. R. M. Alsina-Pagès, M. Hervás, L. Duboc, and J. Carbassa. Design of a Low-Cost Configurable Acoustic Sensor for the Rapid Development of Sound Recognition Applications. Electronics, 9(7):1155, jul 2020. doi:10.3390/electronics9071155. F. R. de Melo, W. D’A. Fonseca, and P. H. Mareze. MEMS digital microphone and Arduino compatible microcontroller: an embedded system for noise monitoring. In 50th International Congress and Exposition on Noise Control Engineering - Internoise 2021, pages 1–12, Washington, DC, USA, Aug. 2021. P. von Pflug and D. Krischker. Aspects of the use of MEMS microphones in phased array systems. In Proceedings of Internoise 2017, Hong Kong, China, Aug. 2017. URL http://bit.ly/int2017-mems-array. M. Suvanto. The MEMS microphone book. MOSOMIC, Kangasala, Finland, 1 edition, 2022. ISBN 978-9529456604. URL http://www.mosomic.com/thememsmicrophonebook/. P. Malcovati and A. Baschirotto. The evolution of integrated interfaces for MEMS microphones. Micromachines, 9(7):1–20, n. 323, 2018. ISSN 2072-666X. doi:10.3390/mi9070323. J. Lewis. Analog and Digital MEMS Microphone Design Considerations, 2013. Analog Devices, Technical Article (MS-2472). PJRC – P. J. Stoffregen. Teensy 4.0 Development Board, Teensy Audio Library, Audio System Design Tool, & Creating New Audio Objects, 2021. URL https://www.pjrc.com. Yichone. ESP8266 ESP32. Online, Shenzen doit, 2017. URL https://github.com/SmartArduino/SZDO ITWiKi/wiki/ESP8266---ESP32. IEC. Electroacoustics – Octave-band and fractional-octave-band filters – Part 1: Specifications. Standard IEC 61260-1:2014, International Electrotechnical Commission, 2014. International standard. IEC. Electroacoustics – Sound level meters – Part 2: Pattern evaluation tests. Standard IEC 61672-2:2013, International Electrotechnical Commission, 2013. International standard. ANSI/ASA. Specification for octave-band and fractional-octave-band analog and digital filters. Standard S1-11:2004 (R2009), American National Standards Institute/Acoustical Society of America, 2009. IEC. Electroacoustics – Octave-band and fractional-octave-band filters – Part 2: Pattern-evaluation tests. Standard IEC 61260-1:2016, International Electrotechnical Commission, 2016. International standard. MEMSensing Microsystems. MSM261S4030H0 – I2S digital output mems mic. with multi modes (datasheet), v 1.7, 2018. P. da Silva Wunderlich, W. D. Fonseca, E. Brandão, and P. H. Mareze. DESENVOLVIMENTO DE UM CALIBRADOR DE RESPOSTA RELATIVA PARA TRANSDUTORES ELETROACúSTICOS. In XXVIII Encontro da SOBRAC. Galoa, 2018. doi:10.17648/sobrac-87174. B. Millier. Fancy Filtering with the Teensy 3.6. Circuit Cellar Magazine, (346), 2019. URL https: //circuitcellar.com/research-design-hub/fancy-filtering-with-the-teensy-3-6/. METRIC RAT AI2. Export CSV data (multiple data rows) to Google Sheet. Online, 2022. URL https://ai2.metricrat.co.uk/guides/export-csv-data-multiple-data-to-google-sheet. 1 felipe.mello@eac.ufsm.br. 2 will.fonseca@eac.ufsm.br. 3 paulo.mareze@eac.ufsm.br. Previous Paper 81 of 808 Next