Weak magnetic sensor push-pull output detection method and system based on row and column scanning

By using a 4×4 detection matrix and current-limiting resistor in conjunction with row-by-row gating scanning, the positioning and hardware protection issues of the push-pull output weak magnetic sensor were solved, achieving efficient and reliable multi-channel sensor detection and reducing system cost and complexity.

CN121164992APending Publication Date: 2025-12-19NAKAMURA SEIKI (WUXI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511488810.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-17
Publication Date
2025-12-19

AI Technical Summary

Technical Problem

Existing matrix scanning schemes suffer from problems such as positioning mechanism failure, current conflict risk, and insufficient anti-interference capability when detecting push-pull output type weak magnetic sensors, resulting in low hardware security and reliability.

Method used

Employing a 4×4 detection matrix structure, and through the collaborative design of row-line series current-limiting resistors and row-by-row gating scanning, combined with an invalid signal filtering mechanism, it achieves precise positioning and hardware protection for 16 push-pull output weak magnetic sensors.

Benefits of technology

It effectively solves the positioning failure and current conflict problems in traditional matrix detection schemes, improves the robustness and detection accuracy of the system, reduces hardware costs and complexity, and simplifies PCB layout.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121164992A_ABST
    Figure CN121164992A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of electronic sensing detection technology, and provides a weak magnetic sensor push-pull output detection method and system based on row and column scanning, and the system comprises a power module, a sensor matrix module, a row line control module, a column line detection module and a microcontroller. A four-row and four-column matrix structure is adopted, detection of 16 paths of sensors can be completed only through eight microcontroller IO ports, the IO port occupancy rate is reduced by 50% compared with a traditional one-to-one connection mode, and the system cost and complexity are effectively reduced; the unique positioning problem of a push-pull output sensor in a matrix is solved through a line-by-line gating scanning logic and a judgment mechanism that a current line is effective, and positioning confusion caused by column line global lowering in a traditional matrix method is avoided; a current-limiting resistor is introduced into each row line, so that a potential short-circuit current path formed by ''high and low level conflict'' is eliminated, and key overcurrent protection is provided for a microcontroller and a sensor.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of electronic sensing detection, in particular to a weak magnetic sensor push-pull output detection method and system based on row-column scanning; it is suitable for the scene that needs to collect multiple weak magnetic signals and the IO resource is limited, such as intelligent door lock magnetic control detection, industrial equipment magnetic position monitoring, and security system magnetic anomaly alarm. BACKGROUND

[0002] In the field of multi-channel weak magnetic signal detection, the traditional scheme usually allocates an independent microcontroller (MCU) IO port for each sensor for data acquisition (i.e. "one-to-one IO connection" mode); this mode will sharply increase the demand for the number of microcontroller (MCU) IO ports when the number of detection channels increases (for example, 16 channels), which not only increases the hardware cost, but also leads to complex printed circuit board (PCB) wiring and system size increase; to optimize the utilization rate of IO resources, the existing technology introduces a row-column scanning matrix detection method, which connects sensors through row lines (Row) and column lines (Col), and controls MxN sensors using M+N lines based on time division multiplexing principle; However, the existing matrix scanning scheme is mainly designed for open-drain output sensors, and when it is applied to push-pull output weak magnetic sensors, the following key technical defects are exposed: Positioning mechanism failure: push-pull output sensors will actively output low voltage when activated; if directly connected to the matrix, when a single sensor is triggered, it will pull down the voltage of the entire column line where it is located, and the traditional method cannot distinguish which specific sensor on the same column is triggered, resulting in inaccurate positioning.

[0003] There is a risk of current conflict: when a row line is set to high and a sensor connected to the row line outputs low, a low-impedance path "microcontroller (MCU) IO port → row line → sensor output pin → ground" is formed, generating an excessive short-circuit current, which seriously threatens the safety of the microcontroller (MCU) IO port and the sensor itself.

[0004] Insufficient anti-interference capability: lack of signal discrimination mechanism for non-selected period, any reason for column line low voltage (such as interference) may be misjudged as valid signal, resulting in low system reliability.

[0005] Therefore, there is an urgent need for a matrix detection scheme specifically for push-pull output weak magnetic sensors to solve the three core problems of accurate positioning, hardware protection, and anti-interference; for this purpose, we propose a weak magnetic sensor push-pull output detection method and system based on row-column scanning. SUMMARY

[0006] In view of the deficiencies of the prior art, the present application effectively solves the positioning failure problem caused by the column line global pull-down and the hardware risk caused by abnormal current in the existing matrix detection scheme through the synergistic design of "row line series current limiting resistor + row-by-row gating scanning + invalid signal filtering"; a 4x4 detection matrix is constructed by using 4 row lines and 4 column lines to realize the detection of 16 push-pull output weak magnetic sensors; To achieve the above object, the present application is realized by the following technical scheme: A weak magnetic sensor push-pull output detection method based on row and column scanning, comprising the following steps: step 1, constructing a 4x4 detection matrix: first, 16 push-pull output weak magnetic sensors are distributed according to the matrix relationship formed by 4 row lines and 4 column lines, each sensor occupies a matrix node, the output end of the sensor is directly connected to the corresponding column line, and is connected to the corresponding row line through a current limiting resistor; Step 2, IO function initialization: the IO port of the microcontroller is initialized and configured; 4 row lines are connected to 4 output IO ports of the microcontroller and configured as push-pull output mode, with default output high level; make it have driving ability, 4 column lines are connected to 4 input IO ports of the microcontroller and configured as input mode with internal pull-up, the column line is pulled to high level by default in input mode; make it in a detection state, ready for active scanning; Step 3, row-by-row gating scanning: after initialization, the microcontroller sets the output IO port of the current row line to low level in sequence, and the remaining 3 row lines remain high level. The level state of the 4 column lines is read during column line level detection, if a column line is low level, it is determined that the sensor at the intersection of the row line and the column line outputs trigger state; if the column line is high level, it is determined that the sensor at the intersection is not triggered.

[0007] Step 4, recovery and result output after scanning: after the current row line detection is completed, it is restored to high level, and step 3 is repeated until all row lines are scanned, and the position information of all triggered sensors is output.

[0008] Preferably, the push-pull output weak magnetic sensor in step 1 outputs high level when no weak magnetic signal is detected, and outputs low level when weak magnetic signal is detected.

[0009] Preferably, the resistance value of the current limiting resistor in step 1 is 1kΩ.

[0010] Preferably, the column line low level when the current row line is pulled down in step 3 is an effective signal, if the row line is high level and the column line is low level, it is determined as invalid interference signal, and is not recorded as sensor trigger.

[0011] A kind of weak magnetic sensor push-pull output detection system based on row-column scanning, for realizing the output detection method, including: power module, sensor matrix module, row line control module, column line detection module and microcontroller; The power module includes 5V power supply, voltage stabilizer, first capacitor and second capacitor;The input end of the voltage stabilizer is connected to the 5V power supply, and the output end is connected to one end of the first capacitor and the second capacitor, and the other end of the first capacitor and the second capacitor is grounded;The output end of the voltage stabilizer is divided into two paths, one of which is used to power the microcontroller, and the other is used to power the 16 sensor VCC pins; The sensor matrix module includes 16 push-pull weak magnetic sensors, which are distributed in 4 rows and 4 columns, the VCC pin of each sensor is connected to the 5V power supply, the ground pin, the ground pin of the microcontroller and the ground terminal of the power module are all connected to the same common ground of the system;The output end of the sensor is directly connected to the corresponding column line and connected to the corresponding row line through a current-limiting resistor; The row line control module includes 4 row lines, each of which is connected to the output end of the corresponding sensor after being connected in series with a current-limiting resistor, and the other end of the row line is connected to the output IO port of the microcontroller; The column line detection module includes 4 column lines, each of which is connected to the output end of the corresponding sensor at one end, and the other end is connected to the input IO port of the microcontroller; The microcontroller is used to control the row line control module to generate a row-by-row scanning signal, read the level state of the column line detection module, process and determine the position of the triggered sensor, and finally output the position information.

[0012] Preferably, the microcontroller uses an STM32F103 series microcontroller.

[0013] Preferably, a third capacitor is connected in parallel between the output end of each sensor in the sensor matrix module and the ground.

[0014] The application provides a weak magnetic sensor push-pull output detection method and system based on row-column scanning;It has the following advantages: a 4-row 4-column matrix structure is adopted, only 8 microcontroller (MCU) IO ports are needed to complete the detection of 16 sensors, the IO port occupancy rate is reduced by 50% compared with the traditional one-to-one connection method, and the system cost and complexity are effectively reduced; Through the "row-by-row gating" scanning logic and the "current row valid" decision mechanism, the unique positioning problem of push-pull output sensors in the matrix is solved, and the positioning confusion caused by the traditional matrix method is avoided; A current-limiting resistor is introduced in each row line, which eliminates the potential short-circuit current path caused by "high-low level conflict", and provides key overcurrent protection for the microcontroller (MCU) and the sensor, and the system robustness is significantly enhanced; Combined with software delay anti-dithering (short delay before judging valid signal) and ignoring strategy for non-selected signal, the false triggering caused by instantaneous interference is effectively inhibited, and the detection accuracy is greatly improved. The push-pull output does not need an external pull-up resistor, and protection is realized by combining with a current-limiting resistor, so that the number of external elements is small, the circuit is simple, and the compactness of PCB layout is facilitated. BRIEF DESCRIPTION OF DRAWINGS

[0015] Figure 1 A method flowchart of the present application is shown in the figure. Figure 2 A system flowchart of the present application is shown in the figure. DETAILED DESCRIPTION

[0016] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0017] Referring to the accompanying Figure 1 The weak magnetic sensor push-pull output detection method based on row-column scanning includes the following steps: Step 1, constructing a 4x4 detection matrix: first, 16 push-pull output weak magnetic sensors are distributed according to the matrix relationship formed by 4 row lines (Row1~Row4) and 4 column lines (Col1~Col4), each sensor occupies a matrix node, the output end (OUT) of the sensor is directly connected to the corresponding column line, and is connected to the corresponding row line through a current-limiting resistor; Step 2, IO function initialization: the IO port of the microcontroller (MCU) is initialized and configured; 4 row lines are connected to 4 output IO ports of the microcontroller (MCU) and configured as push-pull output mode, with default output high level; the 4 row lines are connected to 4 input IO ports of the microcontroller (MCU) and configured as input mode with internal pull-up, with default high level of the column line pulled up by the internal resistor; and the 4 column lines are in a ready-to-detect state, ready for active scanning; Step 3, row-by-row gating scanning: after initialization, the microcontroller (MCU) sets the output IO port of the current row line to low level and keeps the output IO ports of the remaining 3 row lines to high level according to the order of "current row line pulled low and remaining row lines pulled high"; The level state of 4 column lines is read in the column line level detection, if a column line is low, it is determined that the sensor at the intersection of the row line and the column line is triggered; if the column line is high, it is determined that the sensor at the intersection is not triggered; thus, the triggered state is accurately determined; the step is executed gradually until all rows are scanned.

