[go: up one dir, main page]

CN1437030A - Storage battery power detection device and method - Google Patents

Storage battery power detection device and method Download PDF

Info

Publication number
CN1437030A
CN1437030A CN 02103503 CN02103503A CN1437030A CN 1437030 A CN1437030 A CN 1437030A CN 02103503 CN02103503 CN 02103503 CN 02103503 A CN02103503 A CN 02103503A CN 1437030 A CN1437030 A CN 1437030A
Authority
CN
China
Prior art keywords
battery
aforementioned
capacitor
microprocessor
pin
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN 02103503
Other languages
Chinese (zh)
Inventor
陈志清
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chicony Electronics Co Ltd
Original Assignee
Chicony Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chicony Electronics Co Ltd filed Critical Chicony Electronics Co Ltd
Priority to CN 02103503 priority Critical patent/CN1437030A/en
Publication of CN1437030A publication Critical patent/CN1437030A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Measurement Of Current Or Voltage (AREA)

Abstract

The invention relates to a device and a method for detecting the electric quantity of a storage battery, which utilize the charging time of the storage battery to a capacitor of an RC circuit and a table look-up mode to calculate the electric power degree of the storage battery.

Description

蓄电池电量侦测装置与方法Storage battery power detection device and method

技术领域technical field

本发明系关于一种电量侦测装置与方法,更明确地说,本发明是有关一种蓄电池电力的电量侦测装置与方法。The present invention relates to a power detection device and method, more specifically, the present invention relates to a battery power detection device and method.

发明背景Background of the invention

有关蓄电池电量侦测装置与方法,在习知技术上多以分压原理测量蓄电池的端电压,并将侦测点电压送入微处理器中比较,以侦测出蓄电池的电量。请参阅图1所示,系显示习知技术电量侦测装置的实施例。图中蓄电池的电压源Vcc系提供微处理器11的工作电源,并经由电阻器R1、R2取出分压端的端电压VR2,当蓄电池的端电压下降时,分压端VR2的电压也随的下降;微处理器11的输入侦测脚I主要用于接收分压端VR2的电压,当侦测脚所接收到的端电压VR2低于微处理器11的下临界电压时,即侦测脚由逻辑电路的高位准(H)转态为逻辑电路的低位准(L),则表示蓄电池的电力不足。利用前述的方法即能简单地侦测出蓄电池的电量,但此一利用电阻分压的侦测电路却会造成蓄电池端电压回路上产生漏电流12,而耗损蓄电池额外的电量。As for the device and method for detecting battery power, in the prior art, the terminal voltage of the battery is mostly measured by the principle of voltage division, and the voltage at the detection point is sent to the microprocessor for comparison, so as to detect the power of the battery. Please refer to FIG. 1 , which shows an embodiment of a power detection device in the prior art. The voltage source Vcc of the storage battery in the figure provides the working power of the microprocessor 11, and the terminal voltage V R2 of the voltage dividing terminal is taken out through the resistors R1 and R2. When the terminal voltage of the storage battery drops, the voltage of the voltage dividing terminal VR2 also increases with the decline of; the input detection pin I of the microprocessor 11 is mainly used to receive the voltage of the voltage divider terminal VR2 , when the terminal voltage VR2 received by the detection pin is lower than the lower threshold voltage of the microprocessor 11, that is The detection pin changes from the high level (H) of the logic circuit to the low level (L) of the logic circuit, which means that the power of the battery is insufficient. The power of the battery can be simply detected by the aforementioned method, but this detection circuit using resistor voltage division will cause leakage current 12 on the battery terminal voltage circuit, and consume extra power of the battery.

此外,请参阅图2A与图2B所示,系显示习知技术电量侦测装置的另一实施例。由于图1所示的习知技术中侦测电路会造成漏电流,为克服此一问题,另一习知技术还提出将电阻R2的接地端(GND)转接至微处理器11的输出端接脚O;该侦测装置系利用程式规划将微处理器11的该输出端接脚O的初始值设为高位准(逻辑H的电位为Vcc),以使侦测的电阻电路不致发生漏电流,而当微处理器11要测量蓄电池的电量时,微处理器11的输出端接脚O即由高位准规划转换为低位准(即接地),使微处理器11的输入端接脚I即依照前述分压来侦测蓄电池的电量,待测量完毕,再恢复该输出端接脚O为高位准。如图2B所示,该蓄电池电量侦测装置系具有分段式侦测电量的功能,微处理器11进一步使用若干输入端接脚I1、I2、I3以分压分别测得蓄电池端电压下降至不同程度的电量。In addition, please refer to FIG. 2A and FIG. 2B , which show another embodiment of the power detection device in the prior art. Since the detection circuit in the prior art shown in FIG. 1 will cause a leakage current, in order to overcome this problem, another prior art proposes to transfer the ground terminal (GND) of the resistor R2 to the output terminal of the microprocessor 11 Pin O; the detection device uses programming to set the initial value of the output pin O of the microprocessor 11 to a high level (the potential of logic H is Vcc), so that the resistance circuit of the detection will not leak current, and when the microprocessor 11 is to measure the electric quantity of the storage battery, the output terminal pin O of the microprocessor 11 is converted into a low level (i.e. grounding) by the high level planning, so that the input terminal pin I of the microprocessor 11 That is to detect the electric quantity of the storage battery according to the above-mentioned divided voltage, after the measurement is completed, the pin O of the output terminal is restored to a high level. As shown in Figure 2B, the battery power detection device has the function of segmented power detection. The microprocessor 11 further uses a number of input terminal pins I 1 , I 2 , and I 3 to measure the voltage of the battery terminals respectively. The voltage drops to varying degrees of power.

虽然图2A与图2B所示的电量侦测装置能有效的避免漏电流的产生,然而使用微处理器11较多的接脚数量,使微处理器11运用较多的资源来测量蓄电池的电量,相对的也会使得微处理器11的功能无法有效充分地利用。Although the power detection device shown in FIG. 2A and FIG. 2B can effectively avoid the generation of leakage current, the use of more pins of the microprocessor 11 makes the microprocessor 11 use more resources to measure the power of the storage battery. , and relatively, the functions of the microprocessor 11 cannot be effectively and fully utilized.

