Low-cost voltage type wind direction sensor fault detection device

By designing a low-cost fault detection device for voltage-type wind direction sensors, and utilizing the STC8H4K64TLCD microcontroller and integrated circuits, combined with rotation detection and standard value detection algorithms, the problem of fault detection for voltage-type wind direction sensors was solved, achieving efficient and accurate fault location and convenient maintenance solutions.

CN121454089APending Publication Date: 2026-02-03FUJIAN ATMOSPHERIC DETECTION TECH SUPPORT CENT +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511568768.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-30
Publication Date
2026-02-03

AI Technical Summary

Technical Problem

Existing technologies lack low-cost, low-power voltage-type wind direction sensor fault detection tools, which affects the accuracy of wind direction data and makes it difficult to meet the equipment support needs of grassroots meteorological departments.

Method used

Design a low-cost voltage-type wind direction sensor fault detection device. It uses the STC8H4K64TLCD microcontroller from Hongjing Technology as the core, integrating a 12-bit ADC, RTC module, EEPROM module and LCD driver. Combined with voltage acquisition module, fault detection module, display module and power supply module, fault judgment is achieved through rotation detection and standard value detection algorithms.

Benefits of technology

It achieves low-cost and low-power fault detection, improves the accuracy and convenience of sensor fault location, extends the service life of sensors, and is suitable for the on-site maintenance needs of grassroots meteorological departments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121454089A_ABST
    Figure CN121454089A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of meteorological observation equipment fault detection, and discloses a low-cost voltage type wind direction sensor fault detection device aiming at the requirements of a meteorological department on field check and maintenance of a voltage type wind direction sensor. According to the device, a single chip microcomputer serves as a core, high-precision acquisition of output voltage of a sensor and internal Gray code bit signal voltage of the sensor is achieved through an internal 12-bit ADC and a peripheral circuit (including a voltage follower and an RC filter) of the single chip microcomputer, and the measurement precision is improved by combining linear fitting of a least square method; through a fault detection algorithm combining rotation detection and standard value detection, rapid detection and positioning of faults are realized. The device utilizes internal resources of the single-chip microcomputer to drive the segment code liquid crystal screen to display states and record real-time time and detection data, has the characteristics of low cost and low power consumption, can accurately identify various faults according to tests, and is suitable for sensor maintenance of basic meteorological departments.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the technical field of meteorological observation equipment fault detection, in particular to a low-cost voltage type wind direction sensor fault detection device. BACKGROUND

[0002] Wind direction is a key element of meteorological observation and plays an important role in weather forecasting, climate monitoring and atmospheric pollution monitoring. At present, most of the national stations in China use Gray code type wind direction sensors, and the related fault detection research is relatively rich. However, the regional stations widely use analog voltage output type wind direction sensors, but there are few special tools for fault detection and positioning research.

[0003] The voltage type wind direction sensor is a commonly used wind direction sensor in the business of the meteorological department, and the fault of the voltage type wind direction sensor will directly affect the accuracy of the wind direction data and bring hidden dangers to the meteorological observation. In the prior art, there is a lack of special and low-cost detection tools for the on-site verification and maintenance of the voltage type wind direction sensor, and therefore a low-cost and low-power fault detection system based on a domestic single-chip microcomputer needs to be designed to meet the equipment support needs of the grass-roots meteorological departments. SUMMARY

[0004] The application provides a low-cost voltage type wind direction sensor fault detection device to solve the problems in the background art.

[0005] The specific technical scheme is as follows: A low-cost voltage type wind direction sensor fault detection device comprises a single-chip microcomputer, a voltage acquisition module, a fault detection module, a display module, a data storage module and a power supply module. The single-chip microcomputer serves as a core control unit and is electrically connected with the voltage acquisition module, the fault detection module, the display module, the data storage module and the power supply module. The voltage acquisition module is used for acquiring the output voltage of the voltage type wind direction sensor and the voltage of the internal Gray code bit signal of the sensor. The fault detection module is used for judging whether the sensor has a fault and positioning the fault type according to the voltage value acquired by the voltage acquisition module through a preset fault detection algorithm. The display module is used for displaying the detection state, fault information and real-time time of the sensor in real time. The data storage module is used for recording the detection data, real-time time and fault information. The power supply module provides working voltage for each module of the device.

[0006] The low-cost voltage type wind direction sensor fault detection device, wherein the single-chip microcomputer can adopt STC8H4K64T LCD model of 8051 single-chip microcomputer of Macrocrystal Technology, the single-chip microcomputer is integrated with 12-bit ADC, RTC module, EEPROM module and LCD driver; the 12-bit ADC is used for analog-digital conversion of the voltage signal input by the voltage collection module, the RTC module is used for providing real-time time, the EEPROM module constitutes the data storage module, and the LCD driver is used for driving the display module.

[0007] The low-cost voltage type wind direction sensor fault detection device, wherein the voltage collection module comprises a voltage follower, an RC filter and a voltage division network; the voltage follower adopts a GS8334 operational amplifier, an input end of the voltage follower is connected with a voltage output end or a Gray code bit signal output end of the sensor, and an output end is sequentially connected with the RC filter and the voltage division network to an ADC input end of the single-chip microcomputer; the voltage division network is used for reducing the voltage of the Gray code bit signal output to within a reference voltage of 2.5V.

[0008] The low-cost voltage type wind direction sensor fault detection device, wherein the voltage collection module comprises 8 voltage collection channels, one of which is used for collecting the wind direction output voltage of the sensor, and the other 7 are used for collecting the voltages of the 7-bit Gray code bit signals inside the sensor; the 8 voltage collection channels share 8 operational amplifiers.

