Water meter infrared communication circuit structure and water meter low power infrared communication method
By using PNP transistors and the comparator equipped with MCUs to process signals in the water meter infrared communication circuit, the circuit structure is simplified and the anti-interference ability is improved, and the existing water meter infrared communication technology is solved in terms of hardware cost, communication rate, reliability and power consumption, and a more efficient and reliable communication effect is achieved.
Patent Information
- Application Number
- CN202211296843.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-21
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2042-10-21
AI Technical Summary
The existing water meter infrared communication technology has shortcomings in hardware cost, communication rate, reliability and power consumption, especially when the program upgrades, communication efficiency is low and reliability is insufficient.
A water meter infrared communication circuit structure was designed, using PNP transistor and the comparator equipped with MCU to process communication signals, reducing external amplification and shaping circuits, simplifying the circuit structure, and improving the system's anti-interference ability by adjusting the parameters of the comparator. At the same time, N 0x00s are used as preambles for detecting infrared communication signals, which shortens the detection time and reduces power consumption.
It realizes the reduction of hardware costs, improves communication speed and reliability, and reduces power consumption, and improves the overall performance of water meter infrared communication.
Smart Images

Figure CN115589233B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of water meters, and in particular relates to an infrared communication circuit structure of a water meter and a low-power consumption infrared communication method of a water meter. Background Art
[0002] Infrared communication technology is a short-distance communication technology that uses infrared rays to transmit data and is widely used. Due to its low cost and reliable communication, it is widely used in NB or LoRa smart water meters as a human-machine interface for parameter configuration and short-distance transmission of small amounts of data. However, with the development of communication technology and the improvement of the intelligence level of water meters, higher requirements are placed on the speed and reliability of infrared communication technology. For example, when upgrading the program embedded in the water meter through the infrared communication interface, due to the large amount of program data, the communication can only use the standard low baud rate of 9600b / s, so it takes a long time and is inefficient; and because the transmission content is the water meter program, bit errors are not allowed, so the reliability of communication is very high. In the face of these new requirements, it is necessary to improve and optimize the existing infrared communication hardware composition and communication implementation methods to achieve infrared communication technology with lower cost, higher speed, higher reliability and lower power consumption.
[0003] Based on this, the applicant considered designing a water meter infrared communication circuit structure and a water meter low-power infrared communication method that can reduce hardware costs, increase communication speed, improve communication reliability, and reduce power consumption. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, the technical problem to be solved by the present invention is: how to provide a water meter infrared communication circuit structure and a water meter low-power infrared communication method that can reduce hardware cost, increase communication rate, improve communication reliability, and reduce power consumption.
[0005] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0006] The water meter infrared communication circuit structure includes an infrared transceiver diode (D1), a first transistor (Q5) and a second transistor (Q6) both of which are PNP type;
[0007] The emitter e of the first transistor (Q5) is electrically connected to the input voltage (VCC), the collector c of the first transistor (Q5) is connected in series with the first resistor (R14) and then grounded, and the base b of the first transistor (Q5) is connected in series with the second resistor (R15), the capacitor (C14) and the third resistor (R11) in sequence and then electrically connected to the infrared signal transmission output pin (IR_TXD) on the MCU in the main circuit board of the water meter;
[0008] The emitter e of the second triode (Q6) is electrically connected to the input voltage (VCC), the collector c of the second triode (Q6) is respectively connected in series with the base b of the first triode (Q5) and the fourth resistor (R13) and then grounded, and the base b of the second triode (Q6) is connected in series with the fifth resistor (R16) and then connected to the circuit between the second resistor (R15) and the capacitor (C14);
[0009] The infrared transceiver diode (D1) is connected in parallel with the voltage-stabilizing resistor (R12), and the input end of the parallel circuit is electrically connected to the input voltage (VCC), and the output end of the parallel circuit is connected to the circuit between the capacitor (C14) and the third resistor (R11);
[0010] Features:
[0011] The MCU has a comparator inside;
[0012] The collector c of the first transistor (Q5) is electrically connected to the positive input pin of the comparator, the reverse input pin of the comparator is electrically connected to a preset voltage, and the output pin of the comparator is electrically connected to an infrared signal receiving input pin (IR_RXD) on the MCU.
[0013] Compared with the prior art, the water meter infrared communication circuit structure of the present invention has the following advantages:
[0014] 1. Save hardware costs and improve the reliability of communication circuits
[0015] Compared with the existing circuit, the circuit structure in the present technical solution can eliminate the amplification and shaping circuit composed of two transistors (NPN), three resistors and one capacitor originally used to amplify and shape the communication signal, thereby helping to save hardware costs.
[0016] At the same time, the collector c of the first transistor (Q5) is directly electrically connected to the comparator of the MCU to process the communication signal, which makes full use of the idle resources of the MCU, reduces external amplification, shaping and other circuits, simplifies the circuit structure, and thus can further improve the overall reliability of the communication circuit.
[0017] 2. Can improve infrared communication rate and reliability
[0018] Compared with the amplification and shaping circuit previously used, this technical solution uses the MCU's built-in comparator to process the signal, which can obtain an ideal amplification and shaping signal output; based on the high-speed response capability of the comparator, the communication rate can be improved (from the original communication rate of no more than 9600b / s, it can be increased to a maximum of 115200b / s and normal communication can be achieved); using the DAC module built into the MCU, the comparison reference voltage VDAC of the reverse input terminal of the comparator can be easily adjusted through the program, and the hysteresis voltage of the comparator can also be adjusted through the program, which can improve the system's anti-interference ability, thereby improving the reliability of infrared communication.
[0019] The low-power infrared communication method for a water meter includes a step of detecting an infrared communication signal after waking up to determine whether an infrared communication signal exists: if so, entering a communication working mode; if not, going into sleep mode; characterized in that:
[0020] The step of detecting the infrared communication signal uses N 0x00s as the leading code for detecting the infrared communication signal, where N is an integer not less than 2000 (when the baud rate is 9600b / s) or not less than 18000 (when the baud rate is 115200b / s).
[0021] The prior art process of detecting infrared communication signals after the MCU is automatically awakened periodically is usually as follows: to detect whether an infrared communication signal exists, it is necessary to start receiving for at least 1 byte (8 bits for a single byte, plus 2 bits for the start bit and the stop bit, a total of 10 bits) and determine whether an infrared communication signal exists based on the received data. When the baud rate is 9600b / s (the infrared pulse width is 104uS), at least 1 byte, i.e. 10 bits, is received, and the minimum duration is 10*104uS=1040uS (about 1mS).
[0022] The principles and advantages of the low-power infrared communication method for water meters in this technical solution are:
[0023] N 0x00s are used as the leading code for detecting infrared communication signals, and the detection time is set to 3 bits (less than 10 bits). This greatly shortens the time it takes for the MCU to detect infrared communication signals after waking up. Because power consumption is proportional to time, power consumption can be reduced by shortening the time. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 The circuit diagram of the existing water meter infrared communication circuit structure
[0025] Figure 2 The circuit diagram of the water meter infrared communication circuit structure of the present invention is
[0026] Figure 3-1In order to adopt the water meter infrared communication circuit structure of the present invention, when the infrared communication baud rate is 9600b / s, the position is Figure 2 Waveform diagram at ① in the middle
[0027] Figure 3-2 In order to adopt the water meter infrared communication circuit structure of the present invention, when the infrared communication baud rate is 9600b / s, the position is Figure 2 Waveform diagram at point ②
[0028] Figure 3-3 In order to adopt the water meter infrared communication circuit structure of the present invention, when the infrared communication baud rate is 9600b / s, the position is Figure 2 Waveform diagram at point ③
[0029] Figure 4-1 In order to adopt the water meter infrared communication circuit structure of the present invention, when the infrared communication baud rate is 115200b / s, the position is Figure 2 Waveform diagram at ① in the middle
[0030] Figure 4-2 In order to adopt the water meter infrared communication circuit structure of the present invention, when the infrared communication baud rate is 115200b / s, the position is Figure 2 Waveform diagram at point ②
[0031] Figure 4-3 In order to adopt the water meter infrared communication circuit structure of the present invention, when the infrared communication baud rate is 115200b / s, the position is Figure 2 Waveform diagram at point ③
[0032] Figure 5 Flow chart of water meter circulation working mode
[0033] Figure 6 The waveform diagram of a single leading code in this technical solution
[0034] Figure 7 This is a flowchart of the specific operation process of detecting infrared signals in this technical solution.
[0035] Figure 1 and Figure 2 Marked as:
[0036] 100: Infrared serial transceiver
[0037] 200: Comparator DETAILED DESCRIPTION
[0038] The present invention will be further described in detail below in conjunction with the accompanying drawings.
[0039] like Figure 2 As shown:
[0040] The water meter infrared communication circuit structure includes an infrared transceiver diode (D1), a first transistor (Q5) and a second transistor (Q6) both of which are PNP type;
[0041] The emitter e of the first transistor (Q5) is electrically connected to the input voltage (VCC), the collector c of the first transistor (Q5) is connected in series with the first resistor (R14) and then grounded, and the base b of the first transistor (Q5) is connected in series with the second resistor (R15), the capacitor (C14) and the third resistor (R11) in sequence and then electrically connected to the infrared signal transmission output pin (IR_TXD) on the MCU in the main circuit board of the water meter;
[0042] The emitter e of the second triode (Q6) is electrically connected to the input voltage (VCC), the collector c of the second triode (Q6) is respectively connected in series with the base b of the first triode (Q5) and the fourth resistor (R13) and then grounded, and the base b of the second triode (Q6) is connected in series with the fifth resistor (R16) and then connected to the circuit between the second resistor (R15) and the capacitor (C14);
[0043] The infrared transceiver diode (D1) is connected in parallel with the voltage-stabilizing resistor (R12), and the input end of the parallel circuit is electrically connected to the input voltage (VCC), and the output end of the parallel circuit is connected to the circuit between the capacitor (C14) and the third resistor (R11);
[0044] The MCU has a comparator inside;
[0045] The collector c of the first transistor (Q5) is electrically connected to the positive input pin of the comparator, the reverse input pin of the comparator is electrically connected to a preset voltage, and the output pin of the comparator is electrically connected to an infrared signal receiving input pin (IR_RXD) on the MCU.
[0046] Wherein, the MCU is a chip of the EFM32TG series.
[0047] The EFM32TG series chips are low-power microcontrollers based on the ARM architecture with rich features and interfaces. They are currently widely used in metering, IoT terminals and smart terminals.
[0048] During implementation, a chip of type EFM32TG222 may be specifically used, which has two comparators and a digital-to-analog converter (DAC).
[0049] The preset voltage of the inverting input pin of the comparator is the analog output voltage (VDAC) of the digital-to-analog converter built into the MCU.
[0050] In this way, it is easy to conveniently adjust the input of the digital-to-analog converter through the MCU program, thereby adjusting the analog output voltage (VDAC) of the digital-to-analog converter accordingly, so as to better suppress the noise in the communication signal.
[0051] The above water meter infrared communication circuit structure has the following advantages:
[0052] 1. Save hardware costs and improve the reliability of communication circuits
[0053] Compared with the existing circuit, the circuit structure in the present technical solution can eliminate the amplification and shaping circuit composed of two transistors (NPN), three resistors and one capacitor originally used to amplify and shape the communication signal, thereby helping to save hardware costs.
[0054] At the same time, the collector c of the first transistor (Q5) is directly electrically connected to the comparator of the MCU to process the communication signal, which makes full use of the idle resources of the MCU, reduces external amplification, shaping and other circuits, simplifies the circuit structure, and thus can further improve the overall reliability of the communication circuit.
[0055] 2. Can improve the infrared communication rate and reliability (such as Figures 3-1 to 4-3 )
[0056] Compared with the amplification and shaping circuit previously used, this technical solution uses the MCU's built-in comparator to process the signal, which can obtain an ideal amplification and shaping signal output; based on the high-speed response capability of the comparator, the communication rate can be improved (from the original communication rate of no more than 9600b / s, it can be increased to a maximum of 115200b / s and normal communication can be achieved); using the DAC module built into the MCU, the comparison reference voltage VDAC of the reverse input terminal of the comparator can be easily adjusted through the program, and the hysteresis voltage of the comparator can also be adjusted through the program, which can improve the system's anti-interference ability, thereby improving the reliability of infrared communication.
[0057] like Figure 5 As shown, the cyclic working mode of the water meter is shown:
[0058] There are two links between waking up and sleeping: "detecting infrared communication signals" and "processing other matters". The shorter the time taken for these two links, the more power is saved (power consumption is proportional to the running time).
[0059] The low-power infrared communication method for a water meter includes a step of detecting an infrared communication signal after waking up to determine whether an infrared communication signal exists: if so, entering a communication working mode; if not, going to sleep;
[0060] The step of detecting the infrared communication signal uses N 0x00s as the leading code for detecting the infrared communication signal, where N is an integer not less than 2000 (when the baud rate is 9600b / s) or not less than 18000 (when the baud rate is 115200b / s).
[0061] The principles and advantages of the low-power infrared communication method for water meters in this technical solution are:
[0062] Set N 0x00s less than 10 bits as the leading code for detecting infrared communication signals, so that the time for detecting infrared communication signals after wake-up can be shortened. Because power consumption is proportional to time, power consumption can be reduced by shortening time.
[0063] Wherein, N is an integer not less than 2000 (when the baud rate is 9600 b / s) or not less than 18000 (when the baud rate is 115200 b / s).
[0064] The present technical solution preferably uses 2000 0x00 as the leading code when the baud rate is 9600b / s, and preferably uses 18000 0x00 as the leading code when the baud rate is 115200b / s. When the baud rate is 9600b / s and the modulated infrared pulse width is 1 / 16, the effective detection time of 2000 0x00 leading codes is only about 336uS (the receiving time of 3bit is about 312uS, which is close to the receiving time of 3bit at this time), which is significantly reduced compared with the shortest time (1040uS) required by the infrared communication signal detection method of the prior art, and the power consumption is reduced by about 70%, with a significant effect of reducing consumption.
[0065] like Figure 7 As shown: the low-power infrared communication method for water meters also includes a step of switching the baud rate of the serial port receiving infrared signal executed between the "step of detecting infrared communication signals" and the "step of entering the communication working mode", which step includes:
[0066] Set a low level counter for accumulating the number of low level occurrences, and,
[0067] Set a loop count counter for accumulating the number of loops;
[0068] Before the detection, the low level counter and the cycle counter are cleared to start the cycle detection; the cycle detection is: 2uS cycle M times to detect the infrared communication signal, M is a positive integer greater than or equal to 336uS / 2uS; during the cycle detection, read the serial port level value: if the serial port is low level, the low level counter +1; after one detection is completed, the cycle counter +1;
[0069] And when the cycle counter is less than M, continue to read the serial port level value; when the cycle counter is greater than or equal to M, and judge whether the low level counter is greater than 3: if the low level counter is less than or equal to 3, the detection ends and enters the sleep mode; if the low level counter is greater than 3, continue to judge whether the low level counter is greater than 10: if the level counter is greater than 10, set the serial port baud rate to 115200b / s and start the serial port reception to enter the communication working mode; if the level counter is less than or equal to 10, set the serial port baud rate to 9600b / s and start the serial port reception to enter the communication working mode.
[0070] The advantages of using the above "steps for switching the serial port receiving infrared signal rate" are:
[0071] 1. Able to adapt to two communication rates;
[0072] Based on the baud rate of the received infrared signal, a matching and appropriate receiving serial port baud rate is selected to ensure smooth communication.
[0073] 2. It can avoid interference from interfering signals (such as those caused by sunlight or flashlight), and better ensure that it enters sleep mode in time when no effective infrared communication signal is detected, thus saving power consumption.
[0074] The above are only preferred implementations of the present invention. It should be pointed out that a number of modifications and improved technical solutions made by those skilled in the art without departing from the technical solution should also be deemed to fall within the scope of protection required by the claims.
Claims
1. The infrared communication circuit structure of the water meter includes an infrared transceiver diode (D1), a first transistor (Q5) and a second transistor (Q6) both of which are PNP type; The emitter e of the first transistor (Q5) is electrically connected to the input voltage (VCC), the collector c of the first transistor (Q5) is connected in series with the first resistor (R14) and then grounded, and the base b of the first transistor (Q5) is connected in series with the second resistor (R15), the capacitor (C14) and the third resistor (R11) in sequence and then electrically connected to the infrared signal transmission output pin (IR_TXD) on the MCU in the main circuit board of the water meter; The emitter e of the second triode (Q6) is electrically connected to the input voltage (VCC), the collector c of the second triode (Q6) is respectively connected in series with the base b of the first triode (Q5) and the fourth resistor (R13) and then grounded, and the base b of the second triode (Q6) is connected in series with the fifth resistor (R16) and then connected to the circuit between the second resistor (R15) and the capacitor (C14); The infrared transceiver diode (D1) is connected in parallel with the voltage-stabilizing resistor (R12), and the input end of the parallel circuit is electrically connected to the input voltage (VCC), and the output end of the parallel circuit is connected to the circuit between the capacitor (C14) and the third resistor (R11); Features: The MCU has a comparator inside; The collector electrode c of the first transistor (Q5) is electrically connected to the positive input pin of the comparator, the reverse input pin of the comparator is electrically connected to a preset voltage, and the output pin of the comparator is electrically connected to an infrared signal receiving input pin (IR_RXD) on the MCU; The MCU is a chip of the EFM32TG series; The preset voltage of the reverse input pin of the comparator is the analog output voltage (VDAC) of the digital-to-analog converter built into the MCU.
Citation Information
Patent Citations
Water meter infrared communication circuit structure
CN218416370U