Under-voltage abnormal threshold monitoring and data storage system based on microcontroller

By designing a undervoltage abnormality threshold monitoring and data storage system based on microcontrollers, simple components are used to realize the monitoring of power undervoltage and data storage, the problem of data loss in the power undervoltage abnormality of power supply is solved, and timely data storage and circuit simplicity are realized.

CN222867013UActive Publication Date: 2025-05-13SHANDONG INSPUR SCI RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202421877456.1
Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
Filing Date
2024-08-05
Publication Date
2025-05-13
Estimated Expiration
2034-08-05

AI Technical Summary

Technical Problem

In the prior art, when a microcontroller system encounters a power supply undervoltage abnormality, it is unable to monitor and save data in time, resulting in data loss.

Method used

Design a undervoltage abnormality threshold monitoring and data storage system based on microcontrollers. By using external power supply, microcontroller, control unit and external Flash, simple components such as resistors, capacitors, diodes, transistors and voltage regulators, the abnormality monitoring of power supply undervoltage and the timely storage of data is achieved.

Benefits of technology

It realizes data storage of microcontroller system when power supply is undervoltage abnormal, with simple circuit, low cost and easy to implement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN222867013U_ABST
    Figure CN222867013U_ABST
Patent Text Reader

Abstract

The utility model relates to a microcontroller-based undervoltage abnormal threshold monitoring and data storage system, which belongs to the technical field of power supply undervoltage abnormal monitoring and data storage, and comprises an external power supply, a microcontroller, a control unit and an external Flash, a second output end of the external power supply is sequentially connected with a diode D1 and a resistor R1 in series, the second output end of the external power supply is connected with a VCC end of the microcontroller, a third output end of the external power supply is sequentially connected with a resistor R3 and a triode Q1 in series and is finally connected with the microcontroller, and a second port at the lower part of the microcontroller is connected with an external Flash. According to the utility model, simple elements such as the resistors, the capacitors, the diodes, the triodes and the voltage-regulator tubes are adopted for wiring and are connected together to realize abnormal monitoring of power supply undervoltage of the microcontroller, data can be stored in time, and the circuit is simple, low in implementation cost and easy to implement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The utility model relates to the technical field of power supply undervoltage anomaly monitoring and data preservation, in particular to an undervoltage anomaly threshold monitoring and data preservation system based on a microcontroller. Background Art

[0002] A microcontroller is a single-chip microcomputer that integrates the main parts of a microcomputer on a single chip. In the field of measurement and control technology, a microcontroller system without a backup power supply cannot effectively save some necessary data for calculation or collection when encountering an abnormal power undervoltage and the microcontroller is working normally. However, these data need to be restored when the system is powered on next time. Therefore, it is very important to design a power undervoltage abnormality monitoring and data preservation method in the system.

[0003] Currently, power undervoltage abnormality monitoring technology mostly uses power management chips. The circuits of such power management chips are complex and costly, and the power undervoltage abnormality cannot save data in time. Utility Model Content

[0004] In view of the above problems in the prior art, the utility model provides a microcontroller-based undervoltage abnormality threshold monitoring and data storage system, which is achieved through the following technical solutions:

[0005] A microcontroller-based undervoltage abnormality threshold monitoring and data storage system comprises an external power supply, a microcontroller, a control unit and an external Flash, wherein one end of the external power supply is connected to the control unit, the other end of the control unit is connected to the microcontroller, the microcontroller is connected to the external Flash, and the control unit comprises a diode D1, a resistor R1, a resistor R3, and a transistor Q1; the external power supply has three output ends, a first output end of the external power supply is connected in parallel with a plurality of first units, a second output end of the external power supply is sequentially connected in series with a diode D1 and a resistor R1, the second output end of the external power supply is connected to a VCC end of the microcontroller, a third output end of the external power supply is sequentially connected in series with a resistor R3 and a transistor Q1 and finally connected to the microcontroller, and a second port at the bottom of the microcontroller is connected to the external Flash.

[0006] The utility model is further configured as follows: one end of the first unit is connected to an upper first port of the microcontroller, and the first unit comprises a diode and a resistor connected in series in sequence.

[0007] The utility model is further configured as follows: a resistor R2, a diode D2 and a diode D3 are sequentially connected in series on a line between the third output terminal of the external power supply and the resistor R3 and are finally connected to the lower first port of the microcontroller.

[0008] The utility model is further configured as follows: a capacitor C1 is connected to the circuit between the diode D2 and the diode D3, and one end of the capacitor C1 is grounded.

[0009] The utility model is further configured as follows: a first node and a second node are sequentially provided between the diode D3 and the microcontroller, the line of the first node is connected to the transistor Q1, the line of the second node is connected to a capacitor C2, and one end of the capacitor C2 is grounded.

[0010] The utility model is further configured as follows: a resistor R5 is connected in series between the first node and the transistor Q1, a voltage regulator D4 and a capacitor C3 connected in parallel are connected to the line between the resistor R5 and the transistor Q1, and one end of the capacitor C3 is grounded.

