Research and implementation of power supply monitoring technology in handheld terminal equipment

Publisher:和谐共存Latest update time:2012-07-17 Source: 21icKeywords:Handheld Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Introduction

With the rapid development of digital information technology and network technology, various embedded systems have become the new focus of the market. Given that embedded systems are special computer systems with strict requirements on functions, reliability, cost, size and power consumption, reducing their system power consumption and improving the ability of built-in power supplies to work continuously has become an important research topic.

Similar to laptops, embedded systems are usually equipped with an integrated battery pack consisting of multiple batteries connected in series. When its main parameters no longer meet the requirements of the entire system after repeated charging and use, the entire battery pack must be replaced. Generally speaking, due to the slight differences in the electrical parameters of each battery in the battery pack, it is difficult to achieve balanced and sufficient discharge of each cell, which leads to the fact that during the charging process of the battery pack, the battery cell with too high voltage may trigger the battery pack overcharge protection early, and during the discharge process, the battery cell with too low voltage may first cause the battery pack overdischarge protection, thereby significantly reducing the overall capacity of the battery pack, so that the actual capacity of the entire battery pack is often limited by the battery with the worst performance in the battery pack.

There are currently two common solutions to the above problems:

① Research or select new batteries, minimize individual differences and increase the rated capacity of the battery as a whole, such as the development from the initial nickel-cadmium and nickel-metal hydride batteries to the current mainstream lithium batteries; ② Improve the utilization rate of battery cells, that is, use monitoring technology to detect the working condition of each battery cell. If some battery cells are discharged prematurely or have problems, they can be automatically detected and prompted. At this time, only individual replacements are required to ensure the normal operation of the system.

For ordinary users, it is difficult to directly get involved in the relevant fields of the former, while the latter method can be implemented more conveniently and easily. In this way, it is expected to better solve the above-mentioned problems, and at the same time avoid the phenomenon that the normal batteries in the battery pack are also scrapped when the battery pack is replaced as a whole, thereby improving the battery utilization rate. In addition, it can also solve the problem that the cost of special batteries is high and difficult to purchase, so as to effectively reduce the maintenance cost of the system.

1 Monitoring system working principle and circuit design

Combining a specific handheld/embedded super terminal system, this paper conducts a relatively detailed study on the monitoring mode of its built-in power supply.

Because it uses universal No. 5 rechargeable batteries, the second method can be used to solve the problem of battery use and replacement, and then the corresponding "battery management and replacement reminder" function is better implemented based on the LinuX operating system.

1.1 Working principle of monitoring system

The system is powered by 12 nickel-metal hydride batteries with a rated voltage of 1.2V connected in series, and is monitored one by one through 12 specially set monitoring points.

The analog voltage value at the monitoring point is input into the AD converter of the ARM chip S3C2410x through a multi-way switch and an auxiliary circuit, and then reads the voltage value of the corresponding monitoring point through the Linux (driver and GPIO end, and is passed to applications such as data processing and graphic display, thereby realizing power supply monitoring. The specific method is shown in Figure 1.

Figure 1 Power supply monitoring system circuit diagram

1.2 AD conversion and auxiliary circuit

The monitoring system uses the AD converter built into the S3C2410x to convert the analog voltage input into the data required by the application. The chip's built-in AD converter has 8 analog inputs and 10-bit digital outputs, a maximum conversion rate of 500ksps, a conversion clock of 2.5MHz, and an analog input range of 0-3.3V. The voltage range that this system needs to monitor is 0~14.

4V, in view of this situation, this system has designed a voltage divider circuit. In the application program, only the proportional formula is needed to calculate the actual voltage value of each monitoring point. In addition, considering the factors of monitoring accuracy and circuit power consumption, the total resistance of the voltage divider circuit is set to 4.5kΩ. In this way, the corresponding analog input voltage value range is 0.26-3.2V, so as to fully utilize the input bandwidth of the AD converter. At this time, the power consumption of the circuit is only 0.04608W.

1.3 Control Circuit

By using the GPIO port of S3C2410x to control the gating multi-way gate switch circuit, the monitoring system can randomly extract the voltage values ​​of different monitoring points. The gating logic is implemented through decoding, as shown in Table 1.

Table 1 Strobe Logic

2 Power Monitoring System Driver Design
Since the hyperterminal described in this article runs in a Linux environment, the drivers and related implementation strategies and writing methods of each detection link also have many characteristics, which are described in detail as follows.
2.1 How Linux Drivers Work
In the Linux kernel, the device driver exists as a module of the file system. It is responsible for interacting with hardware devices and is connected to the file system through a common interface, thereby connecting with the system kernel. It is an abstract layer between software concepts and hardware devices. System calls are the interface between the kernel and applications, while device drivers are the interface between the kernel and peripherals.
The device driver shields the application from the details of the peripheral hardware. From the application's perspective, the operation method for the peripheral is the same as that for ordinary files. The relationship between the device driver and the system peripheral is shown in Figure 2.
Figure 2 Relationship between Linux driver and system peripherals
2.2 Character Devices
Character devices are the simplest devices in the Linux system and can be accessed like files. When a character device is initialized, its driver registers with the Linux kernel and adds a device_STRUCT data structure entry to the chrdevs vector table. The major device identifier of this device is used as an index to this vector table. The major device identifier of a device is fixed. The device_struct data structure in the chrdevs vector table includes a pointer to the name of the registered device driver and a pointer to a set of file operations. This set of file operations itself is located in the character device driver of this device and handles some specific tasks. The driver of this battery monitoring system under Linux treats the peripheral as a character device and implements operations such as opening, reading, writing and closing in the driver.
2.3 Battery Monitoring Driver Implementation Strategy
Internally, I/O devices are accessed through a fixed set of entry points. This set of entry points is provided by the device driver for a specific device and is defined in the data structure file_operations(). The program defines a variable adc_fops whose data structure is file_operations().
2.3.1 adc_open function
This function opens and initializes the device for I/O operations. The adc_open() subroutine must make necessary preparations for it. If the device is exclusive, the adc_open() subroutine must set some flags to indicate that the device is busy.
2.3.2 adc_read function
The adc_read() subroutine is called when reading the AD converter device file. The battery monitoring system requires real-time reading of the voltage value of the peripheral monitoring point. Therefore, in the adc_read() function, the AD converter is triggered to start working in real time, and the converted data is read using program polling. The content of the adc_read() function is as follows:
2.3.3 adc_iocd function
The adc_iocd() function is called when controlling the peripheral auxiliary circuit. According to the monitoring point logic control table, a selection instruction is issued from the GPIO port of the S3C2410x, and then a read operation can be performed to read the corresponding value. When monitoring is not needed, the control monitoring system enters power saving mode.

2.3.4 adc_close() function

The adc_close() function is used to close the peripheral. When monitoring is finished, the application will call this function to close the device file. Like the adc_open() function, it can also be NULL.

3 How to design Qt/Embedded applications and embed them in Qtopia

QT/Embedded provides a friendly interactive interface for embedded Linux. It is a complete self-contained C++GUI and embedded platform development tool based on LinuX. It is designed for high-end embedded graphics applications and has been popularized. Since the system used in this article needs to work in the form of manual click inspection and automatic undervoltage alarm, it is necessary to follow the corresponding rules and methods to design an efficient and beautiful graphical interface.

3.1 Writing Qt/Embedded Applications

The Qt Designer software generated when compiling Qt for Xll on the host machine is a very popular rapid application development tool for designing interfaces and compiling codes. In Qt Designer, you can add some window components such as input boxes and buttons to the appropriate positions of a blank form by dragging or clicking. At this time, the Designer tool will automatically write and maintain the code.

The basic steps of using Qt Designer for C++ programming are: first, create a form and add controls to it according to the needs of the application. Qt will save the created form as a .ui file. Use the uic tool provided by Qt to convert the file into .h and .cpp files. For control actions, you need to manually add different operation functions. Then use the progen tool to create a .pro project file for the application, and use the tmake tool to create a Makefile for the project. Finally, just run make to generate the executable file.

When writing the operation function, the system determines the voltage value of each battery cell by calculating the observed values ​​of adjacent monitoring points. By querying the discharge end voltage lookup table of the selected battery cell, the remaining power of each battery cell is obtained. When the battery pack power drops to a certain threshold or the storage capacity of a battery cell is less than 3%, the application program alarms to notify the user to charge it or replace it individually in time according to the indicated battery number. In this way, the normal working indicators of the power supply can be guaranteed, and the utilization rate of all batteries can be improved.

3.2 Porting Applications to Qtopia

To publish your own application on the Qtopia platform, you need three files: an execution file, a launcher file, and an icon file.

The executable file is the executable file written and compiled as mentioned above. You need to save the executable file in the qtopia/bin directory. The icon file is a small PNG image of 48*48 size made for the application. It is generally stored in the qtopia/pics directory. At the same time, you also need to create an application launcher (.desktop) file and save it in the qtopia/apps/Applications directory. After copying the above files, re-run Qtopia, you can see the added application icon, click this icon to run the application.

4 Conclusion

Reducing system energy consumption requires reliable support from the embedded system hardware, and it is also inseparable from the reasonable management of hardware resources by the embedded operating system and application programs. The existing Linux provides some power management functions, but due to the flexibility of specific embedded system design, it is generally necessary to customize the application program according to specific needs to accurately monitor and prompt the power supply. Through the research and implementation of power monitoring technology in handheld terminal devices, it will help to complete the power monitoring and management of other types of embedded systems, and it is also expected to have certain reference and reference value for the establishment of similar systems.

Keywords:Handheld Reference address:Research and implementation of power supply monitoring technology in handheld terminal equipment

Previous article:A UPS indicator that cannot be ignored in selecting power supply for computer room
Next article:Operation management of dispatching automation system

Latest Power Management Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号