[0009] The low-cost voltage type wind direction sensor fault detection device, wherein the fault detection algorithm comprises rotation detection and standard value detection. The rotation detection comprises the following steps: S1. detecting whether the sensor has voltage output, if the output voltage is continuously 0V, it is determined that the power supply circuit is faulty (fault code E11); S2. if there is voltage output, it is judged whether the deviation of the voltage value from a preset wind direction voltage comparison table is within the allowable range, if the deviation exceeds the range, it is determined that the operational amplifier circuit or the reference voltage source is abnormal (fault code E21); S3. if the deviation is normal, it is detected whether all wind direction values are output during the rotation of the sensor, if there is an intermediate wind direction value that is not detected, it is determined that the Gray code bit signal is abnormal (fault code E31); if there is a small wind direction value that is not detected, it is determined that the operational amplifier circuit or the reference voltage source inside the sensor is abnormal (fault code E32); if there is a large wind direction value that is not detected, it is determined that the operational amplifier circuit or the reference voltage source inside the sensor is abnormal (fault code E33); The standard value detection comprises the following steps: T1. Fix the sensor at preset standard wind direction angle, the standard wind direction angle includes at least three of 0°, 45°, 90°, 135°, 180°, 225°, 270°, 315°, collect the voltage signal output corresponding position sensor and the gray code bit signal voltage of sensor internal circuit; T2. Determine whether the high and low level of gray code bit signal voltage is within the error allowable range, if abnormal, mark the corresponding gray code bit (Gn, n=0~6); T3. Compare the consistency of gray code value and wind direction voltage comparison table, if inconsistent, mark the corresponding abnormal bit (Gn, n=0~6).

[0010] The low-cost voltage type wind direction sensor fault detection device, wherein the display module adopts a low-power segment code liquid crystal screen, the segment code liquid crystal screen is driven by the LCD driver in the single-chip microcomputer, and is used for displaying real-time time, voltage value, wind direction value, fault code and warning symbol.

[0011] The low-cost voltage type wind direction sensor fault detection device, wherein the RTC module is connected with a 32.768 kHz crystal oscillator and a CR1220 button cell, the button cell is connected with an external power supply circuit through a diode, automatic switching between external power supply and button cell is realized, and uninterrupted power supply of the RTC module is ensured.

[0012] The low-cost voltage type wind direction sensor fault detection device, wherein the power supply module includes a RY8411 power supply chip, the power supply chip converts external 12V voltage into 5V voltage for power supply of the device; the power supply module further includes a voltage division detection circuit, the voltage division detection circuit is composed of resistors R22 and R23, and is used for detecting whether there is external power supply voltage to determine whether there is external power supply; when there is no external power supply, the single-chip microcomputer is controlled to enter a low-power mode.

[0013] The low-cost voltage type wind direction sensor fault detection device, wherein the low-cost voltage type wind direction sensor fault detection device further includes a buzzer module, the buzzer module is connected with an IO port of the single-chip microcomputer, and is used for fault prompt: output a long buzzing signal when the detection result is normal, and output a short buzzing signal when the detection result is abnormal.

[0014] The low-cost voltage type wind direction sensor fault detection device, wherein voltage calculation adopts a least square method linear fitting algorithm, a fitting formula is y=(6097×x - 4190) / 10000, wherein x is an ADC reading, y is a converted voltage value (mV), and the fitting formula is obtained through 16 groups of standard voltages uniformly distributed in 0~2.5V; The low-cost voltage type wind direction sensor fault detection device, wherein the wind direction voltage table predefines two arrays: a voltageTable array and an angleTable array, both containing 128 elements (the specific values can be obtained by referring to the sensor data manual); the voltageTable array stores voltage values corresponding to 0°-357°, and the angleTable array stores corresponding angle values; the corresponding wind direction angle and deviation value are obtained by matching the collected voltage value in the voltageTable array through a binary search algorithm.

[0015] The application has the following beneficial effects: 1. Low cost and low power consumption: domestic single-chip microcomputer is used, and internal resources (ADC, RTC, LCD driver, etc.) are fully utilized to reduce external components and hardware cost; low-power segment code liquid crystal screen, automatic low-power mode design, prolong the use time without power supply, suitable for portable scene.

[0016] 2. High precision detection: voltage follower is used to avoid sensor circuit interference, RC filter is used for noise reduction, and least square method is used for fitting correction to improve voltage measurement accuracy; 12-bit ADC uses multiple sampling average algorithm to further optimize data reliability, providing accurate basis for fault judgment.

[0017] 3. Comprehensive and accurate fault positioning: combination of rotation detection and standard value detection can quickly and preliminarily judge the fault range and accurately locate the specific fault point (such as gray code bit signal anomaly), covering power supply, operational amplifier, gray code and other types of faults, meeting the accurate needs of on-site maintenance.

[0018] 4. Convenient and practical: segment code liquid crystal screen displays key information in real time, buzzer sound prompt, intuitive operation; EEPROM records detection data and time for easy trace analysis; compact size, suitable for on-site carrying and operation by grassroots meteorological department personnel, improving sensor maintenance efficiency, reducing replacement cost and prolonging sensor service life. BRIEF DESCRIPTION OF DRAWINGS

[0019] Figure 1 It is a structure block diagram of the low-cost voltage type wind direction sensor fault detection device; Figure 2 It is a minimum system circuit diagram of the single-chip microcomputer; Figure 3 It is a 12V to 5V power supply circuit diagram; Figure 4 It is a display content schematic diagram of the segment code liquid crystal screen; Figure 5 It is a wind direction sensor voltage acquisition circuit diagram; Figure 6 It is a main program flow chart; Figure 7 Flow chart for ADC reading and voltage conversion Figure 8 Schematic diagram for voltage sampling point and fitting curve Figure 9 Flow chart for rotation detection Figure 10 Flow chart for standard value detection DETAILED DESCRIPTION