[0011] The utility model is further configured as follows: the capacitor C1 is an energy storage capacitor with a set capacitance, and the resistor R2 is a current limiting resistor.

[0012] The utility model is further configured as follows: the emitter voltage of the transistor Q1 is the voltage-divided value Ve of the resistors R3 and R4, the base voltage of the transistor Q1 is the voltage-stabilizing value Vb of the voltage-stabilizing tube D4, and when Ve-Vb>0.7V, the transistor Q1 is turned on.

[0013] In summary, the beneficial technical effects of the utility model are:

[0014] Simple components such as resistors, capacitors, diodes, triodes, and voltage regulators are used for wiring and connection to realize abnormal monitoring of undervoltage of microcontroller power supply, and data can be saved in time. The circuit is simple, the implementation cost is low, and it is easy to implement. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is used to show the overall circuit diagram of the utility model.

[0016] Figure 2 It is used to show the service flow chart of power undervoltage abnormal monitoring interruption. DETAILED DESCRIPTION

[0017] The utility model is further described in detail below in conjunction with the accompanying drawings.

[0018] Example

[0019] like Figure 1-2As shown, a microcontroller-based undervoltage abnormality threshold monitoring and data storage system disclosed in the utility model includes an external power supply, a microcontroller, a control unit and an external Flash. The internal program of the microcontroller contains a power undervoltage abnormality monitoring interrupt service subroutine. The working voltage of the microcontroller is 5V, 3.3V, etc. The control unit is the core control part of the voltage undervoltage abnormality monitoring. When the external power supply is undervoltage abnormal, the control unit can control the microcontroller to continue working for a period of time and trigger the power undervoltage abnormality monitoring interrupt service subroutine at the same time. The microcontroller saves the data to be saved to the external Flash; one end of the external power supply is connected to the control unit, and the The other end of the control unit is connected to the microcontroller, and the microcontroller is connected to the external Flash. The control unit includes a diode D1, a resistor R1, a resistor R3, and a transistor Q1. The diode D1 limits the current direction, and the resistor R1 limits the current size. The external power supply has three output ends. The first output end of the external power supply is connected in parallel with multiple first units, the second output end of the external power supply is connected in series with a diode D1 and a resistor R1 in sequence, the second output end of the external power supply is connected to the VCC end of the microcontroller, the third output end of the external power supply is connected in series with a resistor R3 and a transistor Q1 in sequence and finally connected to the microcontroller, and the second port at the bottom of the microcontroller is connected to the external Flash.

[0020] The process of the power undervoltage abnormal monitoring interrupt service subroutine is as follows: the initial interrupt service subroutine initializes the interrupt to a high level, and then determines the interrupt level. When the interrupt level is high, the interrupt service subroutine continues to run until the end of the run; when the interrupt level is low, the data is saved to the external Flash, and then the interrupt level is determined. When the interrupt level is high, the program continues to run after the data saved in the external Flash is retrieved. When the interrupt level is low, the program ends after waiting for a period of time (each instruction in the interrupt service subroutine is a prior art, and the specific process is shown in the attached Figure 2 ).

[0021] One end of the first unit is connected to the upper first port of the microcontroller. The first unit includes a diode and a resistor connected in series in sequence. Specifically, Figure 1 The diodes D5, D6 ... Dn and the resistors R7, R8 ... Rn shown in the figure have a voltage drop. In order to match the operating voltage of the external power supply with that of other IO ports of the microcontroller and prevent the microcontroller from outputting current through other IO ports when the power supply is under-voltage abnormal, the resistors R7, R8 ... Rn are current limiting resistors on each IO port.

[0022] The circuit between the third output terminal of the external power supply and the resistor R3 is connected in series with a resistor R2, a diode D2 and a diode D3 in sequence and finally connected to the first lower port of the microcontroller. The circuit between the diode D2 and the diode D3 is connected with a capacitor C1, and one end of the capacitor C1 is grounded. When the external power supply exists, the capacitor C1 will be charged. The capacitance of the capacitor C1 is large and the charging time is long, which will affect the normal power-on of the microcontroller. In the process of the external power supply charging the capacitor C1, the capacitor C2 is charged by the diode D1 and the resistor R1 at the same time, so as to ensure that the microcontroller is powered on faster and prevent the capacitor C1 from charging for too long, causing the microcontroller to fail to power on normally.

[0023] A first node and a second node are sequentially arranged between the diode D3 and the microcontroller, the circuit of the first node is connected to the transistor Q1, the circuit of the second node is connected to the capacitor C2, one end of the capacitor C2 is grounded, and the resistor R1 and the capacitor C2 form a filter circuit. The circuit composed of the diode D1 and the resistor R1 charging the capacitor C2 is an acceleration circuit, and the diode D3 limits the external power supply to charge the capacitor C1 through the acceleration circuit when powering on. If the external power supply charges the capacitor C1 through the diode D1 and the resistor R1, it will cause the VCC terminal voltage of the microcontroller to be abnormal, and the power-on fails. It should be noted that the conduction voltage drop of the diode D3 is less than 0.2V, which reduces voltage loss.

