Sensor identification switching circuit and sensor identification switching device

Through the combination of controller, bidirectional optocoupler and logic optocoupler, automatic identification of sensor output type and input type matching are achieved, solving the problem of artificial wiring errors and compatibility in sensor recognition switching, and improving the flexibility and reliability of the system .

CN222281072UActive Publication Date: 2024-12-31GUANGDONG LYRIC ROBOT INTELLIGENT AUTOMATION CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202323671282.1
Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2024-12-31
Estimated Expiration
2033-12-29

AI Technical Summary

Technical Problem

In the prior art, sensor identification switching schemes rely on human wiring, which are prone to errors that lead to sensor failure and cannot automatically adapt to the NPN and PNP compatibility problems of external devices.

Method used

A sensor recognition switching circuit is designed to use a controller, a bidirectional optocoupler and a logic optocoupler to identify the output type of the sensor through push-pull output level signals, and automatically match the input type of the controller, including NPN and PNP types.

Benefits of technology

Automatic recognition of sensors and input type matching is achieved, reducing human configuration errors, improving compatibility and reliability, simplifying installation and maintenance processes, and adapting to different types of sensors without changing physical wiring or complex configurations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN222281072U_ABST
    Figure CN222281072U_ABST
Patent Text Reader

Abstract

The utility model discloses a sensor identification switching circuit and a sensor identification switching device, the circuit comprises a controller, a bidirectional optocoupler and a logic optocoupler, the controller is provided with a first pin and a second pin, the logic optocoupler is provided with a first input pin, a second input pin and an output pin, the first pin is connected with the output pin, and the second pin is connected with the bidirectional optocoupler. The second pin is connected with the first input pin through the logic optocoupler, the second input pin is connected with the sensor, the first input pin and the second input pin are connected through the first resistor, and the controller can activate the logic optocoupler through the second pin to enable the logic optocoupler to carry out push-pull to output a level signal. The output type of the sensor is identified by monitoring the level state of the first pin, and the input type is switched according to the output type, so that the output type of the sensor is automatically identified, and the input type of the controller is automatically matched according to the output type of the sensor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of sensor identification technology, and in particular to a sensor identification switching circuit and a sensor identification switching device. Background Art

[0002] The output types of current sensors can be divided into NPN and PNP types. Correspondingly, the input types of controllers (MCU controllers, PLCs, motion control cards) will also have corresponding NPN and PNP types. The output type of switch-type sensors must match the input type of the controller (MCU controllers, PLCs, motion control cards) in order to properly identify the signal of the switch-type sensor.

[0003] The traditional solution for sensor identification switching in the prior art is generally to have an electrical engineer manually check the output type of the sensor in advance and change the type of the controller through the physical wiring method of the common trigger end. However, this traditional solution may cause sensor failure due to wiring errors by electrical engineers, as well as NPN and PNP compatibility issues caused by changes when external devices are selected or upgraded. Utility Model Content

[0004] The embodiments of the present application provide a sensor identification switching circuit and a sensor identification switching device, which can at least ensure that the solution of the present application can automatically identify the output type of the sensor and automatically match the input type of the controller according to the output type of the sensor, thereby effectively avoiding the problem of sensor failure caused by wiring errors of electrical engineers in traditional solutions, as well as NPN and PNP compatibility issues caused by changes when external devices are selected or upgraded.

[0005] In a first aspect, an embodiment of the present application provides a sensor identification switching circuit, the circuit comprising: a controller, a bidirectional optocoupler and a logic optocoupler, the controller is provided with a first pin and a second pin, the logic optocoupler is provided with a first input pin, a second input pin and an output pin; the first pin is connected to the output pin, the second pin is connected to the first input pin through the logic optocoupler, the second input pin is connected to the sensor, and the first input pin and the second input pin are connected through a first resistor;

[0006] Among them, when the sensor is in trigger mode, the controller is used to enable the logic optocoupler to push-pull the output level signal through the second pin, obtain the level state of the first pin, so as to identify the output type of the sensor according to the level state, and switch the input type according to the output type, and the output type and the input type both include NPN type and PNP type.