[0020] The technical solutions of the present application will be further described below in combination with the drawings and through specific embodiments.

[0021] In the drawings, only for exemplary illustration, the representations are only schematic diagrams, not physical diagrams, and cannot be understood as limitations of the present application; in order to better illustrate the embodiments of the present application, some components in the drawings will be omitted, enlarged or reduced, and do not represent the size of the actual product; for those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings can be omitted.

[0022] In the drawings of the embodiments of the present application, the same or similar reference numerals correspond to the same or similar components; in the description of the present application, it should be understood that if the terms "upper", "lower", "left", "right", "inner", "outer" and the like indicate the orientation or positional relationship shown in the drawings, only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, therefore the terms describing the positional relationship in the drawings are only for exemplary illustration, and cannot be understood as limitations of the present application, for those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.

[0023] In the description of the present application, unless otherwise explicitly specified and limited, if the term "connection" and the like appear to indicate the connection relationship between components, the term should be broadly understood, for example, it can be fixedly connected, or it can be detachably connected, or it can be integrated; it can be mechanically connected, or it can be electrically connected; it can be directly connected, or it can be indirectly connected through an intermediate medium; it can be the internal communication of two components or the interaction relationship between two components. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances. EMBODIMENT

[0024] REFERENCE Figures 1-10 , wherein: Figure 1The structural block diagram of the low-cost voltage type wind direction sensor fault detection device shows the overall composition of the device and the connection relationship of each module. The block diagram takes a single-chip microcomputer as the core control unit. The single-chip microcomputer is connected with PC end software (through UART), RTC module (with 32.768 kHz crystal oscillator), LCD driver (connected with segment code liquid crystal screen), power supply module, buzzer module, ADC module and voltage acquisition module, and clearly presents the cooperative working architecture of each functional module. Figure 2 The single-chip microcomputer minimum system circuit diagram shows the peripheral circuit design of the STC8H4K64T LCD single-chip microcomputer of Macro Crystal Technology in detail. The 32.768 kHz crystal oscillator provides a clock source for the RTC. The CR1220 button cell (B1) cooperates with D4 and D5 to realize automatic power supply switching to ensure uninterrupted power supply for the RTC. The voltage division network composed of R22 and R23 is used to detect the external power supply state. The TL431 provides a 2.5 V accurate reference voltage to the internal ADC. The connection mode of capacitors, resistors and other peripheral elements constitutes the basic circuit for stable operation of the single-chip microcomputer. Figure 3 The 12V to 5V power supply circuit diagram shows the power supply conversion circuit using the RY8411 power supply chip of Chengdu Ruiyuan Semiconductor, which realizes the step-down of the 12V power supply of the automatic weather station to 5V to provide stable working voltage for each module of the system. Figure 4 The display content diagram of the segment code liquid crystal screen shows the types of information that can be displayed on the liquid crystal screen, including real-time time, wind direction voltage value, wind direction angle value, fault code and other key detection data, which intuitively presents the detection state and result of the device. Figure 5 The wind direction sensor voltage acquisition circuit diagram shows the specific circuit design of the voltage acquisition module. The circuit uses the GS8334 operational amplifier to constitute a voltage follower to receive the wind direction sensor output voltage (VWIND) and the 7-way Gray code bit signal voltage (VGRAY0-VGRAY6). After filtering by the RC filter, the voltage is adjusted to the ADC detection voltage range through the voltage division network, and finally connected to the ADC port of the single-chip microcomputer to realize high-precision acquisition of the key voltage signal of the sensor. Figure 6 The main program flowchart shows the working process of the system: starting from internal resource initialization, determining whether there is external power supply through RTC timing, entering detection mode if there is, entering low-power mode if there is not; after completing fault detection in detection mode, updating LCD display, obtaining RTC time, recording data and outputting through serial port, resetting parameters and entering next detection, and prompting detection results through different buzzing modes of the buzzer (normal long buzzing, abnormal short buzzing). Figure 7 The ADC reading and voltage conversion flowchart shows the process of ADC voltage acquisition of the single-chip microcomputer: setting the ADC channel and enabling, delaying and starting AD conversion, reading the ADC value after conversion is completed, closing the ADC power supply, and finally converting the ADC value to the actual voltage value through conversion algorithm.Figure 8 The figure is a schematic diagram of voltage sampling points and fitting curve, the horizontal coordinate is ADC reading, and the vertical coordinate is corresponding voltage value. The fitting curve (y=0.6097x-0.419) in the figure shows the result of linear fitting of 16 standard voltage sampling points uniformly distributed in 0-2.5V by least square method, which intuitively reflects the linear relationship between ADC reading and actual voltage value, and provides a basis for voltage conversion algorithm. Figure 9 The figure is a flow chart of rotation detection, which shows the steps of rotation detection: first, the wind direction output voltage value is obtained, and it is judged whether the voltage output changes or not. If not, it is determined as E11 fault. If there is a change, it is judged whether the voltage value deviation is normal or not. If not, it is determined as E21 fault. If the deviation is normal, it is detected whether all wind direction values are detected or not. If there is an intermediate wind direction not detected, it is determined as E31 fault. If small wind direction is not detected, it is E32 fault. If large wind direction is not detected, it is E33 fault. If all are detected, the rotation detection is passed. Figure 10 The figure is a flow chart of standard value detection, which shows the steps of standard value detection: the Gray code bit signal voltage value is obtained, and it is judged whether the deviation is normal or not. If not, the abnormal point is marked. If normal, it is judged whether the actual wind direction corresponds to the Gray code or not. If not, the abnormal point is marked. The detection is repeated until all standard value detection is completed. If all are normal, “TOK” is displayed. Otherwise, the abnormal point (Gn, n=0-6) is returned.