发明内容Contents of the invention

本发明主要目的,系提供一种利用RC的充电时间并配合查表方式而侦测出工作电压电量的蓄电池电量侦测方法。The main purpose of the present invention is to provide a battery power detection method that uses the charging time of the RC and cooperates with the table look-up method to detect the working voltage and power.

本发明另一目的,系提供一种蓄电池电量侦测装置,利用RC电路与微处理器的组合,仅利用微处理器的单一接脚并运用侦测接脚的工作转态以无段测量蓄电池的电量。Another object of the present invention is to provide a battery power detection device, which uses the combination of RC circuit and microprocessor, only uses a single pin of the microprocessor and uses the working state of the detection pin to continuously measure the battery power.

有鉴于习知技术中蓄电池电量侦测装置会造成漏电流的发生及占用微处理器较多I/O接脚的缺点,本发明遂提出一种蓄电池电量侦测的方法,系利用蓄电池对一RC回路的充电而由充电时间反映该蓄电池的电量,该方法至少包含:形成RC回路中电容器的放电回路,直到该电容器放电至零电位;以及开始计算蓄电池对RC回路充电,直到该电容器充电至一预设的电位所需的时间,藉以获得该蓄电池目前的电量。In view of the shortcomings of the battery power detection device in the prior art that would cause leakage current and occupy more I/O pins of the microprocessor, the present invention proposes a method for battery power detection, which is to use the battery to The charge of the RC circuit reflects the electric quantity of the storage battery by the charging time. The method at least includes: forming a discharge circuit of the capacitor in the RC circuit until the capacitor is discharged to zero potential; and starting to calculate the charging of the storage battery to the RC circuit until the capacitor is charged to The time required for a preset potential to obtain the current capacity of the storage battery.

根据本发明前述方法所提出的一种蓄电池电量侦测装置,包含由蓄电池、电阻器R与电容器C形成的RC回路;以及一微处理器,其中微处理器利用一可规划工作模式的接脚量测RC回路的电容器C。当微处理器要量测蓄电池的电量时,微处理器规划接脚为输出模式,且该接脚输出低位准使电容器C形成放电回路,直到该电容器放电至零电位;之后,微处理器再规划接脚为输入模式,并开始计算该接脚由低位准转态为高位准所需的时间,即RC回路的电容器由零电位充电至高位准所需的充电时间,籍以获得蓄电池的电量。According to the aforementioned method of the present invention, a storage battery power detection device includes an RC loop formed by a storage battery, a resistor R and a capacitor C; and a microprocessor, wherein the microprocessor uses a pin that can be programmed to work Measure the capacitor C of the RC loop. When the microprocessor wants to measure the power of the storage battery, the microprocessor designates the pin as an output mode, and the pin outputs a low level to make the capacitor C form a discharge circuit until the capacitor is discharged to zero potential; after that, the microprocessor again Design the pin as the input mode, and start to calculate the time required for the pin to change from low level to high level, that is, the charging time required for the capacitor of the RC circuit to charge from zero potential to high level, so as to obtain the power of the battery .

根据本发明较佳实施例,一种蓄电池电量侦测方法包含由蓄电池、电阻器R与电容器C形成的RC回路并利用一具有可规划工作模式的接脚的微处理器,该方法包含:According to a preferred embodiment of the present invention, a battery power detection method includes an RC loop formed by a battery, a resistor R, and a capacitor C and utilizes a microprocessor with pins that can be programmed to work. The method includes:

将微处理器的接脚由输入模式转态为输出模式;规划输出模式的该接脚输出低位准,使RC回路的电容器藉由该接脚放电至零电位;再将微处理器的该接脚由输出模式转态为输入模式:以及微处理器开始计算该接脚由低位准转态为高位准所需的时间,即RC回路的电容器由零电位充电至高位准所需的充电时间,藉以获得蓄电池的电量。Turn the pin of the microprocessor from the input mode to the output mode; the pin of the planned output mode outputs a low level, so that the capacitor of the RC circuit is discharged to zero potential through this pin; then the pin of the microprocessor is The pin transitions from output mode to input mode: and the microprocessor starts to calculate the time required for the pin to transition from low level to high level, that is, the charging time required for the capacitor of the RC circuit to charge from zero potential to high level, To obtain battery power.

本发明蓄电池电量侦测装置的优点在于通过RC电路对电容器的充放电原理,防止漏电流的发生,避免蓄电池电量的耗损,且利用电容器的充电时间与对应表的设定,经计算比对藉以获得蓄电池的电量;同时,通过侦测脚位的转态,仅利用单一侦测脚位即能完成侦测出蓄电池电电力的程度,有效减少对微处理器脚位的占用。The advantage of the storage battery power detection device of the present invention is that the principle of charging and discharging the capacitor through the RC circuit prevents the occurrence of leakage current and avoids the loss of battery power, and uses the charging time of the capacitor and the setting of the corresponding table to calculate and compare it. Obtain the power of the battery; at the same time, by detecting the transition of the pin, only a single detection pin can be used to complete the detection of the power level of the battery, effectively reducing the occupation of the microprocessor pin.

附图说明Description of drawings

图1为已知技术的蓄电池电量侦测电路;Fig. 1 is the storage battery power detection circuit of known technology;

图2A、图2B为已知技术的蓄电池电量侦测电路另一实施例;FIG. 2A and FIG. 2B are another embodiment of the battery power detection circuit of the known technology;

图3为本发明蓄电池电量侦测方法的流程图;Fig. 3 is a flow chart of the method for detecting battery power of the present invention;

图4为本发明蓄电池电量侦测装置的架构图;FIG. 4 is a structural diagram of the battery power detection device of the present invention;

