A communicable photoelectric sensor

By using the positive power line and output line of the photoelectric sensor as data receiving and transmitting lines, and by using a voltage divider module and MCU unit for level conversion, the problem of the photoelectric sensor's inability to communicate was solved, enabling data exchange and program upgrades, and improving production efficiency and yield.

CN224319347UActive Publication Date: 2026-06-02ANHUI LANBAO INTELLIGENT MFG TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
ANHUI LANBAO INTELLIGENT MFG TECH CO LTD
Filing Date
2025-05-08
Publication Date
2026-06-02

Smart Images

  • Figure CN224319347U_ABST
    Figure CN224319347U_ABST
Patent Text Reader

Abstract

This invention provides a communicable photoelectric sensor, including a photoelectric sensor connected to a control box. The photoelectric sensor is divided into an NPN type and a PNP type. Both the NPN and PNP types include a voltage divider module and an MCU unit. The NPN type photoelectric sensor also includes a first output circuit, and the PNP type photoelectric sensor also includes a second output circuit. This invention has the following advantages: It uses the positive power line and output line of the photoelectric sensor as the data receiving line and data transmitting line, respectively. Since the voltage level of the MCU differs significantly from that of the proximity switch, the MCU unit cannot communicate directly with the control box. Therefore, this invention adds a voltage divider module and utilizes a comparator and a DAC module to achieve signal reception from the proximity switch. Furthermore, it uses the existing output circuit to send data to the control box, thus achieving bidirectional communication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This utility model relates to the field of photoelectric sensor technology, and in particular to a communicable photoelectric sensor. Background Technology

[0002] Photoelectric proximity switches are a specific application of photoelectric sensors. Common connection lines for photoelectric proximity switches include a positive power supply terminal, a negative power supply terminal, and an output line. The operating voltage is 10–30V DC, far exceeding TTL levels, making direct communication impossible and data exchange unfeasible. Photoelectric sensors generally consist of a transmitter, a receiver, and a filter. During production, crosstalk between the emitted light and the receiver frequently occurs, increasing the distance, reducing the effective signal variation, and decreasing anti-interference capabilities. In severe cases, the photoelectric sensor may shut down completely, requiring rework or even scrapping. Furthermore, due to differences in components and inconsistent assembly precision, product distance consistency is poor, necessitating disassembly for program upgrades, resulting in suboptimal production efficiency and yield.

[0003] As above Figure 1 The current proximity switch electrical diagram shows the NPN type output. Figure 2 The diagram shows a PNP type proximity switch with a wide operating voltage range of 10–30V DC, up to 20V. The positive and negative terminals supply power to the proximity switch, which outputs a switching signal. Both NPN and PNP types are available, but communication functionality is typically lacking. Utility Model Content

[0004] In view of the shortcomings of the prior art described above, the purpose of this utility model is to provide a communicable photoelectric sensor to solve the problem that existing photoelectric sensors do not have communication functions, thus making data exchange and program upgrades impossible.

[0005] To achieve the above and other related objectives, this utility model provides the following technical solution:

[0006] A communicable photoelectric sensor includes a photoelectric sensor connected to a control box. The positive power line, output line, and negative power line of the photoelectric sensor are all connected to the control box. The positive power line of the photoelectric sensor serves as a data receiving line, and the output line of the photoelectric sensor serves as a data transmitting line. The photoelectric sensor communicates with the control box through the data receiving line and the data transmitting line.

[0007] The photoelectric sensor is divided into NPN type photoelectric sensor and PNP type photoelectric sensor. Both NPN type photoelectric sensor and PNP type photoelectric sensor include a voltage divider module and an MCU unit. The NPN type photoelectric sensor also includes a first output circuit, and the PNP type photoelectric sensor also includes a second output circuit. The voltage divider module is connected to the junction box through the positive power line and the negative power line of the photoelectric sensor, respectively. The voltage divider module is also connected to the MCU unit. The MCU unit is also connected to the first output circuit or the second output circuit. The first output circuit is also connected to the junction box through the output line and the negative power line of the photoelectric sensor, respectively. The second output circuit is also connected to the junction box through the positive power line, the output line, and the negative power line of the photoelectric sensor, respectively.