[0025] The low-cost voltage type wind direction sensor fault detection device provided in the embodiment comprises a single-chip microcomputer, a voltage acquisition module, a fault detection module, a display module, a data storage module and a power supply module. The single-chip microcomputer serves as a core control unit and is electrically connected with the voltage acquisition module, the fault detection module, the display module, the data storage module and the power supply module respectively. The voltage acquisition module is used for acquiring the output voltage of the voltage type wind direction sensor and the voltage of the sensor internal Gray code bit signal. The fault detection module is used for judging whether the sensor has a fault and positioning the fault type according to the voltage value acquired by the voltage acquisition module through a preset fault detection algorithm. The display module is used for displaying the detection state, fault information and real-time time of the sensor in real time. The data storage module is used for recording the detection data, real-time time and fault information. The power supply module provides working voltage for each module of the device.

[0026] The low-cost voltage type wind direction sensor fault detection device adopting the above technical solution integrates the voltage acquisition, fault detection, display, data storage and power supply modules by taking the single-chip microcomputer as a core control unit, and each module works cooperatively to realize the detection and positioning function of the voltage type wind direction sensor fault, thereby providing an integrated solution for on-site checking and maintenance of the sensor and meeting the basic needs of the meteorological department for sensor fault detection.

[0027] Specifically, in the embodiment, the single-chip microcomputer can select an STC8H4K64TLCD model 8051 single-chip microcomputer provided by Macro Crystal Technology. The single-chip microcomputer is internally integrated with a 12-bit ADC, an RTC module, an EEPROM module, and an LCD driver. The 12-bit ADC is used for analog-to-digital conversion of a voltage signal input by the voltage acquisition module. The RTC module is used for providing real-time time. The EEPROM module constitutes a data storage module. The LCD driver is used for driving the display module.

[0028] By using the STC8H4K64TLCD single-chip microcomputer integrated with the 12-bit ADC, the RTC, the EEPROM, and the LCD driver, the internal resources are fully utilized, the use of external components is reduced, the circuit design is simplified, and the cost of the device is reduced. Meanwhile, the integration of the internal resources ensures stable linkage of functions such as voltage conversion, real-time time acquisition, data storage, and display driving, and improves the compactness and reliability of the system.

[0029] Specifically, in the embodiment, the voltage acquisition module includes a voltage follower, an RC filter, and a voltage dividing network. The voltage follower uses a GS8334 operational amplifier. The input end of the voltage follower is connected to the voltage output end or the Gray code bit signal output end of the sensor. The output end is connected to the ADC input end of the single-chip microcomputer through the RC filter and the voltage dividing network in sequence. The voltage dividing network is used to reduce the 8V voltage output by the Gray code bit signal to within 2.5V.

[0030] In the set voltage acquisition module, the high-impedance GS8334 voltage follower can avoid interference of the detection device on the internal circuit of the sensor, and ensure that the normal work of the original sensor is not affected. The RC filter can reduce the influence of noise on the voltage signal. The voltage dividing network can convert the high voltage of the Gray code bit signal to within the ADC detection range. The combination of the three effectively improves the accuracy and stability of voltage acquisition, and provides reliable raw data for subsequent fault detection.

[0031] Specifically, in the embodiment, the voltage acquisition module includes 8 voltage acquisition channels, of which 1 is used to acquire the wind direction output voltage of the sensor, and the remaining 7 are used to acquire the voltages of the 7-bit Gray code bit signals inside the sensor. The 8 voltage acquisition channels use 8 operational amplifiers, that is, 2 GS8334 operational amplifiers are used. Each GS8334 operational amplifier includes 4 independent operational amplifiers.

[0032] Through the design of the 8-channel acquisition channel, 1 wind direction sensor output voltage and 7 Gray code bit signal voltages can be acquired at the same time, and the key voltage signals of the sensor are fully covered. The reuse of the 2 GS8334 operational amplifiers optimizes the hardware resource configuration, reduces the hardware cost while ensuring the multi-channel acquisition requirement, and improves the circuit integration.

[0033] Specifically, in the present embodiment, the fault detection algorithm includes rotation detection and standard value detection. The rotation detection includes the following steps: S1. Detecting whether the sensor has voltage output, if the output voltage is continuously 0V, it is determined that the power supply circuit is faulty (fault code E11); S2. If there is voltage output, it is determined whether the deviation of the voltage value from the preset wind direction voltage comparison table is within the allowable range, if the deviation exceeds, it is determined that the operational amplifier circuit or reference voltage source is abnormal (fault code E21); S3. If the deviation is normal, it is detected whether all wind direction values are output during the rotation of the sensor, if there is an intermediate wind direction value that is not detected, it is determined that the Gray code bit signal circuit is abnormal (fault code E31); if there is a small wind direction value that is not detected, it is determined that the operational amplifier circuit or reference voltage source inside the sensor is abnormal (fault code E32); if there is a large wind direction value that is not detected, it is determined that the operational amplifier circuit or reference voltage source inside the sensor is abnormal (fault code E33); The standard value detection includes the following steps: T1. Fixing the sensor at a preset standard wind direction angle, the standard wind direction angle includes at least three of 0°, 45°, 90°, 135°, 180°, 225°, 270° and 315°, collecting the voltage signal output by the sensor at the corresponding position and the Gray code bit signal voltage of the internal circuit of the sensor; T2. Determining whether the high and low levels of the Gray code bit signal voltage are within the error allowable range, if abnormal, marking the corresponding Gray code bit (Gn, n=0-6); T3. Comparing the consistency of the Gray code value with the wind direction voltage comparison table, if inconsistent, marking the corresponding abnormal bit (Gn, n=0-6).

