electronic lock

TW202634156AActive Publication Date: 2026-08-16TONG LUNG METAL IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
TW114104756
Authority / Receiving Office
TW · TW
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-02-08
Publication Date
2026-08-16
Estimated Expiration
2045-02-07

AI Technical Summary

Technical Problem

Existing electronic locks using optical gears for determining rotation status are prone to inaccuracies due to issues like oil stains and dust accumulation, affecting the accuracy of judgment.

Method used

The electronic lock incorporates a motor module, main gear, transmission gear set, encoder, and control module to analyze rotation information through a sensing signal generated by an encoder, using a magnet and Hall sensor to determine door opening direction and control the transmission mechanism accurately.

Benefits of technology

The solution improves the accuracy of rotation status judgment by using an encoder and magnet-Hall sensor system, ensuring precise operation and reducing malfunctions due to environmental factors affecting optical gears.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure TWG2TA001072148_001
    Figure TWG2TA001072148_001
  • Figure TWG2TA001072148_002
    Figure TWG2TA001072148_002
  • Figure TWG2TA001072148_003
    Figure TWG2TA001072148_003
Patent Text Reader

Abstract

An electronic lock includes a knob mounted on a housing, a transmission mechanism, and a control device. The knob can be rotated to drive a latch mechanism for locking or unlocking. The main gear of the transmission mechanism can be controlled to switch between an idle state relative to the knob and a driven state that pushes the knob to rotate synchronously. The control device includes an encoder connected to the transmission gear set of the transmission mechanism. When the unlocking or locking function is activated, the control device controls the operation of the transmission mechanism accordingly based on the signal generated by the encoder. By installing an encoder on the transmission gear set, the control device can control the operation of the transmission mechanism accordingly by analyzing changes in the encoder signal when the unlocking or locking function is activated, which can improve the shortcomings of existing electronic locks that rely on optical gears to determine the rotation status.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a door lock, and more particularly to an electronic lock. Prior Technology

[0002] An electronic lock generally includes a knob connected to a latch mechanism, a transmission mechanism connected to the knob, and a control device connected to the transmission mechanism via a signal. The transmission mechanism can be controlled by the control device to drive the knob to lock or unlock the latch mechanism. The knob can also be manually turned to directly drive the latch mechanism for locking or unlocking. When locking or unlocking electronically via the transmission mechanism, to immediately stop the transmission mechanism after it is positioned, preventing damage or malfunction due to over-driving under high resistance, electronic locks typically also include an optical gear to sense and determine the operating angle of the transmission mechanism. This allows the control device to analyze changes in the reflective signal of the optical gear and control the operation of the transmission mechanism accordingly.

[0003] However, when using this type of electronic lock, the optical gear is prone to abnormal reflection due to oil stains on its reflector during assembly, dust accumulation during use, or other reasons such as detachment or warping, which in turn affects the accuracy of judgment. Summary of the Invention

[0004] Therefore, the object of the present invention is to provide an electronic lock that can improve upon at least one of the disadvantages of the prior art.

[0005] Therefore, the electronic lock of the present invention is suitable for connection to a latch mechanism installed on a door. The electronic lock includes a housing, and a knob, a transmission mechanism, and a control device mounted on the housing. The knob is connected to the latch mechanism and can be driven to lock or unlock the latch mechanism. The transmission mechanism includes a motor module, a main gear connected to the knob, and a transmission gear set connecting the main gear and the motor module. The motor module can be controlled to operate, and the main gear is driven via the transmission gear set, causing the main gear to switch between an idle state where it rotates relative to the knob and a driven state where it pushes the knob to rotate synchronously.

[0006] The control device includes a control module that is signal-connected to the motor module, and an encoder that is electrically connected to the control module and to the transmission gear set. The encoder can be driven by the operation of the transmission gear set to generate a sensing signal. The control module has a built-in unlocking function and a locking function. When the unlocking function and the locking function are activated, the control module analyzes the sensing signal to obtain rotation information. The control module then controls the operation of the motor module accordingly based on the changes in the rotation information.

