SolarCastalia: Solar Energy Harvesting Wireless Sensor Network Simulator

Most existing simulators for WSNs (wireless sensor networks) model battery-powered sensors and provide MAC and routing protocols designed for battery-powered WSNs. Recently, however, increasingly extensive studies of energy harvesting sensor systems require the development of appropriate simulators, but there are few related studies on such simulators. Unlike existing simulators, simulators for energy harvesting WSNs require a new energy model that is integrated with the energy harvesting, rechargeable battery, and energy consuming models. Additionally, the new model must enable applications of the well-known MAC and routing protocols designed for energy harvesting WSNs and have a convenient user-friendly interface. In this work, we design and implement a user-friendly simulator for solar energy harvesting WSNs.


Introduction
A sensor network consists of tens to thousands of smart sensor nodes working with very limited resources in terms of calculation, storage, communication, and energy.Particularly, the core obstacle of existing battery-powered WSNs is a limited lifetime during which the sensor nodes or networks operate functionally.Manual replacement or recharge of the batteries on each node is economically impractical and inordinately expensive.Further, a WSN can be located in an area where such a replacement or recharge is impossible (e.g., dangerous area such as war zones or outdoors).
Hence, for a battery-powered sensor network to operate autonomously for a long period a technology that minimizes the use of limited energy is required.With this aim (i.e., to overcome the short lifetime of a battery-powered wireless embedded system), previous studies have been conducted primarily on the energy-adaptive operation in a system or network level (e.g., a routing or MAC layer), which can operate sensors and maintain a network with minimal energy.However, even with this technique applied, stability and durability are insufficiently guaranteed, because a batterybased energy source is essentially limited.
The need to overcome the limitations and to satisfy the autonomy and continuance of a sensor node or a network in energy terms has recently generated interest in systems that harvest energy sources in the environment autonomously.However, researches on simulators for energy harvesting WSNs have not been conducted thoroughly, and thus such studies remain problematic.Moreover, using existing batterypowered WSN simulators for an energy harvesting WSN study creates the following difficulties.First, they do not provide an energy harvesting model for nodes.Because an energy harvesting sensor node collects energy intermittently or regularly, its schedule must be considered continuously when the remaining energy amount is calculated.Second, in contrast to a battery-powered WSN, an energy harvesting WSN uses a rechargeable battery for energy storage.Because there are a variety of rechargeable batteries, including SLA, NiCd, NiMH, Li-ion, and Li-polymer, each with its own characteristics, a simulator must accommodate the differences among the types and characteristics of rechargeable batteries.Third, existing simulators have extendibility issues as a result of their limitations regarding commercialization of programs, private source codes, and programming languages.Hence, designing a new routing, MAC, topology, and mobility protocol is difficult or impossible.Lastly, most simulators are command-line implementations which have a userunfriendly feature [1].By just increasing the residual energy to some amount, the energy harvesting model may be mimicked very roughly.However, it is not enough to simulate the actual energy harvesting WSN, due to the various components of energy harvesting node and the various environments of deployment.The main reason why we use the simulator prior to the real installation is to test the operation, to identify the problems, and to verify if the performance can meet the application's requirement.The energy harvesting nodes (e.g., the solarpowered nodes) have very different amounts of available energy according to their deployment season/location, panel type/size, and battery type/capacity.Therefore, in order to configure the cost-effective energy harvesting node which can meet the application's requirements, a new simulator for the energy harvesting WSN is positively necessary.
To resolve these problems, this study proposes an efficient simulator that permits easy various-level analysis of energy harvesting WSNs.The proposed simulator has been designed, in particular, for solar energy among many other energy sources.The characteristics of this simulator with solar energy harvesting feature are as follows: firstly, because it has been implemented with consideration of insolation and of the sizes and characteristics of solar panel types, simulation can be conducted under a range of conditions; secondly, because this simulator has been designed by considering the characteristics of each type of energy storage, a variety of analyses can be simulated for a storage type; thirdly, owing to the object-oriented implementation of the simulator, it is easy to add or revise a new model; fourthly, the simulator provides a user with a user-friendly GUI (graphical user interface) for easy operation; fifthly, by providing various solar energybased routing and MAC protocols in the base, a new proposed protocol can be compared and analyzed easily; and lastly, with simulation, a user can perform network-and node-level analyses simultaneously, allowing for an easy detailed performance analysis.
This study consists of the following sections.Section 2 reviews related studies with explanations of energy harvesting sensor systems and the types and characteristics of existing battery-powered WSN simulators.Section 3 describes the proposed simulator's energy model in detail, and Section 4 explains some important modules and user interface.Section 5 analyzes the simulation results of a solar energybased routing protocol by using the proposed simulator and verifies its operation.Section 6 draws conclusions accompanied by a final comment.