图5为应用程式中对应表的特征曲线图;FIG. 5 is a characteristic curve diagram of the corresponding table in the application program;

图6为施密特触发电路的特性图。FIG. 6 is a characteristic diagram of a Schmitt trigger circuit.

微处理器-11          漏电流-12          侦视脚转态一101Microprocessor-11 Leakage current-12 Detect pin transition state-101

电容器放电一102    侦测脚再转态-103     查表-104Capacitor discharge-102 Detect pin re-transition-103 Look-up table-104

具体实施方式Detailed ways

本发明提出一种蓄电池电量侦测的方法,系利用蓄电池对一RC回路的充电而由充电时间反映该蓄电池的电量,该方法至少包含:形成RC回路中电容器的放电回路,直到该电容器放电至零电位;以及开始计算蓄电池对RC回路充电,直到该电容器充电至一预设的电位所需的时间,藉以获得该蓄电池目前的电量。The present invention proposes a method for detecting battery power, which is to use the battery to charge an RC circuit to reflect the battery's power from the charging time. The method at least includes: forming a discharge circuit for the capacitor in the RC circuit until the capacitor is discharged to zero potential; and start to calculate the time required for the battery to charge the RC circuit until the capacitor is charged to a preset potential, so as to obtain the current capacity of the battery.

更进一步的说明,电容器系具有存、放电量的能力,且充电时间会随著充电电压的改变而有快慢之分;当蓄电池接入RC电路后,蓄电池开始对RC电路中的电容器进行充电,此时,电容器的蓄电量由零电位或低电位逐渐达到饱和状态,使RC电路的直流分析形成开路而无漏电流;本发明蓄电池电量侦测的方法系利用充电电压对电容器的充电时间,配合查表加以得到该充电电压的蓄电池的电量,其中,该查表系查出不同的充电时间所对应蓄电池的不同电量对RC电路的电容器充电。To further explain, the capacitor system has the ability to store and discharge capacity, and the charging time will vary with the change of the charging voltage; when the battery is connected to the RC circuit, the battery starts to charge the capacitor in the RC circuit. At this time, the storage capacity of the capacitor gradually reaches a saturated state from zero potential or low potential, so that the DC analysis of the RC circuit forms an open circuit without leakage current; the battery power detection method of the present invention uses the charging voltage to charge the capacitor. Look up the table to obtain the electric quantity of the storage battery of the charging voltage, wherein, the table lookup is to find out the different electric quantities of the storage battery corresponding to different charging times to charge the capacitor of the RC circuit.

电容器的放电回路,可在电容器的端电压处设置一接地开关,利用接地开关的开路(OFF)与闭路(ON)将其电量释放,使电容器电量由饱和状态降至零电位,此放电动作主要是准备重新计算电容器的充电时间,使得电容器能够由零电位开始充电,而不是由电容器的低电位,以避免计算充电时间所发生的错误,而影响电量侦测的准确性;当电容器放电完成后,蓄电池再度对RC电路中的电容器充电,同时亦开始计算充电时间,直到电容器的电量至一预设的电位,且计时器停止计算充电时间,经由该充电时间计算与查表后即得到蓄电池目前的电量。In the discharge circuit of the capacitor, a grounding switch can be set at the terminal voltage of the capacitor, and the electric power can be released by using the open circuit (OFF) and closed circuit (ON) of the grounding switch, so that the electric capacity of the capacitor can be reduced from the saturated state to zero potential. This discharge action is mainly It is to prepare to recalculate the charging time of the capacitor, so that the capacitor can be charged from zero potential instead of the low potential of the capacitor, so as to avoid errors in calculating the charging time and affect the accuracy of power detection; when the capacitor discharge is completed , the battery charges the capacitor in the RC circuit again, and at the same time begins to count the charging time until the electric quantity of the capacitor reaches a preset potential, and the timer stops counting the charging time. After the charging time is calculated and the table is checked, the current state of the battery is obtained. power.

根据上述的电量侦测方法,本发明提供一种蓄电池电量的侦测装置,请参阅图4所示,系显示本发明蓄电池电量侦测装置的架构图。在本发明此一实施例中,该侦测装置至少包含:一电阻器R、一电容器C及一微处理器11,其连接方式如图4所示,蓄电池的电压Vcc系提供微处理器11的工作电源与对RC电路中的电容器充电;当微处理器11获得工作电源后,其内部应用程式将依照其程式设计的内容开始执行工作,微处理器11设定侦测脚的状态。According to the above-mentioned power detection method, the present invention provides a battery power detection device, please refer to FIG. 4 , which shows the structure diagram of the battery power detection device of the present invention. In this embodiment of the present invention, the detection device at least includes: a resistor R, a capacitor C and a microprocessor 11, the connection method is shown in Figure 4, the voltage Vcc of the storage battery is provided to the microprocessor 11 The operating power and the capacitor charging in the RC circuit; when the microprocessor 11 obtains the operating power, its internal application program will start to work according to the content of its programming, and the microprocessor 11 sets the state of the detection pin.