[0007] The advantage of this invention is that by installing and connecting the encoder to the transmission gear set, the control module can control the operation of the transmission mechanism according to the signal changes generated by the encoder when the unlocking or locking function is activated, which can improve the shortcomings of existing electronic locks that use optical gears to determine the rotation status. Simple Explanation of the Diagram

[0008] Other features and effects of the present invention will be clearly presented in the embodiments with reference to the drawings, wherein: Figure 1 is a perspective sectional view illustrating an embodiment of the electronic lock of the present invention installed on a right-opening door type door; Figure 2 is an incomplete exploded perspective view illustrating the structure of this embodiment; Figure 3 is an incomplete exploded perspective view, mainly illustrating the structure of the knob and transmission mechanism in one embodiment. Figure 4 is a functional block diagram illustrating the functional architecture of this embodiment; Figure 5 is a front view illustrating the state of the knob in a locked position in this embodiment; Figure 6 is a view similar to Figure 5, illustrating the situation when the knob is in an unlocked position; Figure 7 is an animation diagram illustrating the situation when this embodiment is installed on a right-hand door type door, and a main gear is driven to rotate in a second clockwise direction when a control module activates a door opening direction determination function; Figure 8 is an incomplete perspective view illustrating the installation of this embodiment on a left-opening door type door. Figure 9 is an animation diagram illustrating the situation when the control module is installed on a left-side door type door and the main gear is driven to rotate in a first clockwise direction when the door opening direction determination function is activated. Figure 10 is an animation diagram illustrating the operation of the main gear when the control module is installed on a right-hand door type door and the control module is activated for the first time to unlock; and Figure 11 is an animation diagram illustrating the operation of the main gear when the control module is installed on a left-hand door type door and the control module is activated for the first time to unlock. Implementation

[0009] Referring to Figures 1, 2, and 3, one embodiment of the electronic lock 200 of the present invention is suitable for installation on the inside of a door 800 and connected to a latch mechanism 900. The electronic lock 200 can sense and determine whether the currently installed door 800 is a left-opening or right-opening type. After determining the opening direction of the door 800, it can be operated to drive the latch mechanism 900 to lock and unlock. In this embodiment, the opening direction is defined based on a person standing outside the door facing the door 800, and then according to the direction of the door hinge relative to the person. When the door hinge is on the left side of the person, the door 800 is a left-opening type. When the door hinge is on the right side of the person, the door 800 is a right-opening type.

[0010] The electronic lock 200 includes a housing 3, a knob 4, a transmission mechanism 5, and a control device 6 mounted on the housing 3.

[0011] The knob 4 is rotatably mounted on the housing 3 and connected to the latch mechanism 900. The knob 4 can be rotated to change between a locked position (as shown in Figure 5) that engages the latch mechanism 900 and an unlocked position (as shown in Figure 6) that unlocks the latch mechanism 900. In this embodiment, the knob 4 has an operating member 41 for hand operation and a drive shaft 42 extending through the housing 3 and connected to the latch mechanism 900. The drive shaft 42 has a shaft portion 421 and two radially opposing pushing protrusions 422 protruding from the outer peripheral surface of the shaft portion 421.

[0012] The transmission mechanism 5 includes a motor module 51, a main gear 52 coaxially connected to the knob 4, and a transmission gear set 53 connecting the motor module 51 and the main gear 52. The main gear 52 includes a gear body 521 coaxially sleeved on the shaft portion 421 of the drive shaft 42, and two elastic members 522 spaced parallel to each other and radially abutting against the shaft portion 421. The gear body 521 meshes with the transmission gear set 53 and can be driven by the transmission gear set 53 to rotate in a first clockwise direction 501 or a second clockwise direction 502, thereby synchronously driving the elastic members 522 to rotate relative to the shaft portion 421. When the main gear 52 is driven to rotate, it will change between an idle state in which it rotates freely relative to the shaft portion 421 and a driving state in which the elastic members 522 abut against the push protrusions 422 respectively, driving the knob 4 to rotate synchronously.

