Proximity switch PCB, detection method and storage medium thereof

By designing a PCB board containing NPN and PNP tubes, using a specific circuit connection method, the problem of poor adaptability of traditional PCB boards is solved, multi-functional adaptation is achieved, and inventory and volume are reduced.

CN119815676APending Publication Date: 2025-04-11KENAIDA ELECTRIC CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411986070.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The PCB boards of traditional proximity switches need to be designed separately to adapt to NPN-PNP-normal open-normal closed functions, resulting in poor adaptability, cumbersome material statistics and large inventory.

Method used

By designing a PCB board containing NPN and PNP tubes, a specific circuit connection method is adopted, so that the same PCB board can simultaneously adapt to NPN circuits and PNP circuits, and realize the function of NPN-PNP normally open and normally closed without changing the PCB circuit structure.

Benefits of technology

It realizes multi-functional adaptation of a PCB board, reduces PCB inventory, reduces material statistics complexity, and reduces PCB volume.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119815676A_ABST
    Figure CN119815676A_ABST
Patent Text Reader

Abstract

The invention relates to the field of PCB design, in particular to a PCB of a proximity switch, a detection method and a storage medium thereof.The PCB comprises an NPN tube Q1, a PNP tube Q2, an NPN tube Q3, a PNP tube Q4, a power source +, a power source-, a load R and a load L. The base electrode of the NPN tube Q1 is electrically connected to the collector electrode of the PNP tube Q2, the collector electrode of the NPN tube Q1 is electrically connected to the base electrode of the PNP tube Q2, the emitter electrode of the NPN tube Q1 is electrically connected to the emitter electrode of the NPN tube Q3, and the base electrode of the NPN tube Q1 is electrically connected to the emitter electrode of the NPN tube Q4. An emitter electrode of the PNP tube Q2 is electrically connected to an emitter electrode of the PNP tube Q4, a base electrode of the NPN tube Q3 is connected to a collector electrode of the PNP tube Q4, a collector electrode of the NPN tube Q3 is electrically connected to a base electrode of the PNP tube Q4, a base electrode of the NPN tube Q1 is electrically connected to an R-IN end, a base electrode of the NPN tube Q3 is electrically connected to an L-IN end, a load R and a load L are connected in series and then connected between the PNP tube Q2 and the PNP tube Q4 in parallel, and a power supply + and a power supply-are connected to the PNP tube Q2 in parallel. And the other group of power supply + and power supply-is connected in parallel with the NPN tube Q2. The method has the effect of greatly improving the adaptability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of PCB board design, and in particular to a PCB board, a detection method and a storage medium thereof for a proximity switch. Background Art

[0002] The NPN and PNP types of proximity switches can achieve different functions, which are mainly reflected in the output signal, circuit connection and application scenarios. In terms of output signal, the NPN proximity switch outputs a low level when there is no target and a high level when it is turned on, while the PNP proximity switch outputs a high level when there is no target and a low level when it is turned on. In terms of circuit connection, the NPN proximity switch is usually used to control the situation where the "source" is connected to the positive pole, and the load is connected to the ground wire by turning on the switch. The PNP proximity switch is suitable for controlling the situation where the "source" is connected to the negative pole, but when the switch is turned on, it connects the load to the positive pole of the power supply. In the application scenario, the NPN proximity switch is more suitable for circuits and systems compatible with low-level signals, and the PNP proximity switch is more suitable for circuits and systems compatible with high-level signals.

[0003] Therefore, there are significant differences between NPN and PNP proximity switches in output signals, circuit connection methods, and application scenarios. When choosing which type of proximity switch to use, it is necessary to decide based on actual circuit needs and design requirements. Traditional proximity switches are generally designed with separate functions such as NPN-PNP-normally open-normally closed. The numerous functional types also lead to a large number of PCB board models, resulting in cumbersome material statistics and large inventory. Summary of the invention

[0004] In order to improve the problem that the PCB board needs to be designed separately to adapt to functions such as NPN-PNP-normally open-normally closed, resulting in poor adaptability, the present application provides a PCB board, a detection method and a storage medium for a proximity switch.