为了防止侦测蓄电池电量产生漏电流,而耗损蓄电池额外的电量。本发明系利用电容器直流充放电的原理,当电容器直流充电至饱和时,电容器视为开路状态,RC电路无漏电流产生。由于微处理器11的输入模式接脚具有高输入阻抗的特性,可以将其视为一接地开关的开路状态。当电容器充电完成后,此时电容器的端电压Vc几乎等于电压Vcc,而电容器的端电压对微处理器11的侦测脚呈现高位准状态。当微处理器11要侦测蓄电池的电量时,应用程式即将微处理器11的侦测脚由输入状态转态为输出状态;当侦测脚为输出状态时,该侦测脚具有低输入阻抗的特性,可以将其视为一接地开关的闭路状态,电容器的端电压利用微处理器11的侦测脚将其电量Vc释放,其放电目的在于确保电容器每一次的充电都能由零电位开始,而电容器的放电时间系指由电容器端电压Vc的饱和电压持续放电至零电位的状态。当电容器的端电压Vc对侦测脚呈现零电位时,微处理器11的应用程式立即将侦测脚由输出状态再次转态为输入状态。In order to prevent leakage current from detecting battery power, and consume extra power of the battery. The invention utilizes the principle of DC charging and discharging of capacitors. When the capacitor is charged to saturation, the capacitor is regarded as an open circuit state, and the RC circuit does not generate leakage current. Since the input mode pin of the microprocessor 11 has a characteristic of high input impedance, it can be regarded as an open state of a ground switch. After the capacitor is fully charged, the terminal voltage Vc of the capacitor is almost equal to the voltage Vcc, and the terminal voltage of the capacitor presents a high level state to the detection pin of the microprocessor 11 . When the microprocessor 11 wants to detect the power of the storage battery, the application program is about to change the detection pin of the microprocessor 11 from the input state to the output state; when the detection pin is in the output state, the detection pin has a low input impedance It can be regarded as a closed-circuit state of a grounding switch. The terminal voltage of the capacitor uses the detection pin of the microprocessor 11 to release its power Vc. The purpose of the discharge is to ensure that the charging of the capacitor can start from zero potential every time. , and the discharge time of the capacitor refers to the state of continuous discharge from the saturation voltage of the capacitor terminal voltage Vc to zero potential. When the terminal voltage Vc of the capacitor presents zero potential to the detection pin, the application program of the microprocessor 11 immediately changes the detection pin from an output state to an input state again.

请继续参阅图4所示,前述微处理器11的侦测脚再次转态完成后,此时该侦测脚为输入状态,由于电容器的放电端已被关闭,所以电压Vc经RC电路重新对电容器充电。当微处理器11的侦测脚转态且电容器开始充电后,微处理器11启动计时器以记录电容器的充电时间,充电时间的计算系由微处理器11的侦测脚来侦测电容器端电压Vc的位准:当侦测脚的位准由低位准转态至高位准后,即能得知目前蓄电池电压Vcc对电容器的充电时间,而微处理器11将利用此一转态的充电时间配合程式中内建的电量对应表求出蓄电池的电量程度。由于本发明蓄电池电量侦测装置利用微处理器11侦测脚的转态,使得微处理器11仅须提供单一侦测脚位即能完成无段侦测蓄电池电量的工作。Please continue to refer to Fig. 4. After the detection pin of the aforementioned microprocessor 11 has completed the transition again, the detection pin is in the input state at this time. Since the discharge end of the capacitor has been closed, the voltage Vc is re-balanced by the RC circuit. The capacitor charges. When the detection pin of the microprocessor 11 turns over and the capacitor begins to charge, the microprocessor 11 starts the timer to record the charging time of the capacitor. The calculation of the charging time is to detect the capacitor terminal by the detection pin of the microprocessor 11. Level of voltage Vc: When the level of the detection pin changes from low level to high level, the charging time of the current battery voltage Vcc to the capacitor can be known, and the microprocessor 11 will use the charging time of this transition state The time matches the built-in power correspondence table in the program to find out the power level of the battery. Because the battery power detecting device of the present invention utilizes the microprocessor 11 to detect the transition of the pin, the microprocessor 11 only needs to provide a single detection pin to complete the work of continuously detecting the battery power.

请参阅如图5所示,系显示应用程式中对应表的特征曲线图,并请配合参阅图4。由于蓄电池的种类及材料繁多,其放电特性也有所不同,所以内建于应用程式中的对应表须针对各类型的蓄电池去实验测量,以取得对应表所需要的资料内容;当然,蓄电池的电压Vcc会随著使用而逐渐降低,当电压Vcc下降时,微处理器11的工作电源亦会下降,而微处理器11侦测脚的高位准也会随著微处理器11的工作电源的下降,而改变侦测脚高位准的电压值。Please refer to Figure 5, which shows the characteristic curve diagram of the corresponding table in the application program, and please refer to Figure 4 together. Due to the variety of battery types and materials, their discharge characteristics are also different, so the corresponding table built in the application must be tested for each type of battery to obtain the information required by the corresponding table; of course, the voltage of the battery Vcc will gradually decrease with use. When the voltage Vcc drops, the working power of the microprocessor 11 will also drop, and the high level of the detection pin of the microprocessor 11 will also drop with the working power of the microprocessor 11. , and change the voltage value of the high level of the detection pin.

请继续参阅图5,电容器充电特征曲线图系以直角座标表示的,其中纵座标为电容器的端电压Vc,横座标为电容器充电时间t;当电容器每次由零电位开始充电时,微处理器11中的计时器启动并开始计算电容器的充电时间,然微处理器11侦测脚的高位准会随著电压Vcc的改变而有所变动,所以对应表必须利用特征曲线图来找出Vcc1、Vcc2、Vccn等不同电压下,侦测脚由低位准转态至高位准的临界电压V1,利用电容器充电特征曲线图即能清楚的找出蓄电池于不同电压值Vcc下对电容器充电,微处理器11的侦测脚由低位准转态至高位准所需的时间T1、T2、…、Tn。Please continue to refer to Figure 5, the capacitor charging characteristic curve is represented by rectangular coordinates, where the ordinate is the terminal voltage Vc of the capacitor, and the abscissa is the capacitor charging time t; when the capacitor starts charging from zero potential each time, micro The timer in the processor 11 starts and starts to count the charging time of the capacitor. However, the high level of the detection pin of the microprocessor 11 will change with the change of the voltage Vcc, so the corresponding table must be found by using the characteristic curve diagram. Under different voltages such as Vcc1, Vcc2, Vccn, etc., detect the critical voltage V1 when the pin transitions from a low level to a high level, and use the capacitor charging characteristic curve to clearly find out that the battery is charging the capacitor under different voltages Vcc. The time T1, T2, . . . , Tn required for the detection pin of the processor 11 to transition from a low level to a high level.