[0013] Referring to Figures 2, 3, and 4, the control device 6 includes a control module 61 that is signal-connected to the motor module 51, an encoder 62 that is electrically connected to the control module 61 and connected to the transmission gear set 53, a magnet 63 disposed on the knob 4, and a Hall sensor 65 that is electrically connected to the control module 61.

[0014] The encoder 62 may be, for example, but not limited to, a mechanical encoder, an optical encoder, or a magnetic encoder, and its rotating shaft is coaxially connected to one of the gears 531 of the transmission gear set 53. It can be driven by the rotation of the gear 531 to generate a sensing signal, such as a square wave signal.

[0015] The magnet 63 is connected to the knob 4 via a disc-shaped connector 64 that is sleeved and fixed outside the shaft portion 421 of the knob 4. The magnet 63 can be rotated synchronously with the rotation of the knob 4. When the knob 4 is driven to rotate to the locked position, it will drive the magnet 63 to move to the position that triggers the Hall sensor 65. The Hall sensor 65 will be triggered by the magnetic field of the magnet 63 and generate a sensing signal. When the knob 4 is driven to rotate away from the locked position, it will drive the magnet 63 to move away from the Hall sensor 65, so that the Hall sensor 65 will not generate the sensing signal. In this embodiment, the knob 4 rotates at an angle of approximately 90 degrees between the unlocked position and the locked position.

[0016] In this embodiment, when the door 800 is a right-opening door, the latch mechanism 900 is exposed on the left side of the door 800. The knob 4 can be driven in a first clockwise direction 501, thereby unlocking the locked latch mechanism 900. When the door 800 is a left-opening door, the latch mechanism 900 is exposed on the right side of the door 800. The knob 4 can be driven in a second clockwise direction 502, thereby unlocking the locked latch mechanism 900.

[0017] The control module 61 has an operable door opening direction determination function, an unlocking function, and a locking function, and has a built-in first door opening direction setting and a second door opening direction setting that can be selected for activation. The door opening direction determination function also includes an initial unlocking function. In addition, the control module 61 also has a built-in initial unlocking condition, an unlocking condition, an unlocking return condition, a locking condition, and a locking return condition.

[0018] When the control module 61 activates the above-mentioned function, it receives and analyzes the sensing signal to obtain rotation information, and further controls the operation of the transmission mechanism 5 according to the correspondence between the rotation information and the aforementioned conditions. The rotation information is data obtained by counting, for example but not limited to, the period, high-level signal, or low-level signal of the square wave sensing signal generated by the encoder 62. This rotation information is related to the rotation state of the main gear 52, which includes, for example but not limited to, the rotation angle, and whether rotation has stopped. The initial unlocking condition, the unlocking condition, the unlocking return condition, the locking condition, and the locking return condition are, for example but not limited to, a predetermined count of one of the periods, high-level signals, or low-level signals.

[0019] Referring to Figures 1 and 2, when the electronic lock 200 is installed on the door body 800 and connected to the latch mechanism 900, the opening direction judgment function of the control module 61 must be activated first, so that the control module 61 can judge the opening direction of the current door body 800. After the first opening direction setting or the second opening direction setting is activated accordingly, the control module 61 can be normally activated to perform the locking and unlocking functions.

[0020] When the control module 61 performs door opening direction determination, the knob 4 must first be manually operated to the unlock position, that is, the knob 4 moves the magnet 63 away from the Hall sensor 65, so that the Hall sensor 65 is no longer triggered by the magnet 63 to generate the sensing signal. Then, the door opening direction determination function of the control module 61 is activated.

