1 Introduction

Traditional MANET routing algorithm always selects the shortest path between a source and a destination. But it is necessary to consider the specific constraints like limited bandwidth and battery power during the process of routing. Nodes in MANETs are mobile and can move out of the range of the other nodes in the network at any time instant. This will divide the network and may require re-establishing the route between the source and destination pair. This process of new route discovery leads to increased control overheads which in turn will increase the power consumption of the battery resulting into reduced node lifetime. Therefore, it is essential to consider not only the hop count but also the residual battery of the nodes during the process of route selection. This requires special routing algorithms which can handle the constraint of limited battery power in order to prolong the network lifetime.

Ease of deployment without specific requirement of infrastructure makes MANETs a popular choice among the wireless networks. A MANET node should have the capacity of sensing, manipulating and transferring data wirelessly. These nodes can be built using a microcontroller, RF transceiver, power source, and/or sensor(s). The RF/radio transceiver are based on wireless technology such as ZigBee (IEEE 802.15.4), Bluetooth (IEEE 802.15.1), and Wi-Fi (IEEE 802.11) [1]. All of them operate at frequency of 2.4 GHz. Bluetooth and ZigBee have data rates of 1 Mbps and 250 kbps respectively while Wi-Fi has data rate up to 54 Mbps. ZigBee has wider range, lower power consumption and lesser device complexity than that of Wi-Fi and Bluetooth. The network latency of ZigBee is the minimum as compared to its other two counterparts. A ZigBee device takes 30 ms to join the network while a Wi-Fi and Bluetooth device need 3–5 s. and 10 s. respectively [2]. Thus it is evident that ZigBee technology is a more appropriate to build a low power, wide range, and scalable wireless ad-hoc network.

2 Related Work

Researchers have been working to find the solutions to cope with the problems faced by MANETs. But it is equally important to validate the proposed solution. In order to check the feasibility of the proposed solution, different researchers have worked on simulation, emulation and real world experimentation. Simulation is the imitation of real world processes and requires analytical models/mathematical functions. Authors have stated about limitations of simulation in [3]. Simulation is based on certain assumptions and MANET characteristics like energy consumption or radio propagation cannot be modelled exactly. Hence, many researchers are also working on the physical implementation of MANETs using hardware platforms/test-beds.

Variety of wireless ad hoc/sensor network platforms are existing to cater different issues and applications in wireless networking. A hardware platform should have appropriate hardware, software/experimentation tools, technique to enable mobility, and techniques for self-maintenance etc., as per the needs of the proposed application and protocols [4]. A hardware platform/test-bed should be adept of testing under realistic situations and constraints. The MANET nodes are built using microcontrollers and radio transceivers and have scarce resources such as battery capacity, computational power, transmission range and bandwidth. The hardware platforms make use of Microprocessors/microcontrollers such as Atmega328, Atmel ARM Cortex M0/1/2/3/4, and JN1548 etc. Majority of the existing hardware platforms have radio transceivers with IEEE 802.15.4 as their communication protocol.

Congduc Pham has investigated the communication performances of different sensor motes which are used in smart city test-beds in [5]. Details of 802.15.4 radio transceiver are also presented along with the performance study of transmission and reception abilities of various hardware platforms like Arduino-based motes, Libelium WaspMote, Telosb-based motes, iMote2 motes and MicaZ motes for surveillance applications.

Ignacio Del Castillo et al. have presented a heterogeneous hierarchical IEEE 802.15.4 based wireless sensor network (WSN) [6] which supports sensor nodes and mobile coordinator over widespread topographical areas. This network was deployed in commercial refrigerated trucks to monitor and communicate certain environmental parameters and was validated experimentally in vehicular applications. IEEE 802.15.4 compatible nodes were installed on each vehicle. A mobile agent was assigned to save the energy by reducing the traffic load on each node so as to prolong the network lifetime. The agent tries to decrease the number of hops to decrease energy consumption due to retransmission errors.