[0018] In step 4, after scanning, the current row line is restored to high level, and step 3 is repeated until all row lines are scanned, and the position information of all triggered sensors is output.

[0019] In step 1, the push-pull output weak magnetic sensor outputs high level when no weak magnetic signal is detected, and outputs low level when the weak magnetic signal is detected. The maximum current of the output end is ≥10mA, which meets the column line pull-down driving requirement.

[0020] In step 1, the resistance value of the current limiting resistor is 1kΩ, and the power is ≥1 / 16W, and the voltage resistance is ≥6.3V, which is used to limit the loop current ≤3.3mA when the row line is high and the output end (OUT) of the sensor is low, avoiding overcurrent damage of the microcontroller (MCU) output IO port and the sensor.

[0021] In step 3, the column line low level when the current row line is pulled down is an effective signal, if the row line is high and the column line is low, it is determined as an invalid interference signal, and is not recorded as a sensor trigger; after the current row line level is switched by the microcontroller (MCU), a short time delay (10-20ms) is ensured to stabilize the column line level. Referring to the accompanying Figure 2 Fig. 1 shows a weak magnetic sensor push-pull output detection system based on row-column scanning, which is used to realize the output detection method in any one of claims 1 to 4, and characterized in that it comprises a power module, a sensor matrix module, a row line control module, a column line detection module and a microcontroller (MCU). The power module comprises a 5V power supply, a voltage stabilizer, a first capacitor and a second capacitor; the input end of the voltage stabilizer is connected to the 5V power supply, and the output end is connected to one end of the first capacitor and the second capacitor, and the other end of the first capacitor and the second capacitor is grounded; the output end of the voltage stabilizer is divided into two paths, one path is used to power the microcontroller (MCU), and the other path is used to power the VCC pin of the 16 sensors; The sensor matrix module comprises 16 push-pull weak magnetic sensors, which are distributed in 4 rows and 4 columns, the VCC pin of each sensor is connected to a 3.3-5V power supply, the ground pin, the ground pin of the microcontroller (MCU) and the ground end of the power module are all connected to the same common ground of the system; the output end (OUT) of the sensor is directly connected to the corresponding column line, and is connected to the corresponding row line through a current limiting resistor; The row line control module includes 4 row lines, each of which is connected to the output end (OUT) of the corresponding sensor after being connected with a current-limiting resistor in series, and the other end of the row line is connected to the output IO port of the microcontroller (MCU). The column line detection module includes 4 column lines, each of which is connected to the output end (OUT) of the corresponding sensor at one end, and is connected to the input IO port of the microcontroller (MCU) at the other end. The microcontroller (MCU) is used to control the row line control module to generate a row-by-row scanning signal, read the level state of the column line detection module, process and judge the position of the trigger sensor, and finally output the position information.