[0021] When the door opening direction determination function is activated, the control module 61 first controls the main gear 52 of the transmission mechanism 5 to rotate in the first clockwise direction 501, which means controlling the motor module 51 to operate. The motor module 51 then drives the main gear 52 to rotate in the first clockwise direction 501 via the transmission gear set 53, thereby attempting to drive the knob 4 to switch to the locked position. At the same time, the transmission gear set 53 synchronously drives the encoder 62.

[0022] The control module 61 receives and analyzes the changes in the sensing signal generated by the encoder 62 to obtain the rotation information. When it determines that the rotation information has stopped changing, that is, when the transmission gear set 53 has not driven the encoder 62 for a predetermined time, it further determines whether it has received the sensing signal. The predetermined time is, for example, but not limited to, 0.5 seconds.

[0023] When the control module 61 determines that it has received the sensing signal, that is, when the knob 4 has been successfully driven to the locked position and the magnet 63 triggers the Hall sensor 65, the control module 61 will activate the first door opening direction setting, setting the first clockwise direction 501 as the locking direction and the second clockwise direction 502 as the unlocking direction.

[0024] When the control module 61 determines that it has not received the sensing signal, it controls the motor module 51 to run in reverse, thereby driving the main gear 52 to rotate in the opposite second clockwise direction 502. When the control module 61 determines that the rotation information has stopped changing, it further determines whether the sensing signal has been received. When the control module 61 determines that the sensing signal has been received, it indicates that the knob 4 has been successfully driven to the locked position, and it will activate the second door opening direction setting, setting the second clockwise direction 502 as the locking direction and the first clockwise direction 501 as the unlocking direction.

[0025] When the control module 61 successfully activates either the first door opening direction setting or the second door opening direction setting, it will continue to execute the initial unlocking function once, and then end the door opening direction determination function.

[0026] If the control module 61, after controlling the motor module 51 to rotate in the reverse direction to make the main gear 52 rotate in the second clockwise direction 502, still does not receive the sensing signal, it indicates that the latch mechanism 900 may be obstructed or malfunctioning and cannot be driven, or that the transmission mechanism 5 has malfunctioned, and will generate a warning message. This warning message may include, but is not limited to, lights, sounds, and / or images. Since the generation of warning messages by the control module 61 is existing technology and there are many methods, it will not be described in detail here.

[0027] Referring to Figures 1, 5, and 6, let's take the installation of the electronic lock 200 on a door 800 in a right-opening mode as an example to illustrate the door opening direction determination function. The latch mechanism 900 is exposed on the left side of the door 800 and can be driven to extend to the left outside the door 800 to perform the locking action. At this time, the knob 4 can be manually driven to rotate in the first clockwise direction 501 to the unlock position shown in Figure 6, thereby unlocking the latch mechanism 900.

[0028] Referring to Figures 6 and 7, when the knob 4 has been manually moved to the unlocked position (as shown in Figure 6), and the control module 61 has its door opening direction determination function activated, the control module 61 will first control the main gear 52 of the transmission mechanism 5 to rotate in the first clockwise direction 501. However, because the knob 4 is restricted by the unlocked latch mechanism 900, it cannot be driven by the main gear 52 to rotate in the first clockwise direction 501. Therefore, the main gear 52 will not rotate, and the knob 4 will remain in the unlocked position.

[0029] At this time, the control module 61 determines that the rotation information has stopped changing and that no sensing signal has been received. It then controls the main gear 52 of the transmission mechanism 5 to reverse in the second clockwise direction 502 (as shown in Figure 7). The main gear 52 changes from the idle state to the driven state and begins to push the knob 4 to rotate in the second clockwise direction 502. When the knob 4 changes to the locked position, it is restricted by the latch mechanism 900, which is already in the locked state, and cannot be driven further. Therefore, the main gear 52 stops rotating. At this time, the Hall sensor 65 is also activated by the magnet 63, generating the sensing signal.

[0030] The control module 61 will determine that the rotation information has stopped changing and that it has received the sensing signal, and then activate the second door opening direction setting.

