The CLEAN Mobile Monitor Prototype

Figure 1. CLEAN mobile monitor prototype

The low-cost mobile monitor (Figure 1) was developed at the Laboratory of Air Quality Control (LCQAr) for measuring air pollutants: carbon monoxide, nitrogen dioxide, sulfur dioxide, and ozone. The hardware is composed of three main blocks: 1) gas transportation, 2) sensors, and 3) microcontroller, as shown in Figure 2. The gas transportation stage captures ambient air samples into the sensors. For this prototype, we used two 5 VDC cooler fans as shown in Figure 3. For this prototype, we used four digital electrochemical sensors for IoT manufactured by SPEC Sensors, as will be described below.

Figure 2. Main hardware blocks
Figure 3. The cooler fan used for gas sampling

The microcontroller we used for the system was the Microchip ATMega2560, embedded into an Arduino Mega platform. The ATMega2560 receives the concentration readings from the digital sensors through a serial hardware interface. The hardware also obtains the time and location where each sample is collected through a GPS module. The microcontroller stores the gas concentration information, alongside the timestamp and coordinates where the readings were taken, into a micro SD card and transmits it to a remote server. A Wi-Fi connection is required for data transmission which is established through an ESP8266 module.

The Sensors

The sensors block consists of an array of four digital screen-printed electrochemical sensors for IoT manufactured by SPEC Sensors, as shown in Table 1. For more detailed information on the electrochemical principle for measuring gas concentration check out the review by Ronan Baron and John Saffell on the subject (BARON and SAFFELL, 2017).

Table 1. Sensors features

Qty.ModelManufacturerAir pollutantRangeResolutionSupply voltage (*)
1DGS-O3 968-042SPEC SensorsOzone0 – 5 ppm20 ppb3.3 V
1DGS-NO2 968-043SPEC SensorsNitrogen dioxide0 – 5 ppm20 ppb3.3 V
1DGS-SO2 968-038SPEC SensorsSulfur dioxide0 – 20 ppm50 ppb3.3 V
1DGS-CO 968-034SPEC SensorsCarbon monoxide0 – 1000 ppm100 ppb3.3 V

*Note: This is the voltage for powering the interface circuit boards of the sensors. See the SPEC Sensors Conditioning Interface section

SPEC Sensors

The SPEC sensors are amperometric, i.e. electrochemical sensors that generate a current proportional to the gas concentration (STETTER and LI, 2008). They use a three electrodes electrochemical configuration, which is the most common for this kind of transducer, i.e.: working, reference, and counter electrodes. SPEC stands for Screen-Printed Electrochemical, which is the technology used for manufacturing the sensors, reducing their cost and dimensions, and still maintaining a high performance (SPEC Sensors, 2016).

SPEC Sensors Conditioning Interface

Amperometric electrochemical sensors produce an output current that is proportional to the gas concentration. In order to read this electrical signal from an acquisition system, the output current must be transformed into a voltage signal. For that purpose, the most commonly used circuit is the potentiostat. SPEC provides potentiostat circuit boards for easily coupling its sensors into a monitoring system.

The digital sensors for IoT that are provided by SPEC are composed of an electrochemical transducer mounted on a circuit board with a potentiostat circuit, for converting the sensor output (current) into voltage; an embedded microcontroller; and a temperature and relative humidity sensor. The microcontroller converts the voltage signal into gas concentration values and implements a software compensation for the effects of the temperature and the relative humidity on the sensor output. The concentration, temperature, and relative humidity values are transmitted through a UART interface following a serial protocol defined by the manufacturer. For more information on the SPEC sensors, like electrical specifications, dimensions, pinout, and serial protocol please check the sensors’ datasheets (Table 1) and the Digital Gas Sensor Developer Kit.