Background and Related Work
2.1.Energy Harvesting Sensor System.Recent studies on harvesting sensor nodes have focused on finding fundamental solutions for energy limitation [2].Energy harvesting sensor nodes harvest energy using various nearby environmentfriendly energy sources and store and consume the harvested energy using rechargeable batteries.Environment-friendly energies include solar, wind, blood pressure, breathing, footstep, and interior environment-generating vibration.Their characteristics are listed in Table 1.Further, as shown in Table 2, various types of rechargeable battery can store these forms of energy, which include SLA, NiCd, NiMH, Li-ion, Li-polymer, and Super-Capacitor, each of which has its own characteristics such as energy conversion efficiency, complete charge/discharge count, self-discharge, and memory effects [3].Because energy harvesting sensor nodes using these environmental energy sources with rechargeable batteries can be used permanently through energy harvesting, energy harvesting WSNs are less expensive to be maintained in comparison with the battery-powered WSN.In addition, due to the possibility of high quality of service (QoS) and the various exteriors of sensors, they can be used more widely than existing battery-powered sensor nodes.Figure 1 shows examples of existing energy harvesting sensor nodes developed by preceding studies.They are the solar energy-based Heliomote node [4], wind-energy-based AmbiMax [5], functional prototype of piezoelectric-powered RFID shoes with mounted electronics [6], and self-powered push button transmitter [7], International Journal of Distributed Sensor Networks 3  in the order placed.As shown in Figure 1, since energy harvesting sensor nodes use a variety of energy sources and storage devices, each sensor can have a different shape and size.Many energy harvesting sensor nodes in addition to those in Figure 1 are under development for various applications.

Battery-Based WSN Simulators.
The development of energy harvesting sensors has given rise to many studies on new techniques in the areas of systems, networks, and data, resulting in the modification and subsequent use of simulators that were implemented for existing battery-powered WSNs.Among those simulators, the most commonly used simulators are NS-2 [8], TOSSIM [9], AVRORA [10], SENS [11], and OMNeT++ [12], which have the following characteristics.
(i) NS-2 is a popular general-purpose network simulator that is used for TCP (transmission control protocol), routing, and multicast protocols.NS-2 provides various network management algorithms and protocols which focus on ad hoc network.However, its WSN protocols are limited to 802.11 and single-hop TDMA protocols, resulting in an insufficiency of dedicated WSN protocols.The use of Tcl (tool command language) is a further obstacle to the use of this simulator.
(ii) TOSSIM which is developed by the TinyOS project team at the University of California at Berkeley supports the MicaZ sensor platform and enables precise analysis, resulting from its ability to emulate even an OS command to the CPU.However, its code interruptibility in the compile phase and its inability to handle fine-grained timing result in less accuracy than that of a simulator such as ATEMU [13].
In addition, it is compatible only with TinyOS's application programs.
(iii) AVRORA which is a Java simulator developed at the University of California at Los Angeles is widely used as an analysis tool for programs written for AVR microcontrollers.Even though this simulator can be used for detailed analyses, including individual sensor and program analysis, tests, and profiling, it neither provides a GUI nor supports a networkcommunication level simulation.Hence, no networklevel simulation is available.
(iv) SENS is a cross level simulator that reflects network communication, applications, and physical environmental factors.Each module uses real-time information obtained from the environment and supports power usage analysis.However, it cannot simulate a MAC protocol accurately and supports only the sound aspects of physical phenomena that are obtained from the sound sensors and actuator.
(v) OMNeT++ is an extensible, modular, componentbased C++ simulation library and framework, primarily for building network simulators.It provides component architectures for models which are programmed in C++ and then assembled into larger components and models using a high-level language (NED).Due to the GUI environment, it is widely used in network-related research, including queuing systems, hardware emulation, or WSNs simulation.
All of these simulators support battery-powered energy models which contain only energy-consumption model without energy harvesting model.In addition, because they do not consider the characteristics of various storage devices, these simulators are inappropriate for analyzing the performance of an energy harvesting system which uses various kinds of rechargeable batteries.In an attempt to resolve such issues, we designed and implemented a simulator dedicated to solar energy-powered WSNs.

Energy Model of the SolarCastalia
An energy harvesting sensor node can use various types of energies in the environment as its energy sources.Among the environment-friendly energy sources, we selected solar energy, which is uncontrollable, but periodically collectible with sufficient energy density and high conversion efficiency [14].The energy model of a solar-powered node is composed of three submodels; energy harvesting model, energy consuming model, and the remaining energy model on the rechargeable battery.
As shown in Figure 2, the energy harvesting system of a sensor node gathers solar energy using a solar cell or solar panel, stores the harvested energy in the rechargeable battery, and operates the sensor system using the stored energy.To simulate more accurate energy harvesting system, we designed an energy harvesting model that considers insolation by weather and climate, the panel size and type characteristics, and characteristics of the types of storage that store the energy harvested.Then, we designed the residual energy model which is combined with an energy harvesting model and an energy consuming model.

Energy Harvesting Model.
The core feature of the proposed simulator is solar energy collection.We incorporated the characteristics of solar panels and rechargeable batteries used in real solar energy harvesting sensor nodes in order to simulate the amount of harvested energy as accurately as possible compared to an actual node.The kinds of solar panel and rechargeable battery are so various, as shown in Tables 2 and 3, and thus the amount harvested varies with the selections.In addition, as shown in Figure 3, to reflect the amount of solar energy by weather and season, we actually measured and collected in a database the hourly harvested solar energy for a year by using TI's EZ430-RF2500-SEH mote of which panel is 5.9 × 5.7 cm 2 thin film.Since insolation changes every decade [15], the measured data are valid for the next ten years.
Based on these characteristics, the amount of energy harvested between time  1 and  2 can be calculated using the following: where   2  1 is energy that is harvested between times  1 and  2 , and it is a value that is calculated by multiplying the actual measurement value (  ) by the weighting value of the characteristics.The terms on the right hand side of the equation are the size ratio of the solar cell ( ratio size ), the characteristic based on the solar cell type ( ratio efficiency ), and the characteristics based on battery type ( ratio efficiency ), respectively, and they are calculated using the following: where  base size is the size of the solar cell which is used when we make the reference values in a database,  input size is the size of the solar cell to be simulated,  base efficiency is the energy conversion efficiency of the solar cell material used in the reference value measurement,  input efficiency is the energy conversion efficiency of the solar cell material to be simulated,  base efficiency is the energy conversion efficiency of the rechargeable battery used in the reference value measurement, and  input efficiency is the energy conversion efficiency of the rechargeable battery to be simulated.Note that (3) and (4) were precalculated using the panel type and battery type, and they exist as constant values such as  single and  SLA .

Energy Consumption Model.
Generally, the power consumption of the sensor node can be calculated by adding the power consumptions for data-transmitting, data-receiving, and others such as data-sensing or data-processing [16].Since our simulator considers the types of rechargeable battery, we added the self-discharged energy of the battery, which reflects the characteristics of the battery type, to the energy consumption model.The following shows the energy consumption model between time  1 and time  2 : where   2  1 represents the energy consumed at one sensor node between  1 and  2 , and its respective terms are calculated as follows: In other words, the energy consumed when receiving the transmission ( RX ) is estimated using the number of bits per second (1) and the energy consumed per bit ().Furthermore, the energy consumed when transmitting ( TX ) is calculated using the number of bits transmitted per second (2), the energy consumed per bit ( 1 ), and the amplifier's energy  2   ( 2 is the energy consumed per bit in the amplifier,  is the transmission distance, and  is a value of 2∼4, which depends on the environment).The energy consumed by the system excluding the TX/RX data ( system ) is calculated by multiplying the consumed electricity (PW) by the duty cycle (DC).Finally, the decreasing value of energy that is due to the self-discharging of the battery (  battery ) is estimated using the remaining energy of the battery at a certain time (  residual ) and the self-discharging ratio ( discharge ).

Remaining Energy Model.
Finally, the energy management module traces the remaining quantity of energy based on (1) and ( 5), as shown in where   residual is the remaining amount of energy at time ,  init is the initial energy of the battery,   0 is the amount of energy harvested until time , and   0 is the amount of energy consumed until time .
In addition, the sensor node operates in three different modes, depending on the remaining amount of energy.When the remaining amount of energy is zero (  residual = 0), indicating that no energy remains in the node, the node enters the sleep mode, and energy consumption stops.While in a battery-powered system, a node's life ends in that case and maintenance such as replacement is required; an energy harvesting system enters the sleep mode and then reactivates, when additional energy is harvested.In contrast, if the node's remaining energy amount is equal to the battery capacity (  residual =  capacity ), then any harvested energy has no space to be stored, so the energy harvesting model ceases operation.In the normal mode (0 <   residual <  capacity ), the energy harvesting model and the energy consumption model operate simultaneously.Further, to reflect rechargeable battery type characteristics, if the complete charge/discharge count exceeds the predetermined charge/discharge count of the selected battery type at time , then the   residual value is set to zero since the performance of a rechargeable battery cannot be guaranteed.

Implementation Issues
The proposed simulator was implemented based on an existing sensor simulator called Castalia [17].Based on Castalia, we modified the design as well as embedding new components, to support energy harvesting feature.

4.1.
Structure Modified for the SolarCastalia.As shown in Figure 4, the SolarCastalia is able to provide the node-level simulation as well as the network-level simulation.Each simulated node is composed of several software components which are closely cooperating such as sensor manager, resource manager, mobility manager, application, and other communication composite modules.In this research, we especially focus on the resource manager, and thus we departmentalize it into devices and energy submanagers, and then drive all energy-related modules to the energy submanager.
The energy submanager consists of the energy harvesting, energy consumption, residual energy modules, and the database for a reference.Firstly, as explained in Section 3.1, the energy harvesting module simulates the amount of harvested energy as accurately as possible, by using the database and the user configurations about the simulation environment such as the panel type and size, the storage type and capacitor, season, and weather.And then, the energy consumption module simulates how much energy is consumed by the node as time goes on, by applying (5) in Section 3.2.Finally, the remaining energy module traces the quantity of available energy with the information of energy harvesting module and energy consumption module.According to the amount of residual energy, the node determines its operating mode such as energy-depletion, fully charged, and normal modes as described in Section 3.3.
In addition, we realize some major routing and MAC protocols, which are designed for a solar-powered WSN, in the communication composite module, so as to make it easy to compare and verify the performance of a newly proposed scheme in MAC and routing layers.The protocols provided in SolarCastalia are summarized in Table 4.

Graphical User Interface.
Designing an efficient user interface requires the following characteristics: when used for the first time, its usage method must be intuitive and consistent over many components for efficient learning.After learning is completed, its use must be effective.Keeping these   aspects in mind, we provided the proposed simulator with a GUI.The GUI is intuitive compared with a commandline interface and allows efficient testing through various functions such as memorization of preceding simulation commands, storage of simulation sets, and autocompletion.
Figure 5 shows the GUI of our simulator which is developed with Tcl/Tk 8.5 GUI toolkit in Linux platform.As the figure shows, various parameters required for simulation, such as node count, routing and MAC protocols, solar panel and storage types, and weather, can be set easily, and the topology, the transmitting/receiving distance, and the like can be viewed effectively through the sensor field window.The configuration of the node or topology can be set using the top menu.

Operation Verification
To verify the operation of the proposed simulator, we compared the results of our simulator with that of a batterypowered WSN simulator, with all conditions (except the energy portion) remaining the same, and we analyzed the proposed simulator in energy metric.
As shown in Figure 6 and Table 5, simulation was conducted for a total of 172,800 seconds from 12 a.m.(midnight) with a squared area of 25 m by 25 m, and its topology contains a sink node positioned at the center and the other twelve nodes positioned randomly.The transmission power of each node was −15 dBm which covers 3∼6 m.Each node senses the data every ten seconds and transmits its sensory data to the sink node using GPSR routing and the CSMA/CA-based Tunable MAC protocol.The detailed environmental setting is shown in Table 5, and the duty cycle of the nodes was set for the daily average amount of harvested energy to be approximately 10% greater than the daily energy consumption, thereby preventing an undesired blackout time.
Through the simulation, we confirmed that the daily average energy consumption of each node was approximately 352 mAh and that the daily average amount of harvested energy was approximately 394 mAh.Because the initial remaining energy on the battery was 113 mAh (500 J), as shown in Figure 7(a), the existing battery-powered system exhausted its energy, equivalent to the initial energy, in six to seven hours, and the network stopped operating.However, the amount of energy on the energy harvesting system fluctuates as times goes by, thus ensuring continuous operation of the nodes.
Figure 7(b) shows the change in the remaining energy of a specific node that began operation at 12 a.m.(midnight) and remained in operation for two days.Daytime energy harvesting kept the system operating at night and in the early morning.Additionally, the remaining energy at the second midnight was greater than that of the first midnight, indicating that controlling the duty cycle prevented node blackout.
Moreover, Figure 7(c) shows the change in the energy harvested at each node for one day, and an intentional deviation is found in the nodes with a consideration of the different amounts of harevested energy among nodes, which could occur in a real-life environment as a result of cloud, shadow, dust, or the like.
Lastly, Figure 7(d) shows the energy consumption of each node.Node 6, which was positioned close to the sink node and was required to relay the packets from Nodes 8, 12, and 7, was transmitting the greatest number of packets, thus consuming the most energy.Node 2 which was required to relay the packets from Nodes 3, 9, and 11 shows the similar results.The nodes with the second highest energy consumption were Nodes 12, 9, 4, and 5, each of which had one neighbor node to which it can relay packets.The energy information and packet transmission rate for each node are found in Table 6.

Conclusion
We proposed an energy harvesting WSN simulator that can emulate various solar energy harvesting sensor systems by configuring the rechargeable battery and solar panel types, the panel size, and the like.In addition, it can simulate the weather and season when the target WSN is intended to operate and can also support major routing and MAC protocols designed for energy harvesting WSNs.Finally, it facilitates more intuitive simulation through a user-friendly GUI and has scalability resulting from object-oriented programming.Consequently, we expect the proposed simulator to be used widely as a research tool to improve the characteristics and performance of energy harvesting WSNs.

Figure 2 :
Figure 2: Structure of an energy harvesting sensor node.

Table 3 :Figure 3 :
Figure 3: Amount of energy harvested by time in March, July, September, and December, which is stored in database.

Figure 4 :
Figure 4: Structure of the proposed SolarCastalia simulator.

Table 4 :
Routing and MAC protocols for energy harvesting WSNs, which is embedded in SolarCastalia.

Table 6 :
Simulation result of each node.