A direct-reading water meter based on Hall sensor coding and its implementation method
By using the alternating layout of multi-Hall sensors and magnetic pole rings in smart water meters, combined with the main control chip and register chip, accurate collection and transmission of water meter flow is achieved, which solves the problem of insufficient anti-interference ability and photoelectricity of existing water meter signal collection. The interference problem of the direct reading method improves the reliability and durability of the equipment.
Patent Information
- Application Number
- CN202011033737.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-27
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2040-09-27
AI Technical Summary
Existing smart water meters have problems with insufficient anti-interference ability in signal collection, poor anti-interference ability of the processor, and the photoelectric direct reading method is affected by sunlight and air bubbles, resulting in low reliability and durability.
Multi-Hall sensors are used for signal collection. Through the combination of the main control chip and the register chip, and the alternating layout of the Hall sensors and magnetic pole rings, accurate readings of the water meter flow are collected and stored, and the data is transmitted through the RS485 bus.
It improves the signal detection stability and anti-interference ability of the water meter, reduces power consumption, solves the problem of bubbles and sunlight interference in the photoelectric direct reading method, and achieves more reliable and durable water meter flow collection.
Smart Images

Figure CN112197824B
Abstract
Description
Technical Field
[0001] The present invention relates to a new water meter flow sampling method, in particular to a direct-reading water meter based on Hall sensor coding and an implementation method thereof, belonging to the technical field of intelligent water meters. Background Art
[0002] With the rapid development of technologies such as 5G, the Internet of Things, and big data, water, electricity, and gas meters are connected to the Internet, and WeChat push notifications make it possible to view water consumption in real time. In addition to the various communication methods, the current smart water meters also have various sampling principles, including pulse sampling meters, passive photoelectric direct reading meters, and non-magnetic sampling meters. In the early pulse meters, many smart water meter manufacturers were unable to solve problems such as processor anti-interference ability, interference signal filtering, and software processing methods, so they launched passive photoelectric direct reading meters. The advantage is that they do not need to be powered on at ordinary times. After power-on, they can read the level of the infrared photoelectric tube according to the level of the infrared photoelectric tube. The state of the water meter is used to determine the position of the water meter wheel. This method is applied to dry water meters. The infrared transmitting tube and the photoelectric receiving tube are very close. Through the opening on the wheel, the flow value of the water meter can be easily identified. However, dry water meters are difficult to waterproof and sunlight affects the receiving voltage of the photoelectric receiving tube. When the photoelectric direct reading sampling method is applied to wet water meters, the influence of sunlight can be ignored, but there are other problems. There are bubbles in the water. When the bubbles are between the infrared transmitting and photoelectric receiving devices, the infrared light cannot be directly projected onto the photoelectric tube, resulting in reading errors. After the bottleneck of the development of passive photoelectric direct reading water meters, non-magnetic water meters that require battery power have now appeared. This type of water meter has problems such as short sampling distance and occlusion of the water meter wheel.
[0003] With the development of Hall technology, the current Hall device can be as small as 1*1.4 mm and as thin as 0.4 mm. When powered by 3 volts, the static current is only 1.5 microamperes. Hall devices are small in size, low in power consumption, and stable in signal detection. Using Hall devices instead of photoelectric sensors to realize direct reading of water meters is a good method. Summary of the invention
[0004] The technical problem to be solved by the present invention is: in view of the current industry difficulties of direct-reading water meters, reliability and durability need to be improved urgently. A direct-reading water meter based on Hall sensor coding and its implementation method are proposed, which adopts multiple Hall sensors for signal acquisition, effectively solving the problems of low consumption, ultra-small and strong anti-interference.
[0005] The solution to the technical problem of the present invention is: a direct-reading water meter based on Hall sensor coding, including a main circuit board, and multiple sampling pieces, multiple character wheels, a main control chip U2, a power chip U1, a communication chip U4 and a register chip U5 installed on the main circuit board, the sampling pieces and the character wheels are arranged vertically in pairs on the main circuit board, and the two are evenly spaced, the data interface of the sampling piece is led to the main control chip U2, the main control chip U2 forms an interrupt according to the soft timing to regularly collect the level on each data interface, and at the same time converts the level into a corresponding numerical value, and combines to form a water meter flow reading, the flow reading is stored in the register chip U5 in a write bus manner, the power chip U1 provides power for the main control chip U2, the communication chip U4 and the register chip U5, and the communication chip U4 realizes the communication between the main control chip U2 and the external device.
[0006] Preferably, the sampling sheet is a semicircular structure, and the straight end is welded on the main circuit board. A plurality of sampling elements with Hall sensors are evenly spaced on the sampling sheet, and the plurality of sampling elements are located on a semicircular line with the same radius. Each sampling element has a data interface connected to the main control chip U2. A magnetic pole ring is arranged on the character wheel on a circular ring with the same radius as the semicircle where the sampling element is located, and the S and N poles in the magnetic pole ring are alternately arranged to provide a corresponding magnetic field to the Hall sensor.
[0007] Preferably, the sampling element adopts a DRV5012 Hall sensor, and the magnetic poles are attached to the character wheel in three pairs of S and N poles with a magnetic field distributed in a ratio of 8:2:5:8:2:5, and the magnetic pole layout is related to the Hall sensor layout.
[0008] Preferably, the sampling chip outputs the corresponding level for the magnetic pole sensed by the magnetic pole ring on the character wheel; when the S pole approaches the top of the chip and exceeds the BOP threshold, it will continue to output a low level until the N pole approaches and exceeds the BRP threshold, and then continue to output a high level, and repeat the sampling process; the main control chip U2 uses an internal crystal oscillator and a soft timing method to sample the level output by each sampling element on the sampling chip, and the main control chip U2 obtains the real value corresponding to the sampling element through numerical conversion, and the real value combination of each sampling element obtains the flow value; the collected flow value is sent to the register chip U5 through the bus by the main control chip U2 according to the storage timing time. When data transmission is required, the external editor inputs the instruction code, and the main control chip parses the instruction and packages the data for transmission according to the function code content.
[0009] Preferably, the level output by the sampling element on each sampling chip is a binary value, which is converted into a hexadecimal value by the main control chip U2, and then searched in a pre-set code data table according to the hexadecimal value. The code data table stores the correspondence between the hexadecimal value and the decimal value, so as to obtain the real value corresponding to the sampling element.
[0010] Preferably, the main control chip U2 and the external editor adopt the remote response trigger mode to transmit instructions. In the absence of external instructions, the main control chip U2 does not send signals to the outside through the communication chip U4. Only when the external editor sends the following instruction format: 3-byte encoding + 1-byte function code + 2-byte CRC check, the main control chip first determines whether the encoding is the identification of this water meter. If the same, it will verify the data through CRC. If it is correct, it will be processed according to the content of the function code.
[0011] Preferably, the function code includes three cases: one is 01, which is used to obtain real-time data, which can be used to check the device status or troubleshoot; one is 02, which is used to obtain all information stored in the register, which can be used for data analysis and mining; and one is 03, which clears the register data.
[0012] Preferably, after the main control chip U2 receives the instruction code from the external editor, if the parsing is correct, it prepares data according to the function code, and the transmission frame format is 3-byte code + 1-byte function code + n-byte data + 2-byte CRC check. When the function code is 01, the instruction sent is 3-byte code + 1-byte function code + 5-byte data + 2-byte CRC check, where the data is arranged in order of the bits. When the function code is 02, the instruction sent is 3-byte code + 1-byte function code + 20-byte data + 2-byte CRC check. The data is extracted from the register and sorted from low to high according to the address until all the data is extracted. When the function code is 03, the register data is cleared.
[0013] The beneficial effects of the present invention compared with the prior art are as follows:
[0014] The present invention adopts 5 Hall sensors to form a sampling piece, and the sampling piece is used as a sampling element to realize effective data collection of a wheel with a special magnetic pole. Each sampling piece outputs 5 groups of levels to form a group of codes. The 0-9 readings of the corresponding digits are obtained by querying the code type data table, and the readings of all digits can be obtained by combination, that is, the real flow of the direct-reading water meter is obtained; the obtained real flow is divided into 5 bytes according to the time sequence and stored in the register, which can be used for data transmission and user water consumption data analysis; when data transmission is required, the RS485 bus is used to perform specific data transmission according to the function code requirements, and the transmission data contains a water meter identification, which is convenient for locating the user; all collection, storage and transmission are completed by a single-chip microcomputer processing chip, and the peripheral devices are all low-consumption devices, which ensures the low power consumption of the entire reading device.
[0015] The present invention solves the bubble problem and sunlight interference problem existing in the currently widely used photoelectric direct-reading water meters, adopts ultra-low power consumption sampling components, and is suitable for various smart water meters with strict requirements on working current.
[0016] The present invention can directly replace the original photoelectric direct reading meter, and only needs to make simple modifications on the character wheel, and other molds do not need to be modified, which greatly saves the time and cost of mold opening.
[0017] The invention solves the problems existing in photoelectric direct-reading meters and is an upgrade solution for photoelectric direct-reading water meters. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is an overall layout diagram of the method for realizing the direct-reading water meter based on Hall sensor coding of the present invention.
[0019] Figure 2 for Figure 1 Layout diagram of the sampling piece of the present invention.
[0020] Figure 3 for Figure 2 The schematic diagram of the Hall sensor sampling chip of the present invention.
[0021] Figure 4 for Figure 1 The magnetic pole layout diagram of the character wheel of the present invention.
[0022] Figure 5 for Figure 1 Schematic diagram of the main control chip.
[0023] Figure 6 for Figure 1 Schematic diagram of the register.
[0024] Figure 7 for Figure 1 RS485 bus schematic diagram.
[0025] Figure 8 for Figure 1 Power supply schematic diagram.
[0026] Fig. 9 This is the remote transmission frame format of the method for implementing the direct-reading water meter based on Hall sensor coding of the present invention.
[0027] Fig.10 The processing flow chart of the method for implementing the direct reading water meter based on Hall sensor coding of the present invention is as follows
[0028] Fig.11 for Figure 2 Code pattern diagram of the sampling slice of the present invention.
[0029] Fig.12 for Fig.11 Corresponding code conversion table.
[0030] Among them: A, sampling chip; F, character wheel; U2, main control chip; U1, power chip; U4, communication chip; U5, register chip. DETAILED DESCRIPTION
[0031] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0032] This example is a direct-reading water meter implementation method based on Hall sensor encoding. The overall method of using Hall sensor + character wheel induction degree to obtain the real water volume of the water meter, wherein the Hall sensor is a sampling element, and the specific sampling element is DRV5012. Five DRV5012s are evenly arranged in a semicircular ring to form a sampling piece; a magnetic pole is arranged in a circle on the character wheel with the same radius as the semicircular ring layout of the sampling piece Hall sensor, and the S and N poles are alternately changed to provide the Hall sensor with a corresponding magnetic field; the five sampling pieces are vertically welded on the main circuit board, and the data interface is led to the main processing chip LPC824. LPC824 forms an interrupt according to soft timing to regularly collect the level of each interface (corresponding to the output of 5 DRV5012 on the sampling piece), convert each bit value, and combine to form a water meter flow reading; the flow data is sorted according to the number of bits to form a group of real readings, which are stored in the MB85RC16 register in the form of writing iic bus; when data transmission is required, the RS485 field bus is used to read the value in real time or from the register in frame format.
[0033] Reference Figure 1 The direct-reading water meter implementation method based on Hall sensor coding adopts horizontal and vertical layouts in the circuit. The main circuit is placed horizontally in a semicircular structure. The sampling piece is arranged perpendicular to the main circuit at a certain interval. The lower pin of the sampling piece is welded on the main circuit. The character wheel and the sampling piece appear in pairs. The magnetic pole layout is related to the Hall sensor layout. The magnetic pole of the character wheel provides an induction source for the sampling piece. The sampling piece induction signal pin is output to the main circuit board and connected to the main control chip U2 according to the circuit board lead. U2 is the brain of the main circuit, commanding the U4 communication chip and the U5 register chip. These chips are uniformly provided with a reference voltage by the U1 power chip. After the main circuit is powered on, the D1 indicator light is on, and the external data interface is undertaken by J1.
[0034] Reference Figure 1 , 2, 3, 4, the direct reading water meter implementation method based on Hall sensor encoding, the sampling piece A and the character wheel F appear in pairs, the control principle of the DRV5012 Hall sensor is: when the S pole is close to the top of the chip and exceeds the BOP threshold, it will continue to output a low level until the N pole is close to and exceeds the BRP threshold, and then continue to output a high level, and the sampling is cyclical; the five DRV5012 Hall sensors on the sampling piece A are evenly distributed on a semicircular ring of the sampling piece, and can sense the level of the corresponding magnetic pole when the character wheel F rotates. The magnetic pole of the character wheel F is also distributed in a circular ring with the same radius as the semicircular ring formed by DRV5012, and the S and N poles are arranged alternately, with a ratio of 8:2:5:8:2:5. The S and N pole magnets are bonded to the character wheel in a pasting manner. The S and N pole magnets are specially customized and can be as close to the outside as possible within a limited range to ensure the distance between the corresponding Hall sensors and improve the output stability and anti-interference ability.
[0035] Reference Figure 3 , 5 , 6, 7, 8, 10, the schematic diagram of the circuit board module, the DRV5012 circuit principle of the sampling chip is very simple, only a filter capacitor is added between the power supply and the ground, and it will automatically sample at a frequency of 20Hz after power-on, and output the corresponding level according to the induced magnetic pole; the 5 DRV5012 outputs of each sampling chip are respectively introduced into the U2 main control chip, and the U2 main control chip uses the internal crystal oscillator method and the soft timing method to sample these 5 levels, that is, the internal timer function is used, and the sampled value is searched in the code data table to obtain the real value of the bit, and the 5-bit combination can get the flow value; the collected data is sent to the U4 communication chip MB85 through the II2 bus by the U2 main control chip according to the storage timing. In the RC16 register, the binary values obtained by the 5 sampling chips are converted into hexadecimal and stored in 5 corresponding addresses in the order of ten thousand, thousand, hundred, ten and unit, each occupying 5 bytes; when data transmission is required, the external editor inputs the instruction code, the main control chip parses the instruction and packages the data for transmission according to the function code content, the physical interface is RS485, which is a universal field bus, and after some conversion modules, it can be easily changed into wifi, radio frequency, Internet of Things and other forms, with very strong scalability; the external power supply is a 9V battery, which outputs 3.3V DC through the voltage regulator chip HT7533 to power all chips; the entire circuit board devices are low-consumption chips, ensuring the low-consumption characteristics of the entire device.
[0036] Reference Fig. 9 , 10The remote transmission instruction format and the device adopt the response trigger mode, that is, in the absence of external instructions, the main control chip does not send signals to the outside through the communication chip. Only when the external editor sends the following instruction format: 3byte code + 1byte function code + 2byteCRC check, the main control chip first determines whether the code is the water meter identification, and then verifies the data through CRC if it is the same. After it is correct, it is processed according to the content of the function code. There are 3 function codes, one is 01, which is used to obtain real-time data (real-time sampling data), which can be used to check the equipment status or troubleshooting; one is 02, which is used to obtain all the information stored in the register, which can be used for data analysis, mining and other work; one is 03, which clears the register data. After the main control chip receives the instruction code, if the parsing is correct, it prepares data according to the function code. The transmission frame format is 3-byte code + 1-byte function code + n-byte data + 2-byte CRC check. When the function code is 01, the instruction is 3-byte code + 1-byte function code + 5-byte data + 2-byte CRC check, where the data is arranged in order of the bits. When the function code is 02, the instruction is 3-byte code + 1-byte function code + 20-byte data + 2-byte CRC check. The data is extracted from the register and sorted from low to high according to the address until all the data is extracted. When the function code is 03, the register data is cleared.
[0037] Reference Fig.11 , 12 , the Hall sensor encoding calculation, in the actual operation of the character wheel F, as the water wheel rotates, driven by the transmission structure, the character wheel also rotates, that is, the S and N magnetic poles on the character wheel rotate relative to the sampling piece position, resulting in changes in the output levels of the 5 sensors of the sampling piece, such as Fig.11 Through these 5 sets of level diagrams, the following is formed Fig.12 The code comparison table shown in the figure shows that when the single-chip LPC284 samples according to the sampling timing, the binary value of the port is converted into hexadecimal, and the number of digits is obtained by searching in the code comparison table. By analogy, all digits can be obtained, and the combination can be used to obtain the actual water meter usage. For example, the single-chip microcomputer collects 11111 at a sampling port, which is 1F in hexadecimal. By looking up the table, 1F corresponds to the number 7, so the changed digit value is 7.
[0038] In addition to the above embodiments, the present invention also includes other implementation modes. Any technical solutions formed by equivalent transformation or equivalent replacement should fall within the protection scope of the claims of the present invention.
Claims
1. A direct-reading water meter based on Hall sensor coding, characterized in that: It includes a main circuit board, and multiple sampling pieces, multiple character wheels, a main control chip U2, a power chip U1, a communication chip U4 and a register chip U5 installed on the main circuit board. The sampling pieces and the character wheels are arranged vertically on the main circuit board in pairs, and the two are evenly spaced. The data interface of the sampling piece is led to the main control chip U2. The main control chip U2 forms an interrupt according to the soft timing to regularly collect the level on each data interface, and at the same time converts the level into a corresponding numerical value, which is combined to form a water meter flow reading. The flow reading is stored in the register chip U5 in a write bus mode. The power chip U1 provides power for the main control chip U2, the communication chip U4 and the register chip U5. The communication chip U4 realizes the communication between the main control chip U2 and the external device; The sampling sheet is a semicircular structure, and the straight end is welded on the main circuit board. A plurality of sampling elements with Hall sensors are evenly spaced on the sampling sheet. The plurality of sampling elements are located on a semicircular line with the same radius. Each sampling element has a data interface connected to the main control chip U2. A magnetic pole ring is arranged on the character wheel on a circular ring with the same radius as the semicircle where the sampling element is located. The S and N poles in the magnetic pole ring are alternately arranged to provide a corresponding magnetic field to the Hall sensor. The sampling element adopts a DRV5012 Hall sensor, and the magnetic poles are attached to the character wheel in three pairs of S and N poles with a magnetic field distributed in a ratio of 8:2:5:8:2:5, and the layout of the magnetic poles is related to the layout of the Hall sensor; The sampling chip outputs the corresponding level for the magnetic pole sensed by the magnetic pole ring on the character wheel; when the S pole approaches the top of the chip and exceeds the BOP threshold, it will continue to output a low level until the N pole approaches and exceeds the BRP threshold, and then continue to output a high level, and repeat the sampling cycle; the main control chip U2 uses an internal crystal oscillator and a soft timing method to sample the level output by each sampling element on the sampling chip. The main control chip U2 obtains the real value corresponding to the sampling element through numerical conversion, and the real value combination of each sampling element obtains the flow value; the collected flow value is sent to the register chip U5 through the bus by the main control chip U2 according to the storage timing time. When data transmission is required, the external editor inputs the instruction code, and the main control chip parses the instruction and packages the data for transmission according to the function code content; The main control chip U2 and the external editor adopt the remote response trigger mode to transmit instructions. In the absence of external instructions, the main control chip does not send signals to the outside through the communication chip U4. Only when the external editor sends the following instruction format: 3byte code + 1byte function code + 2byte CRC check, the main control chip first determines whether the code is the water meter identification, and then verifies the data through CRC if it is the same. If it is correct, it will be processed according to the content of the function code; The function code includes three cases: one is 01, which is used to obtain real-time data and can be used to check the device status or troubleshoot; One is 02, which is used to obtain all the information stored in the register, which can be used for data analysis and mining; the other is 03, which clears the register data; After the main control chip U2 receives the instruction code from the external editor, it prepares data according to the function code if the parsing is correct, and the transmission frame format is 3-byte code + 1-byte function code + n-byte data + 2-byte CRC check. When the function code is 01, the instruction sent is 3-byte code + 1-byte function code + 5-byte data + 2-byte CRC check, where the data is arranged in order of the number of bits. When the function code is 02, the instruction sent is 3-byte code + 1-byte function code + 20-byte data + 2-byte CRC check. The data is extracted from the register and sorted from low to high according to the address until all the data is extracted. When the function code is 03, the register data is cleared.
2. The method for realizing a direct-reading water meter based on Hall sensor coding according to claim 1 is characterized in that: The level output by the sampling element on each sampling chip is a binary value, which is converted into a hexadecimal value by the main control chip U2, and then searched in the pre-set code data table according to the hexadecimal value. The code data table stores the correspondence between the hexadecimal value and the decimal value, so as to obtain the actual value corresponding to the sampling element.
Citation Information
Cited By
Signal acquisition and transmission structure for water metering values
CN123086546A
