Frontiers in Computing and Intelligent Systems ISSN: 2832-6024 | Vol. 1, No. 2, 2022 41 Battery management system of UAV Based on IOT Xu Zhang *, Xi Zhang School of Electronic Information Engineering, Xi'an Technology University, Xi'an 710000, China. * Corresponding author: Xu Zhang. Abstract: Lithium ion battery is a new type of high-energy battery developed successfully in the 20th century. Because of its high energy, high battery voltage, wide operating temperature range, long storage life and other advantages, it has been widely used in military and civil micro unmanned aerial vehicles. In order to monitor the charge and discharge and flight of UAV in real time, this paper designs a UAV battery management system based on the Internet of things, which transmits the battery data to the Internet of things platform in real time through the wireless transmission module. After testing, this design can achieve the effect of real-time monitoring of UAV battery pack. Keywords: Battery; UAV; Battery management system; Internet of things. 1. Introduction With the increasing demand and functions of various industries for micro unmanned aerial vehicles, the demand for real-time access to power battery information is more urgent. At present, some UAV battery management systems control UAVs relatively late, such as location, battery voltage, battery current, battery SOC and other important information. The UAV can't transmit the battery data in time, so it can't know the battery condition in time. Aiming at the problem of late understanding of battery information, this paper designs a new battery management system that can monitor battery information in real time by combining Internet of things technology and traditional technology. 2. System overview The lithium battery management system of UAV Based on Internet of things technology is mainly composed of battery management terminal, cloud management platform and monitoring terminal. According to the monitoring terminal, the user can know the status information of the battery pack in real time according to the remaining power, use status, temperature, etc. of the battery pack; Through the cloud management platform of the Internet of things, the SOC, working temperature, total voltage, current, location and other operating status information of the leased battery pack can be obtained in real time to realize the monitoring of battery equipment. Stm32f103zet6 is the main controller, bq76942 is the data acquisition module, and bc28 is the wireless data transmission module. Battery pack Monitoring unit MCU Voltage detection Current detection Equalizati on unit IIC USART Charge discharge protection unit Wireless communi- cation Figure 1. System block diagram 3. System hardware design The manuscript should include a conclusion. In this section, summarize what was described in your paper. Future directions may also be included in this section. Authors are strongly encouraged not to reference multiple figures or tables in the conclusion; these should be referenced in the body of the paper. 3.1. Wireless communication module of IOT In the battery management system, the total voltage, total current, SOC and direction of the battery pack are transmitted through the data transmission module in the terminal of the battery management system; The cloud management platform can also send charge and discharge control commands to the battery pack through the data transmission module to control whether the battery is discharged externally. bc28 used in the system is an ultra-compact, high-performance, low-power multi band NB-IOT wireless communication module. Support COAP, UDP, IPv4, IPv6 and other communication protocols, including a variety of peripheral interfaces. VDD supplies power to the module through SGM2019- ADJYN5G/TR linear regulator. After the module is successfully powered on, DBG_TXD and DBG_RXD referral is responsible for processing data interaction channel in MCU, and the SMA-KE-165 RF connector transmits the data to the cloud platform of the Internet of things in real time. Figure 2. Wireless communication module 3.2. MCU The main control unit of this design uses Stm32f103zet6 chip of ST company as the terminal control chip, which has the advantages of low cost, wide application range, simple operation and contains multiple extended functions such as IIC interface, SPI interface, USART interface, etc. Figure 2 shows the minimum system circuit of Stm32f103zet6. 42 Figure 3. Stm32f103zet6 minimum system 3.3. Voltage detection module The voltage detection module of bq76942 chip of this system has 14 internal ADC to measure the battery voltage. The total error can be less than 10mV. All battery measurement times are less than 330us. The voltage detection circuit is shown in Figure 4. Figure 4. Voltage detection 3.4. Balance management module The bi-directional inductive active equalization scheme selected in this paper, each equalization unit is composed of switches, energy storage inductors and diodes, which has high equalization efficiency, low cost and high reliability, and is applied to the process of charge and discharge equalization. For example, for two adjacent batteries B1 and B2, let the voltages of B1 and B2 be V1 and V2, the remaining capacities be SOC1 and SOC2 respectively, and SOC2>SOC1. When the difference between SOC1 and SOC2 is greater than 100mV, batteries B1 and B2 will perform equalization operation. The bidirectional inductance active equalization circuit is shown in Figure 5. Figure 5. Active equalization of bidirectional inductance 3.5. Current detection module The charging and discharging current of the system is calculated according to the pressure difference between the two ends of the sampling resistance by inserting the sampling resistance in series in the current acquisition circuit. bq76942 chip has a high-precision 16 bit current acquisition channel, and the minimum measurement time can reach 160ms. It can accurately detect the charging and discharging current of the system. The charging current is positive and the discharging current is negative. In Figure 6, SRN and SRP are respectively connected to the current analog input pin of bq76942 chip. Resistors R12 and R13 are used to limit the current and prevent the chip from being impacted by overcurrent. Capacitors C11 and C12 are used to remove noise and enhance anti-interference ability. Figure 6. Current detection 3.6. System charge discharge protection unit In Figure 7, CHG and DSG are the charge and discharge control pins of the main chip respectively. In the charge and discharge protection circuit, the switch between the source and drain is controlled by adjusting the grid of MOSFET Q27 and Q28 to realize the charge and discharge of the system. In the charging protection circuit, the system monitors the input voltage and current in real time, adds two bq771807dpjr overvoltage protectors to prevent excessive charging voltage, and completes the shutdown of charging MOSFET Q24 and Q25 through the software configuration register when the charging voltage and current are greater than the set protection threshold, so as to prevent overcharging of lithium battery pack during charging and reduce the performance of battery pack. Figure 7. Charge discharge protection unit 4. System software design First of all, the hardware initialization setting is to monitor the working status of the system, and the battery data and data transmission. When the UAV is flying, the system monitors the status of the battery pack in real time, transmits the battery data to the cloud battery management platform through the wireless communication module, monitors the working condition of the battery pack in real time, and processes various types of conditions in time. 4.1. System control strategy First, initialize each module of the system to determine whether the system is in working state. If it is in the working state, read the battery current, voltage, temperature, SOC and other information and transmit it to the Internet of things platform. According to the uploaded information, analyze and process whether to balance the battery pack. 43 STM32 initialization Bq76842 initialization BC28 initialization Status detectionNon working state Read battery information Balance? Battery information Upload Internet of things According to information Processing Working condition Balancing N Y Start Figure 8. System control strategy 4.2. Communication strategy The functions of wireless communication module include two functions: data uploading of battery pack and data sending and receiving of IOT platform. Initialization Start Connect IOT platform Data processing Connection successful Data upload IOT platform IOT platform Instruction issuance MCU End of processing BC28 Y N Y N Figure 9. Communication control strategy 5. System test 5.1. Battery voltage monitoring test Table 1. Battery voltage detection test results Battery Actual voltage /mV Measure voltage /mV Error value /mV Error rate /% 1 4200 4198 -2 0.04 2 4200 4202 +2 0.04 3 4200 4200 0 0 4 4200 4203 +3 0.07 5 4200 4205 +5 0.12 6 4200 4203 +4 0.09 7 4200 4200 0 0 8 4200 4195 -5 0.12 9 4200 4193 -7 0.16 10 4200 4195 -5 0.12 1-10 42000 41994 -5 0.01 Set 10 fully charged 18650 single batteries in the experimental battery pack to 4200mv. Through the designed battery management system, the battery voltage is tested respectively, and the test results are shown in the table. From the results, it can be seen that the maximum measurement error of a single battery and the measurement error of battery pack are 0.16% and 0.01% respectively, meeting the system requirements. 5.2. Battery pack condition monitoring test Through the monitoring interface, the battery state can be read in real time to control the working state of the UAV. The battery condition monitoring test interface is shown in Figure 10. Figure 10. Battery pack status monitoring test interface 6. Conclusion In this paper, in order to monitor the battery status in real time, the software and hardware of the battery management system are designed by using the Internet of things technology, which realizes the real-time monitoring of the battery status. The battery data is uploaded and received through the bc28 wireless transmission module. This system provides a new idea for the research of battery management system. References [1] Islam, Nahina et al. “A Review of Applications and Communication Technologies for Internet of Things (IoT) and Unmanned Aerial Vehicle (UAV) Based Sustainable Smart Farming.” Sustainability 13 (2021): 1821. [2] Muchiri, Nelson and Stephen Muchai Kimathi. “A Review of Applications and Potential Applications of UAV.” (2016). [3] Peter Weiss. "Better Battery Mangement Boosts Electric Vehice Prospect." Engineering 7.08(2021): 17-23. [4] Muhuizhen, Shang Hong. Design of connectionless transmission system based on Nb IOT [j]. mechanical engineer, 2020 (11): 71-73 [5] Xie, Yong et al.“STM32-based vehicle data acquisition system for Internet-of-Vehicles.”2017 IEEE/ACIS 16th International Conference on Computer and Information Science (ICIS)(2017): 895-898. [6] Zhang Haichao, Beiwei Zhang. Design of multi serial port communication system based on STM32 [j]. foreign electronic measurement technology, 2019,38 (02): 99-102.doi:10.1965/j. cnki. femt. 1801078. [7] Li tang juan, Jun cheng Tian et al. Multi string lithium ion battery management system [j]. power technology, 2019,43 (01): 81-83+106. [8] Zeng, Xiaoqiao et al. “Commercialization of Lithium Battery Technologies for Electric Vehicles.” Advanced Energy Materials 9 (2019): n. Pag.