[0034] The rotation detection can quickly and preliminarily locate the fault range by step-by-step judgment of voltage output, deviation and wind direction value integrity; the standard value detection can accurately check the consistency of the Gray code bit signal voltage and value by collecting data at fixed standard wind direction angles, the combination of the two forms a complement, realizing comprehensive identification and accurate positioning of the sensor fault, improving the integrity and accuracy of fault detection.

[0035] Specifically, in the present embodiment, the display module adopts a low-power segment code liquid crystal screen, which is driven by the LCD driver inside the single-chip microcomputer, for displaying real-time time, voltage value, wind direction value, fault code and warning symbol, etc.

[0036] The low-power section code liquid crystal screen is matched with the internal LCD driver of the single-chip microcomputer, which can display real-time time, voltage value, wind direction value, fault code, early warning symbol and other key information in real time, so that users can intuitively obtain the detection state; and due to the low-power characteristic, the energy consumption of the device is reduced, and the device is suitable for long-time use in a portable scene.

[0037] Specifically, in the embodiment, the RTC module is externally connected with a 32.768 kHz crystal oscillator and a CR1220 button cell, the button cell is connected with an external power supply circuit through a diode, automatic switching between the external power supply and the button cell is realized, and uninterrupted power supply of the RTC module is ensured. The RTC module is externally connected with a 32.768 kHz crystal oscillator and a CR1220 button cell, automatic switching between the external power supply and the button cell is realized through a diode, the RTC can continuously work in the presence or absence of the external power supply, the continuity and accuracy of real-time time recording are ensured, and a reliable basis is provided for time marking of detection data.

[0038] Specifically, in the embodiment, the power supply module includes an RY8411 power supply chip, the power supply chip converts an external 12V voltage into a 5V voltage to supply power to the device; the power supply module further includes a voltage division detection circuit, the voltage division detection circuit is composed of resistors R22 and R23, and is used to detect whether the external power supply voltage exists to determine whether the external power supply exists; when the external power supply does not exist, the single-chip microcomputer is controlled to enter a low-power mode.

[0039] The RY8411 power supply chip realizes stable voltage conversion from 12V to 5V, and provides reliable power supply for each module of the device; the voltage division detection circuit can determine the external power supply state, the single-chip microcomputer is controlled to enter a low-power mode when the external power supply does not exist, the use time of the button cell is prolonged, and the portability and endurance of the device are improved.

[0040] Specifically, in the embodiment, the device further includes a buzzer module, the buzzer module is connected with an IO port of the single-chip microcomputer, and is used to provide fault prompts: a long buzzing signal is output when the detection result is normal, and a short and sharp buzzing signal is output when the detection result is abnormal.

[0041] The buzzer module can provide sound prompts for the detection result through different sound signals (long buzzing when normal and short and sharp buzzing when abnormal), assist users in quickly judging the detection state, and especially in a scene where visual observation is not convenient, the feedback efficiency of the detection result is improved.

[0042] Specifically, in the present embodiment, the voltage calculation adopts a least square linear fitting algorithm, and the fitting formula is: y = (6097 * x - 4190) / 10000, where x is the ADC reading, and y is the converted voltage value (mV). The fitting formula is obtained by 16 sets of standard voltage calibration uniformly distributed in 0-2.5V. The fitting formula obtained by standard voltage calibration optimizes the conversion process of ADC reading to voltage value, reduces the conversion error, improves the precision of voltage measurement, and provides a more reliable basis for voltage-related judgment in fault detection.

[0043] Specifically, in the present embodiment, the wind direction voltage table predefines two arrays: the voltageTable array and the angleTable array, both containing 128 elements (the specific values can be obtained by referring to the sensor data manual); the voltageTable array stores the voltage values corresponding to 0°-357°, and the angleTable array stores the corresponding angle values; the corresponding wind direction angle and deviation value are obtained by matching the collected voltage value in the voltageTable array through the binary search algorithm. By predefining the voltageTable and angleTable arrays and matching the collected voltage value through the binary search algorithm, the corresponding wind direction angle and deviation value can be quickly and accurately obtained, which not only improves the efficiency of solving the wind direction value, but also can judge whether the sensor has a hidden fault through the deviation value, providing a more detailed reference basis for fault detection.

[0044] In summary, the low-cost voltage type wind direction sensor fault detection device provided in the present embodiment takes a domestic single-chip microcomputer as the core control unit, integrates hardware circuit design and software algorithm, realizes fault detection and positioning of the voltage type wind direction sensor, and the specific principle is as follows: 1. Sensor principle: the voltage type wind direction sensor (such as EL15-2D) is composed of a wind direction marker, a 7-bit Gray code disc, a photoelectric signal conversion circuit board, etc. When the wind direction marker rotates, the state change of the Gray code disc shielding the photoelectric pair tube light path is processed through signal shaping, Gray code to binary, digital to analog conversion, etc. The analog voltage corresponding to the wind direction is output; by measuring the voltage, the relative position of the wind direction marker can be analyzed, and the actual north pole is pointed to the actual north pole during installation, so that the actual wind direction can be obtained.

[0045] 2. Device hardware principle: 2.1 Macro crystals STC8H4K64TLCD single-chip microcomputer (other models of single-chip microcomputers or ADC, RTC, EEPROM, etc. external functional module circuits) can be used but not limited to, make full use of its internal resources: 12-bit ADC for voltage signal analog-digital conversion, RTC module provides real-time time, EEPROM for data storage, and LCD driver drives segment code liquid crystal screen display.

[0046] 2.2 Voltage acquisition module follows the voltage through high impedance operational amplifier voltage follower, avoid interference sensor internal circuit, after noise reduction by RC filter, through the voltage divider network will Gray code bit signal 8V voltage to within the detection voltage range of ADC 2.5V, voltage divider network consists of R1 (10kΩ) and R2 (4.3kΩ), according to the formula Vout=Vin×(R2 / (R1+R2)), can be Gray code bit signal output 8V voltage to about 2.5V within the detection range of 0~2.5V of the device ADC, " eventually by ADC acquisition 1 way wind direction sensor output voltage and 7 way Gray code bit signal voltage.

