An optical detection system
By combining a mechanical keypad and a main control chip, the problem of easy damage to traditional keyboards is solved, resulting in an automated optical inspection device that is easy to operate and has low maintenance costs, suitable for AOI scanning machines.
Patent Information
- Application Number
- CN202522722247.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2035-12-23
AI Technical Summary
The letter/number keys on traditional universal keyboards are prone to damage, resulting in high replacement costs and no repair value, which affects the operating efficiency and maintenance costs of automated optical inspection equipment.
It adopts a mechanical keypad, and uses a matrix keypad circuit and main control chip to realize key scanning. Combined with a USB interface and electrostatic discharge protection, it simplifies operation and improves reliability.
Mechanical buttons offer easy operation, extended lifespan, reduced maintenance costs, compatibility with multiple systems, and require no additional drivers, ensuring stable operation of the device in complex environments.
Smart Images

Figure CN225031937U_ABST
Abstract
Description
Technical Field
[0001] This utility model relates to the field of automatic optical inspection, and in particular to an optical inspection system. Background Technology
[0002] Automatic optical inspection equipment typically interacts with lower-level machines (such as PLCs, motion controllers, etc.) through a set of communication protocols defined by the manufacturer. Specifically, it uses a general-purpose keyboard to input predefined key values, which are command codes, instruction strings, or specific register addresses / values defined by the control software of the automatic optical inspection equipment.
[0003] The hardware controller of the automated optical inspection equipment receives key values through a communication interface, parses the instructions within them, and then drives the motor, light source, and other components to perform precise actions.
[0004] Some commonly used key values correspond to letter / number keys on a general-purpose keyboard. Due to their high frequency of use, these keys are prone to damage. If one letter / number key breaks, the entire general-purpose keyboard needs to be replaced, which is costly and not worth repairing.
[0005] The disclosure of the above background technical content is only for the purpose of assisting in understanding the concept and technical solution of this application, and does not necessarily provide technical instruction. Utility Model Content
[0006] The purpose of this invention is to provide a mechanical keypad for use on AOI scanning machines to replace traditional general-purpose keyboards, making it easier to operate control commands for AOI.
[0007] To achieve the above objectives, the technical solution adopted by this utility model is as follows:
[0008] An optical inspection system includes an AOI scanning machine, a computer, and a mechanical keypad. The mechanical keypad includes a main control chip and multiple mechanical keys. The main control chip is configured with multiple row pins and multiple column pins. One end of each mechanical key is configured to be connected to a row pin of the main control chip, and the other end of each mechanical key is configured to be connected to a column pin of the main control chip.
[0009] The plurality of mechanical keys form a matrix keyboard circuit. One end of each mechanical key in the same row of the matrix keyboard circuit is connected to the same row pin of the main control chip through a first current-limiting resistor. The other end of each mechanical key in the same column of the matrix keyboard circuit is connected to the same column pin of the main control chip through a second current-limiting resistor.
[0010] Each row pin is configured to sequentially output a low-level scan signal during the key scan process performed by the main control chip; each column pin is connected to the positive power supply of the main control chip through a pull-up resistor, so that when the mechanical key is not pressed, the voltage of its corresponding column pin remains high; when the mechanical key is pressed, the voltage of its corresponding column pin becomes low.
[0011] The row and column pins are respectively connected to the power ground via electrostatic discharge protection devices;
[0012] The main control chip is configured to connect to the input port of the computer;
[0013] The computer is connected to the actuator of the AOI scanning machine, and the computer is configured to run AOI control software.
[0014] Furthermore, based on any or a combination of the aforementioned technical solutions, the mechanical keypad is configured as a USB human-machine interface device, and the main control chip is connected to the input port of the computer via a USB interface circuit.
[0015] Furthermore, based on any or a combination of the aforementioned technical solutions, the USB interface circuit includes a USB connector and an ESD protection circuit, wherein the ESD protection circuit is connected between the USB connector and the USB data pin of the main control chip.
[0016] Furthermore, based on any or a combination of the aforementioned technical solutions, the main control chip is an STM32F103RBT6.
[0017] Furthermore, based on any or a combination of the aforementioned technical solutions, the electrostatic discharge protection device is a transient voltage suppression diode or an ESD protection chip.
[0018] Furthermore, based on any one or a combination of the aforementioned technical solutions, the resistance value of the first current-limiting resistor is in the range of 100Ω to 1kΩ, and / or the resistance value of the second current-limiting resistor is in the range of 100Ω to 1kΩ.
[0019] Furthermore, based on any or a combination of the aforementioned technical solutions, the pull-up resistors connected to the column pins are external pull-up resistors or internal pull-up resistors, and the resistance value of the pull-up resistors ranges from 1kΩ to 10kΩ.
[0020] Furthermore, based on any one or a combination of the aforementioned technical solutions, the number of mechanical buttons is 9 to 16.
[0021] Furthermore, in accordance with any or a combination of the aforementioned technical solutions, the mechanical keypad also includes a status indicator light, which is connected to the main control chip and configured to be driven by the main control chip.
[0022] Furthermore, based on any one or a combination of the aforementioned technical solutions, each mechanical key includes a keycap, a movable shaft, and a reset elastic element, arranged from top to bottom.
[0023] The beneficial effects of the technical solution provided by this utility model are as follows:
[0024] a. Functional mechanical buttons are easier to operate, have a longer lifespan, and reduce AOI equipment maintenance costs;
[0025] b. The main control chip simulates a standard USB HID keyboard device, requiring no additional drivers, is plug-and-play, and is compatible with Windows / Linux systems, simplifying AOI software integration;
[0026] c. Features a dual protection design: current-limiting resistors prevent short-circuit damage to the main control chip's GPIO, and electrostatic discharge protection devices suppress electrostatic discharge, ensuring stable operation of the AOI equipment in the complex electromagnetic environment of the factory. Attached Figure Description
[0027] 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 some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 A structural block diagram of an optical detection system provided as an exemplary embodiment of the present invention;
[0029] Figure 2 A schematic diagram of a matrix keyboard circuit formed by multiple mechanical keys, provided as an exemplary embodiment of the present invention;
[0030] Figure 3 A schematic diagram of the appearance of a plurality of mechanical buttons provided for an exemplary embodiment of the present invention. Detailed Implementation
[0031] To enable those skilled in the art to better understand the technical solutions of this utility model, the technical solutions of the embodiments of this utility model will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this utility model, and not all embodiments. Based on the embodiments of this utility model, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection claimed by this utility model.
[0032] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this utility model are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the utility model described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0033] In one embodiment of this utility model, an optical detection system is provided, such as... Figure 1 As shown, the system includes an AOI scanning machine, a computer, and a mechanical keypad. The mechanical keypad includes a main control chip and multiple mechanical keys 1. Each mechanical key 1 includes a keycap from top to bottom, a movable axis, and a reset elastic element.
[0034] like Figure 2 In the illustrated embodiment, there are 12 mechanical keys 1, which form a matrix keyboard circuit arranged in three rows and four columns. The main control chip is configured with multiple row pins (ROW1, ROW2, ROW3) and multiple column pins (COL1, COL2, COL3, COL4). One end of each mechanical key 1 is configured to be connected to the row pin (ROW1, ROW2, or ROW3) of the main control chip, and the other end of each mechanical key 1 is configured to be connected to the column pin (COL1, COL2, COL3, or COL4) of the main control chip.
[0035] In the matrix keyboard circuit, one end of each mechanical key 1 in the same row is connected to the same row pin of the main control chip through a first current-limiting resistor 3, and the other end of each mechanical key 1 in the same column is connected to the same column pin of the main control chip through a second current-limiting resistor 4. Specifically, the resistance value of the first current-limiting resistor 3 is in the range of 100Ω to 1kΩ, and the resistance value of the second current-limiting resistor 4 is in the range of 100Ω to 1kΩ.
[0036] Each row pin (ROW1, ROW2, ROW3) is configured to sequentially output a low-level scan signal during the key scanning process performed by the main control chip; each column pin (COL1, COL2, COL3, COL4) is connected to the positive power supply of the main control chip through pull-up resistors, so that when mechanical button 1 is not pressed, the corresponding column pin remains at a high level; when the mechanical button is pressed, the voltage of the corresponding column pin becomes low level; specifically, the pull-up resistors connected to the column pins are external pull-up resistors or internal pull-up resistors, and the resistance value of the pull-up resistors is between 1kΩ and 10kΩ.
[0037] The row and column pins are respectively connected to the power ground GND through the electrostatic discharge protection device 2. The electrostatic discharge protection device can be a transient voltage suppression diode or an ESD protection chip.
[0038] The main control chip is configured to connect to the input port of the computer; the computer is connected to the actuator (such as a motor, light source, etc.) of the AOI scanning machine, and the computer is configured to run AOI control software.
[0039] In this embodiment, only 7 GPIOs are used to implement the key detection of 12 mechanical buttons 1, which significantly saves the IO resources of the main control chip. When the elastic reset structure (such as spring or spring sheet) of mechanical button 1 provides a clear trigger stroke, the loop between its corresponding row pin and column pin is connected. In a single scan cycle, the voltage of the corresponding column pin can be detected to be low.
[0040] In one embodiment of this utility model, the mechanical keypad is configured as a USB human-machine interface device, and the main control chip is connected to the input port of the computer through a USB interface circuit.
[0041] Specifically, the USB interface circuit includes a USB connector and an ESD protection circuit, with the ESD protection circuit connected between the USB connector and the USB data pins of the main control chip. The ESD protection circuit effectively suppresses electrostatic discharge, preventing damage to the USB pins of the main control chip from electrostatic discharge in industrial environments and improving system reliability. In this embodiment, an ESD device with a junction capacitance of less than 0.5pF is used, effectively avoiding attenuation or distortion of the full-speed USB signal and ensuring stable data transmission. Furthermore, when frequently plugging and unplugging the USB cable, the ESD protection circuit can absorb instantaneous surge current, extending the lifespan of the mechanical keypad.
[0042] In one specific embodiment, the main control chip uses an STM32F103RBT6 microcontroller, whose internal firmware implements the USB HID protocol. When the keyboard is connected to the computer via a USB cable, the computer's operating system automatically recognizes it as a standard USB keyboard device, without the need to install additional drivers.
[0043] In one embodiment with status indication function, the mechanical keypad also includes a status indicator light, which is connected to the main control chip and configured to be driven by the main control chip.
[0044] The main control chip scans the matrix keyboard in real time. Upon detecting a key press, it encapsulates the data according to the USB HID keyboard report format and sends it to the computer via the USB interface. The computer's AOI control software receives these keyboard inputs and maps them into corresponding control commands. Figure 3 Taking the 12 mechanical buttons shown as an example:
[0045] When the mechanical key marked "<" is pressed, it is equivalent to typing the "left" command code or the corresponding key value on a traditional keyboard. The main control chip scans the matrix keyboard and detects that the mechanical key "<" has been pressed. Based on its position in the matrix, the main control chip determines the corresponding key value through a mapping relationship and sends it to the computer via USB communication. The computer runs the AOI control software based on the received key value, and then sends a control command to the AOI scanning machine to move the AOI optical scanning head to the left.
[0046] Similarly, pressing the mechanical button marked ">" moves the AOI optical scanning head to the right; pressing the mechanical button marked "∧" moves the AOI stage forward; pressing the mechanical button marked "∨" moves the AOI stage backward; and pressing the mechanical button marked "SKIP" moves the AOI stage backward. When the mechanical button labeled "PCB" is pressed, severely defective parts of the PCB are marked and skipped during inspection. When the mechanical button labeled "VACUUM" is pressed, the control panel is vacuumed; pressing "VACUUM" again releases the vacuum. When the mechanical button labeled "ENTER" is pressed, the Enter key is pressed. When the mechanical button labeled "ESC" is pressed, the Enter key is pressed. When the mechanical button labeled "START" is pressed, the AOI starts running and scanning. When the mechanical button labeled "MARK" is pressed, the AOI device performs the marking function. When the mechanical button labeled "DEFECT←" is pressed, the device jumps to the previous defect. When the mechanical button labeled "DEFECT→" is pressed, the device jumps to the next defect.
[0047] As described above, the improvement of this utility model lies in the mechanical key keyboard replacing the general keyboard with a combination of function keys. That is, each mechanical key corresponds to a function key value. For example, pressing the mechanical key ">" in this embodiment achieves the same effect as inputting "right" or other commands on a traditional general keyboard. Obviously, the operation of the functional mechanical keys provided in this embodiment is more convenient.
[0048] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0049] The above description is only a specific embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. An optical detection system, characterized in that, The device includes an AOI scanning machine, a computer, and a mechanical keypad. The mechanical keypad includes a main control chip and multiple mechanical keys. The main control chip is configured with multiple row pins and multiple column pins. One end of each mechanical key is configured to be connected to a row pin of the main control chip, and the other end of each mechanical key is configured to be connected to a column pin of the main control chip. The plurality of mechanical keys form a matrix keyboard circuit. One end of each mechanical key in the same row of the matrix keyboard circuit is connected to the same row pin of the main control chip through a first current-limiting resistor. The other end of each mechanical key in the same column of the matrix keyboard circuit is connected to the same column pin of the main control chip through a second current-limiting resistor. Each row pin is configured to sequentially output a low-level scan signal during the key scan process performed by the main control chip; each column pin is connected to the positive power supply of the main control chip through a pull-up resistor, so that when the mechanical key is not pressed, the voltage of its corresponding column pin remains high; when the mechanical key is pressed, the voltage of its corresponding column pin becomes low. The row and column pins are respectively connected to the power ground via electrostatic discharge protection devices; The main control chip is configured to connect to the input port of the computer; The computer is connected to the actuator of the AOI scanning machine, and the computer is configured to run AOI control software.
2. The optical detection system according to claim 1, characterized in that, The mechanical keypad is configured as a USB human-machine interface device, and the main control chip is connected to the input port of the computer through a USB interface circuit.
3. The optical detection system according to claim 2, characterized in that, The USB interface circuit includes a USB connector and an ESD protection circuit, wherein the ESD protection circuit is connected between the USB connector and the USB data pin of the host control chip.
4. The optical detection system according to claim 1, characterized in that, The main control chip is an STM32F103RBT6.
5. The optical inspection system according to claim 1, characterized in that, The electrostatic discharge protection device is a transient voltage suppression diode or an ESD protection chip.
6. The optical detection system according to claim 1, characterized in that, The resistance value of the first current-limiting resistor is in the range of 100Ω to 1kΩ, and / or the resistance value of the second current-limiting resistor is in the range of 100Ω to 1kΩ.
7. The optical detection system according to claim 1, characterized in that, The pull-up resistors connected to the column pins are either external or internal pull-up resistors, and the resistance value of the pull-up resistors ranges from 1kΩ to 10kΩ.
8. The optical detection system according to claim 1, characterized in that, The number of mechanical buttons is 9 to 16.
9. The optical detection system according to claim 1, characterized in that, The mechanical keypad also includes a status indicator light, which is connected to the main control chip and configured to be driven by the main control chip.
10. The optical detection system according to any one of claims 1 to 9, characterized in that, Each mechanical key consists of a keycap from top to bottom, a movable switch, and a reset spring element.
