A solar charge and discharge controller for wireless sensor nodes

Aiming at the energy supply problem that restricts the life of wireless sensor nodes, a solar energy charge and discharge controller suitable for wireless sensor nodes is designed in this paper. A Microcontroller is used as the core of the solar charge and discharge controller. The software of the solar charge and discharge controller adopts the C language to realize the program of the main control module. Firstly, the function of monitoring solar panel voltage and lithium battery voltage are simulated by Protel software, and the charge time is tested in cloudy and overcast outdoor environment. The results of the experiment show that our controller meets the power supply demand of wireless sensor nodes.


Introduction
With the development of wireless sensor networks, wireless sensor nodes are widely used in daily life [1]. At present, with the maturity of microelectronic technology, wireless sensor nodes are developing toward small volume and low power consumption. However, limited battery power restricts the service life of wireless sensor nodes seriously.
In urban, batteries of wireless sensor nodes are easy to change and wireless sensor nodes can be incorporated into urban power systems; But in natural environment, the battery is not easy to change [2,3]. Domestic and overseas scholars have proposed the concept that we can use environmental energy to supply power. But environmental energy for it cannot supply power to wireless sensor nodes directly and stably [4,5].
The purpose of this paper is to design a controller that can collect and store solar energy in lithium battery. The controller can supply stable power to wireless sensor nodes, which can greatly extend the life of wireless sensor nodes in the natural environment.

Solar energy photovoltaic
Solar energy is an important part of new energy and renewable energy. Solar energy has many advantages, such as wide application and large energy density. It is also a promising energy technology [6]. We can use smaller space to get more energy, which is incomparable to other renewable energy [7,8]

Solar charge and discharge controller
At present, there are various solar controllers in the market. These controllers are more or less defective [9], such as: 1) The protection of energy storage is not enough; 2) Way of charge and discharge is not rational, easy to damage the energy storage. There are three commonly used charge methods: 1) Constant current charge method; 2) Constant voltage charge method; 3) Stage charge method All these charge methods have some limitations. On the other hand, the common voltage controller cannot monitor energy storage constantly, easily lead to deep discharge of energy storage [9]; and deep discharge affect the life of battery. Temperature protection is also not included in these controllers, so these controllers cannot stop working when the controller is overheated. Therefore, improving the efficiency of charge and discharge, enhancing the safety performance and extend life has become an important research direction [10].

Overall structure of controller
The voltage output from the solar panel is generally unstable and the voltage is generally slightly higher, so it cannot be applied directly to nodes. In this situation, the controller needs to stabilize the output voltage, and then stores the energy into the lithium battery. When the light intensity is strong enough, the controller can provide power to the wireless sensor nodes and charge the lithium battery at the same time. When the output power of the solar panel is not enough, the controller charges the lithium battery, and lithium battery provides electric energy for the wireless sensor nodes.
A good charge and discharge control can prevent the overcharge and deep discharge of the lithium battery and extend the life of the lithium battery. The controller should also switch off the circuit to protect the wireless sensor nodes and itself in some special cases, such as short circuit and high temperature of lithium battery. Figure 1 is the structure of the solar charge controller used in this paper.

Power circuit design
In this paper, 51single-chip microcontroller is used as the main control chip. As the sources of the power supply, solar panel cannot directly provide a stable voltage to the 51single-chip microcontroller. The LM2596 switch voltage regulator is adopted in the design of the power circuit to satisfy the power supply demand for 51single-chip microcontroller. LM2596 only needs 4 external components, which can greatly simplify the power circuit and meet the requirement of small volume. LM2596 also has two self-protection circuit, these circuits can ensure the security performance of wireless sensor nodes: 1) two stage frequency reducing current limit for the output switch 2) over temperature shutdown for complete protection under fault conditions Formula (1) is the formula for calculating the output voltage of LM2596: Formula (1) can be derived by Formula (2): Select to be approximately 1kΩ, use a 1% resistor for best stability. The resistance value of can be calculated by Formula (2); Select to be approximately 3.3K, use a 1% resistor. Calculate the inductor Volt*microsecond constant E*T, from Formula (3): Where =internal switch saturation voltage=1.16V; Where =diode forward voltage drop=0.5V; Where =output voltage of solar panel=12V and =output voltage of power circuit=5V.
The value of the E*T calculated by formula 3 is 18.9, an inductance region is determined at the intersection of the E*T value and the maximum load current value, each region being represented by an inductance value and an inductance sequence number [11].
We use the value of E*T from Formula (3) to determine the inductance, the value of inductance is 68μh.

Charge and discharge circuit design
In this paper, TP5410 chip is used as the control chip of charge and discharge circuit. It integrates charging current regulation, charging status indication and charging cut-off. The above features make TP5410 very suitable for wireless sensor nodes, and further reduce the size of controller. The charge mode adopted by TP5410 is constant current first and then constant voltage, as shown in Figure 2.   The charge current can be set by an external resistor, assuming that full battery voltage of the lithium battery is 4.2V. When the battery voltage reaches 4.2V, the charge current will reduce to 1/5 of preset current value gradually. Then, TP5410 will automatically stop charge and switch to the standby mode. TP5410 can real-time monitor the lithium battery, i.e.TP5410 will recharge the lithium battery when the battery voltage is lower than the recharge threshold =4.1V. TP5410 also has the thermal feedback function. It can adjust the charge current at any time to prevent the system from the high temperature of the chip.
When the pin accesses the load, 5V boost output can be completed with few inductors and capacitors, a Schottky diode connected externally. The charge current of the TP5410 is determined by the resistance between the PROG pin and the ground. The relation between the resistance value and the charge current is presented as shown in Formula (4): (4) Due to the charge target is lithium battery, so the charging current can be set to 1A. Formula (4) can be used to derive the required resistance value =0.68 kΩ. If the external capacitor value is too small, it will cause the chip to be unstable. In addition, the controller must have good frequency characteristics, so the BAT and pins are externally connected with two 22μf capacitors in parallel.

Main control module design
In the design, it is necessary to monitor and control the voltage of the solar panel and the voltage of the lithium battery, so the microprocessor is essential. The design uses 51single-chip microcontroller as the core of the main control module. In order to prevent the microcontroller from abnormal program or register, it is necessary to add reset circuit and reset the main module under abnormal situations.
To monitor the solar panel voltage and lithium battery voltage, this design uses PCD8591 to do digital to analog conversion. First, the value of two voltages will be converted to digital signals, and then transmit these signals to the 51single-chip microcontroller through the IIC protocol, at last these signals are processed by 51single-chip microcontroller. The voltage of solar panel and the lithium battery value will be displayed on the 1602 display.

Integrated system design
In the preceding sections, 3.1-3.4 describes the hardware part of the solar charge and discharge controller. This section will describe the overall system design and system operation process of the solar energy charge and discharge controller. The specific flow chart is shown in Figure 3: The basic process of the design is that the solar panel gets solar energy to provide 5V stable voltage for the system through the power circuit. Then, the PCF8591 chip in the main control module transforms the voltage signals of solar panel and lithium battery into digital signals. PCF8591 transmits these signals to 51single-chip microcontroller, and 51single-chip microcontroller processes these signals. At last, the voltage of solar panel and the lithium battery value are displayed on the 1602 display. When the lithium battery has been over charged or deep discharged, the controller will disconnect the charge and discharge circuit in time to prevent damage to the system. In the entire process, the main control module contains A/D detection procedures, the main function, and LCD screen display program. These programs are realized by C language. Solar charge and discharge controller circuit is shown in Figure 4.

Main control module test
We carry on the software simulation to the main control module. First, the program is burned into the 51single-chip microcontroller by the Protel software. The voltage input uses a resistor to make the voltage ratio between the AIN0 port and the AIN1 port of the PCF8591 is 3:1. As shown in Figure 5, the voltage detection function of the main control module can be used normally, the LCD display shows the solar panel voltage and the lithium battery voltage respectively, which are represented by number 1,2. Hardware is shown in Figure 6.

Solar charge time test
The use of solar panels to charge lithium batteries has changed the process of one-way energy decrease of traditional wireless sensor nodes. Solar charge and discharge controller can achieve the energy self-sufficiency of wireless sensor nodes. We use the solar charge and discharge controller to charge 2000mAh lithium batteries from 3.4V to 4.2V in cloudy and overcast weather; Solar panel specification is 6V/5W. Figure 7 shows voltage data of solar panels and lithium battery voltages in a day.
As shown in Figure 7, in the cloudy and overcast weather, the solar panel voltage fluctuated slightly because of the weather. Figure 7 shows that in cloudy weather, lithium battery can charge from 0% to 100% in 7 hours; Even in overcast day without direct sunlight, lithium battery can be charge up to 70%, which fully meets the power supply demand of wireless sensor nodes.

Conclusions
In this paper, through the analysis of the current wireless sensor node energy supply problem, by designing our power circuit, charge and discharge circuit, main control module, and integrated system, we make a solar energy charge and discharge controller. The test results show that:  1) The solar charge and discharge controller can effectively charge the lithium battery when the weather is cloudy, which extends the life of wireless sensor nodes greatly. It has a good charge effect when the weather is overcast without direct sunlight either.
2) The power supply of the system is flexible, even in the absence of lithium battery. The solar panel can provide electrical energy to the main control module and the wireless sensor nodes. The lithium battery can be charged and discharged simultaneously.
In conclusion, the controller designed in this paper has the characteristics of small size, stable operation, high efficiency, good security and so on. It can meet the power supply demand of wireless sensor nodes.