当每次电容器充电电压Vc到达转态的临界电压V1时微处理器11的侦测脚的位准会由低位准转态至高位准,且微处理器11中的计时器亦记录此一充电时间并送入对应表中比对;经由查表的方式,微处理器11可获得目前蓄电池所剩余的电量,并且将蓄电池的电量显示出来。When the capacitor charging voltage Vc reaches the transition threshold voltage V1 each time, the level of the detection pin of the microprocessor 11 will transition from a low level to a high level, and the timer in the microprocessor 11 will also record this charge. The time is sent to the corresponding table for comparison; through the way of looking up the table, the microprocessor 11 can obtain the remaining power of the storage battery at present, and display the power of the storage battery.

本发明的较佳实施例中,利用微处理器11的侦测脚侦测电容器的端电压Vc的高低来判断位准,实务上会进一步考虑微处理器11的侦测脚的高低确认位准存在一灰色区域,当端电压Vc处于该灰色区域中时,微处理器11即无法判定其高/低位准,为解决此问题本发明系利用施密特触发电路(Schmitt trigger)的特性来区分高、于位准的范围。施密特触发电路系一具有迟滞比较器特性,采用正回授的方法来加大比较器的增益,其转换特性请参阅如图6所示,系显示施密特触发电路的特性图。图6中Hmin为上临界(Upper threshold)或上触发电压(UPPer trigger),而Lmax则为下临界(Lower threshofd)或下触发(Lowertrigger)电压。In a preferred embodiment of the present invention, the level is determined by using the detection pin of the microprocessor 11 to detect the terminal voltage Vc of the capacitor. In practice, the level of the detection pin of the microprocessor 11 will be further considered to confirm the level. There is a gray area, and when the terminal voltage Vc is in the gray area, the microprocessor 11 cannot determine its high/low level. In order to solve this problem, the present invention utilizes the characteristics of a Schmitt trigger circuit (Schmitt trigger) to distinguish High, in the range of the level. The Schmitt trigger circuit is a comparator with hysteresis characteristics, and adopts the method of positive feedback to increase the gain of the comparator. For its conversion characteristics, please refer to Figure 6, which shows the characteristic diagram of the Schmitt trigger circuit. In Fig. 6, H min is the upper threshold (Upper threshold) or upper trigger voltage (UPPer trigger), and Lmax is the lower threshold (Lower threshold) or lower trigger (Lowertrigger) voltage.

请继续参阅图6,当微处理器的侦测脚所侦测到的电容器端电压Vc充电至施密特触发电路的上、下临界电压中时,该位准的判定系依据前一位准的状态,若前一位准为低位准,则侦测脚维持于低位准的认定,当电容器持续充电至端电压Vc超越Hmin值,此时侦测脚确认由低位准转态为高位准。Please continue to refer to Figure 6. When the capacitor terminal voltage Vc detected by the detection pin of the microprocessor is charged to the upper and lower threshold voltages of the Schmitt trigger circuit, the level is determined based on the previous level state, if the previous level is low level, then the detection pin is maintained at the low level, when the capacitor continues to charge until the terminal voltage Vc exceeds the H min value, then the detection pin is confirmed to change from low level to high level .

根据本发明较佳实施例,一种蓄电池电量侦测方法,包含由蓄电池、电阻器R与电容器C形成的RC回路并利用一具有可规划工作模式的接脚的微处理器,该方法包含:将微处理器的接脚由输入模式转态为输出模式;规划输出模式的该接脚输出低位准,使RC回路的电容器藉由该接脚放电至零电位;再将微处理器的该接脚由输出模式转态为输入模式;以及微处理器开始计算该接脚由低位准转态为高位准所需的时间,即RC回路的电容器由零电位充电至高位准所需的充电时间,藉以获得蓄电池的电量。According to a preferred embodiment of the present invention, a battery power detection method includes an RC loop formed by a battery, a resistor R, and a capacitor C and utilizes a microprocessor with pins that can be programmed to work. The method includes: Turn the pin of the microprocessor from the input mode to the output mode; the pin of the planned output mode outputs a low level, so that the capacitor of the RC circuit is discharged to zero potential through this pin; then the pin of the microprocessor is The pin transitions from output mode to input mode; and the microprocessor starts to calculate the time required for the pin to transition from low level to high level, that is, the charging time required for the capacitor of the RC circuit to charge from zero potential to high level, To obtain battery power.

更进一步的说明,请参考图3所示,显示本发明蓄电池电量侦测的流程图。该蓄电池电量侦测方法,由蓄电池提供一电压源Vcc、电阻器R与电容器C形成的RC回路并利用一具有可规划工作模式的接脚的微处理器,该接脚系与电容器C的充电端相连接,以形成一放电回路,该方法包含:For further description, please refer to FIG. 3 , which shows the flow chart of the battery power detection of the present invention. In the detection method of battery power, the battery provides a voltage source Vcc, an RC loop formed by a resistor R and a capacitor C, and utilizes a microprocessor with a programmable working mode pin, which is connected to the charging of the capacitor C The terminals are connected to form a discharge circuit, and the method includes:

一、侦测脚F转态101:1. Detect pin F transition state 101:

蓄电池将提供一直流电压源Vcc以提供微处理器所需的工作电源及充电电源;当微处理器开始工作后,其应用程式会预先设定微处理器侦测脚的状态,此时该侦测脚设为输入模式(I/P),同时蓄电池的电压源Vcc对电容器充电至饱和;当微处理器要侦测蓄电池电量时,微处理器的侦测脚透过应用程式的设定由输入模式转态为输出模式(O/P);The battery will provide a DC voltage source Vcc to provide the working power and charging power required by the microprocessor; when the microprocessor starts to work, its application program will pre-set the state of the microprocessor detection pin, at this time the detection The measuring pin is set to input mode (I/P), and at the same time the voltage source Vcc of the battery charges the capacitor to saturation; when the microprocessor wants to detect the battery power, the detecting pin of the microprocessor is set by the application program Input mode transitions to output mode (O/P);

二、电容器放电102:2. Capacitor discharge 102:

微处理器的侦测脚转态为输出模式后,该侦测脚的输出设定为低位准,微处理器的侦测脚与电容器形成一放电回路,电容器利用微处理器的侦测脚放电,直到电容器的端电压为零电位,其放电目的在于确保电容器每一次的充电都能由零电位开始;After the detection pin of the microprocessor turns to the output mode, the output of the detection pin is set to a low level, the detection pin of the microprocessor forms a discharge circuit with the capacitor, and the capacitor is discharged by the detection pin of the microprocessor , until the terminal voltage of the capacitor is zero potential, the purpose of its discharge is to ensure that each charge of the capacitor can start from zero potential;

三、侦测脚再转态103:3. Detect foot re-transition 103:

当电容器利用微处理器的侦测脚放电至零电位后,微处理器的侦测脚透过应用程式的设定由输出模式转态为输入模式;侦测脚在输入模式为高阻抗状态,所以电容器开始充电,同时启动微处理器的计时器开始计时,直到侦测脚由低位准确认转态为高位准后停止计时,所获得的时间为电容器由零电位充电至侦测脚确认由低位准转态为高位准所需的时间长度;以及When the capacitor is discharged to zero potential by the detection pin of the microprocessor, the detection pin of the microprocessor is changed from the output mode to the input mode through the setting of the application program; the detection pin is in a high impedance state in the input mode, Therefore, the capacitor starts to charge, and at the same time, the timer of the microprocessor is started to start counting, until the detection pin is confirmed to turn from a low level to a high level, and then the timing is stopped. the length of time required for the quasi-transition to be high; and

四、查表104:4. Check table 104:

前述计时器所记录的时间将配合查表方式以求出蓄电池的电量,而电量对应表系经由实验所得到的实际数据;实际上,微处理器侦测脚到达确认转态的电位V1及电容器每次的充电时间,会随著蓄电池电压Vcc的高低而有所不同,因此须事先由实验测得电量对应表;微处理器经由该电量对应表,由计时器所记录的时间比对后即求出蓄电池目前的电量。The time recorded by the above-mentioned timer will cooperate with the table look-up method to obtain the power of the battery, and the power corresponding table is the actual data obtained through experiments; in fact, the microprocessor detection pin reaches the potential V1 and the capacitor to confirm the transition The charging time of each charge will vary with the battery voltage Vcc, so it is necessary to measure the power corresponding table in advance through the experiment; the microprocessor will compare the time recorded by the timer through the electric power corresponding table and then immediately Find the current charge of the battery.

根据本发明所实施的蓄电池电量侦测装置与方法将具有诸多优点与特征,其中本发明蓄电池电量侦测方法可运用于各类型的蓄电池电量侦测,藉由RC电路对电容器的充电时间与对应表的设定,经计算比对藉以获得蓄电池的电量。The storage battery power detection device and method implemented according to the present invention will have many advantages and features, wherein the battery power detection method of the present invention can be applied to various types of battery power detection, and the charging time of the capacitor and the corresponding The setting of the table is calculated and compared to obtain the power of the battery.

本发明蓄电池电量侦测装置的优点在于通过RC电路对电容器的充放电原理,防止漏电流的发生,避免蓄电池电量的耗损,且利用电容器的充电时间与对应表的设定,经计算比对藉以获得蓄电池的电量;同时,通过侦测脚位的转态,仅利用单一侦测脚位即能完成侦测出蓄电池电电力的程度,有效减少对微处理器脚位的占用。The advantage of the storage battery power detection device of the present invention is that the principle of charging and discharging the capacitor through the RC circuit prevents the occurrence of leakage current and avoids the loss of battery power, and uses the charging time of the capacitor and the setting of the corresponding table to calculate and compare it. Obtain the power of the battery; at the same time, by detecting the transition of the pin, only a single detection pin can be used to complete the detection of the power level of the battery, effectively reducing the occupation of the microprocessor pin.

在详细说明本发明的较佳实施例的后,熟悉该项技术人士可清楚的了解,并在不脱离本申请专利范围与精神下可进行各种变化与改变,例如:该蓄电池侦测装置的电容器与电阻器亦能同时采用并联方式增加,以改善侦测装置的稳定性及准确度。而且本发明亦不受限于说明书的实施例的实施方式。After describing the preferred embodiments of the present invention in detail, those skilled in the art can clearly understand that various changes and changes can be made without departing from the scope and spirit of the patent application, for example: the storage battery detection device Capacitors and resistors can also be added in parallel to improve the stability and accuracy of the detection device. Furthermore, the present invention is not limited to the embodiments described in the description.

Claims (18)