[0047] 2.3 Power module through RY8411 power chip will be converted to 5V power supply, with the button cell (CR1220) and automatic power switching circuit, to ensure that the RTC in the absence of external power supply can work.

[0048] 3. Software and algorithm principle: 3.1 Voltage value solving: through 16 times ADC sampling to average, combined with the least square method linear fitting algorithm correction, improve the voltage measurement accuracy.

[0049] 3.2 wind direction value solving: based on the predefined voltage wind direction table (128 groups of data), through the bisection search matching acquisition voltage and corresponding wind direction, calculate the deviation to determine the implicit fault.

[0050] 3.3 fault detection algorithm: combined with the rotation detection and standard value detection. Rotation detection through the judgment of voltage output is 0, voltage deviation is normal, wind direction value is complete, preliminary positioning fault range; standard value detection through the fixed sensor at the standard wind direction angle (such as 0°, 45°, etc.), detection of Gray code bit signal voltage and numerical consistency, accurate positioning of fault point.

[0051] Method for use 1. System initialization: after the device starts, the single chip microcomputer automatically initializes the internal resources (IO port, serial port, ADC, RTC, LCD, etc.), segment code liquid crystal screen starts, and is ready to enter the detection state.

[0052] 2. Power supply state judgment: through RTC timing (every 2s) to detect external power supply state. If there is external power supply, enter normal detection mode; if there is no external power supply, the single chip microcomputer enters low power consumption mode, only RTC keeps working, prolonging the life of the button cell.

[0053] 3. Fault detection process: 3.1 Rotation detection: Connect the sensor to the device, rotate the wind vane, and the device collects the wind direction output voltage in real time. If the voltage is continuously 0V, display fault code E11 (suspected power supply failure); if the voltage deviation exceeds the allowed range, display E21 (suspected op-amp or reference voltage failure); if the wind direction value is not detected, display according to the undetected value range: E31 (intermediate wind direction value not detected, suspected Gray code bit signal failure), E32 (small wind direction value not detected), or E33 (large wind direction value not detected).

[0054] 3.2 Standard value detection: If the rotation detection fails, fix the sensor at a standard wind direction angle (such as 0°, 45°, etc.), and the device collects the voltage signal output by the sensor and the Gray code bit signal voltage of the sensor internal circuit. If the Gray code bit signal voltage is abnormal or the value does not match the control table, display the abnormal point (such as G0-G6); after detection is complete, the second detection ends at 0°, and the final result is output.

[0055] 4. Result feedback and data recording: The detection results are displayed on the segment code liquid crystal screen (real-time time, voltage, wind direction, fault code), and the buzzer provides auxiliary prompts (normal long beep, abnormal short beep); detection data (time, voltage, fault information) is automatically stored in EEPROM and can be sent to the PC end through the UART serial port for subsequent analysis.

[0056] In addition, the low-cost voltage type wind direction sensor fault detection device in the embodiment has the following technical effects: 1. Anti-environmental interference capability: The RC filter in the voltage acquisition module not only performs regular noise reduction, but also has parameters specially designed to adapt to different electromagnetic environmental interference in meteorological observation sites. Whether in a complex environment with heavy rain and strong electromagnetic radiation, or in a remote area station with large voltage fluctuations, high-frequency noise and transient pulse interference can be stably filtered out, ensuring the purity of the collected voltage signal and providing a reliable data foundation for subsequent fault detection algorithms. This advantage is particularly prominent in variable meteorological observation scenarios.

[0057] 2. Fault prediction and trend analysis function: The data storage module of the device does not simply record detection data, but through implicit analysis of long-term accumulated detection data (including voltage values, wind direction value deviations, etc. in different time periods). A simple trend judgment algorithm is run using the internal idle resources of the single-chip microcomputer. When a parameter (such as the voltage fluctuation amplitude of the Gray code bit signal of the sensor internal circuit or the voltage signal fluctuation amplitude change output by the sensor) shows regular gradual change over a period of time, potential fault warning can be given in advance. For example, if the voltage value of a certain Gray code bit gradually deviates from the normal range but does not reach the fault threshold, the device will mark the corresponding Gray code bit (Gyn, n = 0 ~ 6) to prompt maintenance personnel to pay attention, realizing the transition from passive fault detection to active preventive maintenance, effectively reducing the probability of sensor sudden failure.

[0058] 3. Cross-model compatibility potential: Although designed primarily for voltage-type wind direction sensors (such as EL15-2D), the device's hardware interface and software algorithm have a certain degree of flexibility. By increasing or adjusting the resistance parameters of the voltage division network, recalibrating the least squares fitting formula, and modifying the voltageTable array and angleTable array parameters in the wind direction voltage reference table, different models and different voltage output ranges of voltage-type wind direction sensors can be adapted. For example, for a sensor with an output voltage range of 0 ~ 5V, only the resistance parameters of the voltage division network need to be adjusted, and the least squares fitting formula needs to be recalibrated, which can realize fault detection for this type of sensor, greatly expanding the application range of the device and reducing the cost of the grass-roots meteorological department due to the variety of sensor models.

[0059] 4. Intelligent wake-up mechanism in low-power mode: The voltage division detection circuit of the power supply module detects the external power supply recovery, and does not immediately wake up the single-chip microcomputer to enter the normal working mode, but first monitors the external power voltage for a short time (about 5 seconds) through the low-power wake-up circuit, and then wakes up the single-chip microcomputer after confirming that the power supply is stable. This design can avoid frequent start and stop of the single-chip microcomputer due to temporary recovery and interruption of external power supply (such as poor contact of the power supply line), reduce unnecessary power consumption loss, and at the same time protect the single-chip microcomputer and other modules from voltage impact, prolonging the overall service life of the device.

