A real-time uploading startup circuit and method for instrument measurement data
By using two photosensitive elements and hysteresis comparators in the real-time upload of instrument measurement data, comparing the sampled values and determining whether to start data uploading is based on the set time, the problem of the instrument being susceptible to environmental factors and causing misstarts, and the reliability and speed of startup are improved.
Patent Information
- Application Number
- CN202210234012.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-10
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2042-03-10
AI Technical Summary
The real-time upload of existing instrument measurement data is easily affected by environmental factors and leads to misstart, and the startup speed is slow and the reliability is poor.
Using a combination of two-channel photosensitive elements and hysteresis comparator, by comparing the sampling values of the two-channel photosensitive elements, we judge whether there is any artificial touch, and based on the set time, whether data upload is started.
Effectively eliminate the impact of environmental factors on the sampling value of photosensitive elements, avoid misstarting starts, and improve startup reliability and speed.
Smart Images

Figure CN114689929B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of intelligent instruments, and in particular to a circuit and method for starting real-time uploading of instrument measurement data. Background Art
[0002] Measuring instruments usually upload measurement data to the background in a timed uploading manner. In order to obtain the measurement data in real time, the measuring instrument is usually also provided with a real-time uploading start circuit for the instrument measurement data.
[0003] like Figure 1 As shown, the real-time upload startup circuit of the instrument measurement data includes a mainboard and a photosensitive element detection circuit, which is composed of a resistor R2, a resistor R1 and a photosensitive element D1T. One end of the resistor R1 is connected to the power supply terminal Vcc of the mainboard, and the other end is connected to the collector of the photosensitive element D1T. The emitter of the photosensitive element D1T is connected to GND, and the connection end of the resistor R1 and the photosensitive element D1T is connected to the sampling end of the mainboard through the resistor R2.
[0004] When the instrument needs to upload a measurement data in real time, manually touch the photosensitive element D1T for a few seconds and then release it. At this time, the timing diagram of the mainboard detecting the sampling data is as follows Figure 2 As shown. That is, when the photosensitive element is touched manually, the sample value will flip twice within the set time t1 (2 to 6 seconds). In this way, when the sample value flips for the first time, it is detected whether the second flip will occur within the set time interval, so as to determine whether to start data uploading.
[0005] The existing instrument measurement data real-time upload startup circuit has the following problems:
[0006] 1. The instrument is easily affected by environmental factors, resulting in false start. For example, when there is a cover on the instrument surface, the cover is closed and then quickly opened, or when there is no cover on the instrument surface or when the cover is open, a door, car, person or other obstruction passes by the instrument quickly, the sampling value will be flipped for the second time within the set time interval, resulting in the above-mentioned false start of upload.
[0007] 2. If the touch time is long, data upload can only be started after the touch ends, and the startup speed is slow; and when the touch time is too long, only one flip may be detected within the set time interval, and data upload cannot be started, and the reliability is poor. Summary of the invention
[0008] The purpose of the present invention is to provide a circuit and method for starting real-time uploading of instrument measurement data to solve the problems raised in the above background technology.
[0009] To achieve the above object, the present invention provides the following technical solutions:
[0010] A real-time upload startup circuit for instrument measurement data includes a mainboard, a hysteresis comparator U1, a voltage regulator tube DZ1, a voltage-dividing resistor R1, a sampling resistor R2, a feedback resistor R5, a diode D1, a photosensitive element D1T, a voltage-dividing resistor R3, a sampling resistor R4 and a photosensitive element D2T. An MCU and a transmitting module are arranged in the mainboard. One end of the voltage-dividing resistor R1 is connected to a power supply terminal Vcc of the mainboard, and the other end is connected to an anode of the diode D1. The cathode of the diode D1 is connected to a collector of the photosensitive element D1T. The emitter of the photosensitive element D1T is connected to GND. The cathode of the diode D1 is connected to a collector of the photosensitive element D1T. The collector of the photosensitive element D1T is also connected to the non-inverting input terminal of the hysteresis comparator U1 through a sampling resistor R2, one end of the voltage-dividing resistor R3 is connected to the power supply terminal Vcc of the mainboard, and the other end is connected to the collector of the photosensitive element D2T, the emitter of the photosensitive element D2T is connected to GND, the voltage-dividing resistor R3 and the collector of the photosensitive element D1T are also connected to the inverting input terminal of the hysteresis comparator U1 through a sampling resistor R4, a feedback resistor R5 is connected between the output terminal and the non-inverting input terminal of the hysteresis comparator U1, and a voltage regulator tube DZ1 is connected between the output terminal of the hysteresis comparator U1 and the ground.
[0011] As a further solution of the present invention: the voltage-dividing resistor R1, the sampling resistor R2, the diode D1, and the photosensitive element D1T constitute a first upload start detection circuit.
[0012] As a further solution of the present invention: the voltage-dividing resistor R3, the sampling resistor R4, and the photosensitive element D2T constitute a second upload start detection circuit.
[0013] As a further solution of the present invention: the MCU samples the output end of the hysteresis comparator U1 and controls the connection to the transmitting module.
[0014] As a further solution of the present invention: the resistance values of the voltage-dividing resistors R1 and R3 are the same.
[0015] As a further solution of the present invention: the resistance values of the sampling resistors R2 and R4 are the same.
[0016] As a further solution of the present invention: the photosensitive element D1T and the photosensitive element D2T are of the same model. When the light intensity is higher, the current in the photosensitive elements D1T and D2T is larger, and the corresponding voltage sampling value connected to the input terminal of the hysteresis comparator U1 is smaller.
[0017] As a further solution of the present invention: the photosensitive elements D1T and D2T are arranged at the same position of the smart meter body, and are subject to the same environmental factors and the same light intensity.
[0018] A method for starting uploading instrument measurement data in real time, using the above-mentioned starting circuit, comprises the following steps:
[0019] Step (1), synchronously sampling the electrical physical quantities of the first photosensitive element D1T and the second photosensitive element D2T in real time; wherein, under the same light intensity, the sampling values corresponding to the first photosensitive element D1T and the second photosensitive element D2T are the same;
[0020] Step (2): adjust the sampling value of the first photosensitive element D1T downward by U D , and will reduce U D The sampling value of the first photosensitive element D1T is compared with the sampling value of the second photosensitive element D2T;
[0021] Step (3): if U is lowered D After that, the sampling value of the first photosensitive element D1T is greater than the sampling value of the second photosensitive element D2T, indicating that D1T must be touched manually. At this time, the duration t during which the sampling value of D1T is higher than the sampling value of D2T is recorded within the set time T1. If U is lowered D If the sampling value of the first photosensitive element D1T is not greater than the sampling value of the second photosensitive element D2T, it means that there is definitely no human touch at this time, and the process returns to step (1), wherein the setting time T1 is determined according to the minimum time value required for touching when starting to upload the measurement data, that is, the shortest time required to touch the photosensitive element D1T when starting to upload the measurement data;
[0022] Step (4), determine whether the duration t is less than the set time T1. If it is less than the set time T1, the measurement data upload is not started; if it is not less than the set time T1, the measurement data upload is started.
[0023] As a further technical solution of the present invention, U D The determination method is as follows: a. Uniformly set m different light intensities and place the two photosensitive elements D1T and D2T in these m different light intensities respectively; b. Without touching, respectively record the n measurement values of the two photosensitive elements D1T and D2T under the i-th light intensity, which are recorded as c. Calculate the average value of n measured values of D1T at the i-th light intensity and the average of n measurements of D2T at the i-th light intensity d. Calculate the n measured values of D1T at the i-th light intensity and The absolute value of the difference and the n measured values of D2T at the i-th light intensity and The absolute value of the difference; e. D Take 2|u| max +Δu, where |u| max is the maximum value among all absolute values, and Δu is the current conduction voltage of all diodes greater than 2|u| max And with 2|u| max The closest on-state voltage is 2|u| max The difference.
[0024] Compared with the prior art, the present invention has the following beneficial effects:
[0025] 1. By adding a few simple electronic devices, the judgment of the sampling value flipping twice within the set time is converted into the judgment of the difference between the two sampling values, and the implementation method is different;
[0026] 2. Since the two photosensitive elements are both installed on the meter, they are close to each other and face the same environment. The difference between the corresponding sampling values of the two is used to determine whether to start uploading the measurement data. This can eliminate the influence of environmental factors such as the cover being closed and then opened or the cover moving in front of the meter on the sampling value of a single photosensitive element, which may cause the measurement data uploading to start incorrectly. This is easy to implement and low cost.
[0027] 3. By setting a diode, the sampling value of the touched photosensitive element is lowered, thereby avoiding the phenomenon of frequent false start of measurement data upload due to the influence of measurement error when the photosensitive element is not touched, and improving the startup reliability.
[0028] 4. By setting the hysteresis comparator, the measurement data upload can be started directly based on the analog signal control, thus avoiding the analog-to-digital conversion and meeting the application requirements of the instrument MCU with a short wake-up time per cycle.
[0029] 5. When the measurement data upload is started by long touch, data can be uploaded immediately when the touch time is reached, even if the touch has not ended, with fast startup speed and high reliability. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 This is the existing startup circuit diagram;
[0031] Figure 2 It is the sampling timing diagram;
[0032] Figure 3 The upload start circuit diagram of the present invention;
[0033] Figure 4 It is the principle diagram of the present invention;
[0034] Figure 5Schematic diagram of hysteresis comparator output.
[0035] Figure 6 Flowchart of the method for starting real-time upload of instrument measurement data. DETAILED DESCRIPTION
[0036] Example 1: Please refer to Figure 3 , a real-time upload startup circuit for instrument measurement data, including: a main board, a hysteresis comparator U1, a voltage regulator tube D Z1 , voltage dividing resistor R1, sampling resistor R2, feedback resistor R5, diode D1, photosensitive element D1T, voltage dividing resistor R3, sampling resistor R4, photosensitive element D2T.
[0037] Among them, the voltage-dividing resistor R1, the sampling resistor R2, the diode D1, and the photosensitive element D1T constitute the first upload startup detection circuit, and the voltage-dividing resistor R3, the sampling resistor R4, and the photosensitive element D2T constitute the second upload startup detection circuit. In the first upload startup detection circuit, one end of the voltage-dividing resistor R1 is connected to the power supply terminal Vcc of the mainboard, and the other end is connected to the anode of the diode D1, the cathode of the diode D1 is connected to the collector of the photosensitive element D1T, and the emitter of the photosensitive element D1T is connected to GND. The cathode of the diode D1 and the collector of the photosensitive element D1T are also connected to the non-inverting input terminal of the hysteresis comparator U1 through the sampling resistor R2. In the second upload startup detection circuit, one end of the voltage-dividing resistor R3 is connected to the power supply terminal Vcc of the mainboard, and the other end is connected to the collector of the photosensitive element D2T, and the emitter of the photosensitive element D2T is connected to GND. The voltage-dividing resistor R3 and the collector of the photosensitive element D1T are also connected to the inverting input terminal of the hysteresis comparator U1 through the sampling resistor R4. A feedback resistor R5 is connected between the output terminal and the in-phase input terminal of the hysteresis comparator U1, and a voltage regulator diode D is connected between the output terminal and the ground. Z1 The main board is provided with an MCU and a transmitting module. The MCU samples the output end of the hysteresis comparator U1 and controls the connection to the transmitting module.
[0038] Example 2, please refer to Figure 2 , based on Example 1, the resistance values of the voltage divider resistors R1 and R3 are the same, the resistance values of the sampling resistors R2 and R4 are the same, and the photosensitive elements D1T and D2T are of the same model. When the light intensity is higher, the current in the photosensitive elements D1T and D2T is larger, and the corresponding voltage sampling value connected to the input terminal of the hysteresis comparator U1 is smaller.
[0039] The working principle of this design is:
[0040] (1) The photosensitive elements D1T and D2T are set at the same position on the body of the smart meter, with the same environmental factors and the same light intensity.
[0041] (2) When the measurement data does not need to be uploaded, the light intensity of the photosensitive elements D1T and D2T is the same, but due to the voltage divider effect of the diode D1, the voltage divider size is the conduction voltage U of the diode D1. D , the voltage value at the non-inverting input of the hysteresis comparator U1 will be lower than the voltage at its inverting input, and the difference between the voltage value at the non-inverting input and the voltage at the inverting input will be lower than the low voltage threshold -Δu of the hysteresis comparator U1, and the output of the hysteresis comparator U1 is low level. At this time, the MCU detects a low level, and the transmitter module does not start uploading data. By setting the diode D1, under the same light intensity, the voltage value at the non-inverting input of the hysteresis comparator U1 can be forced to be lower than the voltage value at the inverting input. This avoids the phenomenon that when the diode D1 is not set, even if the light intensity is the same, due to the influence of the measurement error, the voltage value at the non-inverting input of the hysteresis comparator U1 is sometimes higher than the voltage value at the inverting input, and sometimes lower than the voltage value at the inverting input, thereby causing the measurement data upload to be repeatedly started.
[0042] (3) When it is necessary to start uploading the measured data, manually touch the photosensitive element D1T for a long time. As the light intensity of the photosensitive element D1T decreases, its current will decrease significantly, and then the voltage value at the non-inverting input of the hysteresis comparator U1 will increase and be higher than the voltage at its inverting input. The difference between the voltage value at the non-inverting input and the voltage at the inverting input will be higher than the high voltage threshold Δu of the hysteresis comparator U1, and the output of the hysteresis comparator U1 will be high. At this time, the MCU will continue to detect the high level, and then control the transmitting module to start uploading the measured data.
[0043] like Figure 4 As shown in the figure, the thick red solid line shows that in the case of touch, the sampling voltage value corresponding to D1T, that is, the voltage value of the non-inverting input terminal of the hysteresis comparator U1 changes with the ambient light intensity; the thin blue solid line shows that in the case of no touch, the sampling voltage value corresponding to D2T, that is, the voltage value of the inverting input terminal of the hysteresis comparator U1 changes with the ambient light intensity; the thick red dotted line shows that in the case of touch, the sampling voltage value corresponding to D1T, that is, the voltage value of the non-inverting input terminal of the hysteresis comparator U1 changes with the ambient light intensity.
[0044] Of course, in reality, the changes in the D1T and D2T sampling voltage values with light intensity do not necessarily show the same Figure 4 The linear relationship shown in Figure 4 This is a simplified diagram for illustration purposes only. However, Figure 4 This is the same as the actual trend that the D1T and D2T sampling voltage values decrease as the light intensity increases.
[0045] Without touching D1T, the light intensity of D1T and D2T is the same, but due to the voltage drop effect of diode D1 (the voltage drop is Figure 4 U D ), even if the sampling error is considered (the limit sampling error is U D -Δu), the sampling voltage value of D1T will also be lower than that of D2T, such as Figure 4 As shown by point A on the thick red solid line and point B on the thin blue solid line, the output of the hysteresis comparator U1 is a low level at this time.
[0046] When it is necessary to start uploading the measured data, the D1T is touched manually, and the light intensity of the D1T decreases. At this time, the sampling voltage value of the D1T will increase significantly. Figure 4 As shown in Figure 1, when the light intensity is much higher than a certain intensity E0, the sampling voltage value of D1T after touch will be higher than the sampling voltage value of D2T, such as Figure 4 As shown by point C on the red dotted line in Figure 5 As shown, the difference between the voltage value at the non-inverting input terminal and the voltage at the inverting input terminal of the hysteresis comparator U1 is higher than the high voltage threshold Δu of the hysteresis comparator U1, and the output of the hysteresis comparator U1 is a high level.
[0047] When affected by environmental factors, such as when the shielding cover set on the instrument surface is closed or when there is an obstruction in front of the instrument without setting the shielding cover, the light intensity of D1T and D2T will be weakened, and the corresponding sampling voltage values will increase by the same amplitude, respectively. Figure 4 As shown at points C and D in FIG. 1 , at this time, the sampling voltage value of D1T is still lower than that of D2T, and the output of the hysteresis comparator U1 is still at a low level, thereby avoiding the phenomenon of false start of measurement data upload.
[0048] When the ambient light intensity is lower than a certain value, such as Figure 4 When the light intensity is slightly higher or lower than E0, when D1T is touched, the sampling voltage value of D1T will increase. However, due to the small increase, the difference between the voltage value at the non-inverting input terminal and the voltage at the inverting input terminal of the hysteresis comparator U1 will be lower than the high voltage threshold Δu of the hysteresis comparator U1. At this time, the hysteresis comparator U1 will still output a low level and will not start uploading the measurement data, thereby avoiding the phenomenon of false start of measurement data uploading when the light intensity is too low.
[0049] based on Figure 3 The instrument measurement data in real time uploads the startup circuit, such as Figure 6 As shown, the steps for starting the real-time upload of instrument measurement data are as follows:
[0050] (1) The electrical physical quantities of the first photosensitive element D1T and the second photosensitive element D2T are synchronously sampled in real time; wherein, under the same light intensity, the sampling values corresponding to the first photosensitive element D1T and the second photosensitive element D2T are the same.
[0051] (2) Adjust the sampling value of the first photosensitive element D1T downward by U D , and will reduce U D The sampled value of the first photosensitive element D1T is compared with the sampled value of the second photosensitive element D2T.
[0052] Among them, U D The method of determining is:
[0053] a. Uniformly set m different light intensities, and place the two photosensitive elements D1T and D2T in these m different light intensities respectively;
[0054] b. Without touching, record the n measured values of the two photosensitive elements D1T and D2T at the i-th light intensity, respectively, and record them as
[0055] c. Calculate the average value of n measured values of D1T at the i-th light intensity and the average of n measurements of D2T at the i-th light intensity
[0056] d. Calculate the n measured values of D1T at the i-th light intensity respectively and The absolute value of the difference and the n measured values of D2T at the i-th light intensity and The absolute value of the difference;
[0057] e. Will U D Take 2|u| max +Δu, where |u| max is the maximum value among all absolute values, and Δu is the current conduction voltage of all diodes greater than 2|u| max And with 2|u| max The closest on-state voltage is 2|u| max The difference.
[0058] (3) If U is lowered D After that, the sampling value of the first photosensitive element D1T is greater than the sampling value of the second photosensitive element D2T, indicating that D1T must be touched manually. At this time, the duration t that the sampling value of D1T is higher than the sampling value of D2T is recorded within the set time T1. DIf the sampling value of the first photosensitive element D1T is not greater than the sampling value of the second photosensitive element D2T, it means that there is definitely no human touch at this time, and the process returns to step (1).
[0059] The set time T1 is determined according to the minimum time value required for touching when starting to upload the measurement data, that is, the shortest time required to touch the photosensitive element D1T when starting to upload the measurement data.
[0060] (4) Determine whether the duration t is less than the set time T1. If it is less than the set time T1, the measurement data upload is not started; if it is not less than the set time T1, the measurement data upload is started.
Claims
1. A real-time uploading startup circuit for instrument measurement data, characterized in that: Including main board, hysteresis comparator U1, voltage regulator D Z1 , a voltage-dividing resistor R1, a sampling resistor R2, a feedback resistor R5, a diode D1, a photosensitive element D1T, a voltage-dividing resistor R3, a sampling resistor R4 and a photosensitive element D2T; an MCU and a transmitting module are provided in the main board; One end of the voltage-dividing resistor R1 is connected to the power supply terminal Vcc of the mainboard, and the other end is connected to the anode of the diode D1, the cathode of the diode D1 is connected to the collector of the photosensitive element D1T, the emitter of the photosensitive element D1T is connected to GND, and the cathode of the diode D1 and the collector of the photosensitive element D1T are also connected to the non-inverting input terminal of the hysteresis comparator U1 through the sampling resistor R2; One end of the voltage divider resistor R3 is connected to the power supply terminal Vcc of the mainboard, and the other end is connected to the collector of the photosensitive element D2T. The emitter of the photosensitive element D2T is connected to GND. The voltage divider resistor R3 and the collector of the photosensitive element D1T are also connected to the inverting input terminal of the hysteresis comparator U1 through the sampling resistor R4. A feedback resistor R5 is connected between the output terminal and the non-inverting input terminal of the hysteresis comparator U1. A voltage regulator tube D is connected between the output terminal of the hysteresis comparator U1 and the ground. Z1 ; The resistance values of the voltage-dividing resistors R1 and R3 are the same; the resistance values of the sampling resistors R2 and R4 are the same; the photosensitive element D1T and the photosensitive element D2T are of the same model, and when the light intensity is higher, the current in the photosensitive elements D1T and D2T is larger, and the corresponding voltage sampling value connected to the input end of the hysteresis comparator U1 is smaller; the photosensitive elements D1T and D2T are arranged at the same position of the smart meter body, and are in the same environmental factors and the same light intensity.
2. The real-time uploading startup circuit for instrument measurement data according to claim 1 is characterized in that: The voltage-dividing resistor R1, the sampling resistor R2, the diode D1, and the photosensitive element D1T constitute a first upload start detection circuit.
3. The real-time uploading startup circuit for instrument measurement data according to claim 1 is characterized in that: The voltage-dividing resistor R3, the sampling resistor R4, and the photosensitive element D2T constitute a second upload start detection circuit.
4. The real-time uploading startup circuit for instrument measurement data according to claim 1 is characterized in that: The MCU samples the output end of the hysteresis comparator U1 and controls the connection to the transmitting module.
5. A method for starting real-time upload of instrument measurement data, characterized in that: The starting circuit according to any one of claims 1 to 4 comprises the following steps: Step (1), synchronously sampling the electrical physical quantities of the first photosensitive element D1T and the second photosensitive element D2T in real time; wherein, under the same light intensity, the sampling values corresponding to the first photosensitive element D1T and the second photosensitive element D2T are the same; Step (2): adjust the sampling value of the first photosensitive element D1T downward by U D , and will reduce U D The sampling value of the first photosensitive element D1T is compared with the sampling value of the second photosensitive element D2T; Step (3): if U is lowered D After that, the sampling value of the first photosensitive element D1T is greater than the sampling value of the second photosensitive element D2T, indicating that D1T must be touched manually. At this time, the duration t during which the sampling value of D1T is higher than the sampling value of D2T is recorded within the set time T1. If U is lowered D If the sampling value of the first photosensitive element D1T is not greater than the sampling value of the second photosensitive element D2T, it means that there is definitely no human touch at this time, and the process returns to step (1), wherein the setting time T1 is determined according to the minimum time value required for touching when starting to upload the measurement data, that is, the shortest time required to touch the photosensitive element D1T when starting to upload the measurement data; Step (4), determine whether the duration t is less than the set time T1. If it is less than the set time T1, the measurement data upload is not started; if it is not less than the set time T1, the measurement data upload is started.
6. A method for starting real-time upload of instrument measurement data according to claim 5, characterized in that: U D The determination method is as follows: a. uniformly set m different light intensities, and place the two photosensitive elements D1T and D2T in the m different light intensities respectively; b. Without touching, record the n measured values of the two photosensitive elements D1T and D2T at the i-th light intensity, respectively, and record them as c. Calculate the average value of n measured values of D1T at the i-th light intensity and the average of n measurements of D2T at the i-th light intensity d. Calculate the n measured values of D1T at the i-th light intensity and The absolute value of the difference and the n measured values of D2T at the i-th light intensity and The absolute value of the difference; e. D Take 2|u| max +Δu, where |u| max is the maximum value among all absolute values, and Δu is the current conduction voltage of all diodes greater than 2|u| max And with 2|u| max The closest on-state voltage is 2|u| max The difference.
Citation Information
Patent Citations
Photoconductive switch with delay locking function
CN103501172A
LED power supply circuit with voltage detection and control functions
CN107277976A