1.一种蓄电池电量侦测方法,系利用一微处理机的接脚形成一RC回路的电容C的放电回路,该蓄电池与前述RC回路形成充电回路,该侦测方法包含:1. A storage battery electric quantity detection method, is to utilize the pin of a microprocessor to form the discharge circuit of the electric capacity C of an RC circuit, and this storage battery and aforementioned RC circuit form the charging circuit, and this detection method comprises: 前述微处理机将前述接脚设定为输出模式,使前述电容C在该放电回路中释放电量,直到零电位:The aforementioned microprocessor sets the aforementioned pins as output mode, so that the aforementioned capacitor C discharges electricity in the discharge circuit until zero potential: 前述微处理机设定前连接脚由输出模式转态为输入模式,并开始计时前述电容C的电压达到一预设的电位值所需的时间;以及The aforementioned microprocessor sets the front connection pin from the output mode to the input mode, and starts counting the time required for the voltage of the aforementioned capacitor C to reach a preset potential value; and 前述微处理机根据前述所需的时间获得前述蓄电池的电量。The aforementioned microprocessor obtains the electric quantity of the aforementioned accumulator according to the aforementioned required time. 2.如权利要求1所述的蓄电池电量侦测方法,其特征在于前述微处理机的接脚在未侦测前设定为输入模式。2. The battery power detection method according to claim 1, wherein the pins of the microprocessor are set to input mode before detection. 3.如权利要求1所述的蓄电池电量侦测方法,其特征在于前述所需的时间系指前述蓄电池对RC回路充电将电容C由零电位充电至前述预设的电位值的充电时间。3. The battery power detection method according to claim 1, wherein the required time refers to the charging time for the battery to charge the RC loop to charge the capacitor C from zero potential to the preset potential value. 4.如权利要求1或3所述的蓄电池电量侦测方法,其特征在于前述微处理机包含一对应表,该对应表记录前述蓄电池不同的电量对RC回路充电,将电容C由零电位充电至前述预设的电位值所需的时间。4. The battery power detection method as claimed in claim 1 or 3, wherein said microprocessor includes a corresponding table, which records the different electric quantities of said battery to charge the RC circuit, and charges the capacitor C from zero potential The time required to reach the aforementioned preset potential value. 5.如权利要求4所述的蓄电池电量侦测方法,其特征在于前述微处理机根据前述所需的时间,可从该对应表查出前述蓄电池对应的电量。5. The battery power detection method according to claim 4, wherein the microprocessor can check the corresponding power of the battery from the corresponding table according to the required time. 6.如权利要求1所述的蓄电池电量侦测方法,其特征在于当前述微处理机将前连接脚设定为输出模式时,该接脚的电位输出为低位准。6 . The method for detecting battery power as claimed in claim 1 , wherein when the microprocessor sets the front connecting pin as an output mode, the potential output of the pin is a low level. 7 . 7.如权利要求1所述的蓄电池电量侦测方法,其特征在于前述接脚设定为输入模式,具有施密特触发电路。7. The battery power detection method according to claim 1, wherein said pin is set as an input mode and has a Schmitt trigger circuit. 8.如权利要求7所述的蓄电池电量侦测方法,其特征在于前述预设的电位值系触发前述施密特触发电路的输出由低位准转态到高位准时的电位值。8 . The battery power detection method according to claim 7 , wherein the preset potential value is the potential value when the output of the Schmitt trigger circuit is triggered to transition from a low level to a high level. 9 . 9.一种蓄电池电量侦测方法,系利用一微处理机的可规划转态的接脚形成一RC回路的电容C的放电回路,该蓄电池对前述RC回路形成充电回路,前侦测方法包含:9. A storage battery power detection method, which is to use a programmable transition pin of a microprocessor to form a discharge circuit for the capacitor C of an RC circuit, and the storage battery forms a charging circuit for the aforementioned RC circuit, and the previous detection method includes : 前述微处理机将前述接脚设定为输出模式,使前述电容C在该放电回路中释放电量,直到零电位;The aforementioned microprocessor sets the aforementioned pin as an output mode, so that the aforementioned capacitor C discharges electricity in the discharge circuit until it reaches zero potential; 前述微处理机设定前述接脚由输出模式转态为输入模式,并开始计时前连接脚由低位准到高位准所需的时间;以及The aforementioned microprocessor sets the time required for the aforementioned pin to transition from the output mode to the input mode, and starts timing the connection pin from a low level to a high level; and 前述微处理机根据前述所需的时间获得前述蓄电池白电量。The aforementioned microprocessor obtains the aforementioned battery white quantity according to the aforementioned required time. 10.如权利要求9所述的蓄电池电量侦测方法,其特征在于前述接脚设定为输入模式,具有施密特触发电路。10. The battery power detection method as claimed in claim 9, wherein said pin is set as an input mode and has a Schmitt trigger circuit. 11.如权利要求9所述的蓄电池电量侦测方法,其特征在于前述所需的时间系指前述蓄电池对RC回路充电将电容C由零电位充电至前述接脚由低位准转态到高位准的充电时间。11. The battery power detection method as claimed in claim 9, characterized in that the aforementioned required time means that the aforementioned battery charges the RC loop to charge the capacitor C from zero potential until the aforementioned pin transitions from a low level to a high level charging time. 12.如权利要求9或11所述的蓄电池电量侦测方法,其特征在于前述微处理机包含一对应表,该对应表记录前述蓄电池不同的电量对RC回路的电容C充电,将电容C由零电位充电至前述接脚由低位准转态到高位准所需的时间。12. The battery power detection method as claimed in claim 9 or 11, wherein said microprocessor comprises a corresponding table, and said corresponding table records the different electric quantities of said battery to charge the capacitor C of the RC circuit, and the capacitor C is changed from The time required from zero potential charging to the transition of the aforementioned pin from low level to high level. 13.如权利要求12所述的蓄电池电量侦测方法,其特征在于前述微处理机根据前述所需的时间,可从该对应表查出前述蓄电池对应的电量。13. The battery power detection method according to claim 12, wherein the microprocessor can check the corresponding power of the battery from the corresponding table according to the required time. 14.一种蓄电池电量侦测装置,包含:14. A storage battery power detection device, comprising: 一蓄电池:A storage battery: 一RC回路,该蓄电池对前述RC回路形成充电回路;以及An RC circuit, the storage battery forms a charging circuit for the aforementioned RC circuit; and 一微处理器,具有一可规划转态的接脚,前述接脚形成前述RC回路的电容C的放电回路,当微处理器侦测该蓄电池电量时,前述接脚设定为输出模式使该电容C释放电量直到零电位,之后前述接脚设定为输入模式计时该接脚由低位准转态到高位准所需的时间,藉以获知前述蓄电池的电量。A microprocessor has a pin that can be programmed to turn the state. The aforementioned pin forms a discharge circuit for the capacitor C of the aforementioned RC loop. When the microprocessor detects the battery power, the aforementioned pin is set to an output mode to enable the The capacitor C discharges the electricity until it reaches zero potential, and then the aforementioned pin is set as an input mode to count the time required for the pin to transition from a low level to a high level, so as to obtain the power of the aforementioned battery. 15.如权利要求14所述的蓄电池电量侦测装置,其特征在于前述接脚设定为输入模式,具有施密特触发电路。15. The battery power detection device as claimed in claim 14, wherein said pin is set as an input mode and has a Schmitt trigger circuit. 16.如权利要求14所述的蓄电池电量侦测方法,其特征在于前述微处理机包含一对应表,该对应表记录前述蓄电池不同的电量对RC回路的电容C充电,将电容C由零电位充电至前述接脚由低值准转态到高位准所需的时间。16. The battery power detection method as claimed in claim 14, wherein said microprocessor includes a corresponding table, which records the different electric quantities of said battery to charge the capacitor C of the RC circuit, and changes the capacitor C from zero potential It is the time required for charging the aforementioned pin from a low value to a high level. 17.如权利要求16所述的蓄电池电量侦测方法,其特征在于前述微处理机根据前述所需的时间,可从该对应表查出前述蓄电池对应的电量。17. The battery power detection method according to claim 16, wherein the microprocessor can check the corresponding power of the battery from the corresponding table according to the required time. 18.一种蓄电池电量侦测方法,利用蓄电池对一RC回路的充电而由充电时间反映该蓄电池的电量,该方法包含:形成该RC回路中电容器C的放电回路,直到该电容器C放电至零电位;以及18. A battery power detection method, using the battery to charge an RC loop to reflect the battery’s power from the charging time, the method comprising: forming a discharge circuit for the capacitor C in the RC loop until the capacitor C is discharged to zero electric potential; and 开始计算蓄电池对RC回路充电,直到该电容器C充电至一预设的电位所需的时间,藉以获得该蓄电池目前的电量。Start to calculate the time required for the battery to charge the RC loop until the capacitor C is charged to a preset potential, so as to obtain the current power of the battery.
CN 02103503 2002-02-06 2002-02-06 Storage battery power detection device and method Pending CN1437030A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 02103503 CN1437030A (en) 2002-02-06 2002-02-06 Storage battery power detection device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 02103503 CN1437030A (en) 2002-02-06 2002-02-06 Storage battery power detection device and method