[0022] The microcontroller (MCU) adopts an STM32F103 series microcontroller, the maximum output current of the IO port thereof is ≥20mA, the low-level detection threshold of the input IO port thereof is ≤0.8V, and the low-level recognition requirement of the row line is met.

[0023] A third capacitor is connected in parallel between the output end (OUT) of each sensor in the sensor matrix module and the ground (GND), which is used to filter out high-frequency interference in the weak magnetic signal and avoid column line level jitter.

[0024] Push-pull output weak magnetic sensor: A3144 Hall sensor (working voltage 3~24V, output type push-pull, no magnet high / with magnet low, response time ≤4μs) is selected; Microcontroller (MCU): STM32F103C8T6 (32-bit Cortex-M3 core, 16 GPIO ports, supporting push-pull output / with internal pull-up input) is selected; Current-limiting resistor: 0805 packaged 1kΩ±5% precision resistor (power 1 / 16W, voltage resistance 16V) is selected; The first capacitor is an electrolytic capacitor, and the second capacitor and the third capacitor are ceramic capacitors, 0805 packaged 100nF X7R material ceramic capacitors (voltage resistance 6.3V) are selected; Voltage stabilizer: AMS1117-3.3V (input 4.75~15V, output 3.3V / 1A, power supply for microcontroller (MCU) and sensor) is selected.

