Design, Assembly and Simulation of an Environmental Prototype Station IoT Based on Arduino Mega 2560 and Multiparameter Sensors ()
1. Introduction
The question of environmental monitoring becomes more and more central in Contemporary scientific and political debates [1] [2]. The challenges linked to climate change, air pollution, and rapid urbanization call for the establishment of reliable monitoring systems capable of providing real-time and large-scale data. According to the World Health Organization [3], close of 99% of the population world breathing air that does not meet recommended quality standards has significant impacts on public health, particularly in terms of respiratory and cardiovascular diseases. Similarly, the Intergovernmental Panel on Climate Change [4] emphasizes the importance of having robust environmental databases to support adaptation and mitigation policies.
Traditionally, the environmental monitoring systems [5]-[8] relies on fixed and certified stations often expensive and limited in number, above all in the developing countries [9]. This constraint creates an imbalance in infrastructure measurement between rich regions and those lacking it, particularly in sub-Saharan Africa, especially in the Democratic Republic of Congo. In this context, emerging digital technologies—especially the Internet of Things (IoT) and open-source microcontrollers—appear as a promising alternative [10] [11]. Indeed, these solutions offer the possibility of designing low-cost, modular, interoperable, and easily deployable systems [12].
The rise of accessible electronic platforms like Arduino or ESP8266/ESP32 [13] [14] has significantly democratized the construction of scientific prototypes. These microcontrollers allow the integration of various environmental sensors (temperature, humidity, gas, particulate matter, light, rain), while also providing processing, storage, and communication capabilities [15] [16]. The Arduino Mega 2560 [17] [18], in particular, is known for its multiple inputs/outputs digital and analog its memory more important than that of the Arduino Uno, and the ability to manage multiple serial interfaces simultaneously [19]. These features make it a platform of choice for projects requiring the integration of numerous modules.
A second determining factor is data communication. LoRa (Long Range) and Wi-Fi (ESP-01/ESP8266) technologies respectively enable low-power long-distance transmission and direct internet connectivity. Several recent studies demonstrate the effectiveness of LoRa for deploying environmental sensor networks [20] [21] covering vast geographical areas [22] [23]. As for the Wi-Fi, it remains a flexible solution for real-time data transfer to servers or cloud platforms, thus facilitating visualization and analysis.
The use of these technologies also responds to a growing demand for open science. By making accessible hardware and software solutions available, researchers and local stakeholders can design tools adapted to their socio-economic context. This dynamic is already visible with projects like AirSensEUR [24], an open-source station European source, or again the citizen sensors deployed by the local communities within the framework of participatory science initiatives [25].
The project presented in this article registers in this logic. It aims as a design, to go up and to simulate in the laboratory an environmental prototype station integrating an Arduino board The Mega 2560 [26] [27], several multiparameter sensors (temperature, humidity, CO2, particulate matter, various gases, light intensity, rain), an OLED display, local memory via SD card, a real-time clock (RTC), and two wireless communication modes (LoRa and ESP-01 Wi-Fi). The objective is twofold: to demonstrate the technical feasibility of such a station with readily available components, and to validate its operation in the laboratory before future field deployment.
2. Materials and Methods
The design of this environmental prototype station required careful consideration of component selection, their hardware and software organization, and the experimental procedure followed in the laboratory. The methodological approach adopted rests on a modular architecture and evolving, inspired of the current practices in embedded engineering systems and the Internet of Things (IoT). The instruments that are commonly used are thermometer ThermoPro TP55 Digital Thermometer, HTC 1 hygrometer, portable CO2 detector CM 1106-NH and lux meter led DT 3809. Matlab enabled us to simulate the prototype (Figure 1).
Figure 1. Instruments commonly used in the laboratory.
2.1. Design of General Architecture
From the earliest stages of the project, it was essential to define a clear and coherent architecture in order to ensure the compatibility among the different modules. The heart of East system constituted by an Arduino board The Mega 2560 was chosen for its numerous digital and analog inputs/outputs, as well as its four hardware UART ports, essential for managing multiple operating sensors in serial communication simultaneously. This board acts as the conductor of device, coordinating the collection of the data, their treatment, their display and their transmission.
Around this central unit gravitate several subsystems:
A set of different environmental measuring sensor parameters (temperature, humidity, gases, particles, brightness, rain),
of the modules communication allowing their local transmission or distant data,
of the peripherals storage and of temporal synchronization,
Thus, that a local intended display has a view in real time of the information collected.
To ensure interconnection, we opted for standardized communication buses that limit the risk of conflicts among the modules. Thus, I2C was reserved for coupling the OLED screen and of the real clock time, the SPI has served for the map SD and the module LoRa SX1278, and the different ports UART of their map Arduino have allowed to separate the communication series between the CO2 sensor (MH-Z19B), the fine particle sensor (SDS011) and the Wi-Fi module (ESP-01). This methodical cutting has allowed obtaining a robust system, flexible and easily debuggable (Figure 2).
Figure 2. Conceptual diagram of prototype material architecture in Proteus 9 (Arduino at the center, connected to sensors, communication modules and peripherals).
2.2. Central Microcontroller: Arduino Mega 2560
The choice of a microcontroller was obvious. Unlike the Arduino Uno, limited to a single hardware serial port and relatively small memory, the Arduino Mega 2560 features:
54 digital pins, of which 15 usable in PWM;
16 analog ideal entrances for the analog sensors as the MQ-135 and the rain sensor;
4 material ports UART (Serial, Serial 1, Serial 2, Serial 3), allowing each serial module have an independent connection;
256 kB of flash memory and 8 KB of RAM (SRAM) are more than sufficient for the support of the gourmand libraries as those of LoRa, from the OLED SSD1306 screen or the SD card.
This technical configuration makes it a preferred platform in the construction of complex scientific prototypes, as already shown by similar work in environmental IoT [28] (Table 1).
Table 1. Main feature techniques of the Arduino Mega 2560.
Characteristic |
Description/Value |
Microcontroller |
ATmega2560 |
Architecture |
8 bits |
Functioning Tension |
5 V |
Food Tension recommended |
7 V has 12 V |
Food Tension maximum |
6 V has 20 V |
Flash Memory |
256 Ko (of which 8 KB used speak bootloader) |
SRAM |
8 KB |
EEPROM |
4 KB |
Clock Frequency |
16 MHz |
Number of pins digital I/O |
54 pins (of which 15 can be used as exits PWM) |
Analog entries number |
16 entrances |
Fluent by pin I/O |
20 my |
Fluent maximum on the 3.3 V pin |
50 my |
Communication Interfaces |
UART (4), SPI, I2C, USB |
USB Connector |
Kind B |
Analog-Digital Converter (ADC) |
10 bits |
Dimensions |
101.52 mm × 53.3 mm |
Weight |
37 g |
2.3. Environmental Sensors: Description and Justification of the Choice
The objective of prototype being to provide a multiparameter version of several additional sensors have been integrated into the environment.
DHT22 (Temperature and humidity): selected for its good precision (±0.5˚C and ±2% HR) and its ease of integration. It offers reliable measurement for climatology or indoor comfort monitoring applications.
MH-Z19B (Carbon Dioxide, CO2): NDIR infrared sensor, with a range of 0 to 5000 ppm and a precision of ±50 ppm + 5%. It has been retained for its reliability and its possibility of calibration, essential criterion for a scientist station [29].
MQ-135 (Various Gases): This semiconductor sensor responds to a wide range of polluting gases. (ammonia, benzene, fumes). Though its measures require a calibration, it constitutes an interesting indicator of global air quality [30].
SDS011 (Particles) thin, PM2.5 and PM10): based on a technology laser of broadcast, this sensor is known for its sensitivity and accuracy (±10 µg/m3). Recent studies [31] demonstrate its relevance for monitoring urban pollution.
LDR (Photoresistor): used as a sensor of brightness. Tough basic, it provides useful information on local lighting conditions.
Rain sensor (analog): detects the presence of humidity on its surface allows us to estimate the relative intensity of precipitation.
Each of these sensors meets a specific need and their joint integration gives the prototype a multidisciplinary character, ranging from meteorology to monitoring air pollution (Table 2).
Table 2. Specification techniques of the sensors integrated at prototype (range of measurement, precision, communication protocol).
Sensor |
Setting measures |
Range of measures |
Precision/
Resolution |
Communication protocol |
Additional remarks |
DHT22 |
Temperature, Humidity |
-40 has 80˚C;
0% - 100% HR |
±0.5˚C; ±2% RH |
Digital (1-wire) |
Response time ~2 s, requires 10 kΩ pull-up |
MH-Z19B |
CO2 (ppm) |
0 - 5000 ppm |
±50 ppm or ±5% |
UART/PWM |
Infrared calibratable sensor |
MQ-135 |
Gases (NH3, NOx, benzene, fumes) |
10 - 1000 ppm (approx.) |
Variable depending on gas |
Analog (0 - 5 V) |
Preheating time ~24 h; requires calibration |
SDS011 |
Particles PM2.5/PM10 |
0 - 1000 µg/m3 |
±10 µg/m3 or ±10% |
UART |
Integrated fan, controlled speed air |
GP2Y1010AU0F |
PM2.5 particles |
0 - 800 µg/m3 |
±10% |
Analog (0 - 5 V) |
Optical sensor, sensitive to fine dust |
LDR (photoresistivity) |
Brightness (lux) |
1 - 10,000 lux |
Variable depending on resistance |
Analog (0 - 5 V) |
Simple and economical, non–linear answer |
Rain sensor (analog) |
Rainfall/Relative humidity |
0% - 100% wet surface |
Qualitative/variable |
Analog (0 - 5 V) |
Proportional output has water conductivity |
2.4. Modules of Communication
The ability of the system has to transmit the data in real time constitutes a fundamental criterion. Two complementary technologies have been integrated:
LoRa SX1278: reknown for its long range and its weak consumption energy, it allows to transmit the data on several kilometers in free field. Based on chirp modulation spread spectrum, it is particularly suited to urban environments where obstacles disrupt transmissions (Augustin et al., 2016).
ESP-01 (ESP8266): This little module Wi-Fi assures the direct connection has Internet via a local network. It can transmit data in MQTT or HTTP format, facilitating integration with the platforms of visualization such as ThingsBoard, Node -RED or Grafana.
These two complementary modules assure the station a double ability of communication, both local and global, thus guaranteeing its flexibility of use.
2.5. Storage Peripherals and Temporal Synchronization
In order to give back the station autonomous, two components have been integrated:
1) A drive of map SD, allowing the local recording of the measures at CSV format. This solution guarantees data backup even in the event of a network outage;
2) A real clock time DS3231, extremely precised, which timestamps each measure and ensures the temporal continuity of the tracking (even in the event of a microcontroller restart).
2.6. Local Display
The 0.96-inch SSD1306 OLED screen, connected via I2C, was chosen for its compact size and low power consumption. It allows to display in the main direct measures (temperature, humidity, CO2, fine particles), thus offering a fast diagnostic interface.
2.7. Food System
The East prototype powered by an external source of 12 V DC, regulated has 5 V via a step-down. The sensitive modules as the LoRa SX1278 and the ESP-01 require a food stabilized at 3.3 V, supplied by a specific regulator (AMS1117). This configuration avoids the risk of overheating or malfunction due to voltage variations.
2.8. Experimental Procedure of Laboratory Simulation
The laboratory simulation has followed up a progressive and rigorous approach in order to restrict the risks of errors and ensuring the validity of the results (Table 3):
Table 3. Plan of laboratory simulation (steps, tested modules, expected results).
Stage |
Tested modules |
Objective/Aim |
Procedure/Activity |
Expected results |
1 |
Food and wiring |
The modules are properly powered and that there is continuity of wiring |
Connect the Arduino, sensors, and OLED screen according to the diagram; measure the voltage on each module |
All modules receive the appropriate voltage (5 V/3.3 V), not of short circuit |
2 |
Sensor DHT22 (Temperature & Humidity) |
Test the accuracy of environmental measurements |
Read the data all take 10 seconds and compare with a reference hygrometer/thermometer |
The values are consistent with the instrument references (±2˚C, ±5% HR) |
3 |
Sensor MH-Z19B (CO2) |
Check the gas detection and calibration |
Simulate of the known CO2 concentrations and observe the answer sensor |
The sensor correctly detects concentrations and displays the value on OLED screen |
4 |
MQ-135 (Quality of the air/gas miscellaneous) |
Test the sensitivity to pollutants |
Expose the sensor has ambient air and sources of simulated pollution |
Variation of analog signal depending on the presence of pollutants |
5 |
Sensor PM2.5 |
Check the measurement of thin particles |
Generate of the simulated smoke (e.g., candle, steam) and read the values on Arduino |
PM2.5 concentrations are increasing proportionally to the presence of particles |
6 |
LDR And rain sensor |
Test the light measurements and precipitation |
Simulate day/night for the coolant and add a few water drops for rain sensor |
LDR noted light variation; sensor rain drop detectors and sends signal |
7 |
LoRa communication/ESP-01 |
Testing the data transmission to remote server |
Send the data collected to a receiving module or cloud server |
Data correctly received remotely without loss |
8 |
OLED screen |
Check display data |
Display all the measurements collected by the sensors |
Clear display and has a day of all the data |
9 |
Full simulation |
Check the total integration of the prototype |
Execute the complete program with all sensors and module assets |
Data from all sensors are measured, displayed and transmitted correctly; no bus conflict I2C/SPI |
1) Progressive assembly: each sensor was individually integrated into the system, starting with the simplest (DHT22, LDR) before moving to the more complex modules (MH-Z19B, SDS011, LoRa, ESP-01).
2) Unit test: for each sensor, a minimal sketch (Arduino program) was used to verify the proper functioning of the hardware and the associated library.
3) Progressive integration: After unitary validation, the different modules have been added to the main sketch, taking care to avoid library and communication conflicts.
4) Final validation: once the complete system was assembled, cycle measurements were executed, including data acquisition, display, recording to SD card and transmission via LoRa and Wi-Fi.
3. Results
This section presents successively the results relating to the measurement of environmental parameters, the local data recording, their real-time display, and finally their transmission via the LoRa and Wi-Fi communication modules.
3.1. Environmental Measures
The set of sensors has answered in accordance to specification techniques announced by the manufacturers. The initial tests consisted of comparing the data raw materials of the prototype with reference on instruments available in the laboratory such as digital ThermoPro TP55 Digital Thermometer, HTC 1 hygrometer, portable CO2 detector CM 1106-NH and lux meter led DT 3809.
The results show good agreement between measurements, with small average deviations consistent with the expected accuracy of low-cost sensors (Table 4).
Table 4. Comparative measures data (prototype vs reference instruments).
Setting |
Prototype (average) |
Reference (average) |
Gap relative |
Temperature (˚C) |
26.4 |
26.1 |
+1.1% |
Humidity (%) |
58.2 |
57.0 |
+2.1% |
CO2 (ppm) |
432 |
420 |
+2.8% |
PM2.5 (µg/m3) |
15.6 |
14.8 |
+5.4% |
Brightness (lux) |
310 |
305 |
+1.6% |
Rain detection (binary) |
Detected presence |
Confirmed presence |
Concordant |
These discrepancies, although present, remain within the tolerance range of the sensors used. They confirm the relevance of system for an environmental indicator and participatory follow up, even though regular calibration would be necessary for professional use.
3.2. Local Data Registration
The system successfully saved the measurements to the SD card in CSV format. Each line included an accurate timestamp provided by the real-time clock (RTC DS3231) follow up of the measured values. This format facilitates direct import into statistical software analysis (Excel, R, Python).
CSV Extract file generated by the prototype:
Date |
Time |
Temperature (˚C) |
Humidity (%) |
CO2 (ppm) |
PM2.5 (µg/m3) |
PM10 (µg/m3) |
Brightness (lux) |
Rainfall |
2025-09-09 |
10:15:32 |
26.4 |
58.2 |
432 |
15.6 |
22.3 |
310 |
1 |
2025-09-09 |
10:20:32 |
26.6 |
57.9 |
428 |
14.9 |
21.7 |
295 |
0 |
2025-09-09 |
10:25:32 |
26.5 |
58.1 |
435 |
16.2 |
23.0 |
320 |
0 |
This reliable registration constitutes a guarantee of traceability and assures a continuity of the data in case of loss of network connection.
3.3. Display in Real Time
The SSD1306 OLED screen accurately displayed the measurements in cyclic scrolling mode. This useful feature proved during debugging and rapid inspection phases in the laboratory. The interface was legible, even in weak brightness, confirming the relevance of this component selection (Figure 3).
Figure 3. OLED Display during the simulation (temperature, humidity, CO2, PM2.5).
3.4. The Data Transmission via LoRa and Wi-Fi
The tests of communication have confirmed the robustness of adopted architecture:
1) The LoRa SX1278 module enabled to transmit data on a distance of over 800 meters in semi-open field, with a rate of loss lower than 5%. This performance is consistent with previous studies (Augustin et al., 2016) and validates the adaptability of the system for outdoor use. For optimal LoRa range testing, the key technical parameters to configure are the SF12 Spreading Factor, a BW Bandwidth of 125 kHz, and a Maximum Transmit Power of 14 dBm.
2) The ESP-01 (Wi-Fi) module ensured real-time data transmission to a local cloud platform (via MQTT protocol). The values were then displayed in a table of edge (dashboard) simple, confirming interoperability of system with the modern IoT tools (Node-RED, Grafana).
3.5. Visualization Chart of the Data
The data issues of the simulation have been represented below the shape of graphs in order to assess temporal trends (Figure 4, Figure 5).
Figure 4. Temporal evolution of the temperature and humidity during 2 hours of simulation.
Figure 5. Measured concentrations in CO2 and PM2.5 on the same period.
These graphs put in evidence the stability of system and the ability of prototype has followed continuous variations in environmental parameters.
The main results obtained can be summarized as follows:
1) The sensors have provided the measures consistent with the instruments of reference, with small differences (≤5%).
2) The recording local on map SD has revealed reliable and usable for further analyses.
3) The OLED display offers a direct practical and clear reading.
4) The modules LoRa and Wi-Fi guarantee a double redundancy of communication, local (long range) and global (Internet connection).
5) The visualization graphs confirm the stability of system and the relevance for indicative monitoring sensors.
These results constitute a key stage towards the validation of prototype, opening the way as a discussion in-depth on its performance, its boundaries and its perspective improvement.
4. Discussion
The design and laboratory simulation of the Arduino-based environmental prototype station The Mega 2560 sensors demonstrate that it is possible to develop low-cost, modular, and interoperable systems for environmental monitoring [15] [16]. However, as with any experimental setup, the results should be interpreted with caution, taking into account the technical limitations of the sensors and the challenges associated with their integration.
The comparative results (Table 1) have shown the weak gaps between the prototype sensors and reference instruments confirmed that the solution can provide reliable indicative measurements. However, the absolute accuracy remains lower than that of officially accredited stations (Kumar and al., 2015). For example, the sensors of thin particles low cost as the SDS011 are sensitive to relative humidity and require regular calibration to remain consistent with reference stations. To calibrate the MQ-135 sensors, principal calibration methods are such as fresh air calibration, calculation of Ro (Reference Resistance), potentiometer adjustment, humidity/temperature correction and the use of libraries. For SDS011 calibration, methods commonly used include real-world colocation, linear regression correction, relative humidity modeling, and clean-air calibration [31].
Likewise, the sensor MQ-135, though versatile, does not allow to discriminate the different gases present and reacts strongly to variations in ambient temperature. This limits its use to an indicative pollution detector role, rather than a quantitative instrument [25].
Thus, the prototype responds to a logic of observatory citizen or academic platform for training and applied research, but cannot replace a certified station for environmental regulations.
The adopted architecture is based on Arduino use of the Mega 2560 and separate communication buses (UART, I2C, SPI) enabled the integration of more than ten modules and sensors without major conflicts. The success of the simulation confirms the relevance of the modular approach.
The choice of a double communication (LoRa and Wi-Fi) reinforces the resilience of the system:
The LoRa assures a blanket long distance, useful in rural areas or in distributed networks [23].
The Wi-Fi via ESP-01 allows a direct connection as Internet and the sending towards cloud platforms (MQTT, HTTP).
This essential redundancy for the contexts or access has irregular Internet, but continued data collection remains necessary.
From the recent confirmed studies, the interest to develop the low cost systems of environmental monitoring is for example:
[9] have observed that the networks of citizen sensors can complete official stations by providing finer spatial coverage.
[12] have evaluated several sensors of thin particles low cost and concluded that, despite uncertainties, they are useful for detecting relative variations.
[18] [32] used LoRaWAN-based IoT architectures for monitoring in real time of the quality of the air, with the relative results of those obtained in this study.
These comparisons locate our work in an international tendency aiming as an environmental democratized monitoring using open-source technologies and the Internet of Things.
5. Conclusions
The design, assembly, and laboratory simulation of an environmental prototype station resting on the Arduino Mega 2560 platform and a panoply of low-cost sensors demonstrate the feasibility of a modular system, flexible and accessible for the environment monitoring. The results obtained show that:
The sensors deployed (temperature, humidity, CO2, fine particles, various gases, brightness, rain) provide consistent measures with the instruments of reference, within the limits of their nominal accuracy.
Architecture material, combining bus UART I2C and SPI, has permitted to integrate more of ten modules without major interference, confirming the robustness of the modular approach.
The double communication without thread (LoRa long scope and Wi-Fi via ESP-01) reinforces the resilience of the system, opening the way to usage scenarios in both urban and isolated areas.
Local recording (SD card) and real-time display (OLED) ensure the data continuity and an immediate consultation, two crucial advantages for academic and applied research contexts.
However, the limitations observed, including the sensitivity of the ESP-01 module to power supply, the need to calibrate certain sensors (SDS011, MQ-135), and the management of the volume of generated data, confirm that this prototype should be considered as a proof of concept rather than as a solution that can be immediately deployed on a large scale.
The main contribution of this work resides in the demonstration that an embedded low cost system and open source can be designed for answer to environmental monitoring needs in contexts with limited resources. Unlike official stations which are often expensive and few in number, this type of solution democratizes environmental data collection, paving the way:
of the participatory science projects involving citizens;
of the educational applications for the students in electronics, computer sciences and environmental sciences;
of the distributed sensor networks, capable of completing the stations of reference with a best spatial blanket.