[0005] The present application provides a PCB board for a proximity switch, which adopts the following technical solution: A PCB board for a proximity switch, comprising an NPN tube Q1, a PNP tube Q2, an NPN tube Q3, a PNP tube Q4, two power supplies +, two power supplies -, a load R and a load L, wherein the base of the NPN tube Q1 is electrically connected to the collector of the PNP tube Q2, the collector of the NPN tube Q1 is electrically connected to the base of the PNP tube Q2, the emitter of the NPN tube Q1 is electrically connected to the emitter of the NPN tube Q3, the emitter of the PNP tube Q2 is electrically connected to the emitter of the PNP tube Q4, the base of the NPN tube Q3 is connected to the collector of the PNP tube Q4, and the collector of the NPN tube Q3 is electrically connected to the collector of the PNP tube Q4. On the base of Q4, the base of the NPN tube Q1 and the collector of the PNP tube Q2 are connected in parallel at the R-IN end, the base of the NPN tube Q3 and the collector of the PNP tube Q4 are connected in parallel at the L-IN end, the load R and the load L are connected in series and then connected in parallel between the collector of the PNP tube Q2 and the collector of the PNP tube Q4, the two power supplies + and the two power supplies - are divided into two groups, the power supply + and the power supply - of the first group are connected in parallel between the emitter of the PNP tube Q2 and the emitter of the PNP tube Q4, and the power supply + and the power supply - of the second group are connected in parallel between the base of the NPN tube Q2 and the base of the NPN tube Q4.

[0006] By adopting the above technical solution, through the design of the same PCB board, it is possible to adapt the NPN circuit and the PNP circuit at the same time, and realize the NPN-PNP normally open and normally closed functions without changing the PCB circuit structure, thereby achieving multiple uses of one board, reducing PCB inventory and reducing PCB volume.

[0007] Optionally, it also includes a diode D1, a diode D2, a diode D3 and a resistor R5, the positive electrode of the diode D1 is electrically connected to the R-IN terminal, the negative electrode of the diode D1 is electrically connected to the collector of the PNP tube Q2, the positive electrode of the diode D2 is electrically connected to the L-IN terminal, the negative electrode of the diode D2 is electrically connected to the collector of the PNP tube Q4, the positive electrode of the diode D3 is electrically connected to the power supply + of the first group, and the resistor R5 is connected in series to the power supply - of the second group.

[0008] By adopting the above technical solution, the design of the PCB circuit structure is adapted to the PNP circuit.

[0009] Optionally, it also includes a diode D4 and a resistor R10, wherein the cathode of the diode D1 is electrically connected to the R-IN terminal, the anode of the diode D1 is electrically connected to the collector of the PNP tube Q2, the cathode of the diode D2 is electrically connected to the L-IN terminal, the anode of the diode D2 is electrically connected to the collector of the PNP tube Q4, the anode of the diode D4 is electrically connected to the power supply - of the first group, and the resistor R10 is connected in series to the power supply + of the second group.

[0010] By adopting the above technical solution, by changing the positive and negative pole directions of the diode D1 and the diode D2, and adjusting the positions of the diode D3, the diode D4, the resistor R5 and the resistor R10, the PNP circuit can be quickly switched to the NPN circuit, and the production of the PNP circuit can be switched to the NPN circuit without changing the PCB circuit structure.

[0011] Optionally, it also includes relay KM1, relay KM2, relay KM3 and relay KM4, wherein relay KM1 is connected in series to the positive electrode of diode D1, relay KM2 is connected in series to the negative electrode of diode D1, the end of relay KM1 away from diode D1 is connected in parallel to the negative electrode of diode D1, and the end of relay KM2 away from diode D1 is connected in parallel to the positive electrode of diode D1; relay KM3 is connected in series to the positive electrode of diode D2, relay KM4 is connected in series to the negative electrode of diode D2, the end of relay KM3 away from diode D2 is connected in parallel to the negative electrode of diode D2, and the end of relay KM4 away from diode D2 is connected in parallel to the positive electrode of diode D2.

[0012] By adopting the above technical solution, the positive and negative directions of the diodes D1 and D2 can be quickly changed through the relays KM1, KM2, KM3 and KM4.