[0008] In one embodiment of this utility model, the voltage divider module includes a first resistor and a second resistor connected to each other. The other end of the first resistor is connected to the control box via the positive power line of the photoelectric sensor. The connected end of the first resistor and the second resistor is connected to the MCU unit. The other end of the second resistor is connected to the control box via the negative power line of the photoelectric sensor.

[0009] In one embodiment of the present invention, the MCU unit includes a comparator, a DAC module and a processor. The non-inverting input of the comparator is connected to the voltage divider module, the inverting input of the comparator is connected to the DAC module, the output of the comparator is connected to the first serial port of the controller, and the second serial port of the controller is connected to the first output circuit or the second output circuit.

[0010] In one embodiment of the present invention, the first output circuit includes a first transistor, the base of the first transistor is connected to the second serial port of the MCU unit, the collector of the first transistor is connected to the control box through the output line of the photoelectric sensor, and the emitter of the first transistor is connected to the control box through the negative power line of the photoelectric sensor.

[0011] In one embodiment of this utility model, the second output circuit includes a second transistor and a third transistor. The base of the second transistor is connected to the collector of the third transistor through a resistor. The emitter of the second transistor is connected to the control box through the positive power line of the photoelectric sensor. The collector of the second transistor is connected to the control box through the output line of the photoelectric sensor. The base of the third transistor is connected to the second serial port of the MCU unit. The emitter of the third transistor is connected to the control box through the negative power line of the photoelectric sensor.

[0012] In one embodiment of this utility model, both the NPN type photoelectric sensor and the PNP type photoelectric sensor further include a step-down module. The step-down module is also connected to the control box through the positive power line of the photoelectric sensor, and the step-down module is also connected to the MCU unit.

[0013] As described above, the communicable photoelectric sensor of this invention has the following beneficial effects:

[0014] This invention uses the positive power line and output line of the photoelectric sensor as the data receiving line and data transmitting line, respectively. Because the voltage levels of the MCU and the proximity switch differ significantly, the MCU unit cannot communicate directly with the control box. Therefore, this invention adds a level conversion module, i.e., a voltage divider module, and utilizes a comparator and a DAC module to achieve signal reception from the proximity switch. Specifically, when the control box sends data to the proximity switch, the pulse signal is divided by the first and second resistors in the voltage divider module, then compared by the comparator and transmitted to the processor, thus completing level conversion and pulse signal level judgment, achieving signal transmission. This invention also utilizes the existing output circuit to send data to the control box, realizing signal transmission from the proximity switch. The control box can perform level conversion and level inversion on the received pulse signal to complete signal identification, thereby achieving bidirectional communication. Therefore, this invention not only enables data exchange but also allows for program upgrades of the photoelectric proximity switch without disassembling the product, thus optimizing production efficiency and yield. Attached Figure Description

[0015] Figure 1 The diagram shows the output electrical schematic of an existing NPN type photoelectric proximity switch.

[0016] Figure 2 The diagram shows the output electrical schematic of an existing PNP type photoelectric proximity switch.

[0017] Figure 3 The diagram shows the output of an NPN type photoelectric proximity switch with communication function of a communicable photoelectric sensor disclosed in this embodiment of the present invention.

[0018] Figure 4 The diagram shows a PNP type photoelectric proximity switch with communication function as the output of a communicable photoelectric sensor disclosed in this embodiment of the present invention.

[0019] Figure 5 The diagram shows the communication logic of the NPN type photoelectric proximity switch of the communicable photoelectric sensor disclosed in the embodiments of this utility model.

[0020] Figure 6The diagram shows the communication logic of a PNP-type photoelectric proximity switch for a communicable photoelectric sensor disclosed in this embodiment of the present invention.

[0021] Figure 7 The diagram shows the pulse level change of the positive terminal RX of the power supply in the communicable photoelectric sensor disclosed in this embodiment of the present invention.

[0022] Figure 8 This diagram illustrates the level conversion in a communicable photoelectric sensor disclosed in an embodiment of the present invention. Detailed Implementation

[0023] The following specific examples illustrate the implementation of this utility model. Those skilled in the art can easily understand other advantages and effects of this utility model from the content disclosed in this specification. It should be noted that, unless otherwise specified, the following embodiments and features described herein can be combined with each other.