[0031] Referring to Figures 8 and 9, and taking the electronic lock 200 installed on a door 800 in a left-opening mode as an example, the door opening direction determination function is explained. The latch mechanism 900 is exposed on the right side of the door 800 and can be driven to extend to the right outside the door 800 to perform the locking action. At this time, the knob 4 can be manually driven to rotate in the second clockwise direction 502 to the unlock position (as shown in the left half of Figure 9), thereby unlocking the latch mechanism 900.

[0032] When the knob 4 has been manually moved to the unlocked position and the control module 61 has its door opening direction determination function activated, the main gear 52 of the transmission mechanism 5 rotates in the first clockwise direction 501. The main gear 52 changes from an idle state relative to the knob 4 to a driving state that drives the knob 4 to rotate, thus driving the knob 4 to rotate synchronously in the first clockwise direction 501 until the knob 4 reaches the locked position and can no longer be driven (as shown in the right half of Figure 9). At this time, the Hall sensor 65 is activated by the magnet 63, generating a sensing signal.

[0033] When the control module 61 determines that the rotation information has stopped changing and that it has received the sensing signal, it will activate the first door opening direction setting.

[0034] Referring to Figures 10 and 11, when the control module 61 activates the first door opening direction setting or the second door opening direction setting and then executes the initial unlocking function, it controls the main gear 52 of the transmission mechanism 5 to rotate in the corresponding second clockwise direction 502 or first clockwise direction 501, thereby driving the knob 4 to change to the unlock position. When the control module 61 activates the first door opening direction setting, it controls the main gear 52 of the transmission mechanism 5 to rotate in the second clockwise direction 502 as shown in Figure 10 to perform the unlocking action. When the control module 61 activates the second door opening direction setting, it controls the main gear 52 of the transmission mechanism 5 to rotate in the first clockwise direction 501 as shown in Figure 11 to perform the unlocking action.

[0035] When the control module 61 performs the initial unlocking function, it controls the main gear 52 of the transmission mechanism 5 to rotate in the corresponding second clockwise direction 502 or the first clockwise direction 501. Simultaneously, the control module 61 analyzes and determines whether the current rotation information meets the initial unlocking conditions. When the control module 61 determines that the current rotation information meets the initial unlocking conditions, for example, but not limited to, when the number of cycles of the sensing signal equals the number set for the unlocking conditions, it continues to control the main gear 52 of the transmission mechanism 5 to rotate in the opposite direction in the corresponding first clockwise direction 501 or the second clockwise direction 502, changing to the idle state relative to the knob 4. Then, the control module 61 continues to analyze and determine that the current rotation information meets the unlocking return conditions, for example, but not limited to, when the number of cycles of the sensing signal equals the number set for the unlocking return conditions, the control module 61 controls the transmission mechanism 5 to stop operating. At this point, the control module 61 has completed the initial unlocking function and will record an unlocking record.

[0036] Next, we will continue to describe the locking and unlocking functions activated by the control module 61 after it has successfully started the first door opening direction setting or the second door opening direction setting and ended the door opening direction judgment function. It must be noted that after successfully executing the locking function, the control module 61 will record a locking record, and after successfully executing the unlocking function, the control module 61 will record an unlocking record.

[0037] When the control module 61 is activated to perform the locking function, it will not perform the locking function if the last record is a locked record, but will perform the locking function if the last record is an unlocked record. The control module 61 will issue a warning message if it determines that the locking function should not be performed.

