Small ball sorting control circuit for teaching
By adopting the STC12C5A60S2 series microcontroller and related circuits, the problems of high cost and poor interactivity of existing teaching sorting devices have been solved, realizing a low-cost, easily integrated and programmable teaching sorting control circuit, thus improving the teaching effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2026-04-07
AI Technical Summary
Existing teaching sorting devices have high hardware costs, complex wiring, and are difficult to miniaturize and integrate. Sensor signals are not visible, teaching interactivity is poor, color differences cannot be comprehensively judged, and the PLC control scheme has limited functions and cannot meet the requirements of C language programming.
The STC12C5A60S2 series microcontroller is used as the main control chip. Combined with sensor signal input, button control, serial communication, signal indicator, control signal output and stepper motor drive circuit, it realizes sensor signal processing, motion logic control, human-machine interaction management and data communication. The addition of signal indicator circuit intuitively displays the sensor status and is compatible with Modbus-RTU protocol for easy data communication.
It reduces hardware costs, enhances teaching interactivity, allows students to intuitively observe control logic, supports C language programming and secondary development, simplifies equipment wiring, and improves the integration and miniaturization of equipment.
Smart Images

Figure CN224096141U_ABST
Abstract
Description
Technical Field
[0001] This utility model belongs to the technical field of microcontroller teaching experimental equipment, specifically involving a small ball sorting control circuit for teaching. Background Technology
[0002] In the field of microcontroller teaching and experimental equipment, ball sorting systems are a typical carrier for teaching electromechanical control, sensor technology, and control logic.
[0003] In recent years, with the increasing demand for practical operation in vocational education, there is an urgent need for a low-cost, highly interactive, multi-sensor fusion teaching sorting control circuit that can clearly demonstrate the control logic and support manual operation and secondary development for teaching. Most existing technical solutions use a PLC as the control center, combined with photoelectric sensors, proximity switches, and limit switches to achieve material sorting. These are further supplemented by high-end modules such as frequency converters, servo drives, and HMI touchscreens to control AC motor operation. This results in high hardware costs, complex wiring, and difficulties in miniaturization and integration, making it unsuitable for teaching scenarios.
[0004] Meanwhile, existing teaching sorting devices are mostly based on simplified designs of industrial sorting equipment. The system can only identify a single attribute of the material through a single sensor, and cannot comprehensively judge color differences. Secondly, existing industrial equipment is usually a closed design, making sensor signal states invisible, hindering students' ability to intuitively observe the detection logic. It lacks a manual control interface, making step-by-step debugging or demonstration of the underlying control process impossible, resulting in poor teaching interactivity. Finally, existing equipment is primarily controlled by PLCs or industrial PCs, leading to high teaching experiment costs. Low-cost PLC control solutions have limited functionality, failing to meet the needs of C language-based control logic programming and convenient secondary development teaching. Summary of the Invention
[0005] The purpose of this invention is to address the shortcomings of existing technologies by providing a ball sorting control circuit for teaching purposes.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] A ball sorting control circuit for teaching purposes includes a main control chip circuit, a sensor signal input circuit, a button control circuit, a serial communication circuit, a signal indicator circuit, a control signal output circuit, a stepper motor drive circuit, and a power supply circuit. The sensor signal input circuit, button control circuit, serial communication circuit, signal indicator circuit, control signal output circuit, and stepper motor drive circuit are each electrically connected to the main control chip circuit. The power supply circuit is electrically connected to the main control chip circuit, sensor signal input circuit, button control circuit, serial communication circuit, signal indicator circuit, control signal output circuit, and stepper motor drive circuit.
[0008] The main control chip circuit uses an STC12C5A60S2 series microcontroller, which is mainly responsible for sensor signal processing, motion logic control, human-machine interaction management, control signal indicator status, data communication and expansion tasks of the ball sorting control system.
[0009] The sensor signal input circuit receives digital signals from the sensors, performs optical coupling anti-interference isolation and level conversion processing, and then transmits the signals to the main control chip circuit. Specifically, the sensor signal input circuit receives digital signals from fiber optic sensors and photoelectric sensors, performs optical coupling anti-interference isolation and level conversion processing, and then transmits the color detection signal and position detection signal to the main control chip circuit.
[0010] The button control circuit is used to receive manual command input signals, including start, stop, automatic, manual, and single-step control commands, and transmits the signals to the main control chip circuit. In manual mode, button commands can override the automatic control logic and directly intervene in the opening and closing of the gripper or the movement of the motor; independent buttons can simulate sensor trigger signals for sorting logic verification.
[0011] The serial communication circuit is used to realize data interaction between the main control chip circuit and the external host computer. The data interaction between the main control chip and the host computer software is achieved by uploading sorting quantity, error type, and sensor status to the host computer in real time via the UART protocol; receiving instructions from the host computer to adjust parameters such as sorting speed and setting color judgment threshold; and being compatible with the Modbus-RTU protocol to facilitate data communication with existing training equipment.
[0012] The signal indicator circuit is used to display the sensor signal status. It can display the status of limit sensors, the mechanical position of the sorting device, the opening and closing status of the grippers, the status of material sensors, the status of fiber optic sensors, and equipment fault alarm indications. The current sensor status is visually displayed through changes in light.
[0013] The control signal output circuit is used to output control signals to external actuators; it can also output control signals to electric grippers and stepper motor drive circuits. The control output circuit includes a signal isolation protection circuit, which uses optocouplers to isolate the high-voltage actuator circuit from the low-voltage control circuit, preventing reverse current from damaging the main control chip circuit. The control output circuit also includes an oscilloscope detection interface for connecting an external oscilloscope, facilitating student observation of the control signal waveform.
[0014] The stepper motor drive circuit converts the pulse and direction signals output from the main control chip circuit into high-voltage drive signals recognizable by the stepper motor through optocoupler isolation, driving the X and Y axis stepper motors. The stepper motor drive circuit achieves micro-stepping control through a driver (TB6600HG), improving the horizontal / vertical axis movement accuracy; it monitors the motor current and automatically cuts off the drive signal when the leadscrew jams, achieving overload protection.
[0015] The power supply circuit is the working power supply used to power various circuits.
[0016] The beneficial effects of this utility model are:
[0017] 1. This utility model can realize the control and display functions of the ball sorting system; this utility model adds a signal indicator circuit to display the sensor signals in real time, providing students with an intuitive way to observe during practical training, making it easier to understand the working logic of the ball sorting system and improving the interactivity of teaching.
[0018] 2. This utility model uses a microcontroller as the main control chip, which is low in cost, rich in learning resources, easy to develop, can be smoothly connected with previous courses, reduces the difficulty of operation, improves students' learning efficiency, and facilitates teachers' teaching. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of the structural framework of an embodiment of the present invention.
[0020] Figure 2 This is a schematic diagram of the main control chip circuit in one embodiment of the present invention.
[0021] Figure 3 This is a schematic diagram of a stepper motor drive circuit in one embodiment of the present invention.
[0022] Figure 4 This is a schematic diagram of the sensor signal input circuit in one embodiment of the present invention.
[0023] Figure 5 This is a schematic diagram of the power supply circuit in one embodiment of the present invention.
[0024] Figure 6 This is a schematic diagram of the control signal output circuit in one embodiment of the present invention.
[0025] Figure 7 This is a schematic diagram of a serial communication circuit in one embodiment of the present invention.
[0026] Figure 8 This is a schematic diagram of the button control circuit in one embodiment of the present invention.
[0027] Figure 9This is a schematic diagram of a signal indicator circuit in one embodiment of the present invention. Detailed Implementation
[0028] The present invention will be further described below with reference to the accompanying drawings.
[0029] Example 1
[0030] A ball sorting control circuit for teaching purposes, such as Figure 1 As shown, the system includes a main control chip circuit, and sensor signal input circuit, key control circuit, serial communication circuit, signal indicator circuit, control signal output circuit, stepper motor drive circuit, and power supply circuit, all electrically connected to the main control chip circuit. The main control chip circuit uses an STC12C5A60S2 series microcontroller, primarily responsible for sensor signal processing, motion logic control, human-machine interaction management, controlling signal indicator status, and performing data communication and expansion tasks within the ball sorting control system. The sensor signal input circuit receives digital signals from the sensors, performs optocoupler anti-interference isolation and level conversion processing, and then transmits the signals to the main control chip. The circuit includes: a button control circuit for receiving manual command input signals, inputting start, stop, automatic, manual, and single-step control commands, and transmitting the signals to the main control chip circuit; a serial communication circuit for enabling data interaction between the main control chip circuit and an external host computer; a signal indicator circuit for displaying sensor signal status; a control signal output circuit for outputting control signals to external actuators; a stepper motor drive circuit for converting the pulse and direction signals output by the main control chip circuit into high-voltage drive signals recognizable by the stepper motor through optocoupler isolation, driving the X and Y axis stepper motors; and a power supply circuit for supplying power to all circuits.
[0031] Furthermore, the control output circuit includes a signal isolation protection circuit, which uses optocouplers to isolate the high-voltage execution circuit from the low-voltage control circuit, preventing reverse current from damaging the main control chip circuit. The control output circuit also includes an oscilloscope detection interface for connecting an external oscilloscope, facilitating student observation of the control signal waveform.
[0032] The circuit designs of this embodiment will be described in detail below with reference to the accompanying drawings:
[0033] like Figure 2As shown, the main control chip circuit includes an STC12C5A60S2 series microcontroller U1, a polarized capacitor C2, a resistor R2, a crystal oscillator X1, and non-polarized capacitors C8 and C14; wherein: one end of the polarized capacitor C2 is connected to a +5V voltage, and the other end is grounded through the resistor R2 and connected to the RST terminal of the STC12C5A60S2 series microcontroller U1; the two ends of the crystal oscillator X1 are respectively connected to the XTAL1 terminal and XTAL2 terminal of the STC12C5A60S2 series microcontroller U1, and are respectively grounded through the non-polarized capacitors C8 and C14.
[0034] like Figure 3 As shown, the stepper motor drive circuit includes a TB6600HG driver chip U4, a light-emitting diode LD1, resistors R4, R3, R11, R14, R15, a terminal CN1, a non-polarized capacitor C6, resistors R5, R6, R12, R16, R17, a non-polarized capacitor C10, a polarized capacitor C9, optocouplers U3, U5, U6, resistors R7, R13, R20, and non-polarized capacitors C5, C7, C15.
[0035] Wherein: one end of the light-emitting diode LD1 is connected to the ALERT terminal of the TB6600HG driver chip U4 through resistor R4, and the other end is connected to a +5V voltage and grounded through series resistors R3 and R11; resistors R3 and R11 are also connected to the Vref terminal of the TB6600HG driver chip U4; one end of resistors R14 and R15 connected in parallel is connected to the NFB terminal of the TB6600HG driver chip U4, and the other end is grounded; terminal CN1 is connected to the OUT2B, OUT1B, OUT2A, and OUT1A terminals of the TB6600HG driver chip U4 respectively; one end of resistors R16 and R17 connected in parallel is connected to the NFA terminal of the TB6600HG driver chip U4, and the other end is grounded; one end of the non-polarized capacitor C10 is grounded. One end of the capacitor is connected to the RESET terminal of the TB6600HG driver chip U4; the RESET terminal of the TB6600HG driver chip U4 is also connected to a +5V voltage through resistor R12; one end of the polarized capacitor C9 is grounded, and the other end is connected to a +24V voltage and connected to the Vcc terminal of the TB6600HG driver chip U4; one end of the resistor R5 is connected to a +5V voltage, and the other end is connected to the CW / CCW terminal of the TB6600HG driver chip U4; one end of the resistor R6 is connected to a +5V voltage, and the other end is connected to the CLK terminal of the TB6600HG driver chip U4; one end of the non-polarized capacitor C6 is grounded, and the other end is connected to the Vreg terminal of the TB6600HG driver chip U4, and the Vreg terminal of the TB6600HG driver chip U4 is also connected to a +5V voltage.
[0036] The optocoupler U3 has a +5V voltage connected to its VF+ terminal, a resistor R7 connected to the CLKOU2 / ADC0 / P1.0 terminal of the STC12C5A60S2 series microcontroller U1, a VO terminal connected to the CLK terminal of the TB6600HG driver chip U4, and a +5V voltage connected to its VCC terminal and grounded through a non-polarized capacitor C5.
[0037] The optocoupler U5 has a +5V voltage connected to its VF+ terminal, a resistor R13 connected to the RXD2 / ECI / ADC2 / P1.2 terminal of the STC12C5A60S2 series microcontroller U1, a VO terminal connected to the CW / CCW terminal of the TB6600HG driver chip U4, and a +5V voltage connected to its VCC terminal connected to ground via a non-polarized capacitor C7.
[0038] The optocoupler U6 has a +5V voltage connected to its VF+ terminal, a resistor R20 connected to the ADC1 / P1.1 terminal of the STC12C5A60S2 series microcontroller U1, a VO terminal connected to the ENABLE terminal of the TB6600HG driver chip U4, and a +5V voltage connected to its VCC terminal connected to ground via a non-polarized capacitor C15.
[0039] Terminal CN1 is connected to the four wires (A+, A-, B+, B-) from a two-phase four-wire stepper motor.
[0040] like Figure 4 As shown, the sensor signal input circuit includes optocouplers U8, U10, U13, U15, U18, U9, U12, U16, U19, resistors R23, R24, R26, R32, R34, R37, R39, R42, R50, R51, R25, R33, R35, R40, R49, R52, LEDs LD8 and LD14, test point sockets X2, X3, X5, X6, X8, X9, X11, and terminals CN2, CN3, CN4, CN5, CN6.
[0041] Wherein: pin 1 of the optocoupler U8 is connected to the signal indicator circuit; pin 2 is connected to VDD5 voltage through resistor R24; pin 2 is also connected to test point socket X2 and terminal CN2; pin 3 is grounded; pin 4 is connected to +5V voltage through resistor R23; pin 4 is also connected to the CLKOUT1 / INT# / T1 / P3.5 terminal of the STC12C5A60S2 series microcontroller U1; pin 1 of the optocoupler U10 is connected to the signal indicator circuit, ... Pin 2 is connected to VDD5 voltage through resistor R32. Pin 2 is also connected to test point socket X5 and terminal CN2. Pin 3 is grounded. Pin 4 is connected to +5V voltage through resistor R26. Pin 4 is also connected to the CLKOUT0 / INT# / T0 / P3.4 terminal of STC12C5A60S2 series microcontroller U1. Pin 1 of the optocoupler U13 is connected to the signal indicator circuit. Pin 2 is connected to VDD5 voltage through resistor R37. Pin 2 is also connected to the test point. The X6 socket and CN2 terminal are connected with pin 3 grounded and pin 4 connected to +5V via resistor R34. Pin 4 is also connected to the INT1# / P3.3 terminal of the STC12C5A60S2 series microcontroller U1. The optocoupler U15 has pin 1 connected to the signal indicator circuit and pin 2 connected to VDD5 via resistor R42. Pin 2 is also connected to the test point socket X9 and CN4 terminal. Pin 3 is grounded and pin 4 is connected to +5V via resistor R39. Pin 4 is also connected to the INT0# / P3.2 terminal of the STC12C5A60S2 series microcontroller U1; pin 1 of the optocoupler U18 is connected to the signal indicator circuit, pin 2 is connected to the VDD5 voltage through resistor R51, pin 2 is also connected to the test point socket X11 and the terminal CN6, pin 3 is grounded, pin 4 is connected to the +5V voltage through resistor R50, and pin 4 is also connected to the P3.6 / WR# terminal of the STC12C5A60S2 series microcontroller U1.
[0042] The optocoupler U9 has a +24V voltage connected to pin 1, a light-emitting diode LD8 connected to pin 1 of optocoupler U12, a grounded pin 3, and a VDD voltage connected to pin 4 via resistor R25. Pin 4 is also connected to test point socket X3. The optocoupler U12 has a fiber optic sensor CN3 connected to pin 2 via resistor R35, a grounded pin 3, a +5V voltage connected to pin 4 via resistor R33, and a P0.6 pin of the STC12C5A60S2 series microcontroller U1.
[0043] The optocoupler U16 has a +24V voltage connected to pin 1, a light-emitting diode LD14 connected to pin 1 of optocoupler U19, a grounded pin 3, a VDD voltage connected to pin 4 connected to resistor R40, and a test point socket X8 connected to pin 4. The optocoupler U19 has a photoelectric sensor CN5 connected to pin 2 connected to resistor R52, a grounded pin 3, a +5V voltage connected to pin 4 connected to resistor R49, and a P0.7 pin of the STC12C5A60S2 series microcontroller U1.
[0044] Test point sockets (TH3.2) X2, X3, X5, X6, X8, X9, and X11 are used to lead the sensor signals of station 1, 2, 3, left, and right limit switches to other external control modules through banana head signal lines, respectively, to realize the external connection of sensor signals of the ball sorting device.
[0045] like Figure 6 As shown, the control signal output circuit includes optocouplers U11, U14, U17, resistors R27, R28, R36, R38, R41, R43, and test point sockets X4, X7, X10.
[0046] Wherein: pin 1 of the optocoupler U11 is connected to the signal indicator circuit, pin 2 is connected to VDD5 voltage through resistor R28, pin 2 is also connected to test point socket X4, pin 3 is grounded, pin 4 is connected to +5V voltage through resistor R27, and pin 4 is also connected to the P0.0 terminal of the STC12C5A60S2 series microcontroller U1; pin 1 of the optocoupler U14 is connected to the signal indicator circuit, pin 2 is connected to VDD5 voltage through resistor R38, and pin 2 is also connected to test point socket X 7. Pin 3 is grounded, and pin 4 is connected to +5V voltage through resistor R36. Pin 4 is also connected to P0.1 of the STC12C5A60S2 series microcontroller U1. Pin 1 of the optocoupler U17 is connected to the signal indicator circuit, pin 2 is connected to VDD5 voltage through resistor R43, pin 2 is also connected to the test point socket X10, pin 3 is grounded, and pin 4 is connected to +5V voltage through resistor R41. Pin 4 is also connected to P0.2 of the STC12C5A60S2 series microcontroller U1.
[0047] Test point jacks (TH3.2) X4, X7, and X10 are used to output the left shift, right shift, and gripper control signals to other external control modules via banana-head signal cables, respectively.
[0048] like Figure 8 As shown, the button control circuit includes resistors R53, R54, R55 and switches K1, K2, and K3.
[0049] Specifically: one end of switch K1 is grounded, and the other end is connected to the P0.6 terminal of the STC12C5A60S2 series microcontroller U1 and connected to a +5V voltage through one end of resistor R55; one end of switch K2 is grounded, and the other end is connected to the P0.5 terminal of the STC12C5A60S2 series microcontroller U1 and connected to a +5V voltage through one end of resistor R54; one end of switch K3 is grounded, and the other end is connected to the P0.4 terminal of the STC12C5A60S2 series microcontroller U1 and connected to a +5V voltage through one end of resistor R53.
[0050] Switches K1, K2, and K3 are preferably selected as independent buttons with anti-static properties, large contact points, and long lifespan, facilitating repeated use by students and ensuring longevity and reliability. Switches K1, K2, and K3 can respectively perform functions such as item selection, confirmation, and exit from the LCD screen menu. Furthermore, K1, K2, and K3 can be programmed to perform different functions under different control interfaces.
[0051] like Figure 9 As shown, the signal indicator circuit includes light-emitting diodes LD5, LD6, LD7, LD9, LD10, LD11, LD12, and LD13, and resistors R29, R30, R31, R44, R45, R46, R47, and R48.
[0052] Wherein: one end of the light-emitting diode LD5 is connected to the VDD5 voltage, and the other end is connected to pin 1 of the optocoupler U11 through resistor R29; one end of the light-emitting diode LD6 is connected to the VDD5 voltage, and the other end is connected to pin 1 of the optocoupler U14 through resistor R30; one end of the light-emitting diode LD7 is connected to the VDD5 voltage, and the other end is connected to pin 1 of the optocoupler U17 through resistor R31.
[0053] In this embodiment, LD5 is the status indicator light for the first material tank sensor, LD6 is the status indicator light for the second material tank sensor, and LD7 is the status indicator light for the third material tank sensor.
[0054] One end of the LED LD9 is connected to VDD5 voltage, and the other end is connected to pin 1 of the optocoupler U8 through resistor R44; one end of the LED LD10 is connected to VDD5 voltage, and the other end is connected to pin 1 of the optocoupler U10 through resistor R45; one end of the LED LD11 is connected to VDD5 voltage, and the other end is connected to pin 1 of the optocoupler U13 through resistor R46; one end of the LED LD12 is connected to VDD5 voltage, and the other end is connected to pin 1 of the optocoupler U15 through resistor R47; one end of the LED LD13 is connected to VDD5 voltage, and the other end is connected to pin 1 of the optocoupler U18 through resistor R48.
[0055] In this embodiment, LD9 is the position status indicator light for the first mechanical position of the sorting device, LD10 is the position status indicator light for the second mechanical position of the sorting device, LD11 is the position status indicator light for the third mechanical position of the sorting device, LD12 is the gripper opening / closing status indicator light, and LD13 is the fiber optic sensor status indicator light.
[0056] like Figure 7 As shown, the serial communication circuit uses serial communication terminal H1; pin 1 of the serial communication terminal H1 is connected to +5V, pin 2 is connected to the INT# / RXD / P3.0 terminal of the STC12C5A60S2 series microcontroller U1, pin 3 is connected to the TXD / P3.1 terminal of the STC12C5A60S2 series microcontroller U1, and pin 4 is grounded.
[0057] like Figure 5 The power supply circuit comprises two parts, one of which includes a TPS5430 chip U2, non-polarized capacitors C1 and C3, resistors R1, R8, R9, and R10, a polarized capacitor C4, a Zener diode D1, and an inductor L1. Wherein: the BOOT terminal of the TPS5430 chip U2 is connected to the PH terminal of the TPS5430 chip U2 through a non-polarized capacitor C1; the VSENSE terminal is grounded through a resistor R10; the ENA terminal is grounded through a resistor R8; the GND terminal is grounded; the VIN terminal is connected to a +24V voltage and grounded through resistors R9 and R8; the PH terminal outputs a +5V voltage through an inductor L1; one end of the non-polarized capacitor C3 is connected to the VIN terminal of the TPS5430 chip U2, and the other end is grounded; one end of the Zener diode D1 is connected to the PH terminal of the TPS5430 chip U2, and the other end is grounded; one end of the polarized capacitor C4 is connected to the PH terminal of the TPS5430 chip U2 through an inductor L1, and the other end is grounded; one end of the resistor R1 is connected to a +5V voltage, and the other end is grounded through a resistor R10. This circuit (TPS5430) converts the input DC +24V voltage into DC +5V voltage, which is then supplied to the main control chip circuit, button control circuit, communication circuit, drive circuit, control signal circuit, etc.
[0058] Another part of the circuit includes a B0505S-1W power module PW1, polarized capacitors C11 and C13, a non-polarized capacitor C12, resistors R18 and R19, and light-emitting diodes LD2 and LD3. Specifically: the GND terminal of the B0505S-1W power module PW1 is grounded, the VIN terminal receives +5V and is grounded through polarized capacitor C11, the 0V terminal is grounded, and the +VO terminal outputs VDD5 voltage. Non-polarized capacitor C12 and polarized capacitor C13 are connected in parallel between the 0V and +VO terminals. One end of the light-emitting diode LD2 receives +5V, and the other end is grounded through resistor R18. One end of the light-emitting diode LD3 receives +24V, and the other end is grounded through resistor R19. This part of the circuit (B0505S) isolates and converts the input +5V voltage to VDD5 voltage.
[0059] In the power supply circuit of this embodiment, the +5V circuit and the VDD5 line are electrically isolated and do not interfere with each other. The VDD5 line is used to provide 5V power to the sensor signal input circuit, the control signal output circuit, and the signal indicator circuit.
[0060] Obviously, the above embodiments are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. For those skilled in the art, other variations or modifications can be made based on the above description; it is neither necessary nor possible to exhaustively list all possible implementations here; however, obvious variations or modifications derived therefrom are still within the protection scope of the present invention.
Claims
1. A ball sorting control circuit for teaching purposes, characterized in that: It includes a main control chip circuit, and sensor signal input circuit, key control circuit, serial communication circuit, signal indicator circuit, control signal output circuit, stepper motor drive circuit and power supply circuit, which are electrically connected to the main control chip circuit respectively. The main control chip circuit uses an STC12C5A60S2 series microcontroller, which is mainly responsible for sensor signal processing, motion logic control, human-machine interaction management, control signal indicator status, data communication and expansion tasks of the ball sorting control system. The sensor signal input circuit is used to receive the digital signal from the sensor, and after performing optocoupler anti-interference isolation and level conversion processing, transmit the signal to the main control chip circuit. The button control circuit is used to receive manual command input signals, input start, stop, automatic, manual, and single-step control commands, and transmit the signals to the main control chip circuit. The serial communication circuit is used to realize data interaction between the main control chip circuit and the external host computer; The signal indicator circuit is used to display the sensor signal status; The control signal output circuit is used to output control signals to an external actuator; The stepper motor drive circuit is used to convert the pulse and direction signals output by the main control chip circuit into high-voltage drive signals that can be recognized by the stepper motor through optocoupler isolation, and drive the X and Y axis stepper motors. The power supply circuit is used to supply power to each circuit.
2. The teaching ball sorting control circuit according to claim 1, characterized in that: The control signal output circuit is equipped with a signal isolation protection circuit, which uses optocouplers to isolate the high-voltage execution circuit from the low-voltage control circuit to prevent reverse current from damaging the main control chip circuit.
3. The teaching ball sorting control circuit according to claim 1 or 2, characterized in that: The control signal output circuit is also equipped with an oscilloscope detection interface.
4. The teaching ball sorting control circuit according to claim 1, characterized in that: The main control chip circuit includes an STC12C5A60S2 series microcontroller U1, a polarized capacitor C2, a resistor R2, a crystal oscillator X1, and non-polarized capacitors C8 and C14. One end of the polarized capacitor C2 is connected to a +5V voltage, and the other end is grounded through a resistor R2 and connected to the RST terminal of the STC12C5A60S2 series microcontroller U1; the two ends of the crystal oscillator X1 are respectively connected to the XTAL1 and XTAL2 terminals of the STC12C5A60S2 series microcontroller U1, and are respectively grounded through non-polarized capacitors C8 and C14.
5. The teaching ball sorting control circuit according to claim 4, characterized in that: The stepper motor drive circuit includes a TB6600HG driver chip U4, a light-emitting diode LD1, resistors R4, R3, R11, R14, R15, a terminal CN1, a non-polarized capacitor C6, resistors R5, R6, R12, R16, R17, a non-polarized capacitor C10, a polarized capacitor C9, optocouplers U3, U5, U6, resistors R7, R13, R20, and non-polarized capacitors C5, C7, C15; One end of the light-emitting diode LD1 is connected to the ALERT terminal of the TB6600HG driver chip U4 through resistor R4, and the other end is connected to a +5V voltage and grounded through series resistors R3 and R11; resistors R3 and R11 are also connected to the Vref terminal of the TB6600HG driver chip U4; resistors R14 and R15 are connected in parallel, one end of which is connected to the NFB terminal of the TB6600HG driver chip U4, and the other end is grounded; terminal CN1 is connected to the OUT2B, OUT1B, OUT2A, and OUT1A terminals of the TB6600HG driver chip U4 respectively; resistors R16 and R17 are connected in parallel, one end of which is connected to the NFA terminal of the TB6600HG driver chip U4, and the other end is grounded; one end of the non-polarized capacitor C10 is grounded. The other end is connected to the RESET terminal of the TB6600HG driver chip U4; the RESET terminal of the TB6600HG driver chip U4 is also connected to a +5V voltage through resistor R12; one end of the polarized capacitor C9 is grounded, and the other end is connected to a +24V voltage and to the Vcc terminal of the TB6600HG driver chip U4; one end of the resistor R5 is connected to a +5V voltage, and the other end is connected to the CW / CCW terminal of the TB6600HG driver chip U4; one end of the resistor R6 is connected to a +5V voltage, and the other end is connected to the CLK terminal of the TB6600HG driver chip U4; one end of the non-polarized capacitor C6 is grounded, and the other end is connected to the Vreg terminal of the TB6600HG driver chip U4, and the Vreg terminal of the TB6600HG driver chip U4 is also connected to a +5V voltage; The optocoupler U3 has a +5V voltage connected to its VF+ terminal, a resistor R7 connected to the CLKOU2 / ADC0 / P1.0 terminal of the STC12C5A60S2 series microcontroller U1, a VO terminal connected to the CLK terminal of the TB6600HG driver chip U4, and a +5V voltage connected to its VCC terminal and grounded through a non-polarized capacitor C5. The optocoupler U5 has a +5V voltage connected to its VF+ terminal, a resistor R13 connected to the RXD2 / ECI / ADC2 / P1.2 terminal of the STC12C5A60S2 series microcontroller U1, a VO terminal connected to the CW / CCW terminal of the TB6600HG driver chip U4, and a +5V voltage connected to its VCC terminal connected to ground via a non-polarized capacitor C7. The optocoupler U6 has a +5V voltage connected to its VF+ terminal, a resistor R20 connected to the ADC1 / P1.1 terminal of the STC12C5A60S2 series microcontroller U1, a VO terminal connected to the ENABLE terminal of the TB6600HG driver chip U4, and a +5V voltage connected to its VCC terminal connected to ground via a non-polarized capacitor C15.
6. The teaching ball sorting control circuit according to claim 4, characterized in that: The sensor signal input circuit includes optocouplers U8, U10, U13, U15, U18, U9, U12, U16, U19; resistors R23, R24, R26, R32, R34, R37, R39, R42, R50, R51, R25, R33, R35, R40, R49, R52; light-emitting diodes LD8, LD14; test point sockets X2, X3, X5, X6, X8, X9, X11; and terminals CN2, CN3, CN4, CN5, CN6. Pin 1 of the optocoupler U8 is connected to the signal indicator circuit, pin 2 is connected to VDD5 voltage through resistor R24, pin 2 is also connected to test point socket X2 and terminal CN2, pin 3 is grounded, pin 4 is connected to +5V voltage through resistor R23, and pin 4 is also connected to the CLKOUT1 / INT# / T1 / P3.5 terminal of STC12C5A60S2 series microcontroller U1; Pin 1 of the optocoupler U10 is connected to the signal indicator circuit, pin 2 is connected to VDD5 voltage through resistor R32, pin 2 is also connected to test point socket X5 and terminal CN2, pin 3 is grounded, pin 4 is connected to +5V voltage through resistor R26, and pin 4 is also connected to the CLKOUT0 / INT# / T0 / P3.4 terminal of STC12C5A60S2 series microcontroller U1; Pin 1 of the optocoupler U13 is connected to the signal indicator circuit, pin 2 is connected to VDD5 voltage through resistor R37, pin 2 is also connected to test point socket X6 and terminal CN2, pin 3 is grounded, pin 4 is connected to +5V voltage through resistor R34, and pin 4 is also connected to the INT1# / P3.3 terminal of STC12C5A60S2 series microcontroller U1; Pin 1 of the optocoupler U15 is connected to the signal indicator circuit, pin 2 is connected to VDD5 voltage through resistor R42, pin 2 is also connected to test point socket X9 and terminal CN4, pin 3 is grounded, pin 4 is connected to +5V voltage through resistor R39, and pin 4 is also connected to the INT0# / P3.2 terminal of STC12C5A60S2 series microcontroller U1; Pin 1 of the optocoupler U18 is connected to the signal indicator circuit, pin 2 is connected to VDD5 voltage through resistor R51, pin 2 is also connected to test point socket X11 and terminal CN6, pin 3 is grounded, pin 4 is connected to +5V voltage through resistor R50, and pin 4 is also connected to P3.6 / WR# terminal of STC12C5A60S2 series microcontroller U1; The optocoupler U9 has a +24V voltage connected to pin 1, a light-emitting diode LD8 connected to pin 1 of optocoupler U12, a grounded pin 3, and a VDD voltage connected to pin 4 via resistor R25. Pin 4 is also connected to test point jack X3. The optocoupler U12 has a fiber optic sensor CN3 connected to pin 2 via resistor R35, a grounded pin 3, a +5V voltage connected to pin 4 via resistor R33, and a P0.6 pin of the STC12C5A60S2 series microcontroller U1. The optocoupler U16 has a +24V voltage connected to pin 1, a light-emitting diode LD14 connected to pin 1 of optocoupler U19, a grounded pin 3, a VDD voltage connected to pin 4 connected to resistor R40, and a test point socket X8 connected to pin 4. The optocoupler U19 has a photoelectric sensor CN5 connected to pin 2 connected to resistor R52, a grounded pin 3, a +5V voltage connected to pin 4 connected to resistor R49, and a P0.7 pin of the STC12C5A60S2 series microcontroller U1.
7. The teaching ball sorting control circuit according to claim 6, characterized in that: The control signal output circuit includes optocouplers U11, U14, U17, resistors R27, R28, R36, R38, R41, R43, and test point sockets X4, X7, X10. Pin 1 of the optocoupler U11 is connected to the signal indicator circuit, pin 2 is connected to VDD5 voltage through resistor R28, pin 2 is also connected to test point socket X4, pin 3 is grounded, pin 4 is connected to +5V voltage through resistor R27, and pin 4 is also connected to P0.0 terminal of STC12C5A60S2 series microcontroller U1. Pin 1 of the optocoupler U14 is connected to the signal indicator circuit, pin 2 is connected to VDD5 voltage through resistor R38, pin 2 is also connected to test point socket X7, pin 3 is grounded, pin 4 is connected to +5V voltage through resistor R36, and pin 4 is also connected to P0.1 of STC12C5A60S2 series microcontroller U1. Pin 1 of the optocoupler U17 is connected to the signal indicator circuit, pin 2 is connected to VDD5 voltage through resistor R43, pin 2 is also connected to test point socket X10, pin 3 is grounded, pin 4 is connected to +5V voltage through resistor R41, and pin 4 is also connected to P0.2 of STC12C5A60S2 series microcontroller U1.
8. The teaching ball sorting control circuit according to claim 7, characterized in that: The button control circuit includes resistors R53, R54, R55 and switches K1, K2, and K3; One end of the switch K1 is grounded, and the other end is connected to the P0.6 terminal of the STC12C5A60S2 series microcontroller U1 and connected to a +5V voltage through one end of the resistor R55. One end of the switch K2 is grounded, and the other end is connected to the P0.5 terminal of the STC12C5A60S2 series microcontroller U1 and connected to a +5V voltage through one end of the resistor R54; One end of the switch K3 is grounded, and the other end is connected to the P0.4 terminal of the STC12C5A60S2 series microcontroller U1 and connected to a +5V voltage through one end of the resistor R53.
9. The teaching ball sorting control circuit according to claim 8, characterized in that: The signal indicator circuit includes light-emitting diodes LD5, LD6, LD7, LD9, LD10, LD11, LD12, and LD13, and resistors R29, R30, R31, R44, R45, R46, R47, and R48. One end of the light-emitting diode LD5 is connected to the voltage VDD5, and the other end is connected to pin 1 of the optocoupler U11 through resistor R29; One end of the light-emitting diode LD6 is connected to the VDD5 voltage, and the other end is connected to pin 1 of the optocoupler U14 through resistor R30; One end of the light-emitting diode LD7 is connected to the VDD5 voltage, and the other end is connected to pin 1 of the optocoupler U17 through resistor R31; One end of the light-emitting diode LD9 is connected to the VDD5 voltage, and the other end is connected to pin 1 of the optocoupler U8 through the resistor R44; One end of the light-emitting diode LD10 is connected to the VDD5 voltage, and the other end is connected to pin 1 of the optocoupler U10 through the resistor R45. One end of the light-emitting diode LD11 is connected to the VDD5 voltage, and the other end is connected to pin 1 of the optocoupler U13 through the resistor R46; One end of the light-emitting diode LD12 is connected to the VDD5 voltage, and the other end is connected to pin 1 of the optocoupler U15 through resistor R47; One end of the light-emitting diode LD13 is connected to the VDD5 voltage, and the other end is connected to pin 1 of the optocoupler U18 through resistor R48.
10. The ball sorting control circuit for teaching purposes according to claim 9, characterized in that: The serial communication circuit uses serial communication terminal H1; pin 1 of the serial communication terminal H1 is connected to +5V, pin 2 is connected to the INT# / RXD / P3.0 terminal of the STC12C5A60S2 series microcontroller U1, pin 3 is connected to the TXD / P3.1 terminal of the STC12C5A60S2 series microcontroller U1, and pin 4 is grounded.