Lock state monitoring circuit, electronic lock, and lock state monitoring and control method
By using the ADC pin of the main control chip and the short-circuit of different resistance values in the electronic lock, the insertion and sealing status of the lock rope is solved, and the problem of Hall components occupying pins is achieved, which is easier to monitor the lock status and save chip pins.
Patent Information
- Application Number
- CN202310620540.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-29
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2043-05-29
AI Technical Summary
In existing electronic locks, multiple Hall components and magnets are used to monitor the lock rope status and occupy many main control chip pins, resulting in inconvenient deployment.
A lock state monitoring circuit is adopted to monitor the insertion and sealing status of the lock rope through the ADC pin of the main control chip combined with the resistor shorting method of different resistance values, saving chip pins.
The lock status monitoring process is simplified, the pins of the main control chip are saved, and the monitoring efficiency is improved.
Smart Images

Figure CN117071986B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to an intelligent electronic lock, and more specifically, to a lock state monitoring circuit, an electronic lock, and a lock state monitoring and control method. Background Art
[0002] During the logistics transportation process, it is necessary to prevent the transported cargo compartment (for example, container) from being illegally opened without permission, so as to ensure the safety of cargo compartment transportation; electronic locks are often used to monitor cargo transportation. Electronic locks can detect the status of the lock structure of the electronic lock and upload the status to the monitoring platform in a timely manner.
[0003] Existing electronic locks generally include a lock body and a U-shaped lock cord inserted into the lock body. To monitor whether the lock cord is inserted into the lock body, magnets are usually installed at both ends of the lock cord and multiple Hall elements are installed in the lock body. The multiple Hall elements sense the multiple magnets to monitor whether the lock cord is locked. In addition, to prevent the lock cord from being easily removed from the lock body, the electronic lock is usually equipped with a sealing mechanism. After the lock cord is inserted into the lock body, the sealing mechanism rotates so that the two ends of the sealing mechanism are against the two ends of the lock cord inserted into the lock body. Therefore, even if the lock cord is pulled by external force, the lock cord cannot be easily removed from the lock body. To monitor whether the lock cord is sealed, magnets are also installed on the sealing mechanism and Hall elements are also installed in the electronic lock. The Hall elements also sense the magnets to detect whether the seal is successful. When monitoring whether the lock cord is inserted and whether the electronic lock is sealed, the multiple Hall elements are connected to the pins of the main control chip. Each Hall element feedbacks a high or low level to the main control chip based on whether it senses the magnet. The process of separately monitoring multiple Hall elements is rather cumbersome, and multiple Hall elements will inevitably occupy multiple pins of the main control chip. The pins of the main control chip are limited, which will inevitably cause certain troubles in the connection deployment between other circuit devices in the electronic lock and the main control chip. Summary of the Invention
[0004] In view of the existing technology, the purpose of this application is to provide a lock status monitoring circuit, an electronic lock, and a lock status monitoring and control method, which can provide a simpler monitoring of the lock status and save chip pins during the monitoring process.
[0005] In a first aspect, the present application provides a lock state monitoring circuit for use in an electronic lock, the lock state monitoring circuit comprising a main control chip, a connection terminal comprising a first pin, a second pin, a third pin, a fourth pin, a fifth pin, and a sixth pin, and a first resistor, a second resistor, a third resistor, a fourth resistor connected to a ground in sequence, and a fifth resistor connected to a first power source;
[0006] The first pin, the second pin, and the third pin are respectively connected to one grounded end of the first resistor, the connection point between the first resistor and the second resistor, and the connection point between the second resistor and the third resistor; the fourth pin and the fifth pin are both connected to the connection point between the third resistor and the fourth resistor; the ADC pin of the main control chip and the sixth pin are both connected to the connection point between the fourth resistor and the fifth resistor; the resistance values of the second resistor and the fourth resistor are not equal, and the resistance values of the first resistor and the third resistor are not equal;
[0007] Among them, when only one end of the lock rope of the electronic lock is inserted into the electronic lock, the first resistor or the third resistor is short-circuited; when both ends of the lock rope of the electronic lock are inserted into the electronic lock, the first resistor, the second resistor and the third resistor are all short-circuited; when both ends of the lock rope of the electronic lock are inserted into the electronic lock and the two ends of the lock rope are disconnected, the first resistor and the third resistor are short-circuited; when both ends of the lock rope of the electronic lock are inserted into the electronic lock and sealed, the first resistor, the second resistor, the third resistor and the fourth resistor are all short-circuited; when both ends of the lock rope of the electronic lock are inserted into the electronic lock and the two ends of the lock rope are disconnected, the first resistor, the third resistor and the fourth resistor are short-circuited.
[0008] In one embodiment of the application, the resistance values of the first resistor, the second resistor, the third resistor, the fourth resistor, and the fifth resistor are not equal.
[0009] In one embodiment of the application, the resistance values of the first resistor, the second resistor, the third resistor, the fourth resistor and the fifth resistor are 10KΩ, 20KΩ, 30KΩ, 40KΩ and 50KΩ respectively.
[0010] In a second aspect, the present application further provides an electronic lock, comprising:
[0011] Lock body;
[0012] Two posts are provided in the lock body, each of the posts comprising a conductive first portion, an insulating second portion and a conductive third portion connected in sequence;
[0013] A conductive lock cord having two ends that can be inserted into the lock body, and a groove for the third portion of the abutment to be inserted into each end of the lock cord;
[0014] A conductive cam is rotatably disposed between the two abutting posts and is used to abut the first portions of the abutting posts inserted into the grooves on both sides thereof;
[0015] The lock status monitoring circuit located in the lock body; and
[0016] The first electrical contact, the second electrical contact, the third electrical contact, the fourth electrical contact, the fifth electrical contact and the sixth electrical contact are all arranged in the lock body and respectively connected to the first pin, the second pin, the third pin, the fourth pin, the fifth pin and the sixth pin. The electrical conduction between the first electrical contact and the second electrical contact and the electrical conduction between the third electrical contact and the fourth electrical contact are both achieved through the lock rope and the third part inserted into the groove. The fifth electrical contact and the sixth electrical contact are electrically conducted through the cam and the first parts of the two abutments.
[0017] In one embodiment of the application, the electronic lock further includes a driving device located in the lock body, wherein the driving device is connected to the cam and is used to drive the cam to rotate.
[0018] In one embodiment of the application, the electronic lock also includes two fixed plates and two springs arranged in the lock body; the first part of each of the said pillars slides through the said fixed plate, and one end of each of the said springs is fixedly connected to the fixed plate and the other end is fixedly connected to the said third part of the said pillar.
[0019] In a third aspect, the present application further provides a lock status monitoring and control method, based on the electronic lock, the lock status monitoring and control method includes:
[0020] Based on the sampling voltage of the ADC pin of the lock status monitoring circuit, the two ends of the lock rope of the electronic lock are monitored to see if they are inserted into the lock body to lock the lock;
[0021] Sending a sealing command to the electronic lock to drive the cam to rotate so that the two ends of the cam respectively abut against the first parts of the two abutting posts;
[0022] Monitoring whether the electronic lock is sealed successfully based on the sampled voltage of the ADC pin of the lock status monitoring circuit; and
[0023] Monitor whether the lock cable inserted into the lock body is damaged.
[0024] In one embodiment of the application, monitoring whether both ends of the lock rope of the electronic lock are inserted into the lock body to lock the lock based on the sampled voltage of the ADC pin of the lock state monitoring circuit includes:
[0025] When the sampling voltage of the ADC pin is detected to be the first voltage value U ADC1 , the second voltage value U ADC2 Or the third voltage value U ADC3 When the lock rope is locked, it is determined that the lock rope is not locked successfully;
[0026] When the sampling voltage of the ADC pin is detected to be the fourth voltage value U ADC4 When the lock rope is locked successfully;
[0027] Among them, the first voltage value U ADC1 The second voltage value U ADC2 , the third voltage value U ADC3 and the fourth voltage value U ADC4 U VCC *(R2+R3+R4) / (R2+R3+R4+R5), U VCC *(R1+R2+R4) / (R1+R2+R4+R5), U ADC4 =U VCC * (R1+R2+R3+R4) / (R1+R2+R3+R4+R5) and R4 / (R4+R5), R1, R2, R3, R4 and R5 are the resistance values of the first resistor, the second resistor, the third resistor, the fourth resistor and the fifth resistor respectively, U VCC is the voltage of the first power supply.
[0028] In one embodiment of the application, whether the electronic lock is sealed successfully is monitored based on the sampled voltage of the ADC pin of the lock status monitoring circuit, specifically:
[0029] When the ADC sampling voltage value is monitored to be the fifth voltage value, it is determined that the electronic lock is sealed successfully; wherein, the fifth voltage value is U ADC5 = U VCC *0 / R5; wherein R4 and R5 are the resistance values of the fourth resistor and the fifth resistor respectively, U VCC is the voltage of the first power supply.
[0030] In one embodiment of the application, monitoring whether the lock cord inserted into the lock body is damaged includes:
[0031] When the sampling voltage of the ADC pin is detected to be the sixth voltage value U ADC6 = U VCC *(R2+R4) / (R2+R4+R5), it is determined that the lock cord is disconnected from the middle of the two ends after the lock cord ends are inserted into the lock body;
[0032] When the sampling voltage of the ADC pin is detected to be the seventh voltage value U ADC7 = U VCC * When R2 / (R2+R5), it is determined that the lock cord is inserted into the lock body and the lock cord is disconnected from the middle of both ends after sealing.
[0033] The lock state monitoring circuit, electronic lock, and lock state monitoring and control method provided by the present application have the following advantages: for various lock state conditions, including only one end of the lock cord inserted into the electronic lock, both ends of the lock cord inserted into the electronic lock, both ends of the lock cord inserted into the electronic lock and disconnected, both ends of the lock cord inserted into the electronic lock and sealed, and both ends of the lock cord inserted into the electronic lock and sealed with the ends disconnected, the first, second, third, and fourth resistors in the circuit are short-circuited in different combinations. Furthermore, because the resistance values of the second and fourth resistors are unequal, and the resistance values of the first and third resistors are unequal, the sampled voltages at the ADC pin of the main control chip are different in each of the aforementioned lock state conditions. Thus, the lock state monitoring circuit can provide feedback on the lock state based on the different sampled voltage values at the ADC pin of the main control chip. Compared to the prior art method of separately monitoring the lock state using multiple Hall elements and multiple magnets, this lock state monitoring circuit is simpler and uses a single ADC pin of the main control chip, saving pins on the main control chip. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0035] Figure 1 A top view of the internal structure of the electronic lock according to an embodiment of the present application;
[0036] Figure 2 A three-dimensional diagram of the internal structure of an electronic lock according to an embodiment of the present application;
[0037] Figure 3 A lock status monitoring circuit diagram of an electronic lock in an embodiment of the present application;
[0038] Figure 4 This is a flow chart of a lock status monitoring and control method for an electronic lock according to an embodiment of the present application. DETAILED DESCRIPTION
[0039] In order to make the technical problems, technical solutions and beneficial effects to be solved by this application more clearly understood, this application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0040] It should be noted that when an element is referred to as being “fixed on” or “disposed on” another element, it may be directly on the other element or indirectly on the other element. When an element is referred to as being “connected to” another element, it may be directly connected to the other element or indirectly connected to the other element.
[0041] It should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on this application.
[0042] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. Throughout the description of this application, "plurality" means two or more, unless otherwise specifically defined.
[0043] The lock state monitoring circuit of the present application, the electronic lock using the lock state monitoring circuit, and the lock state monitoring and control method based on the electronic lock are now described in detail with reference to the accompanying drawings.
[0044] Please refer to Figures 1 to 3 The electronic lock 100 provided in the embodiment of the present application includes a lock body 20, two posts 30 located in the lock body 20, a U-shaped lock rope 40 with both ends capable of being inserted into the lock body 20, a cam 50 rotatably disposed between the two posts 30, a lock state monitoring circuit located in the lock body 20, and a first electrical contact 21, a second electrical contact 22, a third electrical contact 23, a fourth electrical contact 24, a fifth electrical contact 25, and a sixth electrical contact 26 all disposed in the lock body 20, wherein Figure 1 Only the approximate spatial positions of the first electrical contact 21 , the second electrical contact 22 , the third electrical contact 23 , the fourth electrical contact 24 , the fifth electrical contact 25 and the sixth electrical contact 26 are shown.
[0045] Specifically, the lock status monitoring circuit is used to monitor the locking and sealing status of the electronic lock 100 in real time during use. Specifically, it detects whether the lock cord 40 is inserted into the lock body 20 to lock the lock and whether the cam 50 rotates to abut against the posts 30 on either side of the cam 50 to seal the lock. Each post 30 comprises a conductive first portion, an insulating second portion, and a conductive third portion, which are connected in sequence. A groove 41 is defined on each end of the lock cord 40 that is inserted into the lock body 20. The groove 41 on each end forms a loop around that end. The third portion of the post 30 defines a protrusion 31 that mates with the groove 41.
[0046] In one embodiment, each stop 30 is a rod made of an insulating material, which is covered with a first, second, and third wrapping layer, which are connected in sequence. The first and third wrapping layers are made of a conductive material, and the second wrapping layer is made of an insulating material. The first, second, and third portions are located at the first, second, and third wrapping layers, respectively. In another embodiment, each stop 30 is a rod with a first portion made of a conductive material, a second portion made of an insulating material, and a third portion made of a conductive material, which are integrally formed.
[0047] like Figure 1 and Figure 2 As shown, the electronic lock 100 further includes a drive device, two fixing plates, and two springs disposed within the lock body 20. Specifically, the drive device is connected to the cam 50 and is used to drive the cam 50 to rotate between the two retaining posts 30. The first portion of each retaining post 30 slides through a fixing plate. Each spring has one end fixedly connected to the fixing plate and the other end fixedly connected to the third portion of the retaining post 30. In one embodiment, the drive device may be, but is not limited to, a servo motor. The two retaining posts 30 may be disposed side by side within the lock body 20, so that the cam 50 rotates between the two retaining posts 30. The angle at which the drive device drives the cam 50 to rotate can be pre-set.
[0048] It is worth noting that, during the process of inserting and removing the lock cord 40 into and from the lock body 20 , each of the abutments 30 can move left and right in the lock body 20 relative to the lock cord 40 inserted into the lock body 20 . Specifically, when both ends of the locking rope 40 are inserted into the lock body 20, each end of the locking rope 40 will touch the resisting column 30 in the lock body 20, specifically, it will touch the protrusion 31 on the third part of the resisting column 30. Due to the force of the locking rope 40, the resisting column 30 will be prompted to move in a direction away from the end of the locking rope 40 it touches. At this time, the resisting column 30 slides on the fixed plate and the spring is compressed. As the locking rope 40 is inserted, when the protrusion 31 encounters the groove 41, due to the action of the spring, the protrusion 31 will eventually be stuck in the groove 41 of the locking rope 40; when the protrusions 31 of the two resisting columns 30 are inserted into the grooves 41 at both ends of the locking rope 40, the driving device drives the cam 50 so that the center axis of the cam 50 and the center axes of the two resisting columns 30 are on the same straight line, and the two ends of the cam 50 respectively resist the two resisting columns 30 inserted into the grooves 41. When the external force pulls the two ends of the lock rope 40 out of the lock body 20, the movement process of the pillar 30 is opposite to the above process, which will not be repeated here, and the spring will return to its original state.
[0049] like Figure 3 As shown, the lock state monitoring circuit includes a main control chip, a connection terminal including a first pin 161, a second pin 162, a third pin 163, a fourth pin 164, a fifth pin 165, and a sixth pin 166, and a first resistor 11, a second resistor 12, a third resistor 13, a fourth resistor 14, and a fifth resistor 15 connected in sequence. The unconnected ends of the first resistor 11 and the second resistor 12 are grounded, while the unconnected ends of the fifth resistor 15 and the fourth resistor 14 are connected to a first power supply VCC. The first pin 161 is connected to one grounded end of the first resistor 11, the second pin 162 is connected to the junction of the first resistor 11 and the second resistor 12, the third pin 163 is connected to the junction of the second resistor 12 and the third resistor 13, the fourth pin 164 and the fifth pin 165 are both connected to the junction of the third resistor 13 and the fourth resistor 14, and the ADC pin of the main control chip and the sixth pin 166 are both connected to the junction of the fourth resistor 14 and the fifth resistor 15. Furthermore, the resistance values of the first resistor 11 and the fourth resistor 14 are unequal.
[0050] Furthermore, when only one end of the lock rope 40 of the electronic lock 100 is inserted into the electronic lock 100, the first resistor 11 or the third resistor 13 is short-circuited; when both ends of the lock rope 40 of the electronic lock 100 are inserted into the electronic lock 100, the first resistor 11, the second resistor 12 and the third resistor 13 are all short-circuited; when both ends of the lock rope 40 of the electronic lock 100 are inserted into the electronic lock 100 and the two ends of the lock rope 40 are disconnected, the first resistor 11 and the third resistor 13 are short-circuited; when both ends of the lock rope 40 of the electronic lock 100 are inserted into the electronic lock 100 and sealed, the first resistor 11, the second resistor 12, the third resistor 13 and the fourth resistor 14 are all short-circuited; when both ends of the lock rope 40 of the electronic lock 100 are inserted into the electronic lock 100 and sealed and the two ends of the lock rope 40 are disconnected, the first resistor 11, the third resistor 13 and the fourth resistor 14 are short-circuited.
[0051] Furthermore, the electronic lock 100 further includes a first electrical contact 21, a second electrical contact 22, a third electrical contact 23, a fourth electrical contact 24, a fifth electrical contact 25, and a sixth electrical contact 26 disposed within the lock body 20 and respectively connected to the first pin 161, the second pin 162, the third pin 163, the fourth pin 164, the fifth pin 165, and the sixth pin 166. Furthermore, electrical conduction between the first electrical contact 21 and the second electrical contact 22, as well as electrical conduction between the third electrical contact 23 and the fourth electrical contact 24, is achieved via the lock rope 40 and the third portion inserted into the groove 41. Electrical conduction between the fifth electrical contact 25 and the sixth electrical contact 26 is achieved via the cam 50 and the first portions of the two abutments 30.
[0052] In one embodiment, the first electrical contact 21 , the second electrical contact 22 , the third electrical contact 23 , the fourth electrical contact 24 , the fifth electrical contact 25 and the sixth electrical contact 26 are conductive interfaces, which may be but are not limited to metal sheets or metal contacts.
[0053] The following Figure 1 Taking the perspective of the electronic lock 100 as an example, the working principle of the lock state monitoring circuit in the electronic lock 100 is described.
[0054] First of all, it is worth mentioning that Figure 1The positions of the first electrical contact 21, the second electrical contact 22, the third electrical contact 23, and the fourth electrical contact 24 are illustrated; wherein, the first electrical contact 21 is always covered by the third portion of a movable post 30 or is disposed on the third portion of the post 30, the third electrical contact 23 is always covered by the third portion of another movable post 30 or is disposed on the third portion of the other post 30, the second electrical contact 22 and the fourth electrical contact 24 are respectively disposed on both sides of the lock body 20 and are respectively disposed at positions where the ends of the lock rope 40 can contact each other when inserted into the lock body 20. Furthermore, the fifth electrical contact 25 is always covered by the first portion of a movable post 30 or is disposed on the first portion of the post 30, and the sixth electrical contact 26 is always covered by the first portion of another movable post 30 or is disposed on the first portion of the other post 30, so as to Figure 1 From a viewing angle, the fifth electrical contact 25 is arranged on the left side, that is, the first part of the left column 30 contacts the fifth electrical contact 25, and the sixth electrical contact 26 is arranged on the right side, that is, the first part of the right column 30 contacts the sixth electrical contact 26.
[0055] It is worth mentioning that in order to prevent the lock state monitoring circuit from short-circuiting several resistors when the lock rope 40 has not yet been inserted into the lock body 20 to lock and the cam 50 has not yet abutted against the two abutments 30 for sealing, thereby affecting the lock state monitoring result, as designed in the aforementioned electronic lock 100, the conductive first part and the conductive third part are separated by an insulating second part. If the insulating second part is not used to separate the first part and the third part, then when the lock state monitoring circuit is not used, the fifth electrical contact 25 and the first electrical contact 21 are electrically connected and the sixth electrical contact 26 and the third electrical contact 23 are electrically connected. Therefore, the fifth pin 165 and the first pin 161 are electrically connected and the sixth pin 166 and the third pin 163 are electrically connected. In this way, when the lock state monitoring circuit is not used, the second resistor 12, the third resistor 13 and the fourth resistor 14 are already short-circuited. In this way, the subsequent short-circuiting of the various resistors caused by the locking of the lock rope 40 and the sealing of the cam 50 cannot be distinguished from the aforementioned short-circuiting.
[0056] It is also worth noting that in the following aspects, when both ends of the lock cord 40 are not inserted into the electronic lock 100, the cam 50 will not rotate to seal. R1, R2, R3, R4 and R5 are the resistance values of the first resistor 11, the second resistor 12, the third resistor 13, the fourth resistor 14 and the fifth resistor 15 respectively. VCC is the voltage value of the first power supply VCC.
[0057] First, Figure 1Taking the electronic lock 100 as an example, if only one end of the lock cord 40 is inserted into the left side of the electronic lock 100, when the protrusion 31 of the third portion of the left side support column 30 is inserted into the groove 41 of the end of the lock cord 40, the first electrical contact 21 and the second electrical contact 22 are electrically connected through the third portion of the left side support column 30 and the end of the lock cord 40. Since the first electrical contact 21 and the second electrical contact 22 are electrically connected to the first pin 161 and the second pin 162 respectively, the first pin 161 and the second pin 162 are conductive, so that the first resistor 11 is short-circuited; and if the lock cord 40 is not completely inserted into the lock body 20 for locking, the sealing will not be performed. Therefore, the fifth electrical contact 25 and the sixth electrical contact 26 will not be conductive; at this point, the second resistor 12, the third resistor 13, the fourth resistor 14, the fifth resistor 15 and the first power supply VCC form a first series circuit. Similarly, if only the other end of the lock cord 40 is inserted into the right side of the electronic lock 100, when the protrusion 31 of the third portion of the right side post 30 is inserted into the groove 41 of the end of the lock cord 40, the third electrical contact 23 and the fourth electrical contact 24 are electrically connected through the third portion of the right side post 30 and the other end of the lock cord 40. Since the third electrical contact 23 and the fourth electrical contact 24 are electrically connected to the third pin 163 and the fourth pin 164, respectively, the third pin 163 and the fourth pin 164 are electrically connected, so that the third resistor 13 is short-circuited. Moreover, if the lock cord 40 is not completely inserted into the lock body 20 for locking, the sealing will not be performed. Therefore, the fifth electrical contact 25 and the sixth electrical contact 26 will not be electrically connected, and the fifth pin 165 and the sixth pin 166 will not be electrically connected. At this point, the first resistor 11, the second resistor 12, the fourth resistor 14, the fifth resistor 15 and the first power supply VCC form a second series circuit.
[0058] Therefore, it can be seen that when only one end of the lock rope 40 is inserted into the lock body 20 to lock, in the first series circuit, the first resistor 1111 is short-circuited or the third resistor 13 is short-circuited; wherein, when the first resistor 1111 is short-circuited, in the second series circuit, the sampled voltage detected at the ADC pin position is U ADC1 :U ADC1 =U VCC * (R2+R3+R4) / (R2+R3+R4+R5); when the third resistor 13 is short-circuited, the sampling voltage detected at the ADC pin position is U ADC2 :U ADC2 = U VCC *(R1+R2+R4) / (R1+R2+R4+R5).
[0059] Secondly, when both ends of the lock rope 40 are not inserted into the lock body 20, the first electrical contact 21, the second electrical contact 22, the third electrical contact 23, the fourth electrical contact 24, the fifth electrical contact 25, and the fifth electrical contact 25 are all non-conductive, thereby making the first pin 161, the second pin 162, the third pin 163, the fourth pin 164, the fifth pin 165, and the sixth pin 166 non-conductive, that is, the first resistor 11, the second resistor 12, the third resistor 13, and the fourth resistor 14 are not short-circuited; at this time, the first resistor 11, the second resistor 12, the third resistor 13, the fourth resistor 14, the fifth resistor 15, and the first power supply VCC form a third series circuit, so it can be obtained that: the sampled voltage detected at the ADC pin position is U ADC3 :U ADC3 =U VCC *(R1+R2+R3+R4) / (R1+R2+R3+R4+R5).
[0060] Thirdly, when both ends of the lock cord 40 are inserted into the lock body 20 for locking, and the cam 50 has not yet rotated to the first portion of the abutment posts 30 on either side thereof, since both ends of the electronic lock 100 are inserted into the lock cord 40, the second electrical contact 22 and the fourth electrical contact 24 are electrically connected via the conductive lock cord 40, thereby electrically connecting the second pin 162 and the fourth pin 164. The reasoning is similar to that of the first aspect: the first electrical contact 21 and the second electrical contact 22 are electrically connected, and the first pin 161 and the second pin 162 are electrically connected, causing the first resistor 11 to be short-circuited; the third electrical contact 23 and the fourth electrical contact 24 are electrically connected, and the third pin 163 and the fourth pin 164 are electrically connected, causing the third resistor 13 to be short-circuited. In the second aspect, at this point, the cam 50 has not yet been rotated to abut the first portion of the two abutting posts 30 for sealing. The fifth electrical contact 25 and the sixth electrical contact 26 are not conducting, so the fifth pin 165 and the sixth pin 166 are not conducting, that is, the fourth resistor 14 is not short-circuited. At this point, the first pin 161, the second pin 162, the third pin 163, and the fourth pin 164 are all electrically conducting, causing the first resistor 11, the second resistor 12, and the third resistor 13 to be short-circuited. Thus, the fourth resistor 14, the fifth resistor 15, and the first power supply VCC form a fourth series circuit. Therefore, it can be obtained that the sampled voltage detected at the ADC pin position is U ADC4 :U ADC4 =U VCC * R4 / ( R4+ R5).
[0061] In the fourth aspect, when both ends of the lock rope 40 are inserted into the lock body 20 to lock the lock and the cam 50 rotates to the first part of the two abutting posts 30, it can be understood that since both ends of the lock rope 40 have been inserted into the lock body 20, according to the content of the second aspect above, in the fourth aspect, the first pin 161, the second pin 162, the third pin 163 and the fourth pin 164 are also electrically conductive, that is, the first resistor 11, the second resistor 12, the third resistor 13 and the fourth resistor 14 are short-circuited; and Because the cam 50 abuts the first portions of the two abutting posts 30 on either side thereof, the fifth electrical contact 25 and the sixth electrical contact 26 are electrically conductive. Furthermore, because the fifth electrical contact 25 and the sixth electrical contact 26 are connected to the fifth pin 165 and the sixth pin 166, respectively, the fourth resistor 14 is short-circuited. Thus, in the fourth aspect, the first resistor 11, the second resistor 12, the third resistor 13, and the fourth resistor 14 are all short-circuited, and the fifth resistor 15 and the first power supply VCC form a fifth series circuit. Therefore, the sampled voltage detected at the ADC pin position is U ADC5 :U ADC5 = U VCC *0 / R5=0V.
[0062] In the fifth aspect, when both ends of the lock rope 40 are inserted into the lock body 20 for locking and the cam 50 is not used for sealing, and when the rope is manually or accidentally cut off or damaged and disconnected from the part between the two ends inside the lock body 20, the situation in this fifth aspect is the same as the above-mentioned second aspect in that: the first electrical contact 21 and the second electrical contact 22 are electrically conductive and the first pin 161 and the second pin 162 are electrically conductive, the third electrical contact 23 and the fourth electrical contact 24 are electrically conductive and the third pin 163 and the fourth pin 164 are electrically conductive; and the difference between the two is that: since the lock rope 40 is manually cut off or accidentally disconnected, the second electrical contact 22 and the fourth electrical contact 24 will not be electrically conductive, so the first pin 161 and the second pin 162 are unlikely to be electrically conductive. Therefore, when both ends of the lock cord 40 are inserted into the lock body 20 to lock the lock, but the lock cord 40 is considered to be damaged by cutting or accidentally damaged, the first resistor 11 and the third resistor 13 are short-circuited, and the second resistor 12 is not short-circuited. At this time, the second resistor 12 and the fourth resistor 14 form a sixth series circuit. Therefore, it can be obtained that the sampled voltage detected at the ADC pin position is U ADC6 :U ADC6 = U VCC *( R2+R4) / (R2+R4+R5).
[0063] Aspect 6: When both ends of the lock cord 40 are inserted into the lock body 20 for locking and the cam 50 rotates to abut the first portion of the two abutting posts 30, and when the lock cord 40 is manually or accidentally cut or damaged from the portion between the two ends inside the lock body 20, the difference between the sixth aspect and the fifth aspect is that the second resistor 12 is not short-circuited, and the first resistor 11, the third resistor 13, and the fourth resistor 14 are short-circuited. Therefore, in the sixth aspect, the second resistor 12, the fifth resistor 15, and the first power supply VCC form a seventh series circuit. Therefore, it can be obtained that the sampled voltage detected at the ADC pin position is U ADC7 :U ADC7 = U VCC * R2 / (R2+R5).
[0064] It is worth noting that, with respect to the first to sixth aspects above, in one embodiment, the resistance values of the first resistor 11 and the third resistor 13 are not equal, and the resistance values of the second resistor 12 and the fourth resistor 14 are not equal; in another embodiment, the resistance values of the first resistor 11, the second resistor 12, the third resistor 13, and the fourth resistor 14 are all not equal. Thus, in these embodiments, U ADC1 ≠U ADC2 ≠U ADC3 ≠U ADC4 ≠U ADC5 ≠U ADC6 ≠U ADC7 .
[0065] In a specific embodiment, the connection terminal may be a 4-pin connection terminal, the main control chip may be but is not limited to an STM32 chip or an EFM32G230 chip, the resistance values of R1, R2, R3, R4 and R5 are 10KΩ, 20KΩ, 30KΩ, 40KΩ and 50KΩ respectively, and further the voltage value of the first power supply VCC is 3.3V.
[0066] To summarize, in the lock state monitoring circuit, for various lock state conditions including only one end of the lock rope 40 inserted into the electronic lock 100, both ends of the lock rope 40 inserted into the electronic lock 100, both ends of the lock rope 40 inserted into the electronic lock 100 and the ends of the lock rope 40 disconnected, both ends of the lock rope 40 of the electronic lock 100 inserted into the electronic lock 100 and sealed, and both ends of the lock rope 40 inserted into the electronic lock 100 and sealed and then the ends of the lock rope 40 disconnected, the first resistor 11, the second resistor 12, the third resistor 13, and the fourth resistor 14 in the circuit are in different short-circuit combinations, and since the resistance values of the second resistor 12 and the fourth resistor 14 are not equal and the resistance values of the first resistor 11 and the third resistor 13 are not equal, the sampled voltages at the ADC pin of the main control chip will be different in the aforementioned various lock state conditions, so that the lock state monitoring circuit can feedback the lock state according to the different values of the sampled voltages at the ADC pin of the main control chip. Compared with the prior art method of using multiple Hall elements and multiple magnets to monitor the lock status separately, the lock status monitoring circuit is simpler and uses one ADC pin of the main control chip, saving the pins of the main control chip.
[0067] Please refer to Figure 4 The lock status monitoring and control method based on the above-mentioned electronic lock provided in an embodiment of the present application includes the following steps S100 to S400.
[0068] Step S100: monitoring whether both ends of the lock rope of the electronic lock are inserted into the lock body to lock the lock based on the sampled voltage of the ADC pin of the lock state monitoring circuit.
[0069] Step S200: Sending a sealing command to the electronic lock to drive the cam to rotate so that the two ends of the cam respectively abut against the first parts of the two abutting posts.
[0070] Step S300: monitoring whether the electronic lock is sealed successfully based on the sampled voltage of the ADC pin of the lock status monitoring circuit.
[0071] Step S400: monitoring whether the lock cord inserted into the lock body is damaged.
[0072] In the above steps, after both ends of the lock cord are inserted into the lock body, it is monitored whether the lock cord is damaged after being inserted into the lock body. After sealing is performed using the cam, it is also monitored whether the lock cord is damaged after being inserted into the lock body.
[0073] In one embodiment, monitoring whether both ends of a lock cord of an electronic lock are inserted into a lock body for locking based on a sampled voltage of an ADC pin of a lock state monitoring circuit includes:
[0074] When the sampling voltage of the ADC pin is detected to be the first voltage value U ADC1 , the second voltage value U ADC2 Or the third voltage value UADC3 When the lock rope is locked, it is determined that the lock rope is not locked successfully;
[0075] When the sampling voltage of the ADC pin is detected to be the fourth voltage value U ADC4 When the lock rope is locked successfully;
[0076] In the above embodiment, the first voltage value U ADC1 The second voltage value U ADC2 , the third voltage value U ADC3 and the fourth voltage value U ADC4 U VCC *(R2+R3+R4) / (R2+R3+R4+R5), U VCC *(R1+R2+R4) / (R1+R2+R4+R5), U ADC4 =U VCC * (R1+R2+R3+R4) / (R1+R2+R3+R4+R5) and R4 / (R4+R5);
[0077] In one embodiment, in step S300, when the sampled voltage value of the ADC is monitored to be the fifth voltage value, it is determined that the electronic lock is sealed successfully; wherein, the fifth voltage value is U ADC5 = U VCC *0 / R5.
[0078] In one embodiment, in step S400, the monitoring of whether the lock cord inserted into the lock body is damaged includes: when the sampling voltage of the ADC pin is monitored to be the sixth voltage value U ADC6 = U VCC * (R2 + R4) / (R2 + R4 + R5), it is determined that the lock rope is disconnected from the middle of the two ends after the lock rope end is inserted into the lock body; and when the sampling voltage of the ADC pin is monitored to be the seventh voltage value U ADC7 =U VCC * When R2 / (R2+R5), it is determined that the lock cord is inserted into the lock body and the lock cord is disconnected from the middle of both ends after sealing.
[0079] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present application should be included in the scope of protection of the present application.
Claims
1. A lock status monitoring circuit, applied to an electronic lock, characterized in that: The lock state monitoring circuit includes a main control chip, a connection terminal including a first pin, a second pin, a third pin, a fourth pin, a fifth pin and a sixth pin, and a first resistor, a second resistor, a third resistor, a fourth resistor connected to the ground in sequence, and a fifth resistor connected to the first power supply; The first pin, the second pin, and the third pin are respectively connected to one grounded end of the first resistor, the connection point between the first resistor and the second resistor, and the connection point between the second resistor and the third resistor; the fourth pin and the fifth pin are both connected to the connection point between the third resistor and the fourth resistor; the ADC pin of the main control chip and the sixth pin are both connected to the connection point between the fourth resistor and the fifth resistor; the resistance values of the second resistor and the fourth resistor are not equal, and the resistance values of the first resistor and the third resistor are not equal; Among them, when only one end of the lock rope of the electronic lock is inserted into the electronic lock, the first resistor or the third resistor is short-circuited; when both ends of the lock rope of the electronic lock are inserted into the electronic lock, the first resistor, the second resistor and the third resistor are all short-circuited; when both ends of the lock rope of the electronic lock are inserted into the electronic lock and the two ends of the lock rope are disconnected, the first resistor and the third resistor are short-circuited; when both ends of the lock rope of the electronic lock are inserted into the electronic lock and sealed, the first resistor, the second resistor, the third resistor and the fourth resistor are all short-circuited; when both ends of the lock rope of the electronic lock are inserted into the electronic lock and the two ends of the lock rope are disconnected, the first resistor, the third resistor and the fourth resistor are short-circuited.
2. The lock state monitoring circuit according to claim 1, wherein: The resistance values of the first resistor, the second resistor, the third resistor, the fourth resistor and the fifth resistor are all different.
3. The lock state monitoring circuit according to claim 1 or 2, characterized in that: The resistance values of the first resistor, the second resistor, the third resistor, the fourth resistor and the fifth resistor are 10KΩ, 20KΩ, 30KΩ, 40KΩ and 50KΩ respectively.
4. An electronic lock, characterized in that: include: Lock body; Two posts are provided in the lock body, each of the posts comprising a conductive first portion, an insulating second portion and a conductive third portion connected in sequence; A conductive lock cord having two ends that can be inserted into the lock body, and a groove for the third portion of the abutment to be inserted into each end of the lock cord; A conductive cam is rotatably disposed between the two abutting posts and is used to abut the first portions of the abutting posts inserted into the grooves on both sides thereof; A lock status monitoring circuit according to any one of claims 1 to 3 located in the lock body; The first electrical contact, the second electrical contact, the third electrical contact, the fourth electrical contact, the fifth electrical contact and the sixth electrical contact are all arranged in the lock body and respectively connected to the first pin, the second pin, the third pin, the fourth pin, the fifth pin and the sixth pin. The electrical conduction between the first electrical contact and the second electrical contact and the electrical conduction between the third electrical contact and the fourth electrical contact are both achieved through the lock rope and the third part inserted into the groove. The fifth electrical contact and the sixth electrical contact are electrically conducted through the cam and the first parts of the two abutments.
5. The electronic lock according to claim 4, characterized in that: The electronic lock further comprises a driving device located in the lock body, wherein the driving device is connected to the cam and is used to drive the cam to rotate.
6. The electronic lock according to claim 4, wherein: The electronic lock also includes two fixed plates and two springs arranged in the lock body; the first part of each of the pillars slides through the fixed plate, and one end of each spring is fixedly connected to the fixed plate and the other end is fixedly connected to the third part of the pillar.
7. A lock status monitoring and control method, based on the electronic lock according to any one of claims 4 to 6, characterized in that: include: Based on the voltage of the ADC pin of the lock status monitoring circuit, the two ends of the lock rope of the electronic lock are monitored to see if they are inserted into the lock body to lock the lock; Sending a sealing command to the electronic lock to drive the cam to rotate so that the two ends of the cam respectively abut against the first parts of the two abutting posts; Monitoring whether the electronic lock is sealed successfully based on the voltage of the ADC pin of the lock status monitoring circuit; and Monitor whether the lock cable inserted into the lock body is damaged.
8. The lock status monitoring and control method according to claim 7, wherein: The voltage of the ADC pin of the lock status monitoring circuit is used to monitor whether both ends of the lock rope of the electronic lock are inserted into the lock body to lock the lock, including: When the voltage of the ADC pin is detected to be the first voltage value U ADC1 , the second voltage value U ADC2 Or the third voltage value U ADC3 When the lock rope is locked, it is determined that the lock rope is not locked successfully; When the voltage of the ADC pin is detected to be the fourth voltage value U ADC4 When the lock rope is locked successfully; Among them, the first voltage value U ADC1 The second voltage value U ADC2 , the third voltage value U ADC3 and the fourth voltage value U ADC4 U VCC *(R2+R3+R4) / (R2+R3+R4+R5), U VCC *(R1+R2+R4) / (R1+R2+R4+R5), U ADC4 =U VCC *(R1+R2+R3+R4) / (R1+R2+R3+R4+R5) and R4 / (R4+R5), R1, R2, R3, R4 and R5 are the resistance values of the first resistor, the second resistor, the third resistor, the fourth resistor and the fifth resistor respectively, U VCC is the voltage of the first power supply.
9. The lock status monitoring and control method according to claim 7, wherein: The voltage of the ADC pin of the lock status monitoring circuit is used to monitor whether the electronic lock is sealed successfully. Specifically: When the voltage value of the ADC is detected to be the fifth voltage value, it is determined that the electronic lock is sealed successfully; wherein, the fifth voltage value is U ADC5 =U VCC *0 / R5; wherein R4 and R5 are the resistance values of the fourth resistor and the fifth resistor respectively, U VCC is the voltage of the first power supply.
10. The lock status monitoring and control method according to claim 7, wherein: The monitoring of whether the lock rope inserted into the lock body is damaged includes: When the voltage of the ADC pin is detected to be the sixth voltage value U ADC6 =U VCC *(R2+R4) / (R2+R4+R5), it is determined that the lock cord is disconnected from the middle of the two ends after the lock cord ends are inserted into the lock body; When the voltage of the ADC pin is detected to be the seventh voltage value U ADC7 =U VCC *R2 / (R2+R5), it is determined that the lock cord is inserted into the lock body and the lock cord is disconnected from the middle of both ends after sealing.
Citation Information
Patent Citations
Electric mortise lock detection device
CN115774158A
Latch-up testing device and latch-up testing method
JP2012230035A