[0025] Current-limiting protection example: a 1kΩ current-limiting resistor is connected in series between each row line and the sensor output terminal (OUT). When the system voltage is 3.3V, and a certain row line is high and a certain sensor output on the row is low (trigger state), the resistor will limit the loop current to I = V / R = 3.3V / 1000Ω≈3.3mA; this current value is much lower than the maximum safe current (20mA) of the STM32F103 microcontroller (MCU) IO port and the maximum current capability (≥10mA) of the A3144 sensor, thereby effectively avoiding device damage.

[0026] Precise positioning example: the microcontroller (MCU) sequentially performs scanning, for example, when only Row2 is set to low (selected), only the 4 sensors on the 2nd row are in a detectable state, and if Col3 detects a low level at this time, it is uniquely determined that the sensor located at (Row2, Col3) is triggered; for non-selected rows (such as Rows 1, 3, and 4), even if there is a sensor output low level on them, they cannot effectively pull down the column line due to the high level of the row line, and the current they generate is strictly limited by the current-limiting resistor, and will not interfere with the correct detection of the currently selected row.

[0027] Anti-interference discrimination example: the microcontroller (MCU) decision logic stipulates that only when a certain row line is actively selected (set to low) will the low level of the column line corresponding to the row be recorded as an effective trigger signal; for example, during scanning of Row1, Col2 is low, which is determined to be (Row1, Col2) trigger; if Col2 is detected to be low during scanning of Row3, it is determined to be (Row3, Col2) trigger; and the low level of Col2 that occurs during non-selected row (such as scanning Row2) is considered an invalid interference signal and is not accepted; this mechanism ensures the row synchronization of the trigger and eliminates false positives.