[0060] 5. Security guarantee for data interaction: When the device interacts with PC software through UART serial port, a simple verification mechanism (such as cumulative sum check) is adopted. Each frame of data is attached with a check bit during transmission, and the PC software checks the data after receiving it to ensure the accuracy of the transmitted data. In the current era of increasingly important meteorological data, this security guarantee for data interaction can prevent fault misjudgment or maintenance decision errors caused by data transmission errors, especially when archiving and analyzing detection data, ensuring the credibility and seriousness of the data.

[0061] The present embodiment also provides the following experimental verification of the above technical effects: 1. Signal acquisition experiment under different interference environments: A test platform simulating different interference environments was set up in the laboratory. High-frequency noise (10 kHz-1 MHz) and transient pulse interference (amplitude 10 V-50 V, pulse width 1 μs-10 μs) were generated by a signal generator to simulate the electromagnetic interference conditions in complex weather observation sites. The voltage-type wind direction sensor (EL15-2D) was connected to the detection device and placed in this environment. The results showed that when the RC filter of the device was not used, the collected voltage signal was severely distorted, with a noise peak-to-peak value of more than 50% of the normal signal amplitude, which caused the subsequent fault detection algorithm to fail to operate normally. After the device was connected, the RC filter automatically adjusted the parameters, and the noise peak-to-peak value of the collected voltage signal was suppressed to within 5% of the normal amplitude, and the digital signal output by the Gray code bit signal was stable and could accurately reflect the change in wind direction, effectively verifying the signal acquisition stability of the device in complex electromagnetic interference environments.

[0062] 2. Fault prediction and trend analysis experiment: A 30-day wind direction sensor operation process was simulated in the laboratory. During this period, the internal circuit parameters of the sensor were adjusted to simulate the gradual deviation of a certain Gray code bit voltage value from the normal range and the output voltage variation amplitude. The detection device continuously recorded the relevant data, and its data storage module detected that the voltage value of a certain Gray code bit showed a regular upward trend of 0.06 V per day (normal range: 8 V±0.5 V) within 8 days, although it did not reach the fault threshold, but the device issued an early warning of potential failure through the trend judgment algorithm, and if the anomaly was marked with the corresponding Gray code bit (Gyn, n=0-6).

[0063] 3. Cross-model compatibility experiment: Two different models of voltage-type wind direction sensors were selected, model A output voltage range is 0-3V, model B output voltage range is 0-5V. Since the original design is for output voltage range 0-2.5V, no voltage dividing network is needed (voltage dividing network is only for the internal Gray code bit signal voltage of the sensor). For the detection of model A output voltage, a voltage dividing network is needed, and the resistance parameters are set, R1 is set to 2.2kΩ, R2 is set to 10kΩ, and the voltageTable array and angleTable array parameters in the wind direction voltage table are modified, and the least squares fitting formula is recalibrated. For the detection of model B output voltage, a voltage dividing network is needed, and the resistance parameters are set, R1 is set to 11kΩ, R2 is set to 10kΩ, and the software parameters are modified accordingly. The experimental results show that after adjustment, the detection device can accurately collect the voltage signals of two different models of sensors and correctly judge their working status, successfully detecting the artificially set simulation faults (such as signal line open circuit, etc.), fully demonstrating the cross-model compatibility potential of the device.

[0064] 4. Low-power mode intelligent wake-up mechanism experiment: In the experiment, the unstable power supply condition is simulated, and the power supply state when the external power supply line is in poor contact is simulated by a programmable power supply, i.e. every 1 minute, the power supply is restored for 30 seconds and then interrupted for 30 seconds. The device is in low-power mode, and the power consumption and single-chip microcomputer start-stop times under this power supply state are recorded. After 10 hours of continuous testing, when using the intelligent wake-up mechanism of the device, the single-chip microcomputer only starts and stops 5 times, and the total power consumption is 5.2mWh; while in the case of turning off the intelligent wake-up mechanism and directly waking up the single-chip microcomputer by the power supply recovery signal, the single-chip microcomputer starts and stops up to 600 times, and the total power consumption is 89.7mWh. At the same time, during the multiple start-stop processes, the device with the intelligent wake-up mechanism turned off has 2 times of single-chip microcomputer program runaway phenomenon caused by voltage impact, while the device with the intelligent wake-up mechanism enabled runs stably, verifying the significant effect of the mechanism in reducing power consumption and protecting hardware.

[0065] 5. Data interaction security experiment: In the experiment of data interaction between the detection device and the PC end software through UART serial port, a data transmission error rate test link is set. By introducing random noise into the transmission line, the interference in actual communication is simulated. When the check mechanism is not used, the data transmission error rate is as high as 5%, resulting in a large amount of data error transmission, seriously affecting the accuracy of fault detection results. After enabling the cumulative sum check mechanism, even in a high interference environment, the data error rate after receiving and checking by the PC end software is controlled within ≤0.001%, effectively ensuring the security of data interaction and the reliability of fault detection data.

[0066] The above merely preferred embodiments of the present application and are not intended to limit the embodiments and protection scope of the present application. Those skilled in the art should be able to understand that any equivalent substitutions and obvious changes made according to the present application description and drawings should be included in the protection scope of the present application.

Claims

1. A low-cost voltage-type wind direction sensor fault detection device, characterized in that, It includes a microcontroller, a voltage acquisition module, a fault detection module, a display module, a data storage module, and a power supply module; the microcontroller, as the core control unit, is electrically connected to the voltage acquisition module, the fault detection module, the display module, the data storage module, and the power supply module respectively; The voltage acquisition module is used to acquire the output voltage of the voltage-type wind direction sensor and the voltage of the Gray code position signal inside the sensor; The fault detection module is used to determine whether the sensor has a fault and to locate the type of fault based on the voltage value collected by the voltage acquisition module and a preset fault detection algorithm. The display module is used to display the sensor's detection status, fault information, and real-time time in real time; The data storage module is used to record detection data, real-time time, and fault information; The power supply module provides operating voltage to each module of the device.