[0013] Optionally, it further includes relay KM5, relay KM6, relay KM7 and relay KM8, wherein the relay KM5 is connected in parallel to the resistor R10, the relay KM6 is connected in parallel to the resistor R5, the relay KM7 is connected in parallel to the diode D3, and the relay KM8 is connected in parallel to the diode D4.

[0014] By adopting the above technical solution, the positions of the diode D3, the diode D4, the resistor R5 and the resistor R10 can be quickly changed through the relay KM5, the relay KM6, the relay KM7 and the relay KM8, so that after the user purchases a PCB board, it can be used for PNP circuits and NPN circuits. At the same time, it also facilitates production, allowing manufacturers to only retain this production line, greatly improving adaptability.

[0015] Optionally, also include: The data processing module is used for the user to input data and output corresponding processing signals to control the on / off of relays KM1, KM2, KM3, KM4, KM5, KM6, KM7 and KM8; The detection module is used to detect the load R and the load L, obtain the detection data and output it to the data processing module. The data processing module performs calculation processing to obtain the corresponding processing signal and output it.

[0016] By adopting the above technical solution, the user can manually switch the PNP circuit and the NPN circuit, and can also automatically switch the PNP circuit and the NPN circuit according to the types of the load R and the load L, which is convenient and fast.

[0017] The present application provides a detection method for a PCB board of a proximity switch, which adopts the following technical solution: A method for detecting a PCB board of a proximity switch, comprising: Acquire detection data and the input signal; Determining load status data through the detection data and a preset load working threshold; Determine load adjustment data according to the load state data, the input signal and a preset control threshold; A processing signal is determined by the load adjustment data and the switching threshold and outputted.

[0018] By adopting the above technical solution, the PNP circuit and the NPN circuit are automatically switched according to the types of the load R and the load L, which is convenient and quick.

[0019] The present application provides a computer-readable storage medium, which adopts the following technical solution: A computer-readable storage medium stores a computer program that can be loaded by a processor and executed to detect a PCB board of a proximity switch.

[0020] By adopting the above technical solution, the computer program is stored in a computer-readable storage medium.

[0021] In summary, the present application includes at least one of the following beneficial technical effects: 1. Through the design of the same PCB board, it is possible to adapt to both NPN circuits and PNP circuits at the same time, and realize the NPN-PNP normally open and normally closed functions without changing the PCB circuit structure, thereby achieving multiple uses of one board, reducing PCB inventory and reducing PCB volume.

[0022] 2. A PCB board can quickly change the positive and negative directions of the diodes D1 and D2, and can also quickly change the positions of the diodes D3, D4, the resistors R5 and R10, so as to adapt to the switching between the PNP circuit and the NPN circuit. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 This is a circuit diagram of the PNP circuit state of a PCB board of a proximity switch in Example 1 of the present application.

[0024] Figure 2 It is a circuit diagram highlighting the state of the NPN circuit.

[0025] Figure 3 This is a circuit diagram of a PCB board of a proximity switch in Example 2 of the present application.

[0026] Figure 4 This is a module schematic diagram of a PCB board of a proximity switch in Example 2 of the present application.

[0027] Figure 5 It is a flow chart of a PCB board of a proximity switch in Example 2 of the present application.

[0028] Explanation of the accompanying drawings: 1. Data processing module; 2. Detection module. DETAILED DESCRIPTION

[0029] The following is combined with Figure 1-5 This application is described in further detail.

[0030] Embodiment 1 of the present application discloses a PCB board of a proximity switch. Figure 1 The PCB board of the proximity switch includes NPN tube Q1, PNP tube Q2, NPN tube Q3, PNP tube Q4, two power supplies +, two power supplies -, load R, load L, resistor R1, resistor R2, resistor R3, resistor R4, resistor R6, resistor R7, resistor R8, resistor R9, diode D1 and diode D1, diode D1 is connected in series between the base of NPN tube Q1 and the collector of PNP tube Q2, resistor R4 is connected in series between the collector of NPN tube Q1 and the base of PNP tube Q2, and resistor R3 and resistor R7 are connected in series between the emitter of NPN tube Q1 and the emitter of NPN tube Q3.