[0028] The above examples are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing examples, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing examples, or make equivalent substitutions for some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solution to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A push-pull output detection method for a weak magnetic field sensor based on row and column scanning, characterized in that, Includes the following steps: Step 1: Construct a 4×4 detection matrix: First, distribute the 16 push-pull output weak magnetic sensors in a matrix relationship formed by the intersection of 4 row lines and 4 column lines. Each sensor occupies a unique matrix node. The output of the sensor is directly connected to the corresponding column line and connected to the corresponding row line through a current-limiting resistor. Step 2, I / O Function Initialization: Initialize and configure the microcontroller's I / O ports; connect the four row lines to the microcontroller's four output I / O ports, configure them as push-pull output mode, with a default output high level; enable them to drive; connect the four column lines to the microcontroller's four input I / O ports, configure them as input mode with internal pull-up resistors, with the column lines pulled high by internal resistors by default in input mode; put them in a ready-to-detect state, preparing for active scanning; Step 3, row-by-row gating scan: After initialization, the microcontroller sets the output I / O port of the current row line to low level in sequence for the four row lines, while keeping the other three row lines high level; When detecting the level of the column line, the level status of the four column lines is read. If a column line is low, the sensor output at the intersection of the row line and the column line is determined to be in a triggered state; if the column line is high, the sensor at that intersection is determined not to be triggered. Step 4, Post-scan recovery and result output: After the current row line detection is completed, restore it to high level, repeat step 3 until all row lines are scanned, and output the position information of all triggered sensors.

2. The method according to claim 1, characterized in that: In step 1, the push-pull output magnetic weakening sensor outputs a high level when no magnetic weakening signal is detected and outputs a low level when a magnetic weakening signal is detected.

3. The method according to claim 1, characterized in that: The current-limiting resistor in step 1 has a resistance of 1kΩ.

4. The method according to claim 1, characterized in that: In step 3, the low level of the column line when the current row line is pulled low is a valid signal. If the row line is high and the column line is low, it is determined to be an invalid interference signal and is not recorded as a sensor trigger.

5. A push-pull output detection system for a weak magnetic field sensor based on row and column scanning, used to implement the output detection method according to any one of claims 1 to 4, characterized in that, include: Power supply module, sensor matrix module, row line control module, column line detection module, and microcontroller; The power module includes a 5V power supply, a voltage regulator, a first capacitor, and a second capacitor. The input terminal of the voltage regulator is connected to the 5V power supply, and the output terminal is connected to one end of the first capacitor and the second capacitor. The other end of the first capacitor and the second capacitor is grounded. The output terminal of the voltage regulator is divided into two paths: one path powers the microcontroller, and the other path powers the VCC pins of 16 sensors. The sensor matrix module includes 16 push-pull weak magnetic sensors, arranged in a 4-row, 4-column cross pattern. The VCC pin of each sensor is connected to a 5V power supply, and the ground pin, the ground pin of the microcontroller, and the ground terminal of the power supply module are all connected to the same common ground of the system. The output terminal of each sensor is directly connected to the corresponding column line and connected to the corresponding row line through a current-limiting resistor. The row line control module includes 4 row lines. Each row line is connected in series with a current-limiting resistor and then connected to the output terminal of the corresponding sensor. The other end of the row line is connected to the output I / O port of the microcontroller. The column line detection module includes 4 column lines, one end of which is connected to the output end of the corresponding sensor, and the other end is connected to the input IO port of the microcontroller; The microcontroller is used to control the row line control module to generate row-by-row scanning signals, read the level status of the column line detection module, process and determine the position of the trigger sensor, and finally output the position information.

6. The system according to claim 5, characterized in that: The microcontroller used is an STM32F103 series microcontroller.

7. The system according to claim 5, characterized in that: In the sensor matrix module, a third capacitor is connected in parallel between the output terminal of each sensor and ground.