In this blog, I will share how to build a real-time environmental noise detection system using Arduino Nano 33 IoT, WiFiNINA, and WebSocket, and document the problems and solutions I encountered during the project.

💡 Inspiration

Week 2

Week 5: 25 Feb

💡 Project objectives

I wish to build a real-time environmental noise monitoring system that can:

Collect environmental noise data through Arduino Nano 33 IoT and send it to the server. The server receives the data and transfers it to the front-end of the web page using WebSocket. The front-end of the web page displays the data in real time through charts and tables, including the current noise level, the original noise data.

🛠️ 1. Project realization

1️⃣ Hardware Arduino Nano 33 Internet of Things SparkFun Sound Detector Button Pixel Screen WiFi network

2️⃣ Software & Technology

Arduino IDE (writing embedded code) Node.js + WebSocket (server) HTML + CSS + JavaScript (front-end web presentation,visualizing data)

📡 2. Arduino Code

On the Arduino Nano 33 IoT side, my code is mainly responsible for:

Acquiring noise data: using analogRead(A0) to read the envelope of the sound signal. Data Mapping: Mapping the raw noise signal (0-1023) to the 30-100 dB range. Connect to WiFi: Connect to a LAN using the WiFiNINA library. Send data using TCP: Sends data to the server via WiFiClient.

截屏2025-02-24 16.44.25.png