Wilawan Rukpakavong et al. have proposed a new method for node lifetime estimation that is applicable for mobile as well as stationary loads. It considers different factors such as battery type, model, brand, discharging rate, self-discharge, battery age and temperature etc. which can affect the lifetime of nodes. Experimentation was done using two wireless sensor test-beds viz. N740 and Mica2 and two different types of nickel metal hydride and alkaline batteries to evaluate the viability of their proposed algorithm. Authors conclude that the node lifetime can be anticipated more accurately by using “Dynamic Node Lifetime Estimation” scheme which is suitable for both online and offline estimation of lifetime [7].

Sheikh Ferdoush et al. present an Arduino and Raspberry Pi based WSN design for environment monitoring in [8]. The system consists of a static base station and a few sensor nodes. Each node was built using a microcontroller, ZigBee transceiver and sensor(s). The ZigBee module of one base station was configured as a coordinator and those of the three sensor nodes were configured as routers to form a mesh network. A web interface was designed to display humidity and temperature data from two nodes. Authors have integrated the gateway, web server and database into one compact low power processor making it useful for numerous environmental monitoring and data acquisition applications.

A WSN on ZigBee technology for environment monitoring in greenhouse was implemented by authors in [9]. Authors have confirmed that the system design is realistic and user-friendly. It is possible to acquire, monitor and study the data from any location by using sensor(s) and ZigBee technology. The system was successfully implemented at an agricultural field in China.

Wan Du et al. have presented a real life industrial application for measurement and control of automobile vibrations by using “MICAz” hardware platform, modelled by SystemC in the IDEA1 simulator in [10]. They implemented and studied slotted “CSMA/CA” algorithm in “beacon-enabled” mode and the un-slotted “CSMA/CA” protocol in “non-beacon” enabled mode, based on the performance metrics namely-packet delivery rate, power consumption per node, latency, and energy consumption per packet. They also evaluated two synchronization mechanisms of IEEE 802.15.4 standard, viz. the non-beacon and beacon tracking to analyse the effect of super frame order and the beacon order for different traffic loads. Authors have concluded that the beacon enabled mode proposes a higher packet delivery rate while the non-beacon enabled mode shows reduced latency and energy consumption due to lack of necessity of resynchronization.

Sushabhan Choudhury et al. have proposed a Sensory Data Acquisition system based on ZigBee and Bluetooth networks in [11]. The system can be used for monitoring of parameters such as humidity, temperature, level of atmospheric gases, proximity of person in the prohibited area in factories/industries/environment. These parameters are regularly transmitted wirelessly to the control room and to the concerned authority using smartphone or tablets. From the experimentation results, the authors have concluded that the ZigBee nodes have transmission range up to 100 m and multiple hops need to be used for long distance communication. While Bluetooth has transmission range up to 10 m.

Wilson T.H. Woon et al. have presented a complete performance evaluation of IEEE 802.15.4 using Network Simulator 2 and testbed experiments in [12]. Authors have evaluated the efficiency of the IEEE 802.15.4 in networks with variable traffic loads and packet sizes. It is concluded that the IEEE 802.15.4 standard is appropriate for low-rate applications up to 20 bytes and 10 kbps traffic load for which the throughput and packet delivery ratio seem to be more constant.

Authors in [13] have proposed a protocol based on nodes’ residual energy and its distance from base station to prolong network lifetime. This technique balances the load distribution among the nodes to reduce the energy consumption in the network. Thus, the nodes save residual energy to increase the network lifetime. First order radio model has been used to estimate the energy efficiency of a network. Simulation results indicate that there is 70% reduction in energy consumption.

Localization of network nodes is an important issue in wireless sensor/ad hoc network as the infrastructure in not fixed and nodes are free join or leave the network at any time leading to a dynamic network topology. Many researchers have been working on the localization of nodes using received signal strength indicator (RSSI) to determine the inner distances between the network nodes.

Bassam Faiz Gumaida and Juan Luo have proposed non-linear optimization method called as intelligent water drops (IWDs) for localizing nodes in an outdoor surroundings [14]. Low precision of RSSI results into error in the RSSI-based localization. To overcome this problem and optimize the localization process, IWD for continuous optimization (IWD-CO) which is a modified version of IWD has been implemented by the authors. It has been observed from the evaluation results that the localization accuracy increases with increase in the number of IWD, number of components, anchor density, and transmission range. Performance of IWD-CO is slightly affected by noise.

For energy conservation and optimal data transmission, authors in [15] have proposed the concept of “equivalent node” to choose the relay node. Analysis of the energy consumption model and data relay model has been done for the same. To choose the optimal energy strategy and prolong the lifetime, a probabilistic dissemination algorithm, called ENS PD, is designed of whole network. Simulations results have shown that the energy consumption has been minimized with guarantee of the quality communication.

A new effective algorithm based on black box optimization technique is proposed in [16] to support the localization of nodes in WSN. This technique is named as “hierarchical structure poly-particle swarm (HSPPS)” optimization. It considers that the ranging technique is based on the received signal strength indicator (RSSI) which is the most inexpensive distance approximation technique. Authors have performed extensive real experimentation to evaluate the performance of the HSPPS algorithm in the outdoor environment with nine anchors and twenty unknown nodes. The proposed algorithm displayed the powerful performance where the localization error was lower than that in the simulation experiment with twelve anchors.

3 Conventional Versus Energy Efficient Routing Algorithms

Conventional routing algorithms tend to select the shortest path/route in order to reduce the number of hops irrespective of the battery level of the nodes. It is essential to implement some techniques to reduce the energy consumption of the nodes in the network in order to save the battery power. Researchers are working on the ways to reduce energy consumption at various levels like physical, MAC, operating system as well as routing. Various maximum lifetime routing algorithms based on metrics such as - minimum energy routing, max – min routing and minimum-cost routing have been implemented. In order to balance the network load, using minimum hop metric would not be sufficient. It is necessary to consider the battery level of the nodes and avoid the routes with nodes having less residual energy during the route selection. This will avoid frequent use of the same nodes on the shortest route and their premature dying, thus extending the network lifetime.

4 Proposed Energy Efficient Routing Algorithm

Conventional DSR algorithm is modified to consider residual battery capacity of the nodes on the probable routes between source and destination nodes. The proposed algorithm is called as Least Max DSR (LMDSR).

Consider there are multiple paths between a source and destination pair as shown in Fig. 1. Numbers near the nodes indicate their remaining battery capacities. There are three paths viz. \(pt1, pt2, pt3\) between the source and the destination nodes. These paths belong to same set ‘PT’.

$$PT = \left\{ { pt1,pt2,pt3 } \right\}$$
(1)

where,

$$pt1 = S - B - C - E - D$$
(2)
$$pt2 = S - A - F - G - D$$
(3)
$$pt3 = S - A - F - H - D$$
(4)

On every path \(pt \in PT\) there may be a weakest node which may get exhausted early leading to path breakage. For example, on path pt1, node ‘C’ has the lowest residual battery capacity, while on paths pt2 and pt3, node ‘G’ and node ‘A’ have the lowest residual battery capacities respectively. The node which has the highest residual battery capacity among these weak nodes is found out and the path which has this node is selected for routing. From Fig. 1 it can be seen that node ‘A’ has highest residual battery capacity among nodes C, G and A. Therefore, path pt3 is selected for routing. This will ensure that the path which has nodes with higher residual battery capacity is selected to avoid exhaustion of nodes with low battery levels, in order to balance the load distribution.

Fig. 1
figure 1

LMDSR route discovery

To find out this weakest node following function is defined:

$$WNpt\left( i \right)_{\forall pt \in PT} = min_{\forall j \in pt} \left\{ {BL_{cur} \left( j \right)} \right\}$$
(5)
$$SNpt = max_{\forall j \in WNpt} \left\{ {WNpt\left( j \right)} \right\}$$
(6)

where \(WNpt\) is the weakest node on the route. \(BL_{cur}\) is the current battery level of the node. \(SNpt\) is the strongest node on the route.

4.1 Algorithm

figure d

5 Mathematical Model for Network Lifetime

Lifetime of a node is determined by the present battery capacity, ‘Cb’ and current consumption required by the node, ‘I’. Lifetime of a node is stated in [7] as given by Eq. 7.

$${\text{L}}_{\text{t}} = \frac{Cb}{{I^{k} }}$$
(7)

where Cb= Cmax * State of Charge (SoC) of the battery, k = 1 is the Peukert’s constant which is calculated from Eq. 10.

Estimation of NiMH battery capacity based on electromotive Force Method (EMF) in stated in [17] as given by Eq. 8.

$$SoC = \left( {1 - \% Loss} \right)*\left( {0.8 + \left( {0.2*\left[ {\frac{{VoC - VoC_{80} }}{{VoCf - VoC_{80} }}} \right]} \right)} \right)$$
(8)

where VoC is the existing voltage capacity. VoC80 is voltage at capacity of 80%. VoCf is voltage at capacity of 100%.

This model is much simpler than that of electrochemical models and less costly. But, it did not consider the current consumption by the microcontroller and transceiver.

Many of the researchers have adopted First Order Radio Model (FORM) [18]. This model considers only two major consumers of node energy, viz. transmit circuitry and receive circuitry. Some of the researchers have considered energy consumption in other than transmission/reception mode such as sleep, idle, active, processing etc. In addition to this, residual battery level as well as actual discharge rate of the battery are considered in this research while calculating the network lifetime. A new model is proposed as given by Eq. 9 which considers all the factors viz. existing/residual battery capacity, actual discharge rate of the battery as well as total energy consumption by the microcontroller and transceiver.

$${\text{Network Lifetime}},{\text{NL }} = \frac{{BC_{R} }}{{EC_{Tot} }} \times \frac{1}{{{\text{DR}}_{B} }}$$
(9)

where BCR = residual battery capacity, ECTot = total energy consumption by microcontroller and transceiver, DRB = Actual discharge rate of battery.

5.1 Effect of Actual Discharge Current of Rechargeable NiMH Batteries on Energy Consumption According to Peukert’s Law [19]

A node has a battery with non-linear discharge behaviour. Peukert’s law states this non-linear battery characteristics to calculate a constant ‘k’ known as Peukert’s constant [18]. The constant k is a number greater than 1 and depends on the battery brand and chemistry, but NiMH batteries are expected to have a constant smaller than 1.3 [20].

Conventional applications with limited batteries often assume an ideal battery model where the amount of the residual battery capacity decreases linearly with power consumption. However, the discharge behaviour of practical batteries is actually non-linear and thus performance degradation may occur if the non-linear behaviour is neglected. Hence, Peukert’s law as given by Eq. 10 [20] is considered to calculate Peukert’s constant ‘k’.

$$k = log_{{\frac{C}{IH} }} \left( { \frac{t}{H} } \right)$$
(10)

where t is discharge time in hours, H is rated discharge time in hours, C is rated capacity in milliampere-hours, I is actual discharge rate in milliampere and k is Peukert’s constant.

The actual discharge rate of battery can be calculated by rearranging Eq. 10 and substituted in Eq. 9 to estimate the network lifetime. Hardware test-bed experiment was performed for measurement of network lifetime in four different test cases as mentioned in Table 1.

Table 1 Test cases

6 Experimental Setup

The hardware setup for the experimentation is as shown in Fig. 2. Five devices namely-coordinator, routers - 1, 2, 3 and end device were configured in API mode to form an ad hoc network. Coordinator and router 1 were fixed devices connected to personal computer 1 (PC 1) with XBee Configuration and Test Utility (XCTU) to set up the frame and transmit it towards the end device through intermediate routers as per the selected algorithm. The number of transmitted data frames and corresponding acknowledgement frames can be observed on the same PC. While the number of data frames received can be observed on personal computer 2 (PC 2) with XCTU. Using laptop can make the nodes portable and changing the distance between the nodes becomes feasible.

Fig. 2
figure 2

Hardware setup

7 Performance Evaluation

Table 2 shows the values of estimated and measured Network Lifetime with DSR and LMDSR algorithms under four test cases.

Table 2 Estimated and measured network lifetime

It was observed that the estimated and measured lifetimes are highest in case 1 and lowest in case 4 as shown in Fig. 3. The measured network lifetime is lesser than that of the estimated in all the four cases. This is because the estimation is done by considering the standard values given in the datasheet. However, in realism, there are various factors such as the initial battery level, battery age, discharge rate of the battery etc. which may affect the lifetime.

Fig. 3
figure 3

Estimated and measured network lifetimes for four test cases

7.1 Effect of Initial Battery Voltage Variation on Network Lifetime