Publications (1)

Publication Number Publication Date
CN1437030A true CN1437030A (en) 2003-08-20

Family

ID=27627843

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 02103503 Pending CN1437030A (en) 2002-02-06 2002-02-06 Storage battery power detection device and method

Country Status (1)

Country Link
CN (1) CN1437030A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7497304B2 (en) 2004-05-27 2009-03-03 Mitsubishi Denki Kabushiki Kaisha Device for detecting failure in driving power supply for elevator, and method for detecting failure in driving power supply for elevator
CN102929184A (en) * 2012-11-23 2013-02-13 杭州士兰微电子股份有限公司 Voltage detection device for micro control unit
CN103675689A (en) * 2012-09-24 2014-03-26 联想(北京)有限公司 Battery detection method and device
CN104166097B (en) * 2013-05-17 2016-12-28 力智电子股份有限公司 How to measure battery power
CN108427056A (en) * 2018-03-09 2018-08-21 陈秀珍 A kind of electric power detection safety warning device
CN110912220A (en) * 2019-10-17 2020-03-24 惠州市蓝微电子有限公司 A power supply circuit and its residual power estimation method

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7497304B2 (en) 2004-05-27 2009-03-03 Mitsubishi Denki Kabushiki Kaisha Device for detecting failure in driving power supply for elevator, and method for detecting failure in driving power supply for elevator
CN100537388C (en) * 2004-05-27 2009-09-09 三菱电机株式会社 Device for detecting failure in driving power supply for elevator, and method for detecting failure in driving power supply for elevator
CN103675689A (en) * 2012-09-24 2014-03-26 联想(北京)有限公司 Battery detection method and device
CN102929184A (en) * 2012-11-23 2013-02-13 杭州士兰微电子股份有限公司 Voltage detection device for micro control unit
CN102929184B (en) * 2012-11-23 2015-01-07 杭州士兰微电子股份有限公司 Voltage detection device for micro control unit
CN104166097B (en) * 2013-05-17 2016-12-28 力智电子股份有限公司 How to measure battery power
CN108427056A (en) * 2018-03-09 2018-08-21 陈秀珍 A kind of electric power detection safety warning device
CN110912220A (en) * 2019-10-17 2020-03-24 惠州市蓝微电子有限公司 A power supply circuit and its residual power estimation method

Similar Documents

Publication Publication Date Title
JP3063105B2 (en) Battery level display
TWI410853B (en) Capacitance measurement device for a touch control device
CN104062504B (en) Super-capacitor detecting circuit
CN108535651A (en) Method and apparatus for calibrating coulomb count based state of charge estimation
JP2010197395A (en) Method of and device for determining charge condition of battery
US6885952B1 (en) System and method for determining voltage levels
CN105676145A (en) Method and device for detecting temperature and ID of battery
CN101435838A (en) Apparatus for measuring capacitance capacity
US6690171B2 (en) Battery capacity detection device and method
CN101339230A (en) Device and method for measuring battery internal resistance
CN1437030A (en) Storage battery power detection device and method
US20070115037A1 (en) Voltage-pulse converting circuit and charge control system
CN1636143A (en) Method and circuit arrangement for determining the average current consumption of a battery-operated apparatus
CN1412571A (en) Method for precise estimated secondary battery significant fully discharge capacity
JPH07183050A (en) Lead storage battery life judgment method
CN112986691B (en) Sensing circuit and method for calculating capacitance value using sensing circuit with inverter
CN101331659B (en) Battery recharge prevention principle for short battery voltage dips
CN110221094B (en) Airflow detection circuit and device
CN112415294A (en) Detection circuit for instantaneous voltage drop and vehicle-mounted diagnosis system
CN1800866A (en) Battery detection system and method thereof
CN2380925Y (en) Apparatus for measuring resistance of sensor
US20210270905A1 (en) Device and method for monitoring remaining power of battery
KR20070117259A (en) Battery level measuring device and method
CN220629581U (en) Online detection circuit of loudspeaker
CN1822469A (en) Method and device for limiting charging of lithium-ion battery

Legal Events

Date Code Title Description
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication