Journal Pre-proof Design of multi-channel data collector for highway tunnel lighting based on STM32 and Modbus protocol Liang Zhao, Shaocheng Qu, Weigang Zhang
PII:
S0030-4026(20)30222-9
DOI:
https://doi.org/10.1016/j.ijleo.2020.164388
Reference:
IJLEO 164388
To appear in:
Optik
Received Date:
3 January 2020
Accepted Date:
11 February 2020
Please cite this article as: Zhao L, Qu S, Zhang W, Design of multi-channel data collector for highway tunnel lighting based on STM32 and Modbus protocol, Optik (2020), doi: https://doi.org/10.1016/j.ijleo.2020.164388
This is a PDF file of an article that has undergone enhancements after acceptance, such as the addition of a cover page and metadata, and formatting for readability, but it is not yet the definitive version of record. This version will undergo additional copyediting, typesetting and review before it is published in its final form, but we are providing this version to give early visibility of the article. Please note that, during the production process, errors may be discovered which could affect the content, and all legal disclaimers that apply to the journal pertain. © 2020 Published by Elsevier.
Put your running title here: Elsevier General template for review
Design of multi-channel data collector for highway tunnel lighting based on STM32 and Modbus protocol Liang Zhao a, Shaocheng Qu a,*, Weigang Zhang b
a
Department of Electronics and Information Engineering, Central China Normal University,
430079 Wuhan, China b
LingJiu Electronics Co. , Ltd, China Shipbuilding Industry Corporation (CSIC), 430079 Wuhan,
ro of
China
Abstract
-p
This paper proposes a multi-channel data collector based on STM32 and Modbus
protocol for highway tunnel lighting system. In terms of hardware, a STM32
re
microcontroller is designed as the main controller, and BH1750 sensor and DHT11 sensor
lP
are chosen to measure illuminance and temperature-humidity, respectively. In terms of software, the measured illuminance and temperature-humidity are read by I²C and
na
single bus, respectively. Based on the RTU working mode of Modbus protocol, STM32 successfully transmits the collected data to host computer, and realizes the real-time collection and uploads of highway tunnel environmental parameters. Furthermore, the
ur
proposed data collector has operated stably in a tunnel lighting energy-saving system for
Jo
nearly two years. The experimental results show that the proposed multi-channel data collector can sense tunnel environment accurately and communicate with upper computer reliably, and has good engineering application value.
*
Corresponding author. E-mail address:
[email protected]
1
Put your running title here: Elsevier General template for review
Keywords: Highway tunnel lighting, data collector, STM32, Modbus protocol, IoT technology.
1. Introduction
Recently, highway construction is flourishing and attracting widespread attentions,
ro of
which greatly benefits people’s transportation and life [1,2]. Tunnels are important sections of highways because there are brightness differences between a tunnel interior
and exterior [3,4]. Generally, a highway tunnel is divided into seven zones, i.e., threshold zone 1, threshold zone 2, transition zone 1, transition zone 2, interior zone, exit zone 1
-p
and exit zone 2, as shown in Fig. 1. In order to create a favorable visual environment and
re
avoid traffic accidents, traditional highway tunnel lighting systems usually operate continuously (24 hours a day and 365 days a year) [5]. However, energy waste is quite
lP
serious in these lighting systems because all tunnel luminaries are always on without considering the variation of traffic volume and daylight [6]. In order to reasonably
na
monitor and control tunnel lighting system and reduce energy consumption, tunnel environmental information should be accurately measured and stably transmitted, so as
Jo
ur
to provide a powerful and reliable data support for tunnel lighting energy-saving control.
Fig. 1. Tunnel zone diagram.
2
Put your running title here: Elsevier General template for review
In response to this issue, a lot of researches have been carried out on the design of measuring system for highway tunnel lighting. Cheng [7] designed an illuminance detection system for long highway tunnel, which achieved wide measurement range (2000-3000 lx) and fast acquisition speed (10 times/s). However, this system is vehicle mounted and mainly used for disposable field test, thus cannot support long-term tunnel monitoring. Han et al. [8] measured and analyzed the adaptation luminance of tunnel
ro of
threshold zone using veiling luminance method and L20 method. Jang et al. [9] developed an imaging luminance meter which measured the external/internal luminance of road tunnel. The test results showed that their developed meter operated well at the real field, but the hardware structure of their design was not given in detail. In reference [10], the
-p
emission spectrum distributions of high-pressure sodium lamp (HPS) and white LEDs
re
were studied based on mesopic vision luminous efficiency model, which can obtain more accurate highway tunnel lighting values. Nevertheless, the effectiveness of this method
lP
needs to be verified in practical engineering applications. Ezzedine and Zrelli [11] proposed an architecture of wireless structural health monitoring system based on fiber
na
Bragg grating sensors (FBGS), which efficiently measured the variation of strain, temperature and humidity in civil structures like tunnels, bridges and mines. Kwong and
ur
Li [12] discussed the differences between the design (calculated) and field-measured luminance of a tunnel lighting project. They found it critical to use the actual roadway
Jo
and surface reflectance measurements within the tunnels to obtain meaningful computer calculations for tunnel rehabilitation projects. Cattini and Rovati [13] proposed a camerabased measuring instrument for road tunnels lighting. Their proposed system is aimed at estimating the veiling luminance because it will be perceived by a driver approaching the
3
Put your running title here: Elsevier General template for review
tunnel, thus allowing the estimation of the optimum luminance level of tunnel entrances and increasing the driver’s safety. In this paper, we design a multi-channel data collector for highway tunnel lighting based on STM32 and Modbus protocol, which is a subsystem of our previous work [14]. In terms of hardware, STM32, as the main controller, uses BH1750 sensor and DHT11 sensor to measure illuminance and temperature-humidity, respectively. In terms of
ro of
software, the measured illuminance and temperature-humidity are read by I²C and single bus, respectively. Based on Modbus protocol, all collected data are successfully
transmitted to host computer, which realizes the accurate measurement and real-time uploads of tunnel environmental parameters.
-p
The remainder of this paper is organized as follows. Section 2 and 3 introduces the
re
hardware and software design of the proposed system, respectively. Section 4 analyzes
lP
the experimental results. Finally, Section 5 concludes the paper.
na
2. Hardware design of the proposed system
The architecture of the proposed multi-channel data collector is shown in Fig. 2. It can
ur
be found that STM32 communicates with BH1750 sensor through I²C bus to obtain realtime illuminance, and communicates with DHT11 sensor through single bus to obtain
Jo
real-time temperature and humidity. Then, the collected data are written into the Flash of STM32. Finally, based on Modbus protocol, host computer such as PC and ARM board sends a request to STM32 via RS-485 interface, so as to read the data stored in Flash register. Please note that because each zone needs an individual data collector, there should be a total of seven data collectors deployed in a tunnel. In order to distinguish
4
Put your running title here: Elsevier General template for review
them, different address codes should be given to the data collectors installed in different
ro of
zones.
-p
Fig. 2. The architecture of the proposed data collector.
re
2.1 Power supply module
lP
The proposed data collector mainly works in the outdoor environment, distributed inside and outside the tunnel, and is supposed to withstand the influence of complex natural environment. Hence, stable power supply should be offered to guarantee the
na
normal operation of whole system. According to the survey, the power supply of the data collector comes from the voltage source provided by Chinese transportation department,
ur
including 5 V and 12 V direct current (DC). However, the required power supply of
Jo
STM32 is 3.3 V and that of some other chips is 5 V. Therefore, we design two DC voltage conversion circuits: 1) 12 V to 5 V voltage-stabilizing circuit and 2) 5 V to 3.3 V voltagestabilizing circuit. As shown in Fig. 3, a low-power LM2596S-5V chip is adopted to design the 12 V to 5 V voltage-stabilizing circuit. With excellent line and load regulation, LM2596 features input voltage range up to 40 V and fixed output voltage 5 V. LM2596 integrates a
5
Put your running title here: Elsevier General template for review
frequency compensator and a fixed-frequency oscillator, enabling its standby current to reduce to only 80 μA and power conversion efficiency to reach 80%. In the DC-DC buck circuit shown in Fig. 3, LM2596 is a step-down switching regulator, L1 is a energystorageinductor and D3 is a free-wheeling diode (FWD). In the swithed-on state, the current flows normally, while in the swithed-off state, L1 and D3 form a loop to keep the
re
Fig. 3. 12 V to 5 V voltage-stabilizing circuit.
-p
ro of
circuit continuously powered.
As shown in Fig. 4, a fixed low dropout linear regulator AMS1117 is adopted to design
lP
the 5 V to 3.3 V voltage-stabilizing circuit. AMS1117 features current limiting, thermal protection and 0.2% typical load regulation, enabling fixed 3.3 V output voltage with
na
maximum error less than 1%. In Fig. 4, C16 and C17 are the input filter capacitors of the power supply, which prevent the voltage from being inverted after power failure. While
ur
C15 and C18 are output filter capacitors, which suppress self-excited oscillation and
Jo
prevent output waveform oscillation.
6
Put your running title here: Elsevier General template for review
ro of
Fig. 4. 5 V to 3.3 V voltage-stabilizing circuit.
2.2 STM32 minimum system
As shown in Fig. 5, a STM32F103C8T6 microcontroller is regarded as the CPU of the
-p
proposed data collector. As a member of STM32F103xx medium-density performance
re
line family, STM32F103C8T6 incorporates the high-performance ARM-based CortexM3 32-bit RISC core operating at a 72 MHz frequency, high-speed embedded memories
lP
(64 Kbytes of Flash memory and 20 Kbytes of SRAM), internal 8 MHz factory-trimmed RC oscillator, and a wide range of enhanced I/Os and peripherals connected to two APB
na
buses. Furthermore, STM32F103C8T6 offers 48 pins, two 12-bit ADCs, a 7-channel DMA controller, seven timers, as well as nine communication interfaces (including two
ur
I2Cs and SPIs, three USARTs, an USB and a CAN). In Fig. 5, BOOT0 (pin 44) and BOOT1 (pin 20) are grounded, which means that in the
Jo
normal startup mode, STM32 boots up its embedded operating system from Flash. D1 and D2 are LED indicator lamps for STM32 and power supply, respectively. Power supply filter circuit consists of C3, C4, …, C9. Y1 is a passive crystal oscillator with two 20 pF capacitors, while X1 is an active crystal oscillator with frequency of 8 MHz.
7
ro of
Put your running title here: Elsevier General template for review
Fig. 5. STM32 microcontroller module.
-p
2.3 illuminance sensor module
Accurate collection of illuminance is the key of this data acquisition system, which is
re
of great significance for driving safety and energy saving in highway tunnel lighting
lP
system. As shown in Fig. 6, BH1750FVI, a digital ambient light sensor, is employed to design illuminance acquisition circuit. Owing to advantages like 1) high resolution and
na
wide detection range (1-65535 lx), 2) human-eye-like spectral responsibility, 3) little light source dependency and 4) small influence of infrared, it is convenient to use BH1750FVI
Jo
ur
to obtain digital 16-bit illuminance data through I2C bus interface (pin 4 and 6 in Fig. 6).
8
Put your running title here: Elsevier General template for review
Fig. 6. illuminance acquisition circuit.
2.4 temperature and humidity sensor module Except for illuminance, temperature and humidity inside and outside the tunnel should also be measured and analyzed for structural health monitoring of tunnels. Hence, we use a popular temperature-humidity sensor namely DHT11 to design temperature and humidity acquisition circuit, as shown in Fig. 7. With advantages such as low cost, high
ro of
stability, fast response, strong anti-interference ability, and high accuracy measurement ( ± 0.2 ℃ for temperature and ± 2%RH for humidity), DHT11 is suitable for
environmental monitoring applications. In Fig. 7, temperature and humidity data are first
na
lP
re
-p
collected by DHT11 and then transmitted to STM32 from pin 2 via single bus.
ur
Fig. 7. temperature and humidity acquisition circuit.
Jo
2.5 interface conversion module The proposed data collector communicates with host computer based on Modbus
protocol, which mainly relies on RS-485 interface. Unfortunately, it does not belong to the nine communication interfaces that STM32 offers. Hence, interface conversion circuit must be designed. As shown in Fig. 8, we utilize an isolated RS-485 transceiver called ADM2483 to implement an UART to RS-485 interface conversion circuit. ADM2483
9
Put your running title here: Elsevier General template for review
provides 500 kbps data rate and allows up to 256 transceivers on the bus, which makes it suitable for multipoint data transmission systems (each zone in tunnel can be regarded as a data collection and transmission point). However, due to RS-485 bus should connect multiple data collectors and the communication cable is laid across a long tunnel, it is vulnerable to external interference such as thunder and lightning. Therefore, it is necessary to conduct isolation between STM32 and ADM2483, so as to reduce signal
which greatly reduces the complexity of circuit design.
ro of
distortion and errors. Fortunately, a 3-channel isolator has been integrated into ADM2483,
In Fig. 8, pin 3 and 6 of ADM2483 are connected to the RXD and TXD pin of UART,
respectively. While pin 4 and 5 are receiver and driver enable inputs, respectively, which
-p
are used to control data transmission direction of RS-485. For example, if RS485_CON
re
inputs a high level signal, DE (the driver) will be enabled but RE (the receiver) will be disabled, that is, ADM2483 is in data transmission mode.
lP
Moreover, a F0505S-1W chip is used to isolate the power supply of this module from the power supply of STM32 and other components, avoiding the mutual interference
na
between different modules. FB1 and FB2 are magnetic beads, which are used to suppress high-frequency noise and peak interference on RS-485 signal line, and also have the
Jo
ur
ability to absorb electrostatic pulses.
10
ro of
Put your running title here: Elsevier General template for review
-p
Fig. 8. UART to RS-485 interface conversion circuit
re
2.6 JTAG debug module
In order to make it convenient for debugging the proposed system, we design the
lP
interface circuit of J-Link simulator, as shown in Fig. 9. Based on this circuit, STM32 development environments (such as IAR and Keil5) can use J-Link download method to
Jo
ur
na
realize single step debugging, breakpoints setting, programs analysis, etc.
11
Put your running title here: Elsevier General template for review
Fig. 9. The interface circuit of J-Link simulator.
3. Software design of the proposed system
Software design of the proposed multi-channel data collector mainly includes: 1) design of data acquisition program and Flash read-write program, 2) transplantation of
ro of
FreeModbus protocol and 3) design of main control program.
3.1 Design of data acquisition program and Flash read-write program
In this section, we design illuminance acquisition program, temperature-humidity
re
3.1.1 Design of illuminance acquisition program
-p
acquisition program, and Flash read-write program.
Based on I2C bus and BH1750FVI sensor, we design the software flowchart of
lP
illuminance acquisition, as shown in Fig. 10. First of all, the I2C module of STM32 is initialized, including I2C GPIO configuration (determine the GPIO ports used by I2C) and
na
I2C mode configuration (determine relevant parameters such as duty cycle of clock line, addressing mode, communication rate and so on). Then, STM32 sends a power-on
ur
instruction “0x01” to motivate BH1750FVI. In order to improve the accuracy and continuity of measurement, STM32 sends a “0x11” measurement instruction to
Jo
BH1750FVI, which realizes continuous measurement of illuminance with high resolution. After waiting for 120-ms measurement time, a 16-bit illuminance value can be read. Finally, this 16-bit data is converted to a decimal number and then divided by 1.2 to get an accurate illuminance with a resolution of 0.5 lx.
12
-p
ro of
Put your running title here: Elsevier General template for review
Fig. 10. The software flowchart of illuminance acquisition.
re
3.1.2 Design of temperature-humidity acquisition program
lP
In this subsection, STM32 uses an I/O port to communicate with DHT11 sensor through single bus, so as to acquire temperature and humidity. Fig. 11 shows the software flowchart of temperature-humidity acquisition. According to DHT11 datasheet, after
na
initializing GPIO, STM32 drives the bus low for 20 ms to request DHT11 and then drives it high for 30 μs to wait for reponse from DHT11. If DHT11 responds to the request,
ur
STM32 will keep reading DHT11’s packets until the transmission is finished. A complete
Jo
temperature-humidity packet should be a 40-bit data message, consisting of 8-bit integral part of humidity data, 8-bit decimal part of humidity data, 8-bit integral part of temperature data, 8-bit decimal part of temperature data and 8-bit checksum. After receiving this 40-bit packet, STM32 drives the bus high to enter idle status, which means one temperature-humidity acquisition has been finished. Finally, the first four 8-bit data
13
Put your running title here: Elsevier General template for review
of the packet will be added together to check whether it is equal to the last 8-bit checksum.
lP
re
-p
ro of
If equal, the collected data is correct and will be saved. Otherwise, it will be dropped.
na
Fig. 11. The software flowchart of temperature-humidity acquisition.
ur
3.1.3 Design of Flash read-write program In order to distinguish the data collector deployed in different zones, device
Jo
information such as Modbus address or baud rate must be stored in its Flash. Hence, we design Flash read/write program in this subsection. As we mention in Section 2.2, the CPU of this data collector is a STM32F103C8T6 microcontroller, whose Flash memory size is 64 Kbytes, made up of 64 1-Kb pages, as shown in Table 1.
14
Put your running title here: Elsevier General template for review
Fig. 12 shows the software flowchart of Flash read-write program. It can be found from Fig. 12 that if it is a read operation, base address in Table 1 will be selected and corresponding page will be read. For example, if we select base address “0x0800 04000x0800 07FF”, then Page 1 will be read. However, if it is a write operation, the Flash controller should first be unlocked. Then, flag is cleared and a selected page is erased. Subsequently, new data are written into corresponding base address. Finally, the Flash
na
lP
re
-p
ro of
controller is locked to ensure that data stored in Flash will not be changed by mistake.
ur
Fig. 12. The software flowchart of Flash read-write.
Jo
3.2 Transplantation of FreeModbus protocol 3.2.1 Modbus protocol Modbus, an application layer messaging protocol, is a de facto standard of industrial
communication fields that has been extensively used in various industry applications since 1979 [15]. In general, there are three kinds of variants of Modbus protocol: 1) Modbus-ASCII (American Standard Code for Information Interchange), 2) Modbus-TCP
15
Put your running title here: Elsevier General template for review
(Transmission Control Protocol) and 3) Modbus-RTU (Remote Terminal Unit). ModbusASCII is mainly used for transmitting small amount of text-format data, while ModbusTCP is mainly used for Ethernet-based data transmission. Compared with them, ModbusRTU is more suitable for the transmission of massive binary industrial data at the field level. Hence, we adopt Modbus-RTU to realize the real-time collection and uploads of
re
Fig. 13. The structure of data frame in Modbus-RTU.
-p
ro of
tunnel environmental parameters.
As shown in Fig. 13, Modbus-RTU establishes a single message structure comprising
lP
four fields: address, function code, data, and CRC (Cyclic Redundancy Check) [16]. The first three fields contain the necessary information for a Modbus transaction, while the
na
forth corresponds to the 16-bit CRC calculation, which is aimed at detecting errors. 3.2.2 Transplantation of FreeModbus protocol stack
ur
In order to make this data collector become a standard Modbus device that compatible with other industrial and commercial Modbus instruments, we transplant the general
Jo
FreeModbus protocol into our proposed data collector. The main transplantation steps are as follows:
Step 1: Download freemodbus-v1.6.zip from [17]. Step 2: Copy C files and header files in “demo/BARE” and “modbus” to corresponding
directory, as shown in Fig. 14.
16
Put your running title here: Elsevier General template for review
Step 3: Configure serial port file “portserial.c”. In “portserial.c”, the functions need to be
modified
mainly
xMBPortSerialInit(),
include: 3)
1)
BOOL
void
vMBPortSerialEnable(),
xMBPortSerialPutByte(),
and
2)
BOOL
4)
BOOL
xMBPortSerialGetByte(). Step 4: Configure timer file “porttimer.c”. In “porttimer.c”, the functions need to be modified mainly have: 1) BOOL xMBPortTimersInit(), 2) void vMBPortTimersEnable(), and 3) void vMBPortTimersDisable().
ro of
Step 5: Design interface functions. In “demo.c”, imitate the given example program “eMBRegInputCB()” to design “eMBRegHoldingCB(), eMBRegCoilsCB() and eMBRegDiscreteCB()”. Then, copy these four functions to “modbusCB.c”.
-p
Step 6: Design main program. Copy “eMBInit(), eMBEnable() and eMBPoll()” from
Jo
ur
na
lP
re
“demo.c” to “main.c”, and then design main control program.
Fig. 14. FreeModbus protocol stack in the corresponding directory of the project file.
3.3 Design of main control program
17
Put your running title here: Elsevier General template for review
Based on Section 3.1 and 3.2, we design the main control program of the proposed data collector, as shown in Fig. 15. The main control program mainly realizes Modbus-based communication between STM32 and host computer, that is, STM32 collects and sends illuminance and temperature-humidity data according to instructions from host computer. The collection and transmission of data rely on querying Modbus events. If it is a read input register event, STM32 will read illuminance, temperature and humidity, and
ro of
respond to host’s request. If it is a read/write holding register event, then further determine
Jo
ur
na
lP
re
-p
whether the operation is read or write, and perform corresponding reaction.
Fig. 15. The software flowchart of main control program.
4. Results and discussion
18
Put your running title here: Elsevier General template for review
In order to evaluate the effectiveness and practicality of the proposed system, this multi-channel data collector has been implemented at a highway tunnel in Guangxi Province of China since January 2018, and served as a subsystem of tunnel lighting energy-saving system proposed by [14]. 4.1 A simple test of reading data As shown in Fig. 16, we consider PC as host computer and use “COM Debug Assistant”
ro of
as well as a dedicated debugging software “Modbus Poll” to perform a simple test of the proposed data collector in our laboratory. In Fig. 16, this data collector is connected to
PC through a RS-485/USB converter. DHT11 sensor (red box) is deployed at the top of
-p
collector, and BH1750 sensor (yellow box) is deployed at the centre, covered by a Fresnel
Jo
ur
na
lP
deployed at the right bottom.
re
lens. While power supply interface (sky-blue box) and RS-485 interface (white box) are
Fig. 16. The proposed multi-channel data collector.
19
Put your running title here: Elsevier General template for review
ro of
Fig. 17. Test results in “Modbus Poll”.
Fig. 17 shows the test results of reading data in “Modbus Poll”. The PC’s request is the first row in the red box: 01 04 00 00 00 08 F1 CC, while data collector’s response is the
-p
second row in the red box: 01 04 10 55 15 2C 43 00 00 8C 41 2F 08 3B 3E 00 00 00 00
B4 F1. According to the message format of Modbus-RTU shown in Fig. 13, “01” is the
re
address of a slave that host wants to communicate with, “04” is function code which
lP
means host wants to read input register of slave, “10” indicates that slave returns 16 bytes data, “55 15 … 00 00” are exactly 16 one-byte data returned by slave, and “B4 F1” is CRC code. The collected 16 bytes environmental data can be parsed as follows:
na
Illuminance: 55 15 2C 43 ——172.083328 lx (transfer 432C1555 to a float number). Temperature: 00 00 8C 41 —— 17.500000℃ (transfer 418C0000 to a float number).
ur
Humidity: 2F 08 3B 3E —— 0.182648 [18.2648%] (transfer 3E3B082F to a float
Jo
number).
Last four bytes: 00 00 00 00——reserved for collecting other kinds of environmental
information such as smoke and fire. Please note that, the unit of illuminance collected by the proposed data collector is lx, while luminance unit in the lighting specification is cd/m2. Generally speaking, the relationship between illuminance and luminance can be described as
20
Put your running title here: Elsevier General template for review
L R E
(1)
where L is luminance, E is illuminance, and R is reflection coefficient which depends on the material of the surface of wall and road in tunnels.
4.2 Field tests in practical tunnel lighting system As shown in Fig. 18, the proposed multi-channel data collector is installed in a box,
ro of
while this box is deployed in a highway tunnel. And there are nine identical data collectors deployed in different zones of the tunnel (seven inside the tunnel, one at the entrance and one at the exit), as shown in Fig. 19. Furthermore, the host computer is an ARM
lP
re
-p
embedded system which is installed in an electricity cabinet, as shown in Fig. 20.
Jo
ur
na
(a)
(b)
21
Put your running title here: Elsevier General template for review
Fig. 18. The proposed data collector in practical tunnel lighting system. (a) Multi-channel
-p
ro of
data collector is installed in a box, (b) The box is deployed in a highway tunnel.
Jo
ur
na
lP
re
Fig. 19. Nine data collectors are deployed in the interior and exterior of a highway tunnel.
Fig. 20. An ARM embedded host computer installed in an electricity cabinet. Since January 2018, the proposed multi-channel data collector has been collecting and uploading tunnel environmental information for a tunnel lighting energy-saving system
22
Put your running title here: Elsevier General template for review
proposed by [14]. In order to demonstrate the stability and accuracy of the proposed system, we analyze the collected environmental data in different zones of a highway tunnel located at Guangxi Province of China. 4.2.1 Environmental data analysis in tunnel entrance and threshold zone 1 During the tunnel construction period, the high-voltage sodium lamps were deployed in the tunnel based on L20 (s) 3500 cd/m2 and k 0.046 . Under this circumstance,
ro of
luminance in threshold zone 1 is calculated by Lth1 k L20 (s) 161 cd/m2. However,
L20 ( s) should not be a constant because sunlight intensity is dynamical. Therefore, tunnel interior luminance should be adjusted along with the change of L20 ( s) .
-p
Fig. 21 gives the curve of luminance in tunnel entrance and threshold zone 1 on 9
November 2019. It can be seen that luminance in tunnel entrance during 00:00 to 07:09
re
and 18:12 to 24:00 is less than 10 cd/m2, resulting in all sodium lamps turned off. Note
lP
that luminance in threshold zone 1 during the early morning and evening is not 0 cd/m2 because there are still some LEDs working for basic lighting. Furthermore, most of luminance in tunnel entrance during 07:09 to 18:12 is more than 300 cd/m2 and less than
na
900 cd/m2, resulting in a quarter of sodium lamps turned on. Hence, luminance in threshold zone 1 is around 40 cd/m2 during daytime, which is exactly a quarter of original
Jo
ur
Lth1 (161 cd/m2).
23
Put your running title here: Elsevier General template for review
Fig. 21. The change of luminance in tunnel entrance and threshold zone 1 on 9 November
ro of
2019.
(b)
ur
na
lP
re
-p
(a)
Jo
Fig. 22. The change of temperature and humidity in tunnel entrance and threshold zone 1 on 9 November 2019. (a) In tunnel entrance, (b) In threshold zone 1. Fig. 22 shows the curve of temperature and humidity in tunnel entrance and threshold
zone 1 on 9 November 2019. From Fig. 22(a), we can see that temperature in tunnel entrance begins to decrease at 00:03 and turns to increase after 08:13. Then, temperature
24
Put your running title here: Elsevier General template for review
starts to drop again after 16:23. Interestingly, the change tendency of humidity in tunnel entrance is opposite to that of temperature, because higher temperature will evaporate moisture in the air more quickly, resulting in lower humidity, and vice versa. Furthermore, the trend of temperature and humidity in Fig. 22(b) is similar to that in Fig. 22(a), which means that tunnel entrance and threshold zone 1 have similar ambient
4.2.2 Environmental data analysis in threshold zone 2
ro of
temperature and humidity.
Fig. 23(a) gives the curve of luminance in threshold zone 2 on 9 November 2019. Obviously, the trend of luminance in Fig. 23(a) is similar to the bottom half of Fig. 21.
-p
This is reasonable because the sodium lamps in threshold 2 are controlled by tunnel
re
lighting system [14] to maintain half of luminance in threshold zone 1. As expected,
of Lth1 (40 cd/m2).
lP
luminance in threshold zone 2 ( Lth 2 ) during daytime is about 20 cd/m2 and is almost half
Similar to Fig. 22(b), Fig. 23 (b) shows that temperature declines during midnight and
na
then raises gradually after 09:08, and finally reduces again when time is 17:13. On the contrary, humidity increases a little at the beginning and then decreases dramatically, and
Jo
ur
finally climbs again when night falls.
25
Put your running title here: Elsevier General template for review
na
lP
re
-p
ro of
(a)
(b)
ur
Fig. 23. Environmental data of threshold zone 2 on 9 November 2019. (a) Luminance,
Jo
(b) Temperature and humidity.
4.2.3 Environmental data analysis in transition zone Figs. 24(a) and 25(a) give the curve of luminance in transition zone 1 and 2 on 9
November 2019, respectively. It can be found from Fig. 24(a) that the change of luminance in transition zone 1 is very similar to that in threshold zone 2, that is, both
26
Put your running title here: Elsevier General template for review
transition zone 1 and threshold zone 2 are darker in the early morning and evening but brighter in the day. And it can also be found from Fig. 24(a) that luminance in transition zone 1 ( Ltr1 ) in the day is 6 cd/m2, which is exactly 15% of above-mentioned Lth1 (in [14], we illustrated that Ltr1 0.15 Lth1 ). Moreover, Fig. 25(a) shows that luminance in transition zone 2 ( Ltr 2 ) is always around 2.1 cd/m2, which means that all sodium lamps remain off during 24 hours.
ro of
Figs. 24(b) and 25(b) show the curve of temperature and humidity in transition zone 1 and 2 on 9 November 2019. Since they are highly similar to Figs. 22(b) and 23(b), details
na
lP
re
-p
are not described here in order to avoid tautology.
Jo
ur
(a)
27
Put your running title here: Elsevier General template for review
ro of
(b)
Fig. 24. Environmental data of transition zone 1 on 9 November 2019. (a) Luminance, (b)
Jo
(a)
ur
na
lP
re
-p
Temperature and humidity.
28
ro of
Put your running title here: Elsevier General template for review
(b)
Fig. 25. Environmental data of transition zone 2 on 9 November 2019. (a) Luminance, (b)
re
4.2.4 Environmental data analysis in interior zone
-p
Temperature and humidity.
lP
Fig. 26 (a) shows the curve of luminance in interior zone on 9 November 2019. Because interior zone is the darkest zone in a tunnel, its luminance is only about 1.5 cd/m2
na
( Lin 1.5 cd/m2). Fig. 26 (b) shows the curve of temperature and humidity in interior zone on 9 November 2019. It can be seen from Fig. 26 (b) that temperature and humidity
ur
fluctuate around 22℃ and 80%, respectively. Hence, interior zone has a relatively stable temperature and humidity environment, which is a notable feature different from other
Jo
zones.
29
ro of
Put your running title here: Elsevier General template for review
na
lP
re
-p
(a)
(b)
ur
Fig. 26. Environmental data of interior zone on 9 November 2019. (a) Luminance, (b)
Jo
Temperature and humidity.
4.2.5 Environmental data analysis in exit zone Similarly, the luminance in exit zone 1 and 2 is lower in the early morning and evening but higher in the day, as shown in Figs. 27(a) and 28(a). Furthermore, luminance in exit zone 1 ( Lex1 ) and in exit zone 2 ( Lex 2 ) during the daytime is approximately 4.5 and 10
30
Put your running title here: Elsevier General template for review
cd/m2, respectively. We can find that the measured Lex1 is exactly triple of Lin (1.5 cd/m2). This is rational because tunnel lighting specification requires that Lex1 3 Lin . However, the measured Lex 2 is about 10 cd/m2 and does not meet Lex 2 5 Lin , resulting from it is enhanced by sunlight outside the tunnel. Figs. 27(b) and 28(b) give the curve of temperature and humidity in exit zone 1 and 2 on 9 November 2019. Similar to the change of temperature and humidity in other zones
ro of
except interior zone, the trend of temperature in exit zone 1 and 2 is “drop, raise and drop”, while that of humidity in exit zone 1 and 2 is “drop and raise”. The reason of this
na
lP
re
-p
phenomenon is explained in Section 4.2.1, therefore we will not repeat it.
Jo
ur
(a)
31
ro of
Put your running title here: Elsevier General template for review
(b)
Fig. 27. Environmental data of exit zone 1 on 9 November 2019. (a) Luminance, (b)
Jo
ur
na
lP
re
-p
Temperature and humidity.
(a)
32
ro of
Put your running title here: Elsevier General template for review
(b)
Fig. 28. Environmental data of exit zone 2 on 9 November 2019. (a) Luminance, (b)
-p
Temperature and humidity.
re
4.2.6 Data accuracy analysis
lP
In this subsection, we first use high-precision industrial meters to measure environmental information of the tunnel, then compare the test results of standard meters with that of the proposed multi-channel data collector, finally calculate the measurement
na
error between these two acquisition methods, as shown in Table 2. Note that the test time is at 15:23 on 9 November 2019 and test areas are threshold zone 1, transition zone
ur
1, interior zone and exit zone 2.
Jo
It can be seen from Table 2 that the measurement error of luminance, temperature and humidity is no more than 1.74 cd/m2, 0.92℃ and 1.43%, respectively. Therefore, the measurement error of the proposed system is small and its measurement accuracy is acceptable.
33
Put your running title here: Elsevier General template for review
Based on above analysis, it can be concluded that the proposed multi-channel data collector not only accurately senses real-time tunnel environment, but also stably transmits the collected environmental data to host computer. It is worth mentioning that the manufacturing cost of the proposed data collector is only 14 dollars, which achieves efficient data acquisition at low cost.
ro of
5. Conclusion
In this paper, we design a multi-channel data collector to achieve efficient measurement
and transmission of highway tunnel environmental information. STM32 and Modbus
-p
protocol are applied as the hardware and software platform, respectively. A highway
re
tunnel, located at Guangxi Province of China, is considered as the study case. Extensive test results on 9 November 2019 demonstrate that the proposed multi-channel data
lP
collector effectively collects and transfers various tunnel environmental information such as illuminance, temperature and humidity, and has good practical and popularizing value.
na
In the future, we will modify Modbus protocol and optimize the circuit design in order to provide a more reliable and accurate data support for tunnel energy-saving lighting.
ur
Conflicts of Interest
Jo
The authors declare that there are no conflicts of interest regarding the publication of this paper.
Acknowledgements
34
Put your running title here: Elsevier General template for review
This work is financially supported by National Natural Science Foundation of China (Grant No. 61673190/F030101), self-determined research funds of CCNU from the colleges’ basic research and operation of MOE (CCNU 18TS042), and Graduate
Jo
ur
na
lP
re
-p
ro of
Innovation Program of CCNU (2019CXZZ102).
35
Put your running title here: Elsevier General template for review
References
Jo
ur
na
lP
re
-p
ro of
[1] S. He, B. Liang, G. Pan, F. Wang, L. Cui, Influence of dynamic highway tunnel lighting environmental on driving safety based on eye movement parameters of the driver, Tunnelling and underground space technology, 67 (2017) 52-60. [2] T. Wang, T. Chen, Y. Hu, X. Zhou, N. Song, Design of intelligent LED lighting systems based on STC89C52 microcomputer, Optik, 158 (2018) 1095-1102. [3] M. Beka, A study on tunnel lighting, J. Light. Des. Appl, 6 (2005) 10-16. [4] L. Shuguang, An optimal model for tunnel lighting control systems, Tunnelling and Underground Space Technology, 49 (2015) 328-335. [5] L. Qin, L. Dong, W. Xu, L. Zhang, Q. Yan, X. Chen, A “vehicle in, light brightens; vehicle out, light darkens” energy-saving control system of highway tunnel lighting, Tunnelling and Underground Space Technology, 66 (2017) 147-156. [6] C. Yang, S. Fan, Z. Wang, W. Li, Application of fuzzy control method in a tunnel lighting system, Mathematical and Computer Modelling, 54 (2011) 931-937. [7] Q. Cheng, Design of A Dynamic Detection System for Long Tunnel of Highway, China Illuminating Engineering Journal, (2016) 53-57. [8] J.-S. Han, M.-W. Lee, H. Kim, Measurement and Analysis of Adaptation Luminance in the Threshold Zone of the Road Tunnel, Journal of the Korean Institute of Illuminating and Electrical Installation Engineers, 26 (2012) 1-7. [9] S.-C. Jang, S.-L. Park, S.-Y. Ko, M. Lee, Research and development on image luminance meter of road tunnel internal and external, Journal of Korean Tunnelling and Underground Space Association, 17 (2015) 1-9. [10] Y. Yong, B. Zuojun, Z. Chuanzheng, W. Lei, Study on the Mesopic Vision Theory used in Road Tunnel Lighting Measurement, in: 2011 Third International Conference on Measuring Technology and Mechatronics Automation, IEEE, 2011, pp. 565-567. [11] T. Ezzedine, A. Zrelli, Efficient measurement of temperature, humidity and strain variation by modeling reflection Bragg grating spectrum in WSN, Optik, 135 (2017) 454462. [12] C. Kwong, T.K. Li, Computer Calculations versus Field Measurements for Tunnel Lighting Design, LEUKOS, 11 (2015) 175-191. [13] S. Cattini, L. Rovati, Low-cost imaging photometer and calibration method for road tunnel lighting, IEEE Transactions on Instrumentation and Measurement, 61 (2012) 1181-1192. [14] L. Zhao, S. Qu, W. Zhang, Z. Xiong, An energy-saving fuzzy control system for highway tunnel lighting, Optik, 180 (2019) 419-432. [15] S. Figueroa-Lorenzo, J. Añorga, S. Arrizabalaga, A Role-Based Access Control Model in Modbus SCADA Systems. A Centralized Model Approach, Sensors, 19 (2019) 4455. [16] C. Urrea, C. Morales, Enhancing Modbus-RTU Communications for Smart Metering in Building Energy Management Systems, Security and Communication Networks, 2019 (2019). [17] https://www.embedded-solutions.at/en/freemodbus-downloads/
36
Put your running title here: Elsevier General template for review
Table. 1. Flash module organization of STM32F103C8T6 Base address
Size (bytes)
Page 0
0x0800 0000-0x0800 03FF
1K
Page 1
0x0800 0400-0x0800 07FF
1K
Page 2
0x0800 0800-0x0800 0BFF
1K
Page 3
0x0800 0C00-0x0800 0FFF
Page 4
0x0800 1000 -0x0800 13FF
…
…
Page 63
0x0800 FC00-0x0800 FFFF
1K 1K …
1K
-p
Main memory
Name
ro of
Block
Acquisition method
Threshold zone 1
Jo Exit zone 2
Humidity (%)
38.34
21.5
75.03
High-precision meter
40.08
21.23
76.46
Error
1.74
0.27
1.43
5.99
21.7
76.19
High-precision meter
6.72
22.31
75.28
Error
0.73
0.61
0.91
Proposed collector
1.78
22.6
73.81
High-precision meter
1.43
23.52
74.29
Error
0.35
0.92
0.48
Proposed collector
7.12
21.91
76.58
High-precision meter
8.38
22.49
75.87
Error
1.26
0.58
0.71
na
ur
Interior zone
Temperature (℃)
Proposed collector
Proposed collector Transition zone 1
Luminance (cd/m2)
lP
Tunnel zones
re
Table 2. The measurement error between the proposed data collector and standard meter.
37