Abstract
One key issue in designing battery-powered wireless sensor networks is to properly control the energy consumption of the sensor nodes in order to prolong their operation time (i.e. lifetime). In this article, we present a real-life application of wireless sensor networks in trains to monitor the goods conditions in a long-distance transportation. We study the wireless sensor network deployment problem in developing a monitoring system with the goal of maximizing the network lifetime under constraints derived from the real application scenario. The key technical problem to solve is to determine the sensor placement and the transmission level for each sensor node, as well as the appropriate number of sensor nodes. We first formulate the problem with a realistic discrete power model as a mixed integer linear programming problem. Then, a two-step efficient deployment heuristic is proposed to satisfy these constraints step by step. The evaluation results indicate that the proposed heuristic performs almost the same as the optimal mixed integer linear programming solution. Moreover, the wireless sensor network with appropriate number of nodes can improve its lifetime up to 10.6% for a train with 80 boxcars. We also discussed a tested experiment in a laboratory environment, as well as the real implementation of the whole monitoring system.
Introduction
In recent years, wireless sensor networks (WSNs) have been integrated into many real-life applications, such as habitat study, 1 environment/ecology monitoring, 2 railway bridge monitoring, 3 datacenter monitoring, 4 and industrial monitoring. 5 A WSN is generally composed of tens to thousands of sensor nodes, each of which is equipped with several sensing devices, a short-range wireless transceiver, a low-cost computational capacity processor, and a limited battery-supplied energy. Sensor nodes monitor some surrounding environment and forward data obtained to a base station, which collects data and then transmits this data to a remote control center.
Although much attention has been paid to designing sensors for low power consumption, sensor nodes still have very limited operation lifetime. Moreover, it may be infeasible or expensive to replace the batteries in sensor nodes after deploying a WSN. One critical and challenging problem in WSNs is how to manage their energy consumption to achieve the maximum lifetime under the battery energy constraint.
In general, multi-hop data forwarding schemes, 6 where the data of sensor nodes that are far away are relayed by their neighbor nodes that are closer to the base station, are more energy efficient than direct transmission when the cover range is fairly large. However, a WSN may still survive only a very limited lifetime if adopting no effective policy to deal with the increased transmission activities of such near-by sensor nodes which depletes the battery energy quickly. 7 To address this problem, one can place more sensor nodes close to the base station and set them transmit at lower transmission levels 7 or adopt duty cycle scheduling approaches 8 to extend their operation time. In addition, mobile base stations are explored to prolong the lifetime of a WSN.9,10 For the case when the base station is not moveable, mobile elements that can transverse the deployment field and convey the collected data from sensor nodes to the base station have been studied for energy-efficient data collection in WSNs.11–17
Railway systems are a critical part of many nations’ infrastructure, where the reliability and safety are two major concerns for their transportation. For some special goods, such as flour and cotton, they will deteriorate if in wet air for a long-distance transportation, which causes economic loss. More seriously, they may self-ignite and cause an explosion if in dry and high temperature air for a long time, which can also put the human life in danger. An automated approach for keeping track of some crucial data within goods and/or boxcars in a train, such as humidity and temperature, is of utmost importance.
In this article, focusing on a real-life application of WSNs in trains to monitor the goods conditions in a long-distance transportation, we address the linear sensor deployment problem with the goal of maximizing the network lifetime. The linear sensor deployment problem has been studied in several recent works,18–26 and their solutions can be applied to many real-life applications, such as monitoring railway bridge, highway traffic, and oil pipeline. We study a many-to-one sensor network as shown in Figure 1. In a boxcar, acquisition nodes directly send data to collection nodes which transmit the collected data to the sink node through multi-hop forwarding scheme (since the energy consumed by receiving data from acquisition nodes in each round of data collection can be seen as a constant, we can only manage the energy for sending or relaying data among sink and collection nodes). The lifetime of the WSN can be limited by collection nodes with heavy traffic load or power consumptions. Due to some realistic constraints, the WSNs for monitoring trains differ from most of the existing work in one to several aspects as follows:
Setting collection nodes in boxcars sharply weakens the transmit signal and shortens the transmission range, compared to that in an open field.
To collect data in all boxcars, each boxcar must hold at least one collection node.
All nodes must locate inside boxcars, that is, nodes cannot be placed between any adjacent two boxcars.

Monitoring a train with sensors.
Hence, the deployment problem of collection nodes in trains becomes even more challenging. We first formulate the problem with realistic discrete power model of nodes as a mixed integer linear programming (MILP) problem. Then, an efficient heuristic to find the transmission level for each collection node is proposed to satisfy the above constraints step by step. The evaluation results show that the heuristic derives nearly the same lifetime as MILP. Moreover, the WSN with appropriate number of nodes can improve its lifetime up to 10.6% for a train with 80 boxcars.
The rest of the article is organized as follows. Section “Problem setting” presents the system model and our assumptions. Section “Sensor deployment for lifetime maximization” discusses the MILP formulation and the efficient heuristic schemes. Section “Evaluation” provides the evaluation results. Section “Real implementation” describes the tested experiment and real implementation of the whole monitoring system. Section “Related work” investigates related work. Section “Conclusion” concludes the article and points out our future work.
Problem setting
A WSN in trains for monitoring long-distance goods transportation consists of three components: acquisition nodes, collection nodes (node for short, if not confused), and sink node, as shown in Figure 1. Collection nodes directly collect and package the data from acquisition nodes in goods. One sink node is fitted in the engine to collect the data forwarded by each collection node, display these data on site, and send them to the remote control center which is mainly responsible for data analysis. The detailed description of the whole monitoring system is shown in section “Real implementation”. Now, we focus on the collection node deployment and provide the corresponding system models.
System model
We consider a WSN consisting of n collection nodes {N1,…,Nn}, which is used to monitor a train with T boxcars. The length of each boxcar is S, and the distance between two boxcars is L. The closest node to the engine is N1 and Nn is the furthest one. We further assume that nodes forward the sensing data one by one to the sink node as shown in Figure 1, that is, node Nn sends its data to node Nn − 1, and Nn − 1 sends its own data as well as the relayed data to node Nn − 1, and so on without interweaving transmission among nodes.
Note that, in WSNs, the transmission range of a node directly depends on its transmission power/current. Lots of theoretical studies, such as Olariu and Stojmenovic, 7 Xing et al., 14 and Liu and Mohapatra, 21 have adopted ideal power model which assumed that nodes’ transmission power and range can adjust continuously, where the required transmission power can be modeled as 27
where d is the distance between two sensor nodes, γ and α are system-dependent parameters, and 2 ≤ β ≤ 4. In general, γ is a small constant. However, most modern nodes can only adjust their transmission power/current and range discretely, and normally have only a few transmission levels. Nodes implemented in our monitoring system belong to this case. We assume that each node has M transmission levels, which are represented as a vector
For each round of data collection, the amount of data in each collection node is the same after data packaging, which needs time t to transmit (send or receive). For node Ni, it will take time (n − i) · t to receive the data from all its predecessors, and then take time (n − i+1) · t to send all date to the next node Ni−1. Suppose that node Ni operates at transmission level m, the required energy consumption is
As shown in Figure 1, di denotes the distance between node Ni and the sink node. d(i,j) = dj − di denotes the distance between nodes i and j. We say a WSN is connected if the transmission range of each node Ni is greater than or equal to the distance between itself and the next node Ni−1, that is, d(i − 1, i).
Problem statement
A feasible node deployment of a WSN for monitoring trains has to meet all the three requirements as follows:
To obtain the maximum lifetime of the WSN, we need to find out the optimal number of nodes n, the distances between each two adjacent nodes d(i − 1, i), and the corresponding transmission level, such that the energy consumption of the energy hole is minimized. Note that the distance d(i − 1, i) should be less than or equal to the corresponding transmission range of Ni. The feasible deployment with maximum lifetime is called optimal deployment. Due to the NP-hardness of the problem, we first formulate this problem as a MILP problem, then develop efficient heuristics.
Sensor deployment for lifetime maximization
Since the data density in nodes varies, that is, more data need to relay/transmit for nodes closer to the sink node and vice verse, unevenly distributing nodes and balancing the energy consumption at each node can further prolong the lifetime of a WSN compared to equal-distance distributing. Following this idea, some research works, such as Liu and Mohapatra 21 and Guo et al., 22 have addressed the linear sensor deployment problem, where nodes can be placed anywhere along a continuous pipeline. However, nodes can locate segmentally in boxcars for train monitoring to meet the requirements above. Hence, not all the transmission levels in ℝ is necessary, and Lemma 1 presents the lower and upper bound of transmission range for any feasible sensor deployment.
For upper bound, if the distance of two adjacent nodes is larger than 2S+L, between the two nodes, there must be at least one boxcar with no node inside, which contradicts the connected deployment. Therefore, the Rup also holds.
After bounding the transmission level by Lemma 1, denote the transmission vector as
Therefore, the lemma holds.
For each value n in the interval derived by Lemma 2, we first formulate an MILP problem, and then propose an efficient heuristic.
MILP formulations
For each node Ni, define several binary variables:
xij = 1 if node Ni locates at boxcar Bj, or xij = 0.
yik = 1 if node Ni operates at transmission level k, or yik = 0.
Each node can locate in only one boxcar
Each node can operate at only one transmission level
As requirement
As requirement
As requirement
The energy consumption of each node Ni is expressed as
We denote the energy hole as Emax =max{Ei|i = 1,…,n}. That is, our objective is to minimize the energy of energy hole
Conditions (1)–(6) form a constraint set, and combined with the optimization objective in condition (7), it forms an MILP problem.
An efficient heuristic
Since the distance d(i − 1, i) between any two adjacent nodes, that is, the transmission range of node Ni, cannot exceed 2S+L, we reassign the transmission range RK as 2S+L but unchange
Now, we will present a two-step heuristic to meet those requirements step by step.
To be self-contained, we include the two algorithms (L2H or H2L) and provide brief explanation for them. Algorithms 1 and 2 show the algorithms adapted to the notations used in this article. The vector V = <c1,…,cK > denotes the number of sensors assigned in each transmission level. There is
Algorithm L2H
This algorithm expands nodes’ transmission levels from low to high. First, if the nodes are not enough to cover the desired range cov, the algorithm exits because of no feasible solution (lines 1–3). Otherwise, the algorithm initializes the transmission level assignment vector V such that all nodes transmit at the lowest level (line 4). If the current level assignment cannot cover the desired range cov, appropriate nodes will be selected to increase their transmission levels (lines 6–13). When the while loop exits, the vector V will contain the transmission level assignment.
Algorithm H2L
This algorithm contracts nodes’ transmission levels from high to low. Instead, the initial assignment vector is V = <0,…,0, nd > (line 4). While the coverage of nodes is larger than the range cov, we decrease the transmission level of the energy hole node that consumes the most energy until no further improvement to the lifetime can be obtained. The steps of this algorithm are similar to those in Algorithm L2H except that it tries to find the energy hole node (lines 6–11) and reduce its transmission level.
After step 1.1, there are some key properties of the current deployment shown as follows:
In sum, the deployment by this sub-step only meets requirement

Step 1: to guarantee requirement
Hence, the distance between any two adjacent nodes becomes smaller or keeps unchanged, and the energy consumption of energy hole also decreases or remains unchanged. All nodes in Figure 2(a) are moved leftward, and the deployment becomes the one in Figure 2(b).
nd⇐nleft;
tn⇐Inull;
For the current deployment, if the node in boxcar BInull locates at the left wall, cov⇐Inull⇐L+(Inull − 1) · S; if the node locates at the right wall, cov⇐Inull · (L+S);
After Step 1.4, the location or distance to the sink node of the collection nodes in boxcars from BInull to Btn should be fixed, because moving them in the next recursion may not lead to better solutions, which is also indicated by the evaluation results. Hence, we choose the current first null boxcar as the last boxcar of the next recursion. In addition, the recursion can definitely terminate, since at the worst case, it would terminate at the sub-problem where there was one node left to cover one boxcar.
Note that for each sub-problem, we keep the data density of each node unchanged as the initial, that is, Ni always receive n − i and send n − i+1 data. The complete algorithm of Step 1 to cover T boxcars by n nodes is shown in Algorithm 3. First, the algorithm makes initialization with parameters that cover the whole train with T boxcars using n sensor nodes (line 1). It then conducts recursion by calling function cover(nd, cov, tn) recursively in line 2. Line 3 conducts an update by setting the energy hole as the sensor node that consumes the most energy. To meet the requirement A3 (i.e. a connected network), line 4 updates each node’s transmission level to Rj that satisfies Rj−1 < d(i − 1, i) ≤ Rj. That is, line 4 adjusts each node’s level to the one with a transmission range just larger than or equal to the distance between itself and next node.
First, from N1 to Nn, move nodes in-between two adjacent boxcars (Bj and Bj+1) leftward or rightward to make them be inside boxcars, as shown in Figure 3. Move one node rightward to the left wall of boxcar Bj+1, if it will not become a new energy hole. Or, move it leftward to the right wall of boxcar Bj. Then, update the energy hole and transmission level of each node accordingly.

Step 2: to guarantee requirement
The time complexity of the two-step heuristic scheme is O(n 2 K 2 ), of which the detailed analysis is shown as follows. For Step 1, the time complexity of sub-steps from 1 to 5 is as follows: O(nd · K 2 ), O(nd), O(tn), O(tn), and O(1), respectively. Due to nd ≥ tn, the time complexity of each sub-problem is dominated by Step 1.1 and equals O(nd · K 2 ). Moreover, the time complexity of Step 2 is O(n). Therefore, the time complexity of the overall algorithm is dominated by Step 1, that is, the recursive algorithm cover(), of which the time complexity is analyzed as follows.
In the worst case, the first null boxcar always appears right before the last boxcar Bt in each sub-problem. Hence, the time complexity of each step of recursion is as follows: O(nK 2 ), O((n − 1)K 2 ),…. In all, the total complexity can be calculated as
Discussions
In practice, sensor nodes may be only installed at some certain locations. For example, put nodes around the air vents of boxcars to enhance transmission signal. In addition, to obtain accurate data, the number of nodes in each boxcar may require to be greater than a threshold value. To deal with these additional requirements or constraints, we can partition a boxcar into a certain number of virtual segments, each of which can be seen as a new boxcar. As shown in Figure 4, a boxcar is partitioned into four segments. Hence, our approaches (both the MILP and the two-step heuristic scheme) proposed can be easily adapted to these realistic cases through the boxcar partition.

A segmented boxcar.
Evaluation
In this article, we consider eight transmission levels as shown in Table 1. Here, the corresponding current values are obtained from the data sheet of TI RF Transceiver CC1101. 28 The transmission range Rk are measured values when the collection nodes around air vents in boxcars are set, which is sharply shorter than that in an open field due to the weakened transmission signal. For a train, the number of boxcars can range from several to 100. The length of one boxcar usually ranges from 9.9 to 17.6 m, and the distance between two boxcars is around 0.6 m.
Sending and receiving current and transmission ranges when transceiver runs at 433 MHz.
The ILOG CPLEX solver has been exploited to obtain the optimal solution from the MILP formulation, compared to which, we evaluate the performance of the proposed two-step heuristic scheme on prolonging the WSN’s lifetime. Figure 5 shows the normalized lifetime of the WSN for different number of nodes in the interval given by Lemma 2. The optimal lifetime derived by MILP for the WSN with T nodes is used as the baseline.

Normalized lifetime for two-step heuristic schemes and MILP. The optimal number of nodes is shown in shadowed text box: (a) T = 50, S = 15 and (b) T = 80, S = 15.
From the results, we can see that the WSN’s lifetime improves as the number of nodes increases. When it reaches an appropriate number of nodes, the WSNs lifetime can be improved by up to 10.6% compared to that for the minimum number when T = 80. However, if more than the appropriate number of nodes are deployed, the WSN’s lifetime reduces as the number of nodes increases due to more energy being consumed in the energy hole to transmit the additional data. Therefore, there is an optimal number of nodes to achieve the maximum lifetime of the WSN, such as 55 nodes for T = 50 and 87 nodes for T = 80, more nodes may not always help improve WSNs’ lifetime.
In addition, our two-step heuristic scheme combined with H2L, labeled as H2L in Figure 5, performs almost the same as the optimal MILP solution, while the one combined with L2H, labeled as L2H in the figure, performs slightly worse. To analyze the results, there are two questions here that we have to answer:
Why the heuristic combined with H2L is better than the one with L2H?
Why they still have very good performance even when considering those realistic constraints, such as requirements
For the first question, the heuristic H2L aims at minimizing the energy consumption for the node that consumes the most energy in each iteration, which complies with the goal of the initial problem. While L2H follows a different direction by choosing the node that consumes the minimum energy and increasing its power level in each interaction, which leads to irreversible energy consumption jump. The similar reasons have also been presented for the result analysis in the previous work of Guo et al. 22
For the second question, there are three main reasons. First, we combine the two good heuristic schemes (H2L and L2H) into each step of recursion. Second is on our choice of when and where to conduct recursion. Since there are usually no enough nodes to cover those boxcars in the interval from the first null boxcar to the last boxcar when n is relatively small, the location of one node is fixed at the left or right wall of one boxcar in this interval, that is, its transmission level is also fixed after Step 1.4. Hence, we can only manage the transmission levels of nodes before the first null boxcar, and choose it as the last boxcar of the next sub-problem. In addition, when n is relatively large, it will conduct few recursions. Third, in Step 2, we move one node in-between two adjacent boxcars to avoid to generate a new energy hole as far as possible.
Real implementation
The Monitoring System for Long-Distance Goods Transportation consists of three layers: sensing layer, communication layer, and application layer, as shown in Figure 6. The collected data in the sensing layer are transmitted to the application layer through GPRS and Internet in the communication layer. The control center in application layer is implemented to store, analyze, and display data obtained from all trains monitored. In what follows, we will detail the local monitoring system for a train in sensing layer.

Monitoring system for long-distance goods transportation. Acquisition nodes are not shown.
We have designed and implemented two types of node: TYP1 and TYP2, as shown in Figure 7(a). TYP1 adopts a low-power MCU MSP430, CC1101 transceiver chip, and temperature and humidity sensor SHT15 and is powered by a high-temperature lithium battery. Besides an MCU MSP430 and transceiver CC1101, TYP2 also integrates a 64*128 dot matrix ST7565 LCD, GPS module Gstar-GS-89m-J, and GPRS module MC52i. TYP1 node limits the lifetime of the WSN in sensing layer. Collection and acquisition nodes in boxcars adopt TYP1, while the sink node employs TYP2. Currently, a set of collection nodes have been installed around air vents in boxcars following the solution derived by the proposed heuristic scheme. The acquisition nodes will be put into goods, such as cotton package, when to load them onto the boxcars.

A tested experiment using one sink node and four collection nodes: (a) TYP1 and TYP2 nodes and (b) temperature and humidity data.
The temperature and humidity data are collected every 5 min and nodes switch to sleep mode for energy conservation after each round of data collection. Collection nodes forward these data to the sink node which provides several functions as follows:
Display the obtained data on site. On LCD, the first column is indices for boxcars, the second is for temperature data, and the last is for humidity data, as shown in Figure 7(b).
Examine the obtained data. If the temperature and/or humidity of one boxcar is higher or lower than a threshold, it sounds alarm and the worker may heat or cool the boxcar.
Insert the location information (longitude and latitude) into the data packet, which is then sent to the remote control center through GPRS module.
We have performed tested experiments for one sink node and four collection nodes, as shown in Figure 7(a). We numbered the four nodes and put them linearly at four different sites around our laboratory. Figure 7(b) shows the temperature and humidity of the four monitored sites, where the top row on LCD corresponds to data of the first node that is closest to the sink node, and the second row is for the second node, and so on. For an accelerated test, each node is set to transmit data continuously at maximum transmission level, where the lifetime of the WSN is around 1 day, for a battery with capacity of 1.2 Ah. This indicates that one WSN equipped with only collection nodes and consisting of 100 boxcars can operate for at least 1000 days under normal situation for the battery of same capacity when the data are collected in a period of 5 min.
Related work
In this section, we investigate existing works that study linear sensor deployment problem, which is the research thread most related to this work. Ganesan et al. 18 consider the problem of jointly optimizing sensor placement and transmission structure for data collection. The authors propose an analytical solution for sensor networks with linear topology. Perillo et al. 20 investigate the transmission range distribution optimization problem with a goal to maximize the lifetime of many-to-one WSNs. The authors propose a solution that determines what fraction of packets each node should send over different distances. Liu and Mohapatra 21 discuss how to deploy back-haul nodes for wireless networks with energy constraints. Specially, the studied problem is to achieve the minimum number of nodes needed to cover a back-haul network given the requirements of lifetime, energy, and covered area. The authors propose a greedy approach that has near-optimal performance. Jawhar et al. 23 consider the delay-tolerant linear sensor networks with mobile nodes and study different movement approaches for these nodes to optimize the delay of data collection. Alduraibi et al. 26 investigate the optimization models for determining the sensor node density with three different objectives: achieving desired detection fidelity with the minimum number of nodes, determining nodes’ placement to maximize the coverage, and minimizing the number of nodes for non-uniform fidelity. The authors propose a general formulation framework that can solve all the three optimization models.
All works, including Ok et al., 19 Guo et al., 22 Wu et al., 24 and Xia et al., 25 study WSNs for pipeline monitoring but they have different focuses. Ok et al. 19 consider self-sustainable sensors and try to minimize the number of sink nodes in the sensor network. Xia et al. 25 also consider self-sustainable sensors but try to minimize the cost of energy harvesting device. Guo et al. 22 focus on battery-powered sensors and try to maximize the lifetime of the senor network. Wu et al. 24 discuss channel-aware relay node placement and try to minimize the power consumption of sensing nodes. All the above works study WSNs with linear topology, but confine to one continuous dimension, that is, nodes can be placed anywhere along the linear space. However, different with them, our work studies a disconnected dimension, where nodes can only be placed inside boxcars and not outside boxcars (i.e. the space between two boxcars). Because of this difference, existing approaches cannot be directly applied to our problem.
Conclusion
In this article, we have discussed the linear sensor deployment problem to maximize the lifetime of WSNs in trains for monitoring long-distance goods transportation. Taking account of several realistic requirements, we presented the lower and upper bounds for both the transmission range and the number of nodes, between which the optimal solution must fall. Based on this, we first formulated the problem as a MILP problem, and then proposed a two-step efficient heuristic scheme which met the requirements step-by-step. The evaluation results show that the proposed heuristic combined with H2L performed nearly the same as the optimal MILP solution, while the one with L2H performed slightly worse. In addition, the WSN with appropriate number of nodes can prolong its lifetime by up to 10.6% for a train with 80 boxcars. We also discussed a tested experiment in a laboratory environment, as well as the real implementation of the whole monitoring system. For our future work, we plan to study the multi-hop scheme with interleaved data forwarding and adapt our monitoring system to more real-life applications.
Footnotes
Academic Editor: Amiya Nayak
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported in part by the National Natural Science Foundation of China under grant numbers 61472072, 61528202, and 61502474.
