<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A Design of Data Acquisition and Intelligent Electrical Cabinets</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Yuji Jiang</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Yongjie Yang</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>School of Information Science and Technology, Nantong University</institution>
          ,
          <addr-line>Nantong</addr-line>
          ,
          <country country="CN">China</country>
        </aff>
      </contrib-group>
      <fpage>121</fpage>
      <lpage>127</lpage>
      <abstract>
        <p>In modern industrial age, the use of electric energy has a higher status in the production and operation of enterprises. In order to ensure the safe and stable operation of the power distribution cabinet in the power distribution room, and to improve the repair accuracy of the staff when an error occurs. This paper designs a monitoring system that collects the internal status data of the power distribution cabinet. This design is based on the STM32 of ARM Company, which can control modules to collect various kinds of data such as voltage and current, temperature and humidity, smoke concentration, etc. Then upload the data to the monitoring cloud platform through 4G Cat1 module. The user can monitor the status on the WeChat applet. When the data is abnormal, the terminal automatically alarms and sends a short message to the control personnel, so that the staff can quickly fix the machine and reduce the economic loss of the enterprise.</p>
      </abstract>
      <kwd-group>
        <kwd>1 Smart electrical cabinet</kwd>
        <kwd>STM32</kwd>
        <kwd>4G Cat1</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        With the development of society and the progress of human society, the annual electricity