[0024] A resistor R5 is connected in series between the first node and the transistor Q1 , a voltage regulator D4 and a capacitor C3 connected in parallel are connected to the line between the resistor R5 and the transistor Q1 , and one end of the capacitor C3 is grounded.

[0025] The capacitor C1 is an energy storage capacitor with a capacitance of about 0.47F. When the power supply is under-voltage abnormal, it stores a certain amount of energy to supply the microcontroller to complete data storage. The resistor R2 is a current limiting resistor to prevent the external power supply from charging the capacitor C1 with excessive current when power is turned on. The diode D2 limits the current direction, that is, the current flows from the positive electrode of the diode D2 to the negative electrode.

[0026] The emitter voltage of the transistor Q1 is the voltage-divided value Ve of the resistors R3 and R4, and the base voltage of the transistor Q1 is the voltage-stabilizing value Vb of the voltage-stabilizing tube D4. When Ve-Vb>0.7V, the transistor Q1 is turned on.

[0027] Specific implementation method of this example: the interrupt pin interrupt of the microcontroller is set to pull up, that is, it is at a high level in the default state; when the external power supply is normally supplied, assuming that the external power supply is 6V, the resistance values ​​of the resistors R3 and R4 are adjusted to make their voltage division value Ve=0.7V, the voltage regulation value of the voltage regulator D4 is selected to be 0.7V, and the transistor Q1 is in the cut-off state, which will not trigger the interrupt service subroutine inside the microcontroller; when the external power supply is undervoltage abnormal, the voltage division value Ve of the resistors R3 and R4 is 0V, at this time the capacitor C1 is 0.47 farad, still storing a lot of energy, the voltage regulation value of the voltage regulator D4 is still 0.7V, the transistor Q1 is just turned on, and the interrupt pin of the microcontroller is pulled down by the resistor R4, triggering the interrupt service subroutine inside the microcontroller, and the subroutine executes to save the data to be saved in the external Flash, and when the external power supply is powered on again, the microcontroller re-retrieves the last saved data in the Flash.

[0028] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the utility model, rather than to limit it. Although the utility model has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the utility model.

Claims

1. A microcontroller-based undervoltage abnormality threshold monitoring and data storage system, comprising an external power supply, a microcontroller, a control unit and an external Flash, characterized in that: One end of the external power supply is connected to the control unit, and the other end of the control unit is connected to the microcontroller, and the microcontroller is connected to the external Flash. The control unit includes a diode D1, a resistor R1, a resistor R3, and a transistor Q1; The external power supply has three output terminals, a first output terminal of the external power supply is connected in parallel with a plurality of first units, a second output terminal of the external power supply is connected in series with a diode D1 and a resistor R1 in sequence, the second output terminal of the external power supply is connected to the VCC terminal of the microcontroller, a third output terminal of the external power supply is connected in series with a resistor R3 and a transistor Q1 in sequence and finally connected to the microcontroller, and a second port at the bottom of the microcontroller is connected to an external Flash.

2. According to claim 1, a microcontroller-based undervoltage abnormality threshold monitoring and data storage system is characterized in that: One end of the first unit is connected to an upper first port of the microcontroller, and the first unit includes a diode and a resistor connected in series in sequence.

3. The undervoltage abnormality threshold monitoring and data storage system based on a microcontroller according to claim 2, characterized in that: The line between the third output terminal of the external power supply and the resistor R3 is connected in series with a resistor R2, a diode D2 and a diode D3 in sequence and is finally connected to the lower first port of the microcontroller.

4. The undervoltage abnormality threshold monitoring and data storage system based on a microcontroller according to claim 3 is characterized in that: The circuit between the diode D2 and the diode D3 is connected with a capacitor C1 , and one end of the capacitor C1 is grounded.

5. The undervoltage abnormality threshold monitoring and data storage system based on a microcontroller according to claim 4, characterized in that: A first node and a second node are sequentially arranged between the diode D3 and the microcontroller. The line of the first node is connected to the transistor Q1. The line of the second node is connected to a capacitor C2. One end of the capacitor C2 is grounded.

6. The undervoltage abnormality threshold monitoring and data storage system based on a microcontroller according to claim 5, characterized in that: A resistor R5 is connected in series between the first node and the transistor Q1 , a voltage regulator D4 and a capacitor C3 connected in parallel are connected to the line between the resistor R5 and the transistor Q1 , and one end of the capacitor C3 is grounded.

7. The undervoltage abnormality threshold monitoring and data storage system based on a microcontroller according to claim 6, characterized in that: The capacitor C1 is an energy storage capacitor with a set capacitance, and the resistor R2 is a current limiting resistor.

8. The undervoltage abnormality threshold monitoring and data storage system based on a microcontroller according to claim 7, characterized in that: The emitter voltage of the transistor Q1 is the voltage-divided value Ve of the resistors R3 and R4, and the base voltage of the transistor Q1 is the voltage-stabilizing value Vb of the voltage-stabilizing tube D4. When Ve-Vb>0.7V, the transistor Q1 is turned on.