[0007] In some embodiments, the second input pin is pin 1 of the bidirectional optocoupler, the first input pin is pin 2 of the bidirectional optocoupler, the output pin is pin 4 of the bidirectional optocoupler, and pin 3 of the bidirectional optocoupler is grounded; a bidirectional light emitting diode is arranged between pins 1 and 2 of the bidirectional optocoupler, and a photosensitive tube is arranged between pins 3 and 4 of the bidirectional optocoupler.

[0008] In some embodiments, pin 2 of the logic optocoupler is connected to the second pin, pins 3 and 5 of the logic optocoupler are grounded, pin 6 of the logic optocoupler is connected to the first input pin, and pin 8 of the logic optocoupler is connected to a power supply; a light emitting diode is arranged between pins 2 and 3 of the logic optocoupler, and a push-pull structure is arranged between pins 5, 6 and 8 of the logic optocoupler, and the push-pull structure includes an interconnected light detector and two MOS tubes.

[0009] In some embodiments, when identifying the output type of the sensor according to the level state, the controller is used to enable the logic optocoupler to push-pull and output a high-level signal through the second pin, so as to identify the sensor as an NPN type when the level state is a low level.

[0010] In some embodiments, when the level state is a low level, the controller is further used to enable the logic optocoupler to push-pull and output a low level signal through the second pin, and to read the level state periodically, so as to identify the sensor as an NPN type when the level state changes from low to high.

[0011] In some embodiments, when the level state is a high level, the controller is further used to enable the logic optocoupler to push-pull and output a low level signal through the second pin, and to read the level state periodically to identify that the sensor is a PNP type when the level state is a low level.

[0012] In some embodiments, when the level state is read at a regular interval and the level state is at a low level, the controller is also used to enable the logic optocoupler to push-pull and output a high level signal through the second pin, and to read the level state at a regular interval so as to identify the sensor as a PNP type when the level state changes from low to high.

[0013] In some embodiments, when the input type of the controller is switched according to the output type, the controller is used to control the second pin to output a high-level signal when the sensor is identified as an NPN type, so that the corresponding input module is automatically switched to the NPN type; when the sensor is identified as a PNP type, the controller controls the second pin to output a low-level signal so that the input module is automatically switched to the PNP type.

[0014] In some embodiments, an indicator light is provided between the first pin and the output pin, and the indicator light is used to light up when the sensor is in a triggered state and the first pin is at a low level after the controller switches the input type of the controller according to the output type; and is off when the sensor is not in a triggered state and the first pin is at a high level.

[0015] In a second aspect, an embodiment of the present application provides a sensor identification switching device, wherein the device is provided with a sensor identification switching circuit as described in any one of the embodiments of the first aspect.

[0016] The present application has at least the following beneficial effects: the sensor identification switching circuit of the present application is composed of a controller, a bidirectional optocoupler and a logic optocoupler, the controller is provided with a first pin and a second pin, the logic optocoupler is provided with a first input pin, a second input pin and an output pin, the first pin is connected to the output pin, and the second pin is connected to the first input pin through the logic optocoupler. The second input pin is connected to the sensor, and the first input pin and the second input pin are connected through a first resistor, wherein, since the level of the first pin will change with the level signal of the push-pull output of the second pin, when the sensor is in trigger mode, the controller can activate the logic optocoupler through the second pin to make it push-pull output the level signal, and identify the output type (NPN or PNP) of the sensor by monitoring the level state of the first pin. Once the type of the sensor is identified, the controller automatically adjusts its input type to match the output type of the sensor, so that the present application can automatically identify the output type of the sensor and adjust the input type of the controller accordingly, reducing the need and errors for manual configuration, and improving compatibility and reliability, reducing the risk of sensor failure caused by wiring errors of electrical engineers, and automatically solving NPN and PNP compatibility issues when external devices are replaced or upgraded, so that the controller can adapt to different types of sensors more flexibly and extensibly without changing the physical wiring or performing complex reconfiguration. In addition, since there is no need for electrical engineers to manually check and configure the sensor, installation, maintenance and troubleshooting processes can be made simpler. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 A schematic diagram of a sensor identification switching circuit proposed in an embodiment of the present application;

[0018] Figure 2 A schematic diagram of a sensor identification switching circuit proposed in another embodiment of the present application. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0020] In some embodiments, although the functional modules are divided in the system diagram, in some cases, the modules can be divided differently from those in the system. The terms first, second, etc. in the specification and claims and the above drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0021] In addition, unless otherwise clearly specified and limited, the term "connected / connected" should be understood in a broad sense. For example, it can be a fixed connection or a movable connection, a detachable connection or a non-detachable connection, or an integral connection; it can be a mechanical connection, an electrical connection, or the two can communicate with each other; it can be a direct connection, or it can be indirectly connected through an intermediate medium.

[0022] In the description of the embodiments of the present application, the description of reference terms "one embodiment / implementation", "another embodiment / implementation" or "certain embodiments / implementations", "in the above embodiments / implementations", etc. means that the specific features, structures, materials or characteristics described in combination with the implementation or example are included in at least two embodiments or implementations disclosed in the present application. In the disclosure of this application, the schematic representation of the above terms does not necessarily refer to the same embodiment or implementation. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that in the flowchart.

[0023] The output types of current sensors can be divided into NPN and PNP types. Correspondingly, the input types of controllers (single-chip controllers, PLCs, motion control cards) will also have corresponding NPN and PNP types. The output type of the switch-type sensor must match the input type of the controller (single-chip controller, PLC, motion control card) in order to normally identify the signal of the switch-type sensor; the traditional solution for sensor identification switching in the prior art is generally to manually check the output type of the sensor in advance by an electrical engineer, and change the type of the controller through the physical wiring of the common trigger end. However, this traditional solution will cause sensor failure due to wiring errors by electrical engineers, as well as NPN and PNP compatibility issues when changes are made with the selection or upgrade of external devices.

[0024] Specifically, in the related art, the sensor output types include NPN type and PNP type, and the controller IO input signal type is fixed, and only one type of NPN and PNP can be selected. The corresponding type of sensor needs to be selected according to the input type of the controller. If the input type of the controller is NPN, the sensor must select the PNP type, and the controller has no response to the NPN type sensor. If the input type of the controller is PNP, the sensor must select the NPN type, and the controller has no response to the PNP type sensor. The IO input signal is set with 1 common terminal, and the common terminal can be connected to 0V or 24V. When the common terminal is connected to 0V, it is a PNP type input, and when the common terminal is connected to 24V, it is an NPN type input. Therefore, compatibility with NPN type sensors and PNP type sensors is achieved by changing the common physical wiring. However, this method cannot automatically identify the sensor type and automatically match the input type of the controller. When wiring, electrical engineers need to check the output type of the sensor in advance and connect the common terminal of the IO input signal according to the output type of the sensor. Once the common terminal is wired incorrectly, the sensor will fail and the sensor signal cannot be normally identified.

[0025] To solve the above problems, the embodiments of the present application provide a sensor identification switching circuit and a sensor identification switching device, which can at least ensure that the scheme of the present application can automatically identify the output type of the sensor and automatically match the input type of the controller according to the output type of the sensor, thereby effectively avoiding the problem of sensor failure caused by wiring errors of electrical engineers in traditional schemes, as well as the NPN and PNP compatibility problems caused by changes with the selection or upgrade of external devices. It can reduce the hardware debugging time of electrical engineers and improve the controller input type. It can also avoid the NPN and PNP compatibility problems caused by changes with the selection or upgrade of external devices.

[0026] The embodiments of the present application are further described below in conjunction with other drawings.

[0027] Please refer to Figure 1 , Figure 1A schematic diagram of a sensor identification switching circuit proposed in an embodiment of the present application; on the first aspect, the embodiment of the present application provides a sensor identification switching circuit, the circuit comprising: a controller, a bidirectional optocoupler and a logic optocoupler, the controller is provided with a first pin and a second pin, the logic optocoupler is provided with a first input pin, a second input pin and an output pin; the first pin DP1 is connected to the output pin, the second pin DP2 is connected to the first input pin through the logic optocoupler, a current-limiting resistor can also be provided between the second pin DP2 and the logic optocoupler, the second input pin is connected to the sensor, and the first input pin and the second input pin are connected through a first resistor; wherein, when the sensor is in trigger mode, the controller is used to make the logic optocoupler push-pull an output level signal through the second pin DP2, obtain the level state of the first pin DP1, so as to identify the output type of the sensor according to the level state, and switch the input type according to the output type, and the output type and the input type both include NPN type and PNP type.

[0028] Among them, the sensor identification switching circuit of the present application is composed of a controller, a bidirectional optocoupler and a logic optocoupler, the first pin is connected to the output pin, and the second pin is connected to the first input pin through the logic optocoupler. The second input pin is connected to the sensor, and a current limiting resistor can also be set between the second input pin and the sensor, and the first input pin and the second input pin are connected through the first resistor. Since the level of the first pin changes with the level signal of the push-pull output of the second pin, when the sensor is in trigger mode, the controller can activate the logic optocoupler through the second pin to make it push-pull output the level signal, and identify the output type (NPN or PNP) of the sensor by monitoring the level state of the first pin. Once the type of the sensor is identified, the controller automatically adjusts its input type to match the output type of the sensor, so that the present application can automatically identify the output type of the sensor and adjust the input type of the controller accordingly, reducing the need and errors of manual configuration, and improving compatibility and reliability, reducing the risk of sensor failure caused by wiring errors of electrical engineers, and automatically solving NPN and PNP compatibility issues when external devices are replaced or upgraded, so that the controller can adapt to different types of sensors more flexibly and extensibly without changing the physical wiring or performing complex reconfiguration. In addition, since there is no need for electrical engineers to manually check and configure the sensor, the installation, maintenance and troubleshooting processes can be made simpler.

[0029] Please refer to Figure 2 , Figure 2A schematic diagram of a sensor identification switching circuit proposed in another embodiment of the present application; in some embodiments, the second input pin is pin 1 of the bidirectional optocoupler U1, the first input pin is pin 2 of the bidirectional optocoupler U1, the output pin is pin 4 of the bidirectional optocoupler U1, and pin 3 of the bidirectional optocoupler U1 is grounded; a bidirectional light emitting diode is arranged between pins 1 and 2 of the bidirectional optocoupler U1, a photosensitive tube is arranged between pins 3 and 4 of the bidirectional optocoupler U1, and a resistor R3 is also arranged between pins 1 and 2 outside the bidirectional optocoupler U1. Specifically, the resistance value of resistor R3 can be 2K.

[0030] Please refer to Figure 2 In some embodiments, pin 2 of the logic optocoupler U2 is connected to the second pin DP2, pins 3 and 5 of the logic optocoupler U2 are grounded, pin 6 of the logic optocoupler U2 is connected to the first input pin, and pin 8 of the logic optocoupler U2 is connected to a power supply, such as a +24V power supply; a light emitting diode is provided between pins 2 and 3 of the logic optocoupler U2, and pins 5, 6, and 8 of the logic optocoupler U2 are provided. Figure 2 The push-pull structure shown in the figure includes a photodetector and two MOS tubes connected to each other.

[0031] Please refer to Figure 2 In some embodiments, the second pin DP2 is connected to pin 2 of the logic optocoupler U2 through a current limiting resistor R5, the sensor is also connected to a +24V power supply and grounded, the sensor is connected to pin 1 of the bidirectional optocoupler U1 through the current limiting resistor R2, pin 5 of the logic optocoupler U2 is grounded through a grounding resistor R6, and pin 8 of the logic optocoupler U2 is connected to the +24V power supply through a grounding resistor R4. The resistance value of R2 can be 6.8K, and the resistance values ​​of R6 and R4 can be 20R.

[0032] In some embodiments, when identifying the output type of the sensor according to the level state, the controller is used to enable the logic optocoupler to push-pull and output a high-level signal through the second pin, so as to identify the sensor as an NPN type when the level state of the first pin is a low level. That is, when the sensor is an NPN type, the level state should be a low level, so the NPN type can be identified.

[0033] In some embodiments, when the level state of the first pin is a low level, the controller is also used to enable the logic optocoupler to push-pull and output a low level signal through the second pin, and to read the level state periodically, so as to identify the sensor as an NPN type when the level state changes from low to high. That is, when the sensor is an NPN type, the level state change trend read periodically should be from low to high, so the NPN type can be identified.

[0034] It can be imagined that, corresponding to the above embodiment, during the identification process, the sensor must be in a triggered state, and the DP2 pin of the controller push-pull outputs a high level. After a delay of 100us, the controller reads the level state of the DP1 pin. The DP1 pin level of the controller is low, indicating that the sensor is of NPN type. If the DP1 pin level of the controller is high, the DP2 pin of the controller is set to push-pull output a low level. After a delay of 100us, the controller reads the level state of the DP1 pin. If it becomes a low level at this time, it means that the sensor is of PNP type. If the DP2 pin is still high, it means that the sensor is not connected.

[0035] In some embodiments, when the level state of the first pin is a high level, the controller is also used to enable the logic optocoupler to push-pull and output a low level signal through the second pin, and to read the level state regularly, so as to identify the sensor as a PNP type when the level state of the first pin is a low level. That is, when the sensor is a PNP type, the regularly read level state should be a low level, so the PNP type can be identified.

[0036] In some embodiments, when the level state is read at a timed interval and the level state is at a low level, the controller is also used to enable the logic optocoupler to push-pull and output a high level signal through the second pin, and to read the level state at a timed interval, so as to identify the sensor as a PNP type when the level state changes from low to high. That is, when the sensor is a PNP type, after outputting a high level signal, the change trend of the level state read at a timed interval should be from low to high, so the PNP type can be identified.

[0037] It can be imagined that after determining and identifying the output type of the sensor, the above process of determining whether the identified type is normal can also be used to improve the recognition accuracy. Specifically, during the recognition process, the sensor must be in a triggered state; if the sensor is identified as an NPN type, the DP2 pin of the controller is set to push-pull and output a low level. After a delay of 100us, the controller reads the level state of the DP1 pin. The DP1 pin of the controller changes from a low level to a high level, indicating that the sensor is an NPN type. If the DP1 pin is always at a low level, it means that the recognition has failed; if the sensor is identified as a PNP type, the DP2 pin of the controller is set to push-pull and output a high level. After a delay of 100us, the controller reads the level state of the DP1 pin. The DP1 pin of the controller changes from a low level to a high level, indicating that the sensor is a PNP type. If the DP1 pin is always at a low level, it means that the recognition has failed.

[0038] Specifically, refer to Figure 2 The present application also has the following specific implementation process of the sensor identification switching circuit. In the following specific implementation process, the controller is an MCU:

[0039] Specific implementation process 1; when the MCU push-pull outputs a high level, the current output by the MCU passes through the R5 current limiting resistor and reaches the 2nd pin of the U2 logic optocoupler. The current reaches the ground of the power supply from the 3rd pin of the U2 logic optocoupler, and the U2 logic optocoupler is turned on; the power supply 24V passes through the R4 current limiting resistor and reaches the 8th pin of the U2 logic optocoupler. The 6th pin of the U2 logic optocoupler outputs a high level and reaches the 2nd pin of the U1 bidirectional optocoupler. When the sensor is an NPN sensor and the sensor is in trigger mode, the 1st and 2nd pins of the U1 bidirectional optocoupler will be turned on. When the 1st and 2nd pins of the U1 bidirectional optocoupler are turned on, the DP1 pin of the MCU is at a low level. Therefore, it can be determined that the output type of the sensor is NPN type.

[0040] Specific implementation process two: When the MCU push-pull outputs a high level, the current output by the MCU passes through the R5 current limiting resistor and reaches the 2nd pin of the U2 logic optocoupler. The current reaches the ground of the power supply from the 3rd pin of the U2 logic optocoupler, and the U2 logic optocoupler is turned on; the power supply 24V passes through the R4 current limiting resistor and reaches the 8th pin of the U2 logic optocoupler. The 6th pin of the U2 logic optocoupler outputs a high level and reaches the 2nd pin of the U1 bidirectional optocoupler. When the sensor is an NPN sensor and the sensor is in trigger mode, the 1st and 2nd pins of the U1 bidirectional optocoupler will be turned on. When the 1st and 2nd pins of the U1 bidirectional optocoupler are not turned on, the DP1 pin of the MCU is at a high level. Therefore, it can be determined that the sensor is not connected or the sensor is a PNP type, which can be further judged through the specific implementation process three.

[0041] Specific implementation process three; when the MCU push-pull output is low, the U2 logic optocoupler is not turned on; the 6th pin of the U2 logic optocoupler outputs a low level, which reaches the 2nd pin of the U1 bidirectional optocoupler. When the sensor is a PNP sensor and the sensor is in trigger mode, the 1st and 2nd pins of the U1 bidirectional optocoupler will be turned on. When the 1st and 2nd pins of the U1 bidirectional optocoupler are turned on, the DP1 pin of the MCU is at a low level, so it can be determined that the output type of the sensor is PNP type.

[0042] Specific implementation process four: When the MCU push-pull outputs a low level, the U2 logic optocoupler is not conducting; the 6th pin of the U2 logic optocoupler outputs a low level, which reaches the 2nd pin of the U1 bidirectional optocoupler. When the sensor is a PNP sensor and the sensor is in trigger mode, the 1st and 2nd pins of the U1 bidirectional optocoupler will be conducting. When the 1st and 2nd pins of the U1 bidirectional optocoupler are not conducting, the DP1 pin of the MCU is at a high level. Therefore, it can be determined that the sensor is not connected or the sensor is of NPN type, which can be further judged through the specific implementation process three.

[0043] It is worth noting that the descriptions of all design processes in this application are the application processes of the sensor identification switching circuit in this application. Therefore, this application protects the circuit structure of the sensor identification switching circuit, not the judgment process. The judgment process described is also only reflected on the basis of the circuit structure of this application. Those skilled in the art can judge the sensor type according to the levels of the first pin and the second pin, that is, the present application can achieve the technical effect of automatically identifying the output type of the sensor and automatically matching the input type of the controller according to the output type of the sensor.

[0044] In some embodiments, when the input type of the controller is switched according to the output type, the controller is used to control the second pin to output a high-level signal when the sensor is identified as an NPN type, so that the corresponding input module is automatically switched to the NPN type; when the sensor is identified as a PNP type, the second pin is controlled to output a low-level signal so that the input module is automatically switched to the PNP type, that is, when the controller identifies that the sensor is an NPN type, the DP2 pin of the controller outputs a high level, and the input module is automatically switched to the NPN type. When the controller identifies that the sensor is a PNP type, the DP2 pin of the controller outputs a low level, and the input module is automatically switched to the PNP type. The input module can be an input module set inside the controller. After determining the output type of the sensor, the input type of the input module can be automatically switched to ensure that the output type of the switch type sensor matches the input type of the controller corresponding to the input module.

[0045] In some embodiments, an indicator light is provided between the first pin and the output pin. The indicator light is used for the controller to switch the input type of the controller according to the output type. The sensor is in a triggered state and the first pin is at a low level. The indicator light is off when the sensor is not in a triggered state and the first pin is at a high level. For details, please refer to Figure 2 , the indicator light includes an LED lamp D1, a +3.3V power supply, a resistor R1 and a resistor R7, one end of the LED lamp D1 is connected to the first pin DP1 through the resistor R7, and the other end of the LED lamp D1 is connected to the 4th pin of the bidirectional optocoupler U1 through the +3.3V power supply and the resistor R1 connected in sequence, wherein the indicator light is used to judge whether the controller successfully switches the input type of the controller according to the output type. For example, after the module switching is completed, when the sensor is in the triggered state, the DP1 pin of the controller is low level, and the D1 indicator light is on, which is a normal state, otherwise it is an abnormal state, or. When the sensor is not triggered, the DP1 pin of the controller is high level, and the D1 indicator light is off, which is a normal state, otherwise it is an abnormal state.

[0046] In some embodiments, after being in a normal state, the controller can determine whether the sensor has a trigger signal according to the level state of DP1.

[0047] In a second aspect, an embodiment of the present application provides a sensor identification switching device, wherein the device is provided with a sensor identification switching circuit as in any one of the embodiments of the first aspect.

[0048] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the above implementation mode. Technical personnel familiar with the field can also make various equivalent modifications or substitutions without violating the spirit of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.

Claims

1. A sensor identification switching circuit, characterized in that: The circuit includes: a controller, a bidirectional optocoupler and a logic optocoupler, the controller is provided with a first pin and a second pin, the logic optocoupler is provided with a first input pin, a second input pin and an output pin; the first pin is connected to the output pin, the second pin is connected to the first input pin through the logic optocoupler, the second input pin is connected to the sensor, and the first input pin and the second input pin are connected through a first resistor; Among them, when the sensor is in trigger mode, the controller is used to enable the logic optocoupler to push-pull the output level signal through the second pin, obtain the level state of the first pin, so as to identify the output type of the sensor according to the level state, and switch the input type according to the output type, and the output type and the input type both include NPN type and PNP type.

2. The sensor identification switching circuit according to claim 1, characterized in that: The second input pin is pin 1 of the bidirectional optocoupler, the first input pin is pin 2 of the bidirectional optocoupler, the output pin is pin 4 of the bidirectional optocoupler, and pin 3 of the bidirectional optocoupler is grounded; A bidirectional light emitting diode is arranged between pin 1 and pin 2 of the bidirectional optical coupler, and a photosensitive tube is arranged between pin 3 and pin 4 of the bidirectional optical coupler.

3. The sensor identification switching circuit according to claim 1, characterized in that: Pin 2 of the logic optocoupler is connected to the second pin, pins 3 and 5 of the logic optocoupler are grounded, pin 6 of the logic optocoupler is connected to the first input pin, and pin 8 of the logic optocoupler is connected to a power supply; a light-emitting diode is arranged between pins 2 and 3 of the logic optocoupler, and a push-pull structure is arranged between pins 5, 6 and 8 of the logic optocoupler, and the push-pull structure includes an interconnected light detector and two MOS tubes.

4. The sensor identification switching circuit according to claim 1, characterized in that: When identifying the output type of the sensor according to the level state, the controller is used to enable the logic optocoupler to push-pull and output a high-level signal through the second pin, so as to identify that the sensor is an NPN type when the level state is a low level.

5. The sensor identification switching circuit according to claim 4, characterized in that: When the level state is a low level, the controller is also used to enable the logic optocoupler to push-pull and output a low level signal through the second pin, and to read the level state periodically, so as to identify the sensor as an NPN type when the level state changes from low to high.

6. The sensor identification switching circuit according to claim 4, characterized in that: When the level state is a high level, the controller is further used to enable the logic optocoupler to push-pull and output a low level signal through the second pin, and to read the level state periodically to identify that the sensor is a PNP type when the level state is a low level.

7. The sensor identification switching circuit according to claim 6, characterized in that: When the level state is read regularly and the level state is at a low level, the controller is also used to enable the logic optocoupler to push-pull and output a high level signal through the second pin, and to read the level state regularly to identify the sensor as a PNP type when the level state changes from low to high.

8. The sensor identification switching circuit according to claim 1, characterized in that: When the input type of the controller is switched according to the output type, the controller is used to control the second pin to output a high-level signal when the sensor is identified as an NPN type, so that the corresponding input module is automatically switched to the NPN type; when the sensor is identified as a PNP type, the controller controls the second pin to output a low-level signal so that the input module is automatically switched to the PNP type.

9. The sensor identification switching circuit according to claim 1, characterized in that: An indicator light is arranged between the first pin and the output pin. The indicator light is used to light up when the sensor is in a triggered state and the first pin is at a low level after the controller switches the input type of the controller according to the output type; and is off when the sensor is not in a triggered state and the first pin is at a high level.

10. A sensor identification switching device, characterized in that: The device is provided with a sensor identification switching circuit as claimed in any one of claims 1 to 9.