For our prototype, we coupled the sensors shown in Table 1 from SPEC, mounted on their interfacing boards, and the Arduino MEGA microcontroller into an RS-485 bus. For each sensor and the microcontroller, a MAX487 transceptor was used for interfacing between the UART ports and the RS-485 bus. Figure 4 illustrates the connection between the sensors and the Arduino MEGA. The serial port used for that purpose on the microcontroller was UART2. The digital ports D02 – D10 of the Arduino were used as outputs for controlling the Read/Write sequence from and to the sensors over the RS-485 bus. The sensor boards must be powered with a 3.3 V power supply. For more details on mounting and connecting the SPEC sensors check out The SPEC Sensors Mounting Guide.

Figure 4. Hardware interface between SPEC sensors and the microcontroller

The Microcontroller

The Arduino MEGA 2560 microcontroller coordinates the tasks associated with data acquisition, data storage, timing, geolocation, and communication. The firmware for this prototype is available in our firmware repository. For details on the firmware structure and firmware libraries please refer to the Firmware Documentation.

Data Storage
Figure 5. SPI connection between micro SD module and the Arduino MEGA

For data storage, we used a micro SD module connected to the microcontroller through a Serial Peripheral Interface (SPI). The micro SD card works with 3.3 V, but the module includes buffers and a voltage regulator that allows a direct connection to the Arduino SPI and to a 5 V power supply, as shown in Figure 5.

GPS Module
Figure 6. The connection between the GPS module and the Arduino MEGA

A GPS module keeps track of the location and the date and time of the gas concentration readings. For this prototype, we used the NEO6M GPS module from U-blox, which is a low-power GPS receptor, with a precision of 5 m. The communication between the GPS module and the Arduino MEGA microcontroller is done through a serial port (UART1), as shown in Figure 6, at a baud rate of 9600 bauds. The module can be powered with 3.3 V or 5 V. For our application we used a 5 V power supply.

Wi-Fi Communication
Figure 7. The ESP-01 module

For Wi-Fi communication, we used the ESP-01 module (Figure 7). This module incorporates the ESP8266 microcontroller together with an embedded antenna with a power gain of 3dBi and a range of up to 90 m. The ESP8266 is a System on Chip (SoC), manufactured by Espressif Systems, which integrates the 32-bits microprocessor Tensilica L106 and implements the TCP/IP and 802.11 b/g/n WLAN MAC protocols. The ESP-01 also incorporates a 512 kB flash memory for programming, which is accessible to the ESP8266 via SPI. It also has eight pins that are used for power supply, connection to the ESP8266 serial port, and connection to four GPIOs of the ESP8266, as shown in Figure 7. For more details on the ESP-01 pinout and how to program and connect this module to the Arduino MEGA, please refer to The ESP-01 Module Programming Guide. A description of the firmware we developed for the ESP8266 microcontroller can be found at The ESP8266 Firmware.

Figure 8. Connection diagram between the ESP-01 Wi-Fi module and the Arduino MEGA

The ESP-01 module provides the connection to a Wi-Fi network for the Arduino MEGA. As shown in Figure 8, a level shifter circuit is required for interfacing with the Arduino pins as a consequence of the different operating voltages of the boards. The HV pin of the level shifter is connected to the digital pin D13 of the Arduino only as a voltage reference of 5 V; it could be connected to any other voltage source that provides that level of electrical tension. The communication between the ATMega2560 and the ESP8266 microcontrollers is implemented over a UART interface (UART3 on the Arduino board), following a communication protocol that is described in detail in The ESP-01 Module Programming Guide. The Arduino acts as a master over the ESP8266, whose only initiative is to establish a connection to the Internet. Once the connection is set, the Arduino can send commands for creating HTTP posts, getting the internet time, or getting the Google geolocation coordinates (more details in The ESP-01 Module Programming Guide). The Arduino microcontroller can also reset the ESP8266 through the D12 GPIO pin.

Visualizing the state of the modules
Figure 9. Connection diagram of the LEDs to the Arduino MEGA

The prototype has three LEDs connected to digital pins of the Arduino MEGA for indicating the state of the GPS module, the sensors, and the SD card. If a module is working properly the corresponding LED will remain on, otherwise, it will blink. Figure 9 illustrates the connection of the LEDs to the Arduino board.

References:

Translate