Power Consumption Optimization in IoT based Wireless Sensor Node Using ESP8266

In this paper, we present the design and prototype implementation of a weather monitoring system for a college campus powered by a renewable energy source which is based on solar panel for remote applications. The device is powered with the help of rechargeable battery which is recharged through solar energy. Sensors are connected to the device and device uploads these sensor data on cloud with the help of Wi-Fi and internet connection. The main objective of this research is to power this device on renewable energy and continuous sensor data uploading on cloud. To keep device in running mode on battery and to save power deep sleep function of the device is used which consume very less power, which makes it sufficient to run on solar power for long time.


Introduction
A weather station is a structure which is used to study the climatic conditions of a particular area. Atmospheric conditions like temperature, humidity, rainfall, pressure, wind, etc. can be measured and predicted with the help of the weather station. Weather monitoring has become very essential in recent times as it can vary in a short period of time. Hence, knowledge about it forms an important part of our day to day activities. It plays a major role in agricultural activities as it helps in determining the process of planting, harvesting and water requirements [1].

Literature Survey
Weather forecasting began from the early civilization. People used meteorological events to predict weather conditions. Farmers were inexperienced in the art of weather monitoring and used unreliable methods like judging the weather from the appearance of the sky and feeling the warmth in the air to carry out their predictions. Later, technology helped to replace all those conventional methods.
The earliest weather station was built in early to mid-1400s. This weather station was made up of a standard rain gauge which was used to measure rainfall. The rainfall was measured in this device using a scale which was dipped into the container. Typical weather stations that are majorly used these days are made up of heavy machinery with a number of moving parts which require regular maintenance and needs to be manually monitored and checked for signs of wear and tear. Due to manual monitoring, there is a delay in the warning of bad weather conditions. In remote areas, where there is a lack of skilled personnel these typical weather stations prove to be very expensive and in the long run are ineffective.
Meteorological departments are set up with weather stations in almost all the areas but they need a huge amount of power supply and resources to function which in turn add to the total cost of the system. On the other hand, depletion of resources is the major problem the world is facing today, so we need to find alternate ways. Excessive use of non-renewable sources of energy in today's world will exhaust the remaining amount of available energy resources at an alarming rate and make it difficult for mankind to sustain for a long period of time. Hence renewable sources of energy like wind, solar, tidal etc. should be used instead of conventional fossil fuel energy resources as much as possible.
In recent times there is an increasing shortage of natural resources so renewable sources are high in demand [2]. For today's clean economy, solar power has found a potent importance worldwide. India has become one of the cheapest producers of solar power. With the growing economy, there is a need for producing a huge amount of energy, and solar power is the best alternative for India as it has a geographical advantage. Taking advantage of India's geographical location and the existing wireless technology, we can implement weather stations by supplying power to them with the help of solar energy. The solar panels will collect the energy from the sun's radiation, convert it into electrical energy and hence provide power to the weather station for its working.

Proposed System
Weather conditions are highly unpredictable, hence proper knowledge about weather conditions is necessary to be prepared for any kind of calamity. Keeping this in mind, the proposed model is a weather station based on solar power, a renewable source of energy which will not pollute the environment and will use less power. It consists of a set of sensors that will monitor various weather parameters like temperature, humidity, pressure etc.
In this project we have deployed an automated weather station (AWS) powered by solar energy. AWS saves the human labour and can be placed at any remote location. It has an enclosure which will protect the circuit from rain or wind. In the past, electricity or batteries were used to power the station and thus communication links were to be established. Now renewable sources of energy such as solar energy, wind energy and turbine energy make it more efficient as well as it makes the use of wireless technology possible. We can then efficiently use this system to power an energy efficient IoTs device [7].
The basic block diagram of our system is shown in Figure 1. The sensors are connected to a Wi-Fi microchip with microcontroller capabilities. For this purpose, we use a WeMOS D1 mini which is a mini Wi-Fi board with 4 Megabyte flash memory based in ESP-8266EX. The board is connected to a rechargeable Li-ion battery which is charged via solar energy through TP-4056 charging module. This data is then uploaded to the cloud for public use [3]. This will provide data to the users without any delays. This automatic device helps us to keep track of the weather in real time.

Methodology
The main connections are shown in Figure 2. The WeMOS D1 mini module is interfaced with the various sensors namely DHT11-temperature and humidity sensor and MQ7-carbon monoxide sensor. Solar panels are located at optimum position to receive maximum sunlight. We have used a Li-ion Rechargeable Battery. This battery gets charged by the solar panel using the TP4056 charging module. The charging module TP4056 has a battery protection chip. The Wi-Fi module works on the power obtained by the Li-ion rechargeable battery. The sensor data is measured and uploaded on the Blynk App and Thinkspeak. This stage is completely powered by solar energy obtained by the solar panel.
The main part of the WeMOS board is ESP8266 chip which consumes a lot of power. Also keeping the device running for a long time will cause heating which in turn increases the temperature and will give an error in the output. To overcome these drawbacks, we use the ESP chip in deep sleep mode which is the most power efficient option.

Hardware
We have used following hardware components for the system implementation, ➢ WeMOS D1 MINI WeMOS D1 Mini is a Wi-Fi device which is based on ESP8266EX chip. It is light in weight and has a small size. It is also breadboard friendly [9]. ➢ DHT11 The DHT11 is a simple, low-cost digital temperature and humidity sensor. ➢ TP4056 Charging Module TP4056 is a complete constant-current/constant-voltage linear charger for single-cell lithium-ion batteries. ➢ MQ-7 The MQ-7 is a carbon monoxide sensor used for sensing concentrations of Carbon Monoxide in the air. ➢ Solar Panel Photovoltaic solar panels absorb sunlight as a source of energy to generate direct current electricity.

➢ Li-ion Rechargeable Battery
The 18650 is a type of rechargeable lithium-ion battery.

Sleep Mode
To conserve the power of the battery we used the sleep mode technique. The ESP8266 series chip provides the three configurable sleep modes. The sleep mode is chosen by the users. The 3 sleep modes are [4] 1. MODEM SLEEP MODE This is used in an application that needs processor operation, for instance in PWM or I2S applications. It complies with 802.11 (U-APSD). This mode is optimized for power consumption such that the modem is stopped but Wi-Fi connection is maintained with transmission of data.

LIGHT SLEEP MODE
This mode suspends the Wi-Fi modem. The CPU is put on hold and it is reactivated if required.

DEEP SLEEP MODE
The projects which run on battery are efficiently implemented with the help of this mode. This mode can be used in systems wherein continuous data transmission is not required [11]. The WeMOS D1 mini module provides the deep sleep mode. It saves the battery by putting it in hibernation. We can wake up the module at regular intervals to read measurements.
The comparison between these three sleep modes are mentioned in below table 1. Table.1

. Difference between the 3 sleeps modes
To activate deep sleep mode we have to connect the RST pin to the D0 pin as shown in figure 3. Pin D0 is not used for any other purpose.

Figure.3. Connection for deep sleep mode
To wake the module manually or with an external action, we have to indicate a zero time (0). Three modes of operation are available to choose from: • RF_DEFAULT -It is the default mode which needs to be specified. The Wi-Fi modem is enabled normally.
• RF_NO_CAL -To consume less energy an alternative version with no calibration is used. In this mode the Wi-Fi modem is activated but no calibration of the radio signal is performed.
• RF_DISABLED -In this mode the Wi-Fi modem is kept on standby. This can be used when we don't require Wi-Fi connection.

Experimental Results
Power is the rate of work being done or heat being transferred. Power is used to indicate the heat dissipation in a unit or individual component. The electrical power P is given 2 where, P is the instantaneous power measured in Watts V is the potential difference across the component measured in Volts and I is the current measured in Amperes. An ampere is a unit of measure of the rate of electron flow or current in an electrical conductor. One ampere of current represents one coulomb of electrical charge (6.24 x 1018 charge carriers) moving past a specific point in one second. mAh means milliamp hour and is a unit that measures (electric) power over time. It is commonly used to measure the energy capacity of a battery. In general, the more mAh and the longer the battery capacity or battery life.

Power consumption of the component
In this section power consumption of each component is mentioned. We have used 3.7V Li-ion battery is used. 4-5 hours of sunlight is required to completely charge the battery through the solar panel of 5-6V.
The device is put in deep sleep mode and readings are taken in an interval of 10 minutes. The power consumption of the components in normal operation is given in table 2. Battery capacity is 2200 mAh so the number of hours the system will work on one full charge is, 2200 mAh /335.35 mAh = 6.56 hours The system will work continuously and data will be uploaded continuously up to 6.56 hours on full charged battery of 2200 mAh. But as battery charging is on solar energy, within 6.56 hours full battery charging is not possible, hence we have implemented sleep modes to save battery and to keep system in running condition for long duration. The power consumption in deep sleep mode is mentioned in below table 3. If we compare table 2 and 3 then we can conclude that in sleep mode power consumption requirement is very less as compared with normal mode of operation.  The implemented system is shown in above figure 5. This prototype is tested for few days and also checked the uploaded data on cloud.

Limitations
After a certain time the solar panels used as collectors will start to degrade and will need to be replaced. In extremely cloudy weather, solar panels of higher efficiency will be required.
In the long run, sensors will also need maintenance. The duration of deep sleep mode needs to be properly maintained in order to get weather readings without spending all the solar energy.

Conclusions
This project helped us overcome the limitations imposed by the traditional system depicted in table 4. Table.4. Comparative analysis with the traditional system

Traditional System Proposed System
Usually non-renewable resources are used to power the station, which in turn harms the ecosystem.
Solar energy is used which is much more reliable and efficient.
This system can't be deployed in remote locations.
This system can be deployed in remote areas.
High cost is incurred on its maintenance enlarging the depreciation value.
This system doesn't need frequent maintenance making the depreciation cost almost nil.
Specialization is needed to use it.
It is user friendly, can be used by laymen too.
Absence of deep sleep mode. Deep sleep mode is implemented to reduce the power consumption This research also successfully demonstrated that it is practically possible to power a weather monitoring system with solar power.

Future Scope
India has a tremendous scope to use and generate solar energy due to its geographical location. Being a tropical country, it receives solar radiation almost throughout the year. It approximately amounts to 3,000 hours of sunshine per annum. Almost each and every part of our country receives 4-7kWh of solar radiation per square meters. Our country has got a good opportunity to tap the solar power due to a high current solar power installed capacity of around 3GW.
For future work, the weather monitoring system will be further refined by including a greater number of sensors to measure different parameters such as pressure. We can use BMP 180, a digital pressure sensor which is typically used for weather forecasting [10]. We can increase productivity of the system by adding more solar panels and batteries of higher efficiency. The wake up cycle can be altered according to our convenience, so that the li-ion battery does not drain at a faster rate. Along with providing data through the cloud, we can also send alert messages when the weather conditions are not suitable.