Method for controlling light supplementing lamp and aiming lamp based on code scanning equipment
Through the cooperation of dual-channel power chips and transistors, the synchronous control of the aiming light and the fill light in the code scanning device is realized, which solves the problem of high power consumption in the existing technology and improves the code scanning efficiency.
Patent Information
- Application Number
- CN202411256966.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2025-01-14
AI Technical Summary
In existing code scanning equipment, the adjustment of the aiming light and fill light cannot be managed synchronously with the logic circuit in the equipment, resulting in an increase in power consumption of the entire machine.
Through the cooperation of dual-channel power chip and triode, synchronous control of aiming light and fill light is achieved. When the camera module collects images, it triggers the fill light to turn on and the aiming light to turn off; after the decoding is successful, the fill light is quickly turned off, and the aiming light is turned on simultaneously when the dual-channel power supply chip is turned back on.
It achieves synchronous management of aiming lights, fill lights and logic circuits, reduces the overall power consumption of the device, and improves code scanning efficiency.
Smart Images

Figure CN119316707A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of code scanning equipment, and in particular to a control method for a fill light and an aiming light based on a code scanning equipment. Background Art
[0002] With the popularity of barcode applications and mobile payments, barcode recognition has gradually been applied to various industries. When a barcode scanner (also called a scanning device) performs barcode recognition, two types of lights are generally used: an aiming light and a fill light. The aiming light is used to indicate the scanning area to the user, and the fill light is used to provide an external light source when the camera reads the barcode image. In the existing control schemes, the aiming light and the fill light are directly controlled synchronously by the processor. After the fill light is turned on, it will continue to light up within a fill light cycle. During this period, even if the decoding is successful, the fill light will still light up within the current fill light cycle, which invisibly increases the power consumption of the device. It can be considered that the adjustment of the aiming light and the fill light in the existing scheme cannot be managed synchronously with the logic circuit in the device, which increases the power consumption of the entire barcode scanner. Summary of the invention
[0003] The present invention provides a control method and circuit for a fill light and an aiming light based on a code scanning device, so as to solve the problem in the prior art that the adjustment of the aiming light and the fill light cannot be managed synchronously with the logic circuit in the device, thereby increasing the power consumption of the whole code scanning device.
[0004] On the one hand, the present invention provides a control method of a fill light and an aiming light based on a code scanning device, comprising:
[0005] The camera module collects images and triggers the fill light to turn on through the dual-channel power chip, and at the same time triggers the aiming light to turn off;
[0006] The processor decodes the captured image. If the decoding is successful, the dual-channel power chip is controlled to be turned off, so that the fill light is turned off, and the camera module is controlled to stop capturing images.
[0007] The processor controls the dual-way power chip to turn on, and the camera module triggers the aiming light to turn on through the dual-way power chip;
[0008] The dual-channel power supply chip has 12 pins, of which the D3 pin is connected to the aiming light, the D1 pin is connected to the fill light, the C2 pin, the A3 pin and the B3 pin are respectively connected to the three enable pins of the processor, the C3 pin is connected to the collector of the transistor, the B2 pin and the base of the transistor are both connected to the camera module, and the emitter of the transistor is grounded;
[0009] Among them, the camera module has a CMOS image sensor. When the camera module is triggered to collect images, the exposure control pin of the CMOS image sensor outputs a high level to the base of the transistor and the B2 pin of the dual-way power supply chip, so that the dual-way power supply chip triggers the fill light to turn on and the aiming light to turn off at the same time.
[0010] According to a control method for a fill light and an aiming light based on a code scanning device provided by the present invention, when the camera module does not capture an image, the exposure control pin of the CMOS image sensor outputs a low level to the base of the transistor and the B2 pin of the dual-way power supply chip, so that the dual-way power supply chip triggers the fill light to turn off and the aiming light to turn on at the same time.
[0011] According to a control method for a fill light and an aiming light based on a code scanning device provided by the present invention, the collector of the transistor is also connected to a power supply.
[0012] According to a control method for a fill light and an aiming light based on a code scanning device provided by the present invention, the A2 pin of the dual-channel power supply chip is connected to the power supply, the B1 pin is connected to the power supply through an inductor, the A1 pin is grounded, the C1 pin is grounded through a capacitor, and the D2 pin is left floating.
[0013] According to a method for controlling a fill light and an aiming light based on a code scanning device provided by the present invention, the processor controls the time for the dual-channel power chip to be turned from off to on to be a preset time.
[0014] According to a method for controlling a fill light and an aiming light based on a code scanning device provided by the present invention, the preset time is 1 ms.
[0015] According to a control method for a fill light and an aiming light based on a code scanning device provided by the present invention, if the processor decoding is unsuccessful, the camera module continues to collect images until timeout.
[0016] Furthermore, the user can set and adjust the preset time for the dual-way power chip to be turned from off to on through the processor, and can also preset the timeout time for the camera module to continuously collect images.
[0017] According to a control method for a fill light and an aiming light based on a code scanning device provided by the present invention, when the processor controls the C2 pin of the dual-way power supply chip to a high level, the dual-way power supply chip is in an open state, and allows the aiming light and the fill light to work under the control of their respective control pins; when the processor controls the C2 pin of the dual-way power supply chip to a low level, the dual-way power supply chip is in a closed state, and signals cannot be transmitted between the pins, so the aiming light and the fill light cannot work at this time.
[0018] According to a control method for a fill light and an aiming light based on a code scanning device provided by the present invention, the dual-channel power supply chip is controlled by a processor to be in a normally open state.
[0019] According to a control method for a fill light and an aiming light based on a code scanning device provided by the present invention, the CMOS image sensor is used to expose the captured image. When exposing, the exposure control pin of the CMOS image sensor is in a high level state, and when not exposing, the exposure control pin of the CMOS image sensor is in a low level state, and the camera module stops capturing images at the same time.
[0020] On the other hand, the present invention also provides a control circuit for a fill light and an aiming light based on a code scanning device, comprising: a power supply access terminal, a dual-channel power supply chip, a fill light access terminal, an aiming light access terminal, a processor, a triode, and a camera module access terminal;
[0021] Among them, the dual-way power supply chip has 12 pins, its D3 pin is connected to the aiming light access end, the D1 pin is connected to the fill light access end, the C2 pin, the A3 pin and the B3 pin are respectively connected to the three enable pins of the processor, the B2 pin is connected to the camera module access end, and the C3 pin is connected to the collector of the transistor; wherein the transistor can be replaced with an NMOS tube, the circuit can still work normally, and the timing logic of the exposure of the CMOS image sensor does not change; the camera module access end simultaneously outputs electrical signals to the B2 pin and the C3 pin of the dual-way power supply chip to control the turning on and off of the aiming light and the fill light.
[0022] According to a control circuit of a fill light and an aiming light based on a code scanning device provided by the present invention, the base of the transistor is connected to the camera module access terminal, the emitter of the transistor is grounded, and the collector of the transistor is also connected to the power access terminal;
[0023] According to a control circuit for a fill light and an aiming light based on a code scanning device provided by the present invention, the A2 pin of the dual-channel power supply chip is connected to the power access terminal, the B1 pin is connected to the power access terminal through an inductor, the A1 pin is grounded, the C1 pin is grounded through a first capacitor, and the D2 pin is left floating.
[0024] According to a control circuit for a fill light and an aiming light based on a code scanning device provided by the present invention, when the processor controls the C2 pin of the dual-way power supply chip to a high level, the dual-way power supply chip is in an on state; when the processor controls the C2 pin of the dual-way power supply chip to a low level, the dual-way power supply chip is in a off state.
[0025] According to a control circuit for a fill light and an aiming light based on a code scanning device provided by the present invention, the dual-channel power supply chip is controlled by a processor to be in a normally open state.
[0026] According to a control circuit of a fill light and an aiming light based on a code scanning device provided by the present invention, the collector of the transistor is connected to the power supply access terminal through a first resistor.
[0027] According to a control circuit for a fill light and an aiming light based on a code scanning device provided by the present invention, the C3 pin of the dual-channel power supply chip is connected to the circuit between the collector of the transistor and the first resistor.
[0028] According to a control circuit of a fill light and an aiming light based on a code scanning device provided by the present invention, the C2 pin of the dual-channel power supply chip is connected to the enable pin corresponding to the processor through a second resistor.
[0029] According to a control circuit for a fill light and an aiming light based on a code scanning device provided by the present invention, the B2 pin of the dual-channel power supply chip is also grounded through a third resistor.
[0030] According to a control circuit of a fill light and an aiming light based on a code scanning device provided by the present invention, the base of the transistor is connected to the access terminal of the camera module through a fourth resistor.
[0031] According to a control circuit for a fill light and an aiming light based on a code scanning device provided by the present invention, the base of the transistor is also grounded through a fifth resistor.
[0032] According to a control circuit for a fill light and an aiming light based on a code scanning device provided by the present invention, the connection line between the power supply access terminal and the first resistor is grounded via a second capacitor and a third capacitor respectively.
[0033] The present invention provides a control method and circuit for a fill light and an aiming light based on a code scanning device. When a camera module captures an image, a CMOS image sensor of the camera module controls image exposure. During exposure, an exposure control pin of the CMOS image sensor synchronously outputs a high level to a B2 pin of a dual-way power chip and a base of a transistor. The dual-way power chip controls the fill light to be turned on and controls the aiming light to be turned off at the same time. When decoding is successful and exposure ends, a processor controls the dual-way power chip to be turned off first and then reopened. When the dual-way power chip is turned off, the fill light is synchronously turned off. By adopting this method, the fill light can be quickly turned off after decoding is successful, thereby saving power consumption. The dual-way power chip is quickly reopened after being turned off, and the aiming light is synchronously turned on when it is reopened. The entire device is restored to a state before the camera module captures the image, waiting for the next image capture trigger. At the same time, by shortening the opening time of the fill light, the entire device can enter the next scanning cycle in advance, thereby improving scanning efficiency.
[0034] Through the cooperation of dual-channel power supply chips and transistors, the control methods of image exposure, aiming light and fill light are integrated to achieve synchronous regulation, so as to improve scanning efficiency, reduce board area, reduce overall power consumption and reduce production costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 It is a flow chart of a method for controlling a fill light and an aiming light based on a code scanning device provided by the present invention;
[0037] Figure 2 It is an electrical block diagram of a control method of a fill light and an aiming light based on a code scanning device provided by the present invention;
[0038] Figure 3 It is one of the control circuit diagrams of the fill light and aiming light based on the code scanning device provided by the present invention;
[0039] Figure 4 This is the second control circuit diagram of the fill light and aiming light based on the code scanning device provided by the present invention;
[0040] Figure 5 is a control circuit diagram of a fill light and an aiming light according to another embodiment of the present invention;
[0041] Figure 6 It is a timing diagram of the exposure control pin, the dual-channel power supply chip, the aiming light and the fill light in the present invention;
[0042] Figure 7 It is a timing diagram of the exposure control pin, aiming light and fill light in the prior art. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] In the prior art, the timing control of the aiming light and the fill light of the code scanning device is as follows: Figure 7As shown, within a fill light cycle T, the fill light is continuously turned on based on the system preset, and the fill light and the aiming light are turned on and off alternately. Before capturing an image, the exposure control pin is in a low level state (i.e., off state), the fill light is off, and the aiming light is on; when the exposure control pin is turned on (i.e., in a high level state), the fill light is turned on and begins to light up continuously for a period T. During the period T when the fill light is turned on, the aiming light is off, and the duration t1 of the exposure control pin being on depends on whether the decoding is successful (because the duration of successful decoding is not fixed). Within a period T, the duration of the exposure control pin being off is t2. Therefore, T=t1+t2, wherein t2=0 (i.e., t1=T), indicating that the decoding is unsuccessful within a period T (i.e., decoding times out), and the decoding program needs to be interrupted after a fill light period T ends, waiting for the next image capture and triggering of the decoding program; t2 represents the duration that the fill light will continue to light up after the decoding is successful, which will invisibly increase the power consumption of the entire machine.
[0045] In view of the above problems, the present invention provides a solution. Figure 1-Figure 6 The present invention describes a control method and circuit for a fill light and an aiming light based on a barcode scanning device. The barcode scanning device is an electronic device with a barcode scanning function, such as a barcode scanning gun, a handheld terminal, or a PDA. When scanning a barcode, the barcode scanning device first aims at the scanning area through the aiming light F1, then collects the image through the camera module, and decodes it synchronously through the processor. When the camera module collects the image, the aiming light F1 is triggered to turn off, and the fill light F2 is turned on for fill light. The camera module includes a lens and a CMOS image sensor. The lens is used to collect barcode images, the CMOS image sensor is used to expose the collected barcode images, and the processor is used to decode the exposed barcode images. The CMOS image sensor has an exposure control pin. When exposed (i.e., the exposure control pin is turned on), the level of the exposure control pin is high, and when not exposed (i.e., the exposure control pin is turned off), the level of the exposure control pin is low.
[0046] On the one hand, the present invention provides a control method of a fill light and an aiming light based on a code scanning device, comprising:
[0047] When the barcode scanning device is not used for a long time, it will enter a dormant state and will be activated before use. When activated (for example, pressing the scanning switch), the dual-channel power chip U1 is turned on, the aiming light F1 is on, the camera module waits for triggering, and the fill light F2 is turned off. This state is called the initial state, waiting for triggering scanning;
[0048] Next, the camera module collects images and triggers the fill light F2 to turn on through the dual-channel power chip, while triggering the aiming light F1 to turn off;
[0049] At the same time, the processor synchronously decodes the captured image. If the decoding is successful, the dual-channel power chip U1 is controlled to be turned off, so that the fill light F2 is turned off, and the camera module is controlled to stop capturing images.
[0050] Finally, the processor controls the dual-way power chip U1 to turn on, and the camera module triggers the aiming light F1 to turn on through the dual-way power chip U1. At this time, the fill light F2 is still in the off state, and the code scanning device returns to the initial state, waiting for the next scan trigger.
[0051] The dual-way power chip U1 has 12 pins, namely A1 (GAN), A2 (IN), A3 (SDA), B1 (SW), B2 (STROBE), B3 (SCL), C1 (OUT), C2 (HWEN), C3 (TORCH / TEMP), D1 (LED2), D2 (TX) and D3 (LED1) pins; it is worth noting that the dual-way power chip U1 here refers to a power chip controlling the on and off of two loads;
[0052] The D3 pin of the dual-channel power chip U1 is connected to the aiming light F1, the D1 pin is connected to the fill light F2, the C2 pin, the A3 pin and the B3 pin are respectively connected to the three enable pins of the processor, the C3 pin is connected to the collector of the transistor Q1, the B2 pin and the base of the transistor Q1 are both connected to the camera module, the emitter of the transistor Q1 is grounded, and the collector of the transistor Q1 is also connected to the power supply;
[0053] Furthermore, the A2 pin of the dual-channel power chip U1 is connected to the power supply, the B1 pin is connected to the power supply through an inductor L1, the A1 pin is grounded, the C1 pin is grounded through a first capacitor C11, and the D2 pin is suspended;
[0054] In this embodiment, transistor Q1 is an NPN transistor;
[0055] In some embodiments, Figure 4 As shown, the transistor Q1 can be replaced by an NMOS tube Q2, and the specific connection method is: the G pole of the NMOS tube Q2 is connected to the camera module, the S pole of the NMOS tube Q2 is grounded, the D pole of the NMOS tube Q2 is connected to the C3 pin of the dual-channel power supply chip U1, and the D pole of the NMOS tube Q2 is also connected to the power supply; in terms of working principle, when the G pole of the NMOS tube Q2 is at a high level, its S pole and D pole are turned on; when the G pole of the NMOS tube Q2 is at a low level, its S pole and D pole are cut off (i.e., disconnected).
[0056] It should be noted that replacing the transistor Q1 with the NMOS transistor Q2 will not affect the operation of the entire circuit logic.
[0057] Among them, the C2 pin of the dual-way power chip U1 is the switch pin of the dual-way power chip U1. When the C2 pin is at a high level, the dual-way power chip U1 is turned on and is in a working state, allowing signal transmission between other pins; when the C2 pin is at a low level, the dual-way power chip U1 is turned off and is in a non-working state, and signals cannot be transmitted between other pins, and the internal power supply of the dual-way power chip U1 is cut off; wherein the camera module has a CMOS image sensor, and the CMOS image sensor is used to expose the collected image. When exposing, the exposure control pin of the CMOS image sensor is at a high level, and when not exposing, the exposure control pin of the CMOS image sensor is at a low level;
[0058] When the camera module is triggered to capture an image, the exposure control pin of the CMOS image sensor synchronously outputs a high level to the base of the transistor Q1 and the B2 pin of the dual-way power supply chip U1, so that the dual-way power supply chip U1 triggers the fill light F2 to turn on and triggers the aiming light F1 to turn off; that is, the exposure control pin of the CMOS image sensor is connected to the base of the transistor Q1 and the B2 pin of the dual-way power supply chip U1 respectively. During exposure, the exposure control pin of the CMOS image sensor is at a high level, which is directly transmitted to the B2 pin of the dual-way power supply chip U1, so that the B2 pin of the dual-way power supply chip is at a high level, and the D1 pin of the dual-way power supply chip U1 is controlled to turn on, so that the fill light F2 is turned on; at the same time, the high level of the exposure control pin is transmitted to the base of the transistor Q1, triggering the transistor Q1 to turn on, so that the C3 pin of the dual-way power supply chip U1 is at a low level, and the D3 pin of the dual-way power supply chip U1 is controlled to turn off, so that the aiming light F1 is turned off;
[0059] When the camera module does not capture an image, the exposure control pin of the CMOS image sensor synchronously outputs a low level to the base of the transistor Q1 and the B2 pin of the dual-way power supply chip U1, so that the dual-way power supply chip U1 triggers the fill light F2 to turn off and triggers the aiming light F1 to turn on; that is, when the CMOS image sensor does not perform image exposure, the exposure control pin of the CMOS image sensor is at a low level, and this low level is directly transmitted to the B2 pin of the dual-way power supply chip U1, so that the B2 pin of the dual-way power supply chip U1 is at a low level, and the D1 pin of the dual-way power supply chip U1 is controlled to turn off, so that the fill light F2 is turned off; at the same time, the low level of the exposure control pin is transmitted to the base of the transistor Q1, triggering the transistor to disconnect, so that the C3 pin of the dual-way power supply chip U1 is connected to the power supply through the first resistor R11 and is in a high level state, and the D3 pin of the dual-way power supply chip U1 is controlled to turn on, so that the aiming light F1 is turned on.
[0060] It can be simply understood as follows: when the camera module collects images, the base of the transistor Q1 is at a high level, the collector and emitter of the transistor Q1 are turned on, so that the C3 pin of the dual-channel power supply chip U1 is grounded and becomes a low level state, and the aiming light F1 is turned off;
[0061] When the camera module does not capture images, the base of transistor Q1 is at a low level, and the collector and emitter of transistor Q1 are disconnected, so that the C3 pin of the dual-channel power chip connected to the power supply becomes a high level state, and the aiming light F1 is turned on.
[0062] After the transistor Q1 is replaced with the NMOS transistor Q2, the operation logic is as follows: when the camera module collects images, the G pole of the NMOS transistor Q2 is at a high level, and the S pole and the D pole of the NMOS transistor Q2 are turned on, so that the C3 pin of the dual-channel power supply chip U1 is grounded and becomes a low level state, and the aiming light F1 is turned off;
[0063] When the camera module is not capturing images, the G pole of the NMOS tube Q2 is at a low level, and the S pole and D pole of the NMOS tube Q2 are cut off (i.e., disconnected), so that the C3 pin of the dual-way power supply chip U1 connected to the power supply becomes a high level state, and the aiming light F1 turns on. The processor controls the time from closing to opening of the dual-way power supply chip U1 to a preset time; after the processor decodes successfully, the fill light F2 needs to be turned off quickly to reduce power consumption; in this embodiment, the dual-way power supply chip U1 is turned off to cut off the power supply of the fill light F2, so as to achieve the purpose of quickly turning off the fill light F2, but the shutdown time of the dual-way power supply chip U1 should not be too long, so as not to affect the subsequent normal operation of the code scanning device, and the purpose of turning off the dual-way power supply chip U1 is only to turn off the fill light F2, so in principle, as long as the dual-way power supply chip U1 is turned off The corresponding purpose can be achieved by turning off the fill light F2 in an instant, but in order to avoid the shutdown of the dual-way power chip U1 affecting the operation of the entire system, the time for the dual-way power chip U1 to be reopened should be as soon as possible. In this embodiment, the preset time t is set to 1ms, that is, the time from the dual-way power chip U1 being closed to being opened is set to 1ms, which is conducive to the normal operation of the entire system; of course, the preset time t can also be set to other durations according to actual needs. After the dual-way power chip U1 is reopened, the code scanning device returns to the initial state and waits for the next scan trigger. In this way, the logical relationship above remains unchanged, that is, the working logic of the aiming light F1 and the fill light F2 remains normal, thereby ensuring that the fill light F2 can be quickly turned off under the condition that the logical timing of the aiming light F1 and the fill light F2 remains unchanged, thereby reducing the exposure time and reducing the consumption of the system by turning on the fill light F2.
[0064] If the processor decoding is unsuccessful, the camera module continues to capture images, and the processor decodes synchronously until it times out, and the barcode scanning device returns to its initial state. The timeout here means that the decoding time exceeds a preset maximum decoding time. When the decoding time exceeds this time, the system automatically interrupts the decoding program. It should be noted here that the camera module captures images frame by frame, and the processor also decodes the captured images frame by frame. Once a frame of image is decoded successfully, the image capture stops. The decoding timeout means that the multiple frames of images captured cannot be decoded successfully within the preset maximum decoding time.
[0065] When the processor controls the C2 pin of the dual-way power chip U1 to be at a high level, the dual-way power chip U1 is in an open state; when the processor controls the C2 pin of the dual-way power chip U1 to be at a low level, the dual-way power chip U1 is in a closed state.
[0066] In this embodiment, the dual-way power supply chip U1 is controlled by the processor to be in a normally open state, and the dual-way power supply chip U1 is also controlled by the processor to be in a closed state;
[0067] In some embodiments, Figure 4 As shown, the C2 pin of the dual-way power supply chip U1 is also connected to the power supply, so that the dual-way power supply chip U1 remains in a normally-on state; that is, the C2 pin of the dual-way power supply chip U1 is also connected to the power supply through the second resistor R12, and the level of the C2 pin of the dual-way power supply chip U1 is pulled high by the power supply, so that the dual-way power supply chip U1 remains in a normally-on state. If the dual-way power supply chip U1 is to be turned off, it needs to be controlled by the processor.
[0068] When the fill light F2 is turned on, the processor controls the dual-channel power chip U1 to output current to the fill light F2. The current size can be preset to adjust the luminous intensity of the fill light F2.
[0069] On the other hand, the present invention also provides a control circuit for a fill light and an aiming light based on a code scanning device, which is used to execute the control method for a fill light and an aiming light based on a code scanning device described above, and the circuit comprises: a power supply access terminal, a dual-channel power supply chip, a fill light access terminal, an aiming light access terminal, a processor, a triode, and a camera module access terminal;
[0070] The model of the dual-way power chip U1 is LM3644, which is specially designed for LED drivers. The dual-way power chip U1 integrates two independently programmable LED current sources, giving users the ability to flexibly adjust the current ratio between the two LED lamps, thereby meeting the needs of multiple lighting modes of the two LED lamps.
[0071] Specifically, the dual-way power chip U1 has 12 pins, namely A1 (GAN), A2 (IN), A3 (SDA), B1 (SW), B2 (STROBE), B3 (SCL), C1 (OUT), C2 (HWEN), C3 (TORCH / TEMP), D1 (LED2), D2 (TX) and D3 (LED1) pins; it is worth noting that the dual-way power chip U1 here refers to a power chip controlling the on and off of two loads;
[0072] The D3 pin of the dual-channel power chip U1 is connected to the aiming light access terminal, the D1 pin is connected to the fill light access terminal, the C2 pin, the A3 pin and the B3 pin are respectively connected to the three enable pins of the processor, the B2 pin is connected to the camera module access terminal, and the C3 pin is connected to the collector of the transistor Q1; the base of the transistor Q1 is connected to the camera module access terminal, the emitter of the transistor Q1 is grounded, and the collector of the transistor Q1 is also connected to the power access terminal;
[0073] Furthermore, the A2 pin of the dual-channel power chip U1 is connected to the power access terminal, the B1 pin is connected to the power access terminal through an inductor L1, the A1 pin is grounded, the C1 pin is grounded through a first capacitor C11, and the D2 pin is suspended;
[0074] As the name implies, the power access port is used to connect the power supply, the fill light access port is used to connect the fill light F2, the aiming light access port is used to connect the aiming light F1, and the camera module access port is used to connect the camera module;
[0075] In this embodiment, transistor Q1 is an NPN transistor;
[0076] In some embodiments, Figure 5 As shown, the transistor Q1 can be replaced by an NMOS tube Q2, and the specific connection method is: the G pole of the NMOS tube Q2 is connected to the camera module access terminal, the S pole of the NMOS tube Q2 is grounded, the D pole of the NMOS tube Q2 is connected to the C3 pin of the dual-channel power chip U1, and the D pole of the NMOS tube Q2 is also connected to the power access terminal; in terms of working principle, when the G pole of the NMOS tube Q2 is at a high level, its S pole and D pole are turned on; when the G pole of the NMOS tube Q2 is at a low level, its S pole and D pole are cut off (i.e., disconnected).
[0077] It should be noted that replacing the transistor Q1 with the NMOS transistor Q2 will not affect the operation of the entire circuit logic.
[0078] The processor configures related data parameters, such as the current when the aiming light F1 and the fill light F2 are turned on, through the A3 pin of the dual-way power chip U1; the processor configures related clock parameters, such as the maximum decoding time, through the B3 pin of the dual-way power chip U1;
[0079] Among them, the C2 pin of the dual-way power chip U1 is a switch control pin of the dual-way power chip U1, which can be controlled by the processor. When the processor controls the C2 pin of the dual-way power chip U1 to be high level, the dual-way power chip U1 is in the open state, and allows the aiming light F1 and the fill light F2 to start working under the control of the corresponding control pin, and allows signals to be transmitted between other pins; when the processor controls the C2 pin of the dual-way power chip U1 to be low level, the dual-way power chip U1 is in the closed state, signals cannot be transmitted between other pins, and the internal power supply of the dual-way power chip U1 is cut off, and the aiming light F1 and the fill light F2 are turned off and cannot work;
[0080] In this embodiment, the C2 pin of the dual-way power chip U1 can be directly connected to the enable pin corresponding to the processor, or can be connected to the enable pin corresponding to the processor through the second resistor R12, so that the dual-way power chip U1 is controlled by the processor to be in a normally open state;
[0081] In some embodiments, the C2 pin of the dual-way power supply chip U1 is also connected to the power supply, so that the dual-way power supply chip U1 remains in a normally-on state; specifically, the C2 pin of the dual-way power supply chip U1 is directly connected to the processor on the one hand, and is also connected to the power supply through the second resistor R12 on the other hand, and the level of the C2 pin of the dual-way power supply chip U1 is pulled up by the power supply, so that the dual-way power supply chip U1 remains in a normally-on state.
[0082] Among them, the C3 pin of the dual-way power chip U1 is the switch control pin of the aiming light F1. When the C3 pin of the dual-way power chip U1 is at a high level, the aiming light F1 is turned on, and when the C3 pin of the dual-way power chip U1 is at a low level, the aiming light F1 is turned off;
[0083] The B2 pin of the dual power chip U1 is the switch control pin of the fill light F2. When the B2 pin of the dual power chip U1 is at a high level, the fill light F2 is turned on. When the B2 pin of the dual power chip U1 is at a low level, the fill light F2 is turned off.
[0084] Furthermore, the level of the C3 pin of the dual-channel power chip U1 is controlled by the camera module, transistor Q1 and the power supply;
[0085] The level of the B2 pin of the dual-power chip U1 is directly controlled by the camera module;
[0086] The collector of the transistor Q1 is connected to the power supply access terminal through the first resistor R11, and the C3 pin of the dual-way power chip U1 is connected to the line between the collector of the transistor Q1 and the first resistor R11.
[0087] The B2 pin of the dual-channel power supply chip U1 is also grounded through a third resistor R13, the base of the transistor Q1 is connected to the camera module access terminal through a fourth resistor R14, and the base of the transistor Q1 is also grounded through a fifth resistor R15.
[0088] The second resistor R12, the third resistor R13, the fourth resistor R14, and the fifth resistor R15 are all current limiting resistors.
[0089] The connection line between the power supply access terminal and the first resistor R11 is grounded via a second capacitor C12 and a third capacitor C13 respectively.
[0090] The first capacitor C11, the second capacitor C12 and the third capacitor C13 are all filter capacitors, which are used for absorbing ripples in the circuit and smoothing the output voltage.
[0091] In summary, the present invention provides a control method and circuit for a fill light and an aiming light based on a code scanning device. On a dual-way power chip, the logic control of the aiming light F1 and the fill light F2 is realized, and the exposure timing of the camera module is synchronized. When the camera module collects and exposes an image, the fill light F2 is turned on and the aiming light F1 is turned off. When the processor decodes successfully, the processor immediately turns off the dual-way power chip U1 to quickly turn off the fill light F2, shortening the turn-on time of the fill light F2, so that the fill light F2 does not need to be turned on continuously for a cycle. After the dual-way power chip U1 is turned off, it is quickly restarted, and the code scanning device enters the next scanning trigger stage. At this time, the fill light F2 is turned off and the aiming light F1 is turned on. By shortening the turn-on time of the fill light F2, it helps to improve the code scanning efficiency and also reduces power consumption. Furthermore, through the dual-channel power supply chip U1, the current of the aiming light F1 and the fill light F2 can be set and changed through software (i.e., configured through the processor), avoiding the need to dismantle the machine to replace hardware to change the current. Only a dual-channel power supply chip U1 plus a transistor Q1 are needed to implement the switching logic, which reduces the complexity of the circuit design and the hardware layout area.
[0092] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for controlling a fill light and an aiming light based on a code scanning device, characterized in that: include: The camera module collects images and triggers the fill light to turn on through the dual-channel power chip, and at the same time triggers the aiming light to turn off; The processor decodes the captured image. If the decoding is successful, the dual-channel power chip is controlled to be turned off, so that the fill light is turned off, and the camera module is controlled to stop capturing images. The processor controls the dual-way power chip to turn on, and the camera module triggers the aiming light to turn on through the dual-way power chip; The dual-channel power supply chip has 12 pins, of which the D3 pin is connected to the aiming light, the D1 pin is connected to the fill light, the C2 pin, the A3 pin and the B3 pin are respectively connected to the three enable pins of the processor, the C3 pin is connected to the collector of the transistor, the B2 pin and the base of the transistor are both connected to the camera module, and the emitter of the transistor is grounded; Among them, the camera module has a CMOS image sensor. When the camera module is triggered to collect images, the exposure control pin of the CMOS image sensor outputs a high level to the base of the transistor and the B2 pin of the dual-way power supply chip, so that the dual-way power supply chip triggers the fill light to turn on and the aiming light to turn off at the same time.
2. The control method of the fill light and aiming light based on the code scanning device according to claim 1 is characterized in that: When the camera module does not capture an image, the exposure control pin of the CMOS image sensor outputs a low level to the base of the transistor and the B2 pin of the dual-way power chip, so that the dual-way power chip triggers the fill light to turn off and the aiming light to turn on.
3. The control method of the fill light and aiming light based on the code scanning device according to claim 2 is characterized in that: The collector of the triode is also connected to a power source.
4. The control method of the fill light and aiming light based on the code scanning device according to claim 3 is characterized in that: The A2 pin of the dual-channel power chip is connected to the power supply, the B1 pin is connected to the power supply through an inductor, the A1 pin is grounded, the C1 pin is grounded through a capacitor, and the D2 pin is suspended.
5. The control method of the fill light and aiming light based on the code scanning device according to claim 1, characterized in that: The processor controls the dual-way power chip to switch from off to on for a preset time.
6. The control method of the fill light and aiming light based on the code scanning device according to claim 5 is characterized in that: The preset time is 1 ms.
7. The control method of the fill light and aiming light based on the code scanning device according to claim 1, characterized in that: If the processor decoding is unsuccessful, the camera module continues to capture images until a timeout.
8. The control method of the fill light and aiming light based on the code scanning device according to claim 1, characterized in that: When the processor controls the C2 pin of the dual-way power supply chip to be at a high level, the dual-way power supply chip is in an open state; when the processor controls the C2 pin of the dual-way power supply chip to be at a low level, the dual-way power supply chip is in a closed state.
9. The control method of the fill light and aiming light based on the code scanning device according to claim 8, characterized in that: The dual-channel power supply chip is controlled by the processor to be in a normally open state.
10. The control method of the fill light and aiming light based on the code scanning device according to claim 1, characterized in that: The CMOS image sensor is used to expose the collected image. When exposing, the exposure control pin of the CMOS image sensor is at a high level, and when not exposing, the exposure control pin of the CMOS image sensor is at a low level.