44 Journal of Engineering, Mechanics and Architecture www. grnjournal.us AMERICAN Journal of Engineering, Mechanics and Architecture Volume 3, Issue 4, 2025 ISSN (E): 2993-2637 Sending Carbon Monoxide (CO) Concentration Data to MS Excel and Creating a Database Marasulov Islombek Ravshanbek o‘g‘li Assistant, Andijan state technical institute m_islombek92@mail.ru Abstract: There are several ways to detect and monitor work gas, and it is now advisable to select the most appropriate one. This article describes solutions for sending information from the MQ-7 sensor to the MS Excel program directly for a certain period of time and storing it in the form of a database. Keywords: carbon monoxide, Arduino, Temperature, MS Excel, Sensor, Sketch, Data acquisition. Introduce Carbon Monoxide Gas, CO — is a colorless, odorless, and toxic gas. It is produced by the incomplete combustion of coal and organic substances. Its molecular weight is 28.0, and its density is 814 kg/m³. It liquefies at –191.5 °C and solidifies at –205 °C. It is slightly soluble in water but dissolves well in dichloroethane, ammonium hydroxide solution, and hydrochloric acid under pressure. Carbon monoxide can be liquefied. When it burns, a large amount of heat is released. Under the influence of light or in the presence of activated carbon, it reacts with chlorine to form phosgene. Carbon monoxide has harmful effects on the human body. There is a very small amount of carbon monoxide in the atmosphere. It is also found in rocks, coal, and combustible gases. Industrially, it is produced by converting solid fuels into gas. In laboratories, it can be obtained by reacting concentrated sulfuric acid with formic acid. In metallurgy, it is used to reduce metals from their oxides. Nowadays, it is possible to obtain measurement results for all parameters using sensor detectors. Moreover, these results can be monitored through various displays located in the same environment where the sensor is installed. The data can also be transmitted to personal computers and mobile phones using both wired and wireless methods. The transmitted information is stored as a database, providing the user with the ability to continuously monitor and compare the parameters. This device can also be used in household conditions to detect carbon monoxide emitted from the incomplete combustion of coal, wood, or natural gas. The device is powered by a 5–9 V power supply and is installed in front of any fuel-burning stove. This article discusses one possible solution to this issue. Main part Problem statement It is possible to install all types of analog and digital sensors onto a microcontroller board and receive the necessary parameters from them. In the process analyzed in this article, an Arduino 45 Journal of Engineering, Mechanics and Architecture www. grnjournal.us board is used as the microcontroller. The information from the sensor can be monitored on an LCD or the Arduino serial monitor. However, there is no capability to monitor the data at specific time intervals and store it in the form of a database. This setup only allows real-time observation of the transmitted data. It is not possible to view or compare the previous values of the updated data. As a result, the parameters measured at past moments in time remain unidentified. Research methods It is possible to create a system in which the data coming from the sensor is sent directly to MS Excel at specific time intervals and stored as a database. In this way, monitoring carbon monoxide (CO) gas (or any other parameter) continuously is no longer required, and it becomes possible to compare the presence or concentration of carbon monoxide at different times. Carbon monoxide has been selected as the parameter to be transmitted. While signaling the received information, the CO gas sensor also sends the data to MS Excel at specified time intervals. Likewise, this can be adapted for other parameters such as humidity, dust concentration, distance, and so on. To solve this issue, the "DATA Acquisition for Excel" macro is used. Solution to the problem and obtained results First, the Arduino platform is connected via cables to the analog carbon monoxide sensor. The MQ-7 model sensor is selected as the device for measuring CO gas. Figure 1. The procedure for connecting the carbon monoxide sensor pins to the ports of the Arduino platform. General information about the MQ-7 carbon monoxide sensor The MQ-7 sensor is a semiconductor device. Its operating principle is based on the change in resistance of a thin film layer of tin dioxide (SnO₂) when it comes into contact with specific gas molecules. The sensitive element of the sensor consists of a ceramic tube coated with Al₂O₃ (aluminum oxide), and a sensitive layer of tin dioxide applied to it. A heating element runs through the inside of the tube, heating the sensitive layer to the temperature at which it begins to react with the detected gas. Sensitivity to different gases can be achieved by altering the composition of the additives in the sensitive layer. Measurement Range  Carbon monoxide (CO): 20–2000 ppm. Specifications  Sensor operating voltage: 3.3–5 V; 46 Journal of Engineering, Mechanics and Architecture www. grnjournal.us  Power consumption: 180 mA;  Detection range: 100–10000 ppm;  Dimensions: 25.4 × 25.4 mm;  Interface: Analog and digital;  Response time: Less than 10 seconds;  Operating temperature: -10°C to +50°C;  Operating humidity: Not more than 95%;  Recovery time: Less than 150 seconds. Once the device is brought into operation, it is connected to the computer via an Arduino cable. This cable serves both as the data transmission and power source. If the data needs to be sent over a certain distance or monitored remotely, Bluetooth or Wi-Fi modules can be used. In this case, the device can be operated anywhere without the need to connect it directly to a computer. Additionally, if LED lights or buzzer elements are added to the device, when the concentration of carbon monoxide in the environment increases, these connected elements can be used for signaling. Next, a program for the temperature sensor is written in the Arduino sketch. This program includes a code (command) to send data to the MS Excel data sheet. The transmitted data can be accepted by the MS Excel program either indefinitely or refreshed after a certain period, depending on the operator’s preferences. Below is the software developed and presented by the author, which includes the code for measuring temperature and sending the obtained data to MS Excel. #include #include #define MQ7PIN A0 dht11 MQ7; int row_excel = 0; // Qatorlar miqdori int CO; // excelga jo’natish uchun o’zgaruvchi void setup(){ Serial.begin(9600); // Ma’lumot yuborish tezligi Serial.println("CLEARDATA"); // Excel listini tozalash Serial.println("LABEL, Sana, Vaqt, Namlik, Temperatura, Qatorlar"); // Qator nomlari } void loop(){ row_excel++; // qatorlar raqami + 1 Serial.print("DATA, DATE, TIME,"); // Excelda joriy vaqt va sanani aks ettirish int chk = MQ7.read(MQ7PIN); Serial.print((float)MQ7.CO 2); Serial.print(","); Serial.println(row_excel); // Agar qatorlar 50 ga yetganda, axborotlar yana yangi qarotdan boshlanadi 47 Journal of Engineering, Mechanics and Architecture www. grnjournal.us //if (row_excel > 50) { //row_excel = 0; //Serial.println("ROW,SET,2"); //} delay(2000); // } After the software is written, it is uploaded to the microcontroller on the Arduino platform, and the sensor device is tested. This test can be monitored on the Arduino sketch monitor. Once the device is tested, we can send the incoming data to the MS Excel program. Although the software written in the Arduino sketch contains a command to send values to MS Excel, it is not possible to directly connect it with the MS Excel program. To synchronize the Arduino sketch and MS Excel data sheets, we use the PLX-DATA Acquisition for Excel macro. This macro helps to connect two Arduino sketches with the MS Excel program. Figure 2. Interface of the Data Acquisition for Excel macro. Installing and using PLX-DAQ on a computer After PLX-DAQ is installed on the computer, a folder named PLX-DAQ will be created on the desktop. To run this macro, you need to access the PLX-DAQ Spreadsheet shortcut within this folder on the desktop. This shortcut will also open Microsoft Excel along with the macro. Figure 3. Working state of the PLX-DATA Acquisition for Excel macro. 48 Journal of Engineering, Mechanics and Architecture www. grnjournal.us Once the Arduino platform is connected to a specific port, the port number will also appear in the "Port" field of the macro. After the device is connected, the "Connect" button is clicked. As a result, the data coming from the sensor installed on the Arduino platform will be displayed in the rows of Microsoft Excel at the specified time intervals. This macro also has features to refresh the time and clear the data rows. After the required data is collected, the file is saved using the usual saving method in MS Excel. Subsequent data results will be generated in the same manner. Figure 4. Results obtained using the device. Scientific results obtained within the scope of the research Previously, the information obtained from the carbon monoxide sensor could only be displayed on LCDs, and there was no capability to store the data. As a result of this research, it is now possible to continuously monitor the data from the sensor, store it in the form of a database, and compare previous readings with future ones. The time intervals of the data being sent to the database can be adjusted. In addition, by connecting sensors that measure other physical quantities, it is possible to form a data repository that includes not only temperature and humidity but also other parameters. References 1. Jeremi Blum. Изучаем Arduino-инструменты и методы технического волшебства, Санкт-Петербург. 2015. 2. A.V. Belov. Создаем устройства на микроконтроллерах, Санкт-Петербург.2007. 3. Белов А.В. Микроконтроллеры AVR. От азов программирования до создания практических устройств – 2016. 4. Петин В.А. Проекты с использованием контроллера Arduino (Электроника) 2014. 5. https://uz.wikipedia.org/wiki/Is_gazi