[0038] When the control module 61 starts executing the locking function, it controls the main gear 52 of the transmission mechanism 5 to rotate in the corresponding second clockwise direction 502 or the first clockwise direction 501, according to the currently activated first door opening direction setting or the second door opening direction setting. This changes the driving state to drive the knob 4 to rotate. That is, the main gear 52 and the knob 4 will change from the state shown in the lower left corner of Figure 10 to the state shown in the upper left corner, or from the state shown in the lower left corner of Figure 11 to the state shown in the upper left corner. When the control module 61 analyzes and determines that the current rotation information meets the locking conditions, such as, but not limited to, the number of cycles of the sensing signal being equal to the number set by the locking conditions, it controls the main gear 52 of the transmission mechanism 5 to rotate in the opposite direction to the corresponding first clockwise direction 501 or the second clockwise direction 502, changing the state to the idle state of the knob 4. When the control module 61 analyzes and determines that the current rotation information meets the locking return condition, it will control the transmission mechanism 5 to stop operating, thereby ending the locking function and recording the locking record. At this time, the main gear 52 and the knob 4 will be in the state shown in the upper right corner of Figure 10 or the state shown in the upper right corner of Figure 11.

[0039] When the control module 61 performs the locking function, if the rotation information does not change to meet the locking condition after a predetermined time, it determines that the locking has failed and accumulates one locking failure count. When the control module 61 determines that the number of locking failures is less than n1, it controls the main gear 52 of the transmission mechanism 5 to rotate in the opposite direction to the corresponding first clockwise direction 501 or second clockwise direction 502 until the rotation information stops changing, and then re-executes the locking function. When the accumulated number of locking failures equals n1, the control module 61 issues a locking failure message and controls the main gear 52 of the transmission mechanism 5 to rotate in the opposite direction to the corresponding first clockwise direction 501 or second clockwise direction 502 until the encoder 62 stops generating the sensing signal, that is, the rotation information stops changing. n1 is an integer.

[0040] When the control module 61 is activated to perform the unlocking function, it first determines whether the last record is an unlock record or a lock record. If the control module 61 determines that the last record is an unlock record, it will not perform the unlocking function and will issue a warning message. The warning message may include, but is not limited to, lights, sounds, and / or images.

[0041] When the control module 61 determines that the last record is the locked record, it will begin to execute the unlocking function. The control module 61 will control the main gear 52 of the transmission mechanism 5 to rotate in the corresponding first clockwise direction 501 or second clockwise direction 502, changing to the driving state of starting to drive the knob 4. That is, the main gear 52 and the knob 4 will change from the state shown in the upper right corner of Figure 10 to the state shown in the lower right corner, or from the state shown in the upper right corner of Figure 11 to the state shown in the lower right corner. When the control module 61 determines that the rotation information meets the unlocking condition, it will continue to control the main gear 52 of the transmission mechanism 5 to rotate in the opposite direction to the second clockwise direction 502 or the first clockwise direction 501, changing to the idle state. When the control module 61 further analyzes and determines that the rotation information meets the unlocking return condition, it will control the transmission mechanism 5 to stop operating, thereby ending the unlocking function and recording an unlocking record. At this time, the main gear 52 and the knob 4 will be in the state shown in the lower left corner of Figure 10 or the state shown in the lower left corner of Figure 11.

[0042] Furthermore, when executing the unlocking function, the control module 61 will determine that the unlocking has failed if the rotation information does not change to meet the unlocking conditions after a predetermined time, and will accumulate one unlocking failure count. When the control module 61 determines that the number of unlocking failures is less than n2, it will control the main gear 52 of the transmission mechanism 5 to rotate in the opposite direction to the corresponding second clockwise direction 502 or the first clockwise direction 501 until the rotation information stops changing, and then re-execute the unlocking function. When the accumulated number of unlocking failures equals n2, the control module 61 will issue an unlocking failure message and control the main gear 52 of the transmission mechanism 5 to rotate in the opposite direction to the corresponding second clockwise direction 502 or the first clockwise direction 501 until the encoder 62 stops generating the sensing signal, that is, the rotation information no longer changes. n2 is an integer.

[0043] In summary, by installing and connecting the encoder 62 to the transmission gear set 53 of the transmission mechanism 5, when the control module 61 activates the unlocking or locking function and controls the transmission mechanism 5 to rotate the knob 4, it can control the operation of the transmission mechanism 5 according to the changes in the rotation information obtained by analyzing the sensing signal of the encoder 62. This can improve the shortcomings of the existing electronic lock 200, which is prone to affecting the accuracy of the judgment when using optical gears to judge the rotation status due to oil stains or dust on the reflector of the optical gears.

[0044] Furthermore, by combining the design of setting the magnet 63 and the Hall sensor 65 between the knob 4 and the control module 61, the control module 61 can accurately and automatically determine the opening direction of the door 800 by analyzing the changes in the rotation information obtained by the sensing signal of the encoder 62 and by determining whether the sensing signal of the Hall sensor 65 has been received.

[0045] Therefore, the electronic lock 200 of this invention is indeed a very convenient and practical creation, and it can indeed achieve the purpose of this invention.

[0046] However, the above description is merely an embodiment of the present invention and should not be construed as limiting the scope of the present invention. Any simple equivalent changes and modifications made in accordance with the scope of the patent application and the contents of the patent specification of the present invention shall still fall within the scope of the patent of the present invention.

[0047] 200: Electronic Lock 3: Shell 4: Knob 41: Operating components 42: Drive shaft 421: Shaft section 422: Push the convex part 5: Transmission mechanism 501: First clockwise direction 502: Second clockwise direction 51: Motor Module 52: Main Gear 521: Gear Body 522: Elastic component 53: Transmission gear set 531: Gear 6: Control device 61: Control Module 62: Encoder 63: Magnet 64: Connector 65: Hall sensor 800: Door 900: Locking mechanism

Claims

1. An electronic lock suitable for connection to a latch mechanism mounted on a door, the electronic lock comprising: a housing; a knob mounted on the housing and connected to the latch mechanism, and operable to lock or unlock the latch mechanism; a transmission mechanism mounted on the housing, including a motor module, a main gear connected to the knob, and a transmission gear set connecting the main gear and the motor module, the motor module being controllable to drive the main gear via the transmission gear set, causing the main gear to switch between an idle state relative to the knob and a driven state that synchronously rotates the knob; and a control device mounted on the housing, including a control module signal-connected to the motor module and an electrical connection disposed on the control module and connected to the transmission gear set. The encoder is driven by the operation of the transmission gear set to generate a sensing signal. The control module has a built-in unlocking function and a locking function. When the control module is operated to perform either the unlocking function or the locking function, it will control the motor module to drive the main gear to rotate in a corresponding first clockwise direction and a second clockwise direction, rotating in the driving state and the idling state respectively. The control module will analyze the sensing signal to obtain rotation information and control the operation of the motor module accordingly based on the changes in the rotation information.

2. The electronic lock as described in claim 1, wherein, The control module has a built-in first door opening direction setting and a second door opening direction setting that can be activated selectively. When the control module is activated and executes the unlocking function, it controls the main gear of the transmission mechanism to rotate in the corresponding first clockwise or second clockwise direction to the driving state, based on the currently activated first or second door opening direction setting. When it determines that the rotation information meets an unlocking condition, it controls the main gear of the transmission mechanism to rotate in the opposite direction to the second clockwise or first clockwise direction to the idle state. When the control module further analyzes and determines that the rotation information meets an unlocking return condition, it controls the transmission... The mechanism stops operating and records an unlocking record. When the control module is activated and executes the locking function, it controls the main gear of the transmission mechanism to rotate in the corresponding second clockwise direction or the first clockwise direction to the driving state, based on the currently activated first door opening direction setting or the second door opening direction setting. When it determines that the rotation information meets a locking condition, it controls the main gear of the transmission mechanism to rotate in the opposite direction to the first clockwise direction or the second clockwise direction to the idling state. When the control module continues to analyze and determine that the rotation information meets a locking return condition, it controls the transmission mechanism to stop operating and records a locking record.

3. The electronic lock as described in claim 2, wherein, When the unlocking function is activated, the control module first determines whether the last record is the unlock record or the lock record. If the last record is the unlock record, the control module will not execute the unlocking function and will issue a warning message. If the last record is the lock record, the control module will start executing the unlocking function. Similarly, when the locking function is activated, the control module first determines whether the last record is the unlock record or the lock record. If the last record is the lock record, the control module will not execute the locking function and will issue a warning message. If the last record is the unlock record, the control module will start executing the locking function.

4. The electronic lock as described in claim 1, wherein, The control device also includes a magnet mounted on the knob and rotated synchronously with it, and a Hall sensor electrically connected to the control module. When the knob is moved to a locked position, it triggers the Hall sensor, causing the Hall sensor to generate a sensing signal. The control module also has a built-in door opening direction determination function. When this function is activated, if the control module determines that the Hall sensor has not generated a sensing signal, it first controls the main gear of the transmission mechanism to rotate in a first clockwise direction. When the rotation information stops changing, it determines that the door is open. If the sensor signal is not received, the control module will activate a first door opening direction setting when it determines that the sensor signal has been received, setting the first clockwise direction as the locking direction and a second clockwise direction opposite to the first clockwise direction as the unlocking direction. If the control module does not receive the sensor signal, it will control the main gear of the transmission mechanism to rotate in the second clockwise direction. When it determines that the rotation information has stopped changing, it will determine whether the sensor signal has been received. If the control module determines that the sensor signal has been received, it will activate a second door opening direction setting when it determines that the second clockwise direction has been received, setting the second clockwise direction as the locking direction and the first clockwise direction as the unlocking direction.

5. The electronic lock as described in claim 4, wherein, The control module also has a built-in initial unlocking function. When either the first door opening direction setting or the second door opening direction setting is activated, the control module will actively execute the initial unlocking function once. When executing the initial unlocking function, the control module will control the main gear of the transmission mechanism to rotate in the corresponding first clockwise direction or second clockwise direction to the driving state, depending on the currently activated first door opening direction setting or second door opening direction setting. When the control module determines that the rotation information meets an initial unlocking condition, it will control the main gear of the transmission mechanism to rotate in the opposite direction to the corresponding second clockwise direction or first clockwise direction to the idle state. When the control module continues to analyze and determine that the rotation information meets an unlocking return condition, it will control the transmission mechanism to stop operating and record an unlocking record.

6. The electronic lock as described in claim 4, wherein, When the control module controls the main gear of the transmission mechanism to rotate in the second clockwise direction, and determines that no sensing signal has been received after the rotation information stops changing, it will issue a warning message.

7. The electronic lock as described in claim 2, wherein, When the control module performs the locking function, it will accumulate one locking failure count if the rotation information does not change to meet the locking condition after a predetermined time. If the number of locking failures is less than n1, it will control the main gear of the transmission mechanism to rotate in the opposite direction to the corresponding first clockwise direction or the second clockwise direction until the rotation information stops changing. Then, it will re-execute the locking function. When the number of locking failures is equal to n1, the control module will issue a locking failure message and control the main gear of the transmission mechanism to rotate in the opposite direction to the corresponding first clockwise direction or the second clockwise direction until the rotation information stops changing. n1 is an integer.

8. The electronic lock as described in claim 2, wherein, When the control module executes the unlocking function, it will accumulate one unlocking failure count if the rotation information does not change to meet the unlocking condition after a predetermined time. If the number of unlocking failures is less than n2, it will control the main gear of the transmission mechanism to rotate in the opposite direction to the corresponding second clockwise direction or the first clockwise direction until the rotation information stops changing. Then, it will re-execute the unlocking function. When the number of unlocking failures is equal to n2, the control module will issue an unlocking failure message and control the main gear of the transmission mechanism to rotate in the opposite direction to the corresponding second clockwise direction or the first clockwise direction until the rotation information stops changing. n2 is an integer.