consumption is increasing exponentially. As the tail end of the distribution system of the power grid,
the performance of the distribution cabinet has a crucial impact on the safe and stable operation of the
local power system [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Once there is a problem with the power supply and distribution system, it means
that the company may experience a power outage, and the related equipment of the company will stop
running and fall into a "paralyzed state".
      </p>
      <p>The internal state data acquisition system terminal of the electric cabinet designed in this paper can
obtain the electric energy parameters and non-electrical energy parameters inside the electric cabinet in
time. When the parameters are abnormal, there will be a voice alarm, which can make the staff aware
of the equipment failure at the first time, increase the repair efficiency, reduce the workload of manual
inspection on site, and ensure the safety of enterprise production and people's life.</p>
    </sec>
    <sec id="sec-2">
      <title>2. System design architecture</title>
      <p>The internal situation monitoring system of the smart electric cabinet designed in this paper is
composed of four parts: front-end data acquisition equipment, Internet of Things communication
transmission, cloud platform server and user terminal.</p>
      <p>
        The front-end data acquisition equipment is designed to install a data acquisition terminal in each
power distribution cabinet to collect internal electric data and environment data. These data are
transmitted to the cloud platform server using the 4G cat1 communication module with MQTT protocol
[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. The cloud server communicates with the client through the Internet, and the user can use the
WeChat applet to view the internal status of the power distribution cabinet [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. When data is abnormal,
users can quickly know through SMS (Short Message Service). The overall architecture of the
monitoring system is shown in Figure 1.
      </p>
      <p>DCisatbriibnuettio1n atecqrdmuaiistniatailo1n</p>
    </sec>
    <sec id="sec-3">
      <title>3. Hardware design</title>
    </sec>
    <sec id="sec-4">
      <title>3.1. Choice of microprocessor</title>
      <p>user terminal</p>
      <p>
        Considering the requirement of the high performance, low cost and low power consumption of the
design, the data acquisition equipment of this design selects the STM32F103ZET6 chip of ST
Semiconductor Company as the microprocessor. Its core is an ARM32-bit Cortex-M3 CPU whose
highest operating frequency is 72MHz, and it has abundant I/O ports and communication interfaces [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
    </sec>
    <sec id="sec-5">
      <title>3.2. Terminal Hardware Design Selection</title>
      <p>This system selects SUI-101A AC energy metering module to obtain electrical parameters such as
voltage, current, active power, etc. The transmission accuracy of current and voltage measured by
SUI101A can reach ultra-high precision of 0.2 class. It is connected with MCU（Microcontroller Unit）
through TXD and RXD, as shown in Figure 2.</p>
      <p>The module obtains the current and voltage signals from the load line through the built-in current
and voltage transformers and sends them to the 24-bit high-precision ADC for processing, and then
sends the waveform data to the 8-bit microcontroller to calculate the current, voltage and other
parameter values, and finally transmitted to STM32 through the serial port for data analysis.</p>
    </sec>
    <sec id="sec-6">
      <title>3.3. Monitoring system terminal data collection requirements standard</title>
      <p>
        The monitoring system terminal data standards are as follows:
1. Electric power monitoring standards. At present, most of the power distribution rooms are 220V
or 380V low-voltage power distribution cabinets. The voltage on the primary side can be
directly measured, and the current on the primary side needs to be converted into a secondary
side measurement current of 5A/1A. This paper takes the rated 220V, 5A, and the power factor
of 1.0 as an example to monitor the voltage, current and active power in the power distribution
cabinet in real time, and the accuracy error of the measured value is required to be no less than
0.2%.
2. Air temperature and humidity adjustment standards. According to the national standard for
lowvoltage complete sets of equipment (GB7251.1-2013) [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], the upper limit of the temperature in
the cabinet shall not exceed +40°C, and the lower limit shall not be lower than -5°C or -25°C.
      </p>
      <p>At the same time, the average temperature difference in one day shall not be higher than +35℃.
3. Smoke concentration standard. The range of detectable combustible gas and smoke of MQ-2
smoke sensor is 100-10000ppm, Therefore, when it is detected that the smoke concentration in
the power distribution cabinet exceeds 200ppm, a voice alarm is activated, and a short message
is sent to notify the maintenance personnel to check whether the cables and wires wrapped with
rubber skin inside the power cabinet are damaged.</p>
      <p>In this experiment, the power distribution cabinet in the school laboratory is selected for testing. To
ensure the safety of electricity and personnel, the power data collected in this experiment are normal
safety data, and will be further tested in a professional and safe environment in the future; Taking the
normal environment as a reference, the temperature and humidity changes are changed by the flame of
the lighter and the placement of the ice pack, so as to trigger the abnormal temperature and humidity
alarm; To detect the status of the wires and cables in the power distribution cabinet, the burning waste
rubber skin is used to simulate a fire and trigger the smoke concentration alarm.</p>
    </sec>
    <sec id="sec-7">
      <title>3.4. Communication module</title>
      <p>
        With the rapid advancement of the country's 5G construction, it is the general trend that 2G and 3G
will withdraw from the stage [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Previously, the domestic market once strongly promoted NB-IoT.
However, the 2G network also involves many real-time, mobility, and requires a certain bandwidth
transmission capability, and even supports the application scenarios of voice communication
capabilities, such as vehicle, mobile payment, industrial interconnection, etc. This is something that
NB-IoT, whose uplink and downlink rates are only 100Kbps, cannot satisfy. Therefore, Cat1 for the
IoT market stands out [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ].
      </p>
      <p>This paper selects ATK-IDM750C module as the communication module. It is a high-performance
full Netcom 4G Cat1 DTU product that can hold 4G mobile phone cards. It is applied in occasions with
low bandwidth rate requirements with the advantages of low latency and low cost, and can quickly solve
the wireless data transmission solution in the application scenario.</p>
      <p>It supports connecting to various cloud servers (such as Tencent Cloud, Alibaba Cloud), supports
AT commands/SMS, and supports MQTT data transparent transmission. Data transmission is shown in
Figure 5. In MQTT transparent transmission mode, serial data can be sent to the MQTT server through
DTU.</p>
      <p>Serial
communication
Send serial</p>
      <p>data
MCU</p>
      <p>ATK-IDM750C
Cat1 DTU
4G wireless
communication
DTU packages MQTT data
and publishes it to the pub
topic</p>
      <p>Publish
topic: pub</p>
      <p>MQTT Server</p>
      <p>Server
receives data</p>
    </sec>
    <sec id="sec-8">
      <title>4. Software Design</title>
    </sec>
    <sec id="sec-9">
      <title>4.1. Overall software architecture</title>
      <p>The overall architecture of the software design is shown in Figure 6. After the system is powered on,
the single-chip microcomputer first initializes the sensor module, obtains the environmental data
information inside the cabinet, and compares the collected information with the set threshold. If the data
parameters are not within the threshold range, a voice alarm will be sounded immediately, the data will
be sent to the cloud platform through the communication module, and the management personnel will
be notified by SMS to check the abnormality.</p>
      <p>Module
initialization
Electric energy data
collection</p>
      <p>Temperatureand
humidity data
collection</p>
      <p>Smoke
concentration</p>
      <p>collection
Isthe data within the
threshold?</p>
      <p>Y</p>
      <p>N
Trigger alarm and report to cloud platform and send SMS</p>
      <p>periodically</p>
    </sec>
    <sec id="sec-10">
      <title>4.2. Main program design</title>
      <p>
        The compilation of the hardware control program is written using KEIL5 software, which is the best
development tool for Cortex-M core processors. In order to make the work between each functional
module of the system independent and improve the effective utilization of CPU, the UC/OS-III
embedded system is transplanted into STM32 [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. STM32 occupies the CPU in turn through the
algorithm in the UC/OS-III system package, and each function module task is created by the Task_Start
initial task, set priorities according to the type of tasks to solve the multi-task scheduling problem, so
that people have a kind of CPU to execute multiple tasks at the same time.
      </p>
    </sec>
    <sec id="sec-11">
      <title>4.3. MQTT protocol</title>
      <p>MQTT is a low-overhead, low-bandwidth instant messaging protocol. Its biggest advantage is that
it can provide real-time and reliable message services for remote devices with very little code and
limited bandwidth. MQTT is widely used in Internet of Things, mobile applications, etc.</p>
      <p>The MQTT workflow is shown in Figure 7. First, the subscriber subscribes the topic to the server
and waits to receive the message; then, the server receives the message published by the publisher and
determines the topic of the message. If the message topic is consistent with the topic subscribed by the
subscriber, the message is forwarded to the subscriber to realize the delivery of the message from the
publisher to the subscriber.</p>
      <p>
        The MCU communicates with the ATK-IDM750C through AT commands, and the message quality
QoS selects QoS0 that is distributed at most once. The terminal will collect data to the 4G module
through the serial port. The 4G module uploads data every 5 minutes. The PING heartbeat request
interval is 1 minute. When there is no message to send, a heartbeat packet [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] must be sent to inform
the server that the client is "online".
      </p>
      <p>Publish topic: pub
Message : specific data</p>
      <p>Broker</p>
      <p>Subscribe to topics: sub</p>
      <p>Topic: pub</p>
      <p>Message : specific data
Publish</p>
      <p>Subscribe</p>
    </sec>
    <sec id="sec-12">
      <title>4.4. WeChat applet design</title>
      <p>The user terminal can view the data through the WeChat applet. The interface during the test is
shown in Figure 8. (a) shows the interface when the data is normal. (b) shows the interface when the
smoke concentration exceeds the standard. (c) is the SMS reminder interface received when the data is
abnormal.
(c)
Figure 8: (a) Data normal interface, (b) Data exception interface, (c) SMS interface.</p>
    </sec>
    <sec id="sec-13">
      <title>5. Conclusion</title>
      <p>
        This paper introduces a monitoring system based on STM32 for collecting internal status data of
power distribution cabinets. Through the intelligent terminal installed in the power distribution cabinet,
the electric data of the cabinet can be automatically collected and analyzed, and the parameters such as
humidity and temperature of the environment can be automatically identified. When the collected data
exceeds the set limit, the system will trigger an alarm. After receiving the alarm information, the staff
can eliminate potential safety hazards in time, which significantly improves the safety of the power
distribution cabinet. It can also reduce the workload of on-site manual inspections, increase the work
efficiency of staff, ensure the safety of electricity consumption of personnel, and actively respond to
the unattended management direction of the power distribution room advocated by the state [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. The
experimental results show that the data detection results meet the standard requirements, and the fault
accuracy rate is 100%.
      </p>
      <p>In the future, this design plans to increase the image acquisition function and realize the network
long-distance transmission function of the image, which can enable the staff to view the internal status
of the power distribution cabinet more intuitively. It is also planned to connect the system to the network
alarm device, and notify the relevant departments for rescue as soon as a fire or other major accident
occurs to further improve safety.
6. References</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Tao</given-names>
            <surname>Yang</surname>
          </string-name>
          , Jun Liu,
          <string-name>
            <given-names>Ming</given-names>
            <surname>Lv</surname>
          </string-name>
          .
          <article-title>Informatization design of monitoring system for low-voltage distribution cabinet</article-title>
          [J].
          <source>China Management Informatization</source>
          ,
          <year>2021</year>
          ,
          <volume>24</volume>
          (
          <issue>06</issue>
          ):
          <fpage>122</fpage>
          -
          <lpage>123</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Ruilin</given-names>
            <surname>Zhao</surname>
          </string-name>
          .
          <article-title>Implementation of MQTT protocol in smart power gateway</article-title>
          [J].
          <source>Electrical Appliances and Energy Efficiency Management Technology</source>
          ,
          <year>2021</year>
          (
          <volume>07</volume>
          ):
          <fpage>83</fpage>
          -
          <lpage>87</lpage>
          .DOI:
          <volume>10</volume>
          .16628/j.cnki.2095-
          <fpage>8188</fpage>
          .
          <year>2021</year>
          .
          <volume>07</volume>
          .016.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Xiangbei</given-names>
            <surname>Zhang</surname>
          </string-name>
          , Tao Zhang, Chaofeng Chen.
          <article-title>Concrete production management and control system based on Internet of things and WeChat applet</article-title>
          [J].
          <source>Highway</source>
          ,
          <year>2018</year>
          ,
          <volume>63</volume>
          (
          <issue>10</issue>
          ):
          <fpage>18</fpage>
          -
          <lpage>21</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Huoliang</surname>
            <given-names>Liu</given-names>
          </string-name>
          , Yang Sen.
          <article-title>STM32 library development practical guide[M]</article-title>
          . Beijing: Machinery Industry Press,
          <year>2014</year>
          ,
          <volume>448479</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Zhumei</given-names>
            <surname>Lin</surname>
          </string-name>
          .
          <article-title>Design of digital temperature and humidity meter based on DHT22[J]</article-title>
          .
          <source>Journal of Jiamusi University (Natural Science Edition)</source>
          ,
          <year>2016</year>
          ,
          <volume>34</volume>
          (
          <issue>02</issue>
          ):
          <fpage>223</fpage>
          -
          <lpage>225</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>GB</surname>
          </string-name>
          <year>7251</year>
          .12
          <article-title>-2013 Low-voltage switchgear and controlgear assemblies-Part 2: Power switchgear and controlgear assemblies/IEC 61439-2: 2011 Low-voltage switchgear and controlgear assemblies-Part2: Power switchgear and controlgear assemblies[S]</article-title>
          .
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          <article-title>[7] 2G and 3G withdraw from the Internet of Things! The Ministryof Industry and Information Technology issued a heavy document[J]</article-title>
          .
          <source>Computer Knowledge and Technology (Experience Skills)</source>
          ,
          <year>2020</year>
          , (
          <volume>06</volume>
          ):
          <fpage>5</fpage>
          -
          <lpage>6</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>Bo</given-names>
            <surname>Chen</surname>
          </string-name>
          , Zhihui Gan.
          <article-title>NB-IoT and CAT 1 coverage capability analysis[J]</article-title>
          .
          <source>Mobile Communications</source>
          ,
          <year>2017</year>
          ,
          <volume>41</volume>
          (
          <issue>22</issue>
          ):
          <fpage>57</fpage>
          -
          <lpage>61</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Huanyu</given-names>
            <surname>Qu</surname>
          </string-name>
          , Liping Chen, Jixin Wang. Research on Communication Between UC/
          <string-name>
            <surname>OS-III Tasks</surname>
          </string-name>
          [J].
          <source>Computer Knowledge and Technology</source>
          ,
          <year>2012</year>
          ,
          <volume>08</volume>
          (
          <issue>2</issue>
          ):
          <fpage>306</fpage>
          -
          <lpage>308</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Peiyuan</surname>
            <given-names>Wang</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>Yusheng</given-names>
            <surname>Du</surname>
          </string-name>
          .
          <article-title>An IoT intelligent monitoring system based on MQTT protocol[J]</article-title>
          .
          <source>Information Technology and Informatization</source>
          ,
          <year>2018</year>
          (
          <volume>01</volume>
          ):
          <fpage>107</fpage>
          -
          <lpage>110</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>Xing</given-names>
            <surname>Li</surname>
          </string-name>
          .
          <article-title>Research on centralized monitoring application of unattended computer room in power grid</article-title>
          [J].
          <source>Information and Communication</source>
          ,
          <year>2015</year>
          (
          <volume>04</volume>
          ):
          <fpage>251</fpage>
          -
          <lpage>252</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>