[0031] Reference Figure 1, the emitter of PNP tube Q2 is electrically connected to the emitter of PNP tube Q4, diode D2 is connected in series between the base of NPN tube Q3 and the collector of PNP tube Q4, resistor R9 is connected in series between the collector of NPN tube Q3 and the base of PNP tube Q4, R-IN terminal is electrically connected to one end of resistor R1, one end of resistor R1 is connected in parallel between the base of NPN tube Q1 and diode D1, L-IN terminal is electrically connected to one end of resistor R8, the other end of resistor R8 is connected in parallel between the base of NPN tube Q3 and diode D2. Load R is connected in series with load L, the end of load R away from load L is connected in parallel between diode D1 and the collector of PNP tube Q2, and the end of load L away from load R is connected in parallel between diode D2 and the collector of PNP tube Q4. Two power supplies + and two power supplies - are divided into two groups, and the power supply + and power supply - of the second group are connected in parallel between the base of NPN tube Q2 and the base of NPN tube Q4. Resistor R2 is connected in series with resistor R6, the end of resistor R2 away from resistor R6 is connected in parallel with the base of NPN tube Q1, the end of resistor R6 away from resistor R2 is connected in parallel with the base of NPN tube Q3, the power supply + and the power supply - of the first group are connected in parallel between resistor R2 and resistor R6, and the power supply + and the power supply - of the first group are also connected in parallel between load R and load L, and load R and load L can be external electrical appliances.

[0032] Reference Figure 1 When working as a PNP circuit, it also includes a diode D3 and a resistor R5, the anode of the diode D1 is electrically connected to the base of the NPN tube Q1, the cathode of the diode D1 is electrically connected to the collector of the PNP tube Q2, the anode of the diode D2 is electrically connected to the base of the NPN tube Q3, the cathode of the diode D2 is electrically connected to the collector of the PNP tube Q4, the anode of the diode D3 is electrically connected to the power supply + of the first group, and the resistor R5 is connected in series to the power supply - of the second group.

[0033] Reference Figure 2 When working as an NPN circuit, it also includes a diode D4 and a resistor R10. There is no resistor R5 and a diode D3 in this circuit. The cathode of the diode D1 is electrically connected to the base of the NPN tube Q1, the anode of the diode D1 is electrically connected to the collector of the PNP tube Q2, the cathode of the diode D2 is electrically connected to the base of the NPN tube Q3, the anode of the diode D2 is electrically connected to the collector of the PNP tube Q4, the anode of the diode D4 is electrically connected to the power supply - of the first group, and the resistor R10 is connected in series to the power supply + of the second group.

[0034] The implementation principle of a PCB board of a proximity switch in Example 1 of the present application is: by changing and adjusting the positive and negative directions of diodes D1 and D2 and the positions of resistors R5 and R10 on the same PCB board, the power supply polarity of the transistor is changed, and the current direction of the short-circuit protection diode is swapped to achieve two working states of NPN and PNP on the same PCB board.

[0035] Embodiment 2: Embodiment 2 of the present application discloses a PCB board of a proximity switch. Referring to FIG. 3 , the PCB board of the proximity switch includes a relay KM1, a relay KM2, a relay KM3, a relay KM4, a relay KM5, a relay KM6, a relay KM7, a relay KM8, a detection module 2 and a data processing module 1, a resistor R5, a resistor R10, a diode D3 and a diode D4 can exist at the same time, one end of the relay KM1 is electrically connected to the positive electrode of the diode D1, the other end of the relay KM1 is electrically connected to the base of the NPN tube Q1, one end of the relay KM2 is electrically connected to the negative electrode of the diode D1, the other end of the relay KM2 is electrically connected to the collector of the PNP tube Q2, the end of the relay KM1 away from the diode D1 is connected in parallel to the negative electrode of the diode D1, and the end of the relay KM2 away from the diode D1 is connected in parallel to the positive electrode of the diode D1.

[0036] Reference Figure 3 , one end of relay KM3 is electrically connected to the positive electrode of diode D2, the other end of relay KM3 is electrically connected to the base of NPN tube Q3, one end of relay KM4 is electrically connected to the negative electrode of diode D2, the other end of relay KM4 is electrically connected to the collector of PNP tube Q4, the end of relay KM3 away from diode D2 is connected in parallel to the negative electrode of diode D2, the end of relay KM4 away from diode D2 is connected in parallel to the positive electrode of diode D2. Relay KM5 is connected in parallel to resistor R10, relay KM6 is connected in parallel to resistor R5, relay KM7 is connected in parallel to diode D3, and relay KM8 is connected in parallel to diode D4.

[0037] Reference Figure 4, the detection module 2 includes various instruments with collection functions, such as electric energy meters, ammeters, voltmeters, etc., to collect data from loads R and L, obtain detection data and output them to the data processing module 1. The data processing module 1 includes a processor and a database, the database is used to store various threshold data, such as load working thresholds, control thresholds and other threshold data, the processor is used to receive the detection data, and call the corresponding threshold data from the database to calculate and process the data, obtain the processing signal and output it to relays KM1, relays KM2, relays KM3, relays KM4, relays KM5, relays KM6, relays KM7 and relays KM8 for corresponding control, so as to directly switch the circuit between the PNP circuit and the NPN circuit, and the processor can also directly accept the user's input, for example, the user can burn in the program through the keyboard or interface to achieve direct control.

[0038] The processor may include a central processing unit such as a CPU or MPU or a host system built around a CPU or MPU, including hardware or software. After the meter has a processor, people can freely control the metering instrument through programming to make it run according to people's wishes. The processor can control local measurement transmission, remote measurement transmission, remote communication, etc. through internal protocols. Internal protocols refer to all protocols that achieve mutual communication or links within the same metering instrument or the same system, including: human-computer interaction protocols, software / hardware (interface) protocols, chip bus (C-Bus) protocols, internal bus (I-Bus) protocols, etc. Part or all of the protocols. With the development of integrated circuit technology, some protocols that belong to the external bus (E-Bus) protocol are also classified as internal protocols after the external bus (E-Bus) is integrated into the chip.

[0039] Embodiment 2 of the present application discloses a method for detecting a PCB board of a proximity switch. Figure 5 , the detection method of the PCB board of the proximity switch includes the following steps: S1, obtain detection data and input signal; S11, determining load status data by detecting data and a preset load working threshold; S12, determining load adjustment data according to load state data, input signal and preset control threshold; S13, determining and outputting a processing signal based on the load adjustment data and the switching threshold.

[0040] In detail: the detection data is the working status data of load R and load L. For example, by detecting the current and voltage of the load, the working power can be obtained. Combined with the load working threshold, it can be determined whether the load has reached the rated power and is in normal operation. This is the load status data; the input signal is the input signal, such as the R-IN terminal, the L-IN terminal, or the power supply + and the power supply -. Combined with the control threshold, it is possible to automatically determine under what conditions the circuit is used, whether it is used for differential signals, or for power supply circuit control, XOR or other functions. At this time, combined with the load status data, it can be determined whether the load is in the state it should be in under the working condition corresponding to the input signal. If the judgment is yes, it means that the circuit type is correct. If the judgment is no, it means that the circuit type is wrong. At this time, it will automatically switch between the PNP circuit or the NPN circuit.

[0041] Embodiment 2 of the present application discloses a computer-readable storage medium. The computer-readable storage medium stores a computer program that can be loaded by a processor and executes a method for detecting a PCB board of a proximity switch.

[0042] Computer-readable storage media include, for example, various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0043] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.

Claims

1. A PCB board for a proximity switch, characterized in that: The invention comprises an NPN tube Q1, a PNP tube Q2, an NPN tube Q3, a PNP tube Q4, two power supplies +, two power supplies -, a load R and a load L, wherein the base of the NPN tube Q1 is electrically connected to the collector of the PNP tube Q2, the collector of the NPN tube Q1 is electrically connected to the base of the PNP tube Q2, the emitter of the NPN tube Q1 is electrically connected to the emitter of the NPN tube Q3, the emitter of the PNP tube Q2 is electrically connected to the emitter of the PNP tube Q4, the base of the NPN tube Q3 is connected to the collector of the PNP tube Q4, and the collector of the NPN tube Q3 is electrically connected to the base of the PNP tube Q4 , the base of the NPN tube Q1 and the collector of the PNP tube Q2 are connected in parallel at the R-IN terminal, the base of the NPN tube Q3 and the collector of the PNP tube Q4 are connected in parallel at the L-IN terminal, the load R and the load L are connected in series and then connected in parallel between the collector of the PNP tube Q2 and the collector of the PNP tube Q4, the two power supplies + and the two power supplies - are divided into two groups, the power supply + and the power supply - of the first group are connected in parallel between the emitter of the PNP tube Q2 and the emitter of the PNP tube Q4, and the power supply + and the power supply - of the second group are connected in parallel between the base of the NPN tube Q2 and the base of the NPN tube Q4.

2. The PCB board of a proximity switch according to claim 1, characterized in that: It also includes a diode D1, a diode D2, a diode D3 and a resistor R5, wherein the anode of the diode D1 is electrically connected to the R-IN terminal, the cathode of the diode D1 is electrically connected to the collector of the PNP tube Q2, the anode of the diode D2 is electrically connected to the L-IN terminal, the cathode of the diode D2 is electrically connected to the collector of the PNP tube Q4, the anode of the diode D3 is electrically connected to the power supply + of the first group, and the resistor R5 is connected in series to the power supply - of the second group.

3. The PCB board of a proximity switch according to claim 2, characterized in that: It also includes a diode D4 and a resistor R10, wherein the cathode of the diode D1 is electrically connected to the R-IN terminal, the anode of the diode D1 is electrically connected to the collector of the PNP tube Q2, the cathode of the diode D2 is electrically connected to the L-IN terminal, the anode of the diode D2 is electrically connected to the collector of the PNP tube Q4, the anode of the diode D4 is electrically connected to the power supply - of the first group, and the resistor R10 is connected in series to the power supply + of the second group.

4. The PCB board of a proximity switch according to claim 3, characterized in that: It also includes relay KM1, relay KM2, relay KM3 and relay KM4, wherein relay KM1 is connected in series to the positive electrode of diode D1, relay KM2 is connected in series to the negative electrode of diode D1, the end of relay KM1 away from diode D1 is connected in parallel to the negative electrode of diode D1, the end of relay KM2 away from diode D1 is connected in parallel to the positive electrode of diode D1; relay KM3 is connected in series to the positive electrode of diode D2, relay KM4 is connected in series to the negative electrode of diode D2, the end of relay KM3 away from diode D2 is connected in parallel to the negative electrode of diode D2, the end of relay KM4 away from diode D2 is connected in parallel to the positive electrode of diode D2.

5. The PCB board of a proximity switch according to claim 4, characterized in that: It also includes relays KM5, KM6, KM7 and KM8. The relay KM5 is connected in parallel to the resistor R10, the relay KM6 is connected in parallel to the resistor R5, the relay KM7 is connected in parallel to the diode D3, and the relay KM8 is connected in parallel to the diode D4.

6. The PCB board of a proximity switch according to claim 5, characterized in that: Also includes: The data processing module (1) is used for allowing the user to input data and outputting corresponding processing signals to control the on / off of the relays KM1, KM2, KM3, KM4, KM5, KM6, KM7 and KM8; The detection module (2) is used to detect the load R and the load L, obtain detection data and output it to the data processing module (1); the data processing module (1) performs calculation processing to obtain the corresponding processing signal and outputs it.

7. A method for detecting a PCB board of a proximity switch, using the PCB board of a proximity switch according to claim 1, characterized in that: include: Acquire detection data and the input signal; Determining load status data through the detection data and a preset load working threshold; Determine load adjustment data according to the load state data, the input signal and a preset control threshold; A processing signal is determined by the load adjustment data and the switching threshold and outputted.

8. A computer-readable storage medium, characterized in that: A computer program is stored which can be loaded by a processor and executes a method for detecting a PCB board of a proximity switch as claimed in claim 7.