2. The low-cost voltage-type wind direction sensor fault detection device according to claim 1, characterized in that, The microcontroller integrates a 12-bit ADC, an RTC module, an EEPROM module, and an LCD driver. The 12-bit ADC is used to perform analog-to-digital conversion on the voltage signal input from the voltage acquisition module. The RTC module is used to provide real-time data. The EEPROM module constitutes the data storage module. The LCD driver is used to drive the display module.

3. The low-cost voltage-type wind direction sensor fault detection device according to claim 1, characterized in that, The voltage acquisition module includes a voltage follower, an RC filter, and a voltage divider network. The voltage follower is an operational amplifier. The input of the voltage follower is connected to the voltage output of the sensor or the Gray code signal output. The output is connected to the ADC input of the microcontroller in sequence through the RC filter and the voltage divider network. The voltage divider network can reduce the Gray code signal voltage or the voltage signal output by the wind direction sensor to the detection voltage range of the microcontroller's ADC as needed.

4. The low-cost voltage-type wind direction sensor fault detection device according to claim 3, characterized in that, The voltage acquisition module includes 8 voltage acquisition channels, one of which is used to acquire the wind direction output voltage of the sensor, and the other 7 channels are used to acquire the voltage of the 7-bit Gray code signal inside the sensor; the 8 voltage acquisition channels share 8 operational amplifiers.

5. The low-cost voltage-type wind direction sensor fault detection device according to claim 1, characterized in that, The fault detection algorithm includes rotation detection and standard value detection; The rotation detection includes the following steps: S1. Check if the sensor has a voltage output. If the output voltage is consistently 0V, it is determined that the power supply circuit is faulty. S2. If there is voltage output, determine whether the deviation between the voltage value and the preset wind direction voltage reference table is within the allowable range. If the deviation exceeds the range, it is determined that the operational amplifier circuit or the reference voltage source is abnormal. S3. If the deviation is normal, check whether the sensor outputs all wind direction values ​​during rotation. If there are intermediate wind direction values ​​that are not detected, it is determined that the Gray code position signal is abnormal. If there are small wind direction values ​​that are not detected, it is determined that the operational amplifier circuit or reference voltage source inside the sensor is abnormal. If there are large wind direction values ​​that are not detected, it is determined that the operational amplifier circuit or reference voltage source inside the sensor is abnormal. The standard value detection includes the following steps: T1. Fix the sensor at a preset standard wind direction angle, which includes at least three of the following: 0°, 45°, 90°, 135°, 180°, 225°, 270°, and 315°. Collect the voltage signal output by the sensor at the corresponding position and the Gray code position signal voltage of the sensor's internal circuit. T2. Determine whether the high and low levels of the Gray code position signal voltage are within the allowable error range. If abnormal, mark the corresponding Gray code position. T3. Compare the Gray code values ​​with the wind direction and voltage comparison table. If they are inconsistent, mark the corresponding abnormal bit.

6. The low-cost voltage-type wind direction sensor fault detection device according to claim 1, characterized in that, The display module uses a low-power LCD screen, which is driven by the LCD driver inside the microcontroller to display real-time time, voltage value, wind direction value, fault code and warning symbol.

7. The low-cost voltage-type wind direction sensor fault detection device according to claim 2, characterized in that, The RTC module is externally connected to a 32.768kHz crystal oscillator and a CR1220 button cell battery. The button cell battery is connected to the external power supply circuit through a diode to realize automatic switching between external power supply and button cell battery to ensure uninterrupted power supply to the RTC module.

8. The low-cost voltage-type wind direction sensor fault detection device according to claim 1, characterized in that, The power supply module includes a power chip that converts an external 12V voltage to a 5V voltage to power the device. The power supply module also includes a voltage divider detection circuit, which consists of resistors R22 and R23. This circuit is used to detect the presence of an external power supply voltage to determine whether there is an external power supply. When there is no external power supply, the microcontroller is controlled to enter a low-power mode.

9. The low-cost voltage-type wind direction sensor fault detection device according to claim 1, characterized in that, It also includes a buzzer module, which is connected to the I / O port of the microcontroller and is used for fault indication: when the detection result is normal, it outputs a long beep signal (lasting 3 seconds), and when the detection result is abnormal, it outputs a short beep signal (once every 0.5 seconds, lasting 3 seconds).

10. The low-cost voltage-type wind direction sensor fault detection device according to claim 2, characterized in that, The voltage calculation uses the least squares linear fitting algorithm, and the fitting formula is: y=(6097×x- 4190) / 10000, where x is the ADC reading and y is the converted voltage value (mV). The fitting formula is obtained by calibration with 16 sets of standard voltages evenly distributed in the range of 0 to 2.5V. The wind direction and voltage reference table predefines two arrays: voltageTable and angleTable, each containing 128 elements. The voltageTable array stores the voltage values ​​corresponding to 0° to 357°, and the angleTable array stores the corresponding angle values. The collected voltage values ​​are matched in the voltageTable array using a binary search algorithm to obtain the corresponding wind direction angle and deviation value.

Citation Information

Patent Citations

  • Fault detection device for Gray code disk wind-direction sensor

    CN102520211A

  • Gray code-based wind direction sensor detection method

    CN113406356A

  • Portable meteorological sensor fault detection device

    CN208314229U

  • On-site checking device for wind direction sensor

    CN216209249U

  • Regional automatic weather station checking and overhauling instrument

    CN221550953U