Counting detection sensor
By incorporating a power-off protection module and a background-suppressing photoelectric sensor into the counting detection sensor, the problems of high cost and poor environmental adaptability in existing egg counting detection sensors have been solved, enabling stable detection and data storage under different lighting and environmental conditions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN CHEVEN TECH
- Filing Date
- 2025-12-01
- Publication Date
- 2026-04-24
AI Technical Summary
Existing egg counting sensors are costly, complex in structure, and have high requirements for lighting and environment, making it difficult to operate stably under different conditions.
The counting and detection sensor, which employs a power-off protection module, a detection module, and a main control module, combined with a background-suppressing photoelectric sensor and an MCU chip, enables accurate counting of eggs and saves data even when power is off.
It reduces system costs, improves the accuracy and reliability of detection, and can work stably under different lighting and environmental conditions, avoiding false detections and missed detections, and ensuring the integrity of production data.
Smart Images

Figure CN121920405A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of sensor technology, specifically relating to a counting detection sensor. Background Technology
[0002] In modern egg production lines, real-time detection and counting of eggs are typically required to achieve automated sorting and production statistics. Existing technologies mostly employ image recognition-based detection methods, which involve acquiring egg images using industrial cameras and then utilizing image processing algorithms for target identification and quantity counting. While this approach achieves high detection accuracy, it suffers from drawbacks such as high system cost, complex algorithms, and stringent requirements for hardware configuration and lighting conditions.
[0003] Therefore, there is an urgent need for a simple, low-cost, interference-resistant, and accurate egg counting sensor circuit solution. This solution can operate stably under different lighting and environmental conditions and supports data communication and storage functions for production data statistics and equipment status management. Summary of the Invention
[0004] This application provides a counting detection sensor that solves the problems of high cost and complex structure of existing counting detection sensors.
[0005] To address the aforementioned technical problems, this application provides a counting detection sensor, including a power-off protection module, a detection module, and a main control module; The power failure protection module is connected to an external power source and is used to detect whether there is a power failure in the input power. When the input power is detected to be disconnected, the power failure protection module sends a power failure signal to the main control module. The detection module is used to detect whether there is an object at a preset position and output the detection result to the main control module; The main control module is used to receive the detection results output by the detection module and to perform statistical analysis on the detection results to obtain statistical data. The main control module is also used to receive the power failure signal from the power failure protection module. If the power failure signal is received, the statistical data is saved.
[0006] Furthermore, the counting detection sensor also includes a power supply module, which comprises a DC-DC unit and a voltage regulator unit. The DC-DC unit is used to step down the input power supply and deliver it to the voltage regulator unit. The voltage regulator unit receives the stepped-down power supply and further steps it down to obtain the working power supply, and then supplies the working power supply to the power failure protection module, the detection module and the main control module.
[0007] Furthermore, the power-down protection module includes: a first transistor and a second transistor. The emitter of the first transistor is connected to the input power supply via a diode, and the base of the first transistor is also connected to the input power supply to monitor whether there is a power failure. The collector of the first transistor is connected to the base of the second transistor, and the collector of the second transistor is connected to the operating power supply. The emitter of the second transistor is grounded. When the input power supply voltage drops to a threshold, the second transistor turns on, and the collector of the second transistor outputs the power failure signal to the main control module.
[0008] Furthermore, the detection module includes several sensor detection units. When a sensor detection unit detects an object at a preset position, it sends a low-level signal to the main control module. When no object is detected, it sends a high-level signal to the main control module.
[0009] Furthermore, the main control module includes an MCU chip, one end of which is connected to the sensor detection unit via a pull-up resistor and connected to the operating power supply. The MCU chip outputs a high-level signal when the sensor detection unit does not detect an object and outputs a low-level signal when the sensor detection unit detects an object.
[0010] Furthermore, the counting detection sensor also includes a communication module. The communication module is used to receive statistical data from the main control module and upload the statistical data to the host computer; the communication module is also used to receive configuration data from the host computer and transmit the configuration data to the main control module to configure the initial parameters of the main control module.
[0011] Furthermore, the communication method between the communication module and the main control module is RS485 communication.
[0012] Furthermore, the counting detection sensor also includes a first indicator light and a second indicator light. The first indicator light is used to indicate whether the input power supply is on. When the input power supply is on, the first indicator light is lit. The second indicator light is used to indicate whether the MCU chip is communicating with the host computer. When the MCU chip is communicating with the host computer, the second indicator light flashes.
[0013] Furthermore, the counting detection sensor circuit also includes a crystal oscillator unit, which is used to provide a clock signal to the MCU chip.
[0014] Furthermore, the counting detection sensor also includes a programming interface, which is used to program the compiled program file to the MCU chip.
[0015] This application employs a detection module to detect target objects at preset locations. A background-suppressing photoelectric sensor detects the object's presence, automatically suppressing interference from external background light. Even if the detected object has a highly reflective surface or an irregular shape, the detection signal remains stable and reliable, avoiding false detections and missed detections. This improves detection accuracy and system reliability, eliminating the need for an image recognition system and simplifying complex image acquisition and processing algorithms. The power-off protection module monitors the input power status in real time. When a power failure is detected, it sends a power-off signal to the main control module. The main control module then promptly saves statistical data, preventing data loss due to sudden power outages or system malfunctions, thus ensuring the integrity and security of production statistics. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only a part of the embodiments of this application, and not all of the embodiments. For those skilled in the art, other drawings obtained from these drawings without creative effort are all within the scope of protection of this application.
[0017] Figure 1 This is a schematic diagram of the structure of a technical sensor provided in an embodiment of this application.
[0018] Figure 2 A circuit diagram of a single sensor detection unit provided in an embodiment of this application.
[0019] Figure 3 The circuit diagram of the main control module provided in the embodiments of this application.
[0020] Figure 4 The circuit diagram of the DC-DC unit provided in the embodiment of the present invention.
[0021] Figure 5 The circuit diagram of the voltage regulator unit provided in the embodiment of the present invention.
[0022] Figure 6 The circuit diagram is provided for a power-off protection module according to an embodiment of the present invention.
[0023] Figure 7 The circuit diagram of the indicator light provided in the embodiment of this application.
[0024] Figure 8 The circuit diagram of the crystal oscillator unit provided in the embodiments of this application is shown.
[0025] Figure 9 The circuit diagram of the programming interface provided in the embodiments of this application.
[0026] Figure 10 The circuit diagram of the communication module provided in the embodiment of this application. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0028] To make the description of this disclosure more detailed and complete, illustrative descriptions of the implementation methods and specific embodiments of this application are provided below; however, this is not the only form of implementing or utilizing the specific embodiments of this application. The implementation methods cover the features of multiple specific embodiments and the method steps and their order for constructing and operating these specific embodiments. However, other specific embodiments can also be used to achieve the same or equivalent functions and step sequences. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0029] Figure 1 A counting detection sensor provided in the embodiments of this application, such as Figure 1 As shown, the counting detection sensor includes a main control module, a power-off protection module, a detection module, a crystal oscillator module, a power supply module, and a communication module. The main control module receives the detection results output by the detection module and performs statistical analysis on the results to obtain statistical data. When it receives a power-off signal from the power-off protection module, it promptly saves the statistical data to prevent data loss due to sudden power outages or system failures, thereby ensuring the integrity and security of production statistical data.
[0030] The detection module detects target objects at preset locations. It uses a background-suppressing photoelectric sensor to detect the object's presence, automatically suppressing interference from external background light. Even if the object's surface has high reflectivity or irregular shapes, the detection signal remains stable and reliable, avoiding false detections and missed detections. This improves detection accuracy and system reliability. It eliminates the need for an image recognition system, saving on complex image acquisition and processing algorithms and reducing system costs. The detection module includes 19 sensor detection units. Figure 2 This is a circuit diagram of a single sensor detection unit provided in an embodiment of this application. Figure 3 The circuit diagram of the main control module provided in the embodiments of this application is as follows: Figure 2 and Figure 3As shown, each sensor detection unit includes a power supply terminal VIN, a ground terminal, and an output terminal IN. The power supply terminal VIN provides power to the sensor detection unit. The output terminal IN is connected to the MCU chip in the main control module. The output terminal IN is also connected to the working power supply VP30 through a pull-up resistor. When the photoelectric sensor detects an object, the output terminal IN outputs a low-level signal. When the sensor detection unit does not detect an object, the output terminal IN outputs a high-level signal.
[0031] Optionally, the sensor detection unit uses an ultra-thin background suppression photoelectric sensor as the detection element. This photoelectric sensor can accurately identify the object being detected under different background reflection conditions. Through its internal background suppression structure and optical modulation method, it effectively distinguishes between the object and the reflected light from the background, thereby avoiding false triggering or missed detection caused by changes in ambient light or reflection from the surface of the object being detected. The main control module counts the passing status of objects based on the detection signals from each sensor, thereby realizing the detection and recording of the number of objects in the production line.
[0032] Optionally, a filtering circuit is provided around the MCU chip to filter the input signal. The filtering circuit includes resistors and capacitors, which suppress high-frequency interference components in the input signal to obtain a stable level signal input to the MCU chip. By setting this filtering circuit, the influence of external electromagnetic interference, signal jitter, or sensor output fluctuations on the detection results can be effectively reduced, ensuring the accuracy and stability of the MCU chip's sampling and statistical processing.
[0033] The power module includes a DC-DC unit and a voltage regulator unit. Figure 4 The circuit diagram of the DC-DC unit provided in the embodiment of the present invention shows that the VIN and 0V input terminals are connected to the positive and negative terminals of an external power supply, respectively. The external power supply is typically a DC input of 10V to 30V.
[0034] Surge protection and reverse connection protection circuits are provided at the power input terminal. Specifically, a varistor RV1 is connected to the input terminal to absorb potential surge voltages in the input power supply, thereby preventing transient high voltages from impacting subsequent circuits. Diode D1 is a Schottky diode, connected in series in the input power path in the forward direction to protect against reverse polarity. When the external power supply is reversed, the diode is in a reverse cutoff state, thus blocking current from entering the subsequent circuit and preventing damage to chips and other components. A current-limiting resistor R1 is also connected in series at the input terminal VIN to limit the current when surges or transient currents occur, reducing electrical stress on subsequent components. Capacitors C11 and C5 are connected to ground respectively to store energy and filter the input voltage, reducing input ripple and improving power supply stability. The subsequent DC-DC conversion circuit consists of chip U2 and external inductors, resistors, and capacitors. The VIN terminal of U2 is connected to the pre-filtered VCC_IN. Through inductor L1 and output capacitors C3 and C40, a step-down converter structure is formed to convert the input 10-30V to a stable 5V power supply (V5P0). Resistor R2 is connected to the EN terminal of U2 to pull up the EN pin, enabling U2 and ensuring the normal operation of the DC-DC module. The DC-DC module ultimately obtains 5V DC power and outputs it through the V5P0 interface to the voltage regulator unit for further step-down.
[0035] Figure 5 This is a circuit diagram of a voltage regulator unit provided in an embodiment of the present invention. The voltage regulator unit is used to further step down the V5P0 power supply output from the front-end DC-DC converter module to V3P3D, providing a stable 3.3V operating power supply for subsequent digital circuits or low-voltage devices. The input power supply V5P0 is input to the IN pin of the LDO voltage regulator chip U1 via Schottky diode D9. D9 is connected in series at the input of U1 to block current backflow when the output voltage is higher than the input voltage, thereby preventing V3P3D from generating reverse current to the V5P0 line. U1 is a linear voltage regulator chip, wherein the IN, OUT, EN, BP / FP and GND pins are connected according to the standard voltage regulator circuit method. The EN pin of U1 is grounded or fixed open to keep the LDO in working state. Filter capacitors are set at the input and output of U1 respectively. C4 at the input is used to stabilize the input voltage and suppress high-frequency noise. The output terminal consists of a filter network formed by capacitors C41, C42, C2, and C25 connected in parallel, used for voltage regulation, energy storage, and ripple suppression. Through this circuit structure, U1 can stably convert the input 5V power supply to a 3.3V output, ensuring that the output voltage remains stable under load changes or input fluctuations.
[0036] Figure 6 This is a circuit diagram of the power-down protection module provided in this embodiment of the invention. The power-down protection module monitors the voltage state of the input power supply VIN and outputs a power-down signal to the MCU when the external power supply fails, enabling the MCU to perform data saving operations in time before the power is completely lost. The input power supply VIN is described using 24V as an example. When the input power supply VIN is powered on, it charges capacitor C39 through resistor R29 and diode D8. Since R29 and R30 form a voltage divider network, when VIN is stable at 24V, the voltage to the left of D8 is approximately 22.5V. After the forward voltage drop of D8, C39 is charged to approximately 21.8V. When the input power supply VIN is stable, the base of the first transistor Q1 simultaneously receives the 24V voltage from VIN. Because its base voltage is higher than the emitter voltage provided by C39, Q1 is in the off state. When Q1 is off, there is no voltage input to the base of the second transistor Q2, and Q2 is also in the off state. The power-down signal PF0 remains at a high level or in an open circuit state.
[0037] When the input power supply voltage VIN begins to drop, C39 maintains its original energy storage voltage. When the input power supply VIN drops to approximately 21.2V, the voltage of C39 (21.8V) is higher than the base voltage of the first transistor Q1, creating a potential difference of approximately 0.6V. C39 forms a discharge path through the emitter of the first transistor Q1, R31, and the input power supply VIN, turning on the first transistor Q1.
[0038] After the first transistor Q1 is turned on, C39 forms a second discharge path through the collector of the first transistor Q1, R32, and the base-emitter structure of Q2, providing approximately 0.6V to the base of the second transistor Q2, thus turning it on. When the second transistor Q2 is turned on, its output is pulled to ground, outputting a low-level power-down detection signal PF0. The MCU can then perform internal data saving operations by detecting the low-level state of PF0.
[0039] With the above structure, a power-down signal can be output in advance when the input power supply VIN voltage has not completely disappeared but has dropped to a preset threshold, ensuring that the data saving operation has enough time to complete.
[0040] Figure 7The indicator light circuit diagram provided in this application embodiment includes a first indicator light D7 and a second indicator light D6. The first indicator light D7 indicates the system power status; one end is connected to the power output terminal, and the other end is connected to ground via a current-limiting resistor. When an external power supply is connected and powers the circuit, the first indicator light D7 receives a stable voltage and is lit, indicating that the circuit is powered on. The second indicator light D6 indicates the communication status of the communication module and is connected to the LED_RED port of the MCU chip. When the MCU is transmitting and receiving RS485 data with the host computer, it controls the on / off state of the second indicator light D6 by outputting high and low levels on the LED_RED signal pin. The second indicator light D6 flashes during communication to indicate that data communication is in progress.
[0041] Figure 8 The circuit diagram of the crystal oscillator unit provided in this application embodiment shows that the nominal frequency of crystal oscillator XL1 is 16MHz, used to generate a stable and accurate 16MHz mechanical vibration. Load capacitors C23 and C24, two capacitors of the same capacitance, are connected to the two ends of the crystal oscillator respectively, with the other end grounded. Together with the equivalent inductance of the crystal oscillator and stray capacitances on the PCB, they form a circuit that resonates at the target frequency, improving the accuracy and stability of the oscillation frequency. After power-on, the inverting amplifier of DSC_OUT starts working, generating wideband electrical noise. This noise is fed back to the two ends of crystal oscillator XL1 through C23 and C24. As a high-Q frequency-selective element, the crystal oscillator presents the lowest impedance only to signals at its resonant frequency. Therefore, the 16MHz frequency component is fed back to the DSC_IN pin of the MCU for amplification. The amplified signal is output from the DSC_OUT pin and fed back to the crystal oscillator again. This cycle continues, with the signal being continuously amplified and frequency-selected, and the oscillation quickly established and stabilized at the crystal oscillator's inherent 16MHz frequency, thus providing a stable clock source for the MCU.
[0042] Figure 9This is a circuit diagram of the programming interface provided in this application embodiment. The programming interface is used to program the compiled program file to the MCU chip. Pins DID and CLK are connected to the corresponding functional pins of the MCU through series resistors R27 and R28, respectively. The resistance values of series resistors R27 and R28 can be selected as 10 ohms. This is used for current limiting, suppressing overshoot and ringing phenomena that may occur during high-speed signal transmission, improving signal integrity, and providing a certain overcurrent protection for the corresponding I / O pins of the MCU. Pin GND is connected to the system's common ground terminal, and pin NRST is connected to the MCU's reset pin. This connection allows the external programmer to actively control the MCU's reset state. Before programming, the programmer can pull this pin low to force the MCU into a reset state, and then put it into a specific system boot program or debug mode, preparing it to receive and write new program code. Pin V3P3D is connected to the 3.3V operating power supply.
[0043] Figure 10 The circuit diagram of the communication module provided in this application embodiment shows that the communication module interacts with the main control module via an RS485 circuit. This RS485 circuit includes a transceiver chip U4, used to implement differential signal transmission between the main control module and an external host computer. The DI pin of U4 is connected to the transmit pin of the main control module for receiving data sent by the main control module; the RD pin of U4 is connected to the receive pin of the main control module for outputting data signals from the host computer to the main control module. The DE and RE pins of U4 are driven by control signals from the main control module. By controlling the high and low levels of DE / RE, U4 switches between transmit and receive modes, thereby ensuring correct switching of data direction.
[0044] In this RS485 circuit, resistors R8, R9, and R12 are used for current limiting or bias matching of the signal ports; capacitors C13 and C14 are used to filter the chip power supply to stabilize the chip's operating voltage; a common-mode inductor and a transient suppression diode are also included to suppress external interference signals and transient voltages, improving the reliability of bus communication. Interface terminal CON1 is used to physically connect the RS485 differential signal to an external host computer. Through this circuit structure, the communication module can receive statistical data from the main control module via the RS485 bus and upload it to the host computer. Simultaneously, it can receive configuration data from the host computer and transmit it to the main control module to set the initial parameters of the main control module.
[0045] In the several embodiments provided in this application, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between devices or units, and may be electrical, mechanical, or other forms.
[0046] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0047] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A counting detection sensor, characterized in that, It includes a power failure protection module, a detection module, and a main control module; The power failure protection module is connected to an external power source and is used to detect whether there is a power failure in the input power. When the input power is detected to be disconnected, the power failure protection module sends a power failure signal to the main control module. The detection module is used to detect whether there is an object at a preset position and output the detection result to the main control module; The main control module is used to receive the detection results output by the detection module and to perform statistical analysis on the detection results to obtain statistical data. The main control module is also used to receive the power failure signal from the power failure protection module. If the power failure signal is received, the statistical data is saved.
2. The counting detection sensor as described in claim 1, characterized in that, The counting detection sensor also includes a power supply module, which comprises a DC-DC unit and a voltage regulator unit. The DC-DC unit is used to step down the input power supply and deliver it to the voltage regulator unit. The voltage regulator unit receives the stepped-down power supply and further steps it down to obtain the working power supply, and then supplies the working power supply to the power failure protection module, the detection module and the main control module.
3. A counting detection sensor as described in claim 2, characterized in that, The power-down protection module includes: a first transistor and a second transistor. The emitter of the first transistor is connected to the input power supply via a diode, and the base of the first transistor is also connected to the input power supply to monitor whether there is a power failure. The collector of the first transistor is connected to the base of the second transistor, and the collector of the second transistor is connected to the operating power supply. The emitter of the second transistor is grounded. When the input power supply voltage drops to a threshold, the second transistor turns on, and the collector of the second transistor outputs the power failure signal to the main control module.
4. A counting detection sensor as described in claim 3, characterized in that, The detection module includes several sensor detection units. When a sensor detection unit detects an object at a preset position, it sends a low-level signal to the main control module. When no object is detected, it sends a high-level signal to the main control module.
5. A counting detection sensor as described in claim 3, characterized in that, The main control module includes an MCU chip. One end of the MCU chip is connected to the sensor detection unit via a pull-up resistor and is connected to the power supply. When the sensor detection unit does not detect an object, it outputs a high-level signal, and when the sensor detection unit detects an object, it outputs a low-level signal.
6. A counting detection sensor as described in claim 1, characterized in that, The counting detection sensor also includes a communication module. The communication module is used to receive statistical data from the main control module and upload the statistical data to the host computer; the communication module is also used to receive configuration data from the host computer and transmit the configuration data to the main control module to configure the initial parameters of the main control module.
7. A counting detection sensor as described in claim 6, characterized in that, The communication method between the communication module and the main control module is RS485 communication.
8. A counting detection sensor as described in claim 5, characterized in that, The counting detection sensor also includes a first indicator light and a second indicator light. The first indicator light is used to indicate whether the input power supply is on. When the input power supply is on, the first indicator light is lit. The second indicator light is used to indicate whether the MCU chip is communicating with the host computer. When the MCU chip is communicating with the host computer, the second indicator light flashes.
9. A counting detection sensor as described in claim 6, characterized in that, The counting detection sensor circuit also includes a crystal oscillator unit, which is used to provide a clock signal to the MCU chip.
10. A counting detection sensor as described in claim 6, characterized in that, The counting detection sensor also includes a programming interface, which is used to program the compiled program file to the MCU chip.