[0024] Please see Figures 3 to 6 This utility model provides a communicable photoelectric sensor, including a photoelectric sensor connected to a control box. When communicating with the control box, the positive power line, output line, and negative power line of the photoelectric sensor are all connected to the control box. The positive power line of the photoelectric sensor serves as a data receiving line (RX), and the output line of the photoelectric sensor serves as a data transmitting line (TX). The photoelectric sensor communicates with the control box through the data receiving line and the data transmitting line. In this embodiment, the photoelectric sensor is a photoelectric proximity switch sensor, which is a specific application form of the photoelectric sensor. The following description uses a photoelectric proximity switch sensor as an example. Among them, photoelectric proximity switch sensors are divided into NPN type photoelectric proximity switch sensors and PNP type photoelectric proximity switch sensors.

[0025] Please see Figure 5 The NPN type photoelectric proximity switch sensor includes a voltage divider module, a voltage buck module, an MCU unit, and a first output circuit. Both the voltage divider module and the voltage buck module are connected to the control box through the positive power line of the photoelectric proximity switch. The voltage divider module is also connected to the control box through the negative power line of the photoelectric proximity switch. Both the voltage divider module and the voltage buck module are also connected to the MCU unit. The MCU unit is also connected to the first output circuit. The first output circuit is connected to the control box through the output line of the photoelectric proximity switch and the negative power line, respectively.

[0026] The voltage divider module includes a first resistor and a second resistor. The MCU unit includes a comparator, a DAC module, and a processor. The first output circuit includes a first transistor. It should be noted that the step-down voltage in this embodiment is an LDO circuit. The following description uses the first resistor R1, the second resistor R2, and the first transistor Q1 as an example.

[0027] One end of the first resistor R1 is connected to the second resistor R2. The other end of the first resistor R1 and the step-down module are both connected to the control box through the positive power line of the photoelectric proximity switch. The connected end of the first resistor R1 and the second resistor R2 is connected to the positive input of the comparator. The other end of the second resistor R2 is connected to the control box through the negative power line of the photoelectric proximity switch. The inverting input of the comparator is connected to the DAC module. The output of the comparator is connected to the processor's serial port mRX. The processor's serial port mTX is connected to the base of the first transistor Q1. The collector of the first transistor Q1 is connected to the control box through the output line of the photoelectric proximity switch. The emitter of the first transistor Q1 is connected to the control box through the negative power line of the photoelectric proximity switch.

[0028] Please see Figure 6 The PNP type photoelectric proximity switch sensor includes a voltage divider module, a voltage step-down module, an MCU unit, and a second output circuit. Both the voltage divider module and the voltage step-down module are connected to the control box through the positive power line of the photoelectric proximity switch. The voltage divider module is also connected to the control box through the negative power line of the photoelectric proximity switch. Both the voltage divider module and the voltage step-down module are also connected to the MCU unit. The MCU unit is also connected to the second output circuit. The second output circuit is connected to the control box through the positive power line, the output line, and the negative power line of the photoelectric proximity switch, respectively.

[0029] The voltage divider module includes a first resistor and a second resistor, the MCU unit includes a comparator, a DAC module and a processor, and the first output circuit includes a second transistor and a third transistor. The following uses the first resistor R1, the second resistor R2, the second transistor Q2 and the third transistor Q3 as examples for illustration.

[0030] One end of the first resistor R1 is connected to the second resistor R2. The other end of the first resistor R1 and the step-down module are both connected to the control box through the positive power line of the photoelectric proximity switch. The connected end of the first resistor R1 and the second resistor R2 is connected to the positive input of the comparator. The other end of the second resistor R2 is connected to the control box through the negative power line of the photoelectric proximity switch. The inverting input of the comparator is connected to the DAC module. The output of the comparator is connected to the processor's serial port mRX. The processor's serial port mTX is connected to the base of the third transistor Q3. The emitter of the third transistor Q3 is also connected to the control box through the negative power line of the photoelectric proximity switch. The collector of the third transistor Q3 is connected to the base of the second transistor Q2 through a resistor. The collector of the second transistor Q2 is connected to the control box through the output line of the photoelectric proximity switch. The emitter of the second transistor Q2 is also connected to the control box through the positive power line of the photoelectric proximity switch.