Figure 4 shows the graphs of initial battery voltage variation versus network lifetime. It is observed that the more the initial battery voltage the larger is the network lifetime. The estimated network lifetime from the proposed mathematical model given by Eq. 9 and the measured network lifetime using hardware setup as in Fig. 1 are comparable.

Fig. 4
figure 4

Effect of initial battery voltage variation on network lifetime

Figure 5 shows the battery discharge characteristics during DSR and LMDSR modes for case 1. Battery discharges in 12.30 h with DSR algorithm and in 16.17 h with that of LMDSR algorithm. Thus, there is 31% increase in the network lifetime with LMDSR algorithm which selects the route with stronger node i.e. with higher residual battery voltage.

Fig. 5
figure 5

Battery discharge characteristics for case 1

7.2 Comparison of Network Lifetime, Throughput and Energy Consumption in Four Cases

Equations 11, 12 and 13 are used to calculate network lifetime, energy consumption, and Throughput in all four communication scenarios.

$${\text{Network Lifetime}}\;\left( {{\text{hours}}} \right) = \left( {Ttx_{{1st_{packet} }} - Trx_{{last_{packet} }} } \right)$$
(11)

where \(Ttx_{{1st_{packet} }} = Time\, of\, transmission\, of\, 1st\, packet\, by\, source\, node\), \(Trx_{{last_{packet} }} = Time\, of\, reception\, of\, last\, packet\, by\, destination\, node\)

$${\text{Energy consumption}}\,\left( \% \right) = \frac{{\left( { B_{init } - B_{end } } \right)}}{{B_{init } }} \times 100$$
(12)

where Binit= Initial battery level, Bend= Battery level at the end of communication

$${\text{Throughput}}\;\left( {\text{bits/s}} \right) = \frac{{\# Rx_{packets} }}{Network Lifetime}$$
(13)

where \(Rx_{packets} = Received Packets\).

Comparison of Network Lifetime and Energy Consumption in all the four cases respectively is shown in Figs. 6 and 7 respectively. It can be seen that the Network Lifetime with LMDSR algorithm is higher than that with DSR algorithm in all the four cases. It is highest in case 1 i.e. static line of sight communication because there are no obstacles as well as no link breakages due to mobility of nodes. In case 4 i.e. mobile with obstacle communication, frequent route reestablishment was required due to link breakages because of node mobility and obstacles. This lead to increased energy consumption and reduced network lifetime.

Fig. 6
figure 6

Comparison of network lifetime in 4 cases

Fig. 7
figure 7

Comparison of energy consumption in 4 cases

Comparison of throughput with DSR and LMDSR algorithms in all the four cases is shown in Fig. 8. It is observed that the throughput with LMDSR algorithm is slightly reduced than that with DSR algorithm. Throughput is the ratio of total number of received bits to the network lifetime. Hence, increase in the network lifetime may result into reduced throughput. Thus, a tradeoff between network lifetime and throughput has been observed.

Fig. 8
figure 8

Comparison of throughput in 4 cases

8 Summary and Conclusion

Many researchers have implemented first order radio model which considers only two major consumers of node energy, viz. transmit circuitry and receive circuitry. Some of the researchers have considered energy consumption in other than transmission/reception mode such as sleep, idle, active, processing etc. Conventionally the battery model assumes that the remaining battery capacity decreases linearly with power consumption. But, the discharge behaviour of practical batteries is actually non-linear and thus performance degradation may occur if the non-linear behaviour is neglected. Hence, in addition to the energy consumption in different modes like transmit, receive, sleep, idle, active, and processing, this research work also considers residual energy as well as actual discharge rate of the battery while calculating the network lifetime. This gives more realistic and accurate estimation of network lifetime. Otherwise the measured and estimated lifetimes would have a drastic variation which may lead to wrong design solutions.

The low cost hardware implementation of wireless ad hoc network has been done using Arduino Mega2560 and ZigBee transceiver. From the experimental results it can be concluded that the proposed LMDSR algorithm extends the network lifetime approximately by 35% with average reduction of 21% in the energy consumption as compared to conventional DSR algorithm. A tradeoff between network lifetime and throughput has been observed. Average 1% increase in PDR and 31% decrease in end to end delay was observed with proposed LMDSR algorithm.