[0031] Specifically, this invention utilizes existing wiring to add serial port functionality to a photoelectric proximity switch. The positive power supply line serves as the RX of the proximity switch, and the NPN or PNP output line serves as the TX of the photoelectric proximity switch. Since the MCU's serial port level is 3.3V or 5V, while the photoelectric proximity switch operates at 10-30V DC, a step-down module is needed to reduce the voltage of the signal from the positive power supply line. Because the MCU and control box cannot communicate directly, this invention adds level conversion and pulse signal recognition before connecting to the MCU's serial port, thus achieving signal reception. This invention also utilizes existing output circuitry as the TX transmitter, thereby achieving signal transmission. For details, please refer to [link to details]. Figure 3 and Figure 4 .

[0032] More specifically, this communication requires the control box to achieve bidirectional communication. When communication is not needed, the photoelectric proximity switch is connected to a voltage source. After passing through a step-down module, the voltage is VCC, which powers the processor, comparator, serial port, DAC, and other modules. When communication is needed, the photoelectric proximity switch is connected to the control box. Due to the significant difference between the MCU's voltage level and the proximity switch's voltage level, the voltage is divided by the first resistor R1 and the second resistor R2, and then connected to the comparator and finally to the MCU's serial port mRX. This completes the level conversion and pulse signal level judgment, thus realizing signal transmission. The MCU's serial port mTX signal in the photoelectric proximity switch is transmitted to the control box through the output circuit. Figure 5 In this context, mTX is inversely related to the output TX; Figure 6 The mTX and output TX are in the same direction; the control box can handle the level conversion and level inversion of the output TX to complete the signal recognition, thereby realizing the two-way communication function.

[0033] To elaborate further, the minimum and maximum voltage limits of the photoelectric proximity switch, Vbmin and Vbmax, are reduced to VCC after passing through a step-down module. VCC powers the processor, comparator, serial port, DAC, and other modules.

[0034] When the control box sends data to the photoelectric proximity switch, the control box generates a pulse signal (V0-V2) at the positive terminal of its power supply. When the control box does not send data, the positive terminal of its power supply remains stable at V0. V0 is greater than the minimum voltage limit (Vbmin) of the photoelectric proximity switch, and V2 is less than the maximum voltage limit (Vbmax). The pulse level variation is within the operating range of the photoelectric proximity switch; please refer to [link to relevant documentation] for details. Figure 7 V1 is between V0 and V2;

[0035] When the control box sends data to the photoelectric proximity switch, the pulse voltage change at the positive terminal of the power supply is transmitted to the proximity switch. The voltage is divided by the first resistor R1 and the second resistor R2 and sent to the positive input of the comparator. The DAC module's voltage divider is connected to the negative input of the comparator. If the level at the positive input of the comparator is higher than the level at the negative input, the comparator outputs VCC level; if the level at the positive input is lower than the level at the negative input, the comparator outputs a low level. Normally, the positive input of the comparator should not be equal to the level at the negative input to avoid uncertainty in the comparator's output state. Appropriately selecting the values ​​of V0 and V2 is beneficial to improving signal quality. Generally, V1 = (V2 - V0) / 2 + V0 is chosen. The value of V1 can be calculated from the voltage value V4 of the DAC module, i.e., V1 = V4 * (R1 + R2) / R2. This ensures that the comparator's switching level is between V0 and V2, guaranteeing the accuracy of the pulse voltage transfer to the MCU serial port level and reducing communication data errors. To improve anti-interference capability, the comparator hysteresis is set internally by the MCU.

[0036] When the control box is not sending data, that is, when the positive power supply is V0, the voltage after passing through the first resistor R1 and the second resistor R2 is V3 = V0 / (R1+R2)*R2. At this time, the value of V3 is less than V4, so V5 is low. When the voltage at the positive power supply is V2, the voltage after passing through the first resistor R1 and the second resistor R2 is V3 = V2 / (R1+R2)*R2. At this time, the value of V3 is greater than V4, so V5 is VCC level. Since the comparator is a positive comparison, the positive power supply and V5 level are in the same direction. Please refer to [link to relevant documentation] for details. Figure 8 ;

[0037] When the proximity switch sends data to the control box, the output circuit is in NPN logic. At this time, the positive power supply level is stable at V0. The mTX drive circuit in the MCU serial port controls the conduction and cutoff of the first transistor Q1. When mTX is low, TX is at level V0; when mTX is VCC, TX is low. That is, mTX and output TX are inversely related, thus generating a pulse signal on output TX.

[0038] When the proximity switch sends data to the control box, the output circuit is in PNP logic. The mTX driver in the MCU serial port controls the conduction and cutoff of the third transistor Q3, which in turn controls the conduction and cutoff of the second transistor Q2. When mTX is low, TX is low; when mTX is VCC, TX is V0, meaning mTX and output TX are in the same direction, thus generating a pulse signal on output TX. Since mTX is controlled by the MCU serial port, configuring the MCU serial port enables serial data transmission. The internal circuit of the control box performs level and phase conversion according to the proximity switch logic to achieve data parsing.

[0039] Furthermore, there are other alternative solutions to this utility model that can also achieve the purpose of the utility model. The alternative solutions are: 1. Using a similar architecture but changing the number of voltage divider resistors; 2. Using a similar architecture but using an external comparator; 3. Using a similar architecture but changing the DAC module to a resistor divider; 4. Using a similar architecture for other types of proximity switches.

[0040] In summary, this invention only requires adding two resistors to the existing cable of the proximity switch. By utilizing the comparator, DAC module, and serial port module built into the MCU, communication can be achieved with almost no increase in cost. It not only enables bidirectional data transmission but also achieves the purposes of calibration, crossbeam calibration, threshold and hysteresis adjustment, program upgrade, and process data monitoring.

[0041] The above embodiments are merely illustrative of the principles and effects of this utility model and are not intended to limit this utility model. All equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this utility model should still be covered by the claims of this utility model.

Claims

1. A communicable photoelectric sensor, characterized in that: The system includes a photoelectric sensor connected to a control box. The positive power line, output line, and negative power line of the photoelectric sensor are all connected to the control box. The positive power line of the photoelectric sensor serves as a data receiving line, and the output line of the photoelectric sensor serves as a data transmitting line. The photoelectric sensor communicates with the control box through the data receiving line and the data transmitting line. The photoelectric sensor is divided into NPN type photoelectric sensor and PNP type photoelectric sensor. Both NPN type photoelectric sensor and PNP type photoelectric sensor include a voltage divider module and an MCU unit. The NPN type photoelectric sensor also includes a first output circuit, and the PNP type photoelectric sensor also includes a second output circuit. The voltage divider module is connected to the junction box via the positive and negative power lines of the photoelectric sensor. The voltage divider module is also connected to the MCU unit. The MCU unit is also connected to the first output circuit or the second output circuit. The first output circuit is also connected to the junction box via the output line and negative power line of the photoelectric sensor. The second output circuit is also connected to the junction box via the positive power line, output line, and negative power line of the photoelectric sensor.

2. The communicable photoelectric sensor according to claim 1, characterized in that: The voltage divider module includes a first resistor and a second resistor connected to each other. The other end of the first resistor is connected to the control box via the positive power line of the photoelectric sensor. The connected end of the first resistor and the second resistor is connected to the MCU unit. The other end of the second resistor is connected to the control box via the negative power line of the photoelectric sensor.

3. A communicable photoelectric sensor according to claim 1, characterized in that: The MCU unit includes a comparator, a DAC module, and a processor. The non-inverting input of the comparator is connected to the voltage divider module, the inverting input of the comparator is connected to the DAC module, the output of the comparator is connected to the first serial port of the controller, and the second serial port of the controller is connected to the first output circuit or the second output circuit.

4. A communicable photoelectric sensor according to claim 3, characterized in that: The first output circuit includes a first transistor, the base of which is connected to the second serial port of the MCU unit, the collector of which is connected to the control box through the output line of the photoelectric sensor, and the emitter of which is connected to the control box through the negative power line of the photoelectric sensor.

5. A communicable photoelectric sensor according to claim 3, characterized in that: The second output circuit includes a second transistor and a third transistor. The base of the second transistor is connected to the collector of the third transistor through a resistor. The emitter of the second transistor is connected to the control box through the positive power line of the photoelectric sensor. The collector of the second transistor is connected to the control box through the output line of the photoelectric sensor. The base of the third transistor is connected to the second serial port of the MCU unit, and the emitter of the third transistor is connected to the control box through the negative power line of the photoelectric sensor.

6. A communicable photoelectric sensor according to claim 1, characterized in that: Both the NPN and PNP photoelectric sensors include a step-down module, which is connected to the control box via the positive power line of the photoelectric sensor. The step-down module is also connected to the MCU unit.