Control method based on Hall switch and lamp

By detecting the duration of the magnetic signal on the Hall switch and judging the source of interference, the problem of the Hall switch malfunctioning or drifting under the interference of external magnets is solved, and the stabilization switch and shifting functions of the lamp are realized.

CN119449001APending Publication Date: 2025-02-14POWER ON TOOLS CO LTD XIAMEN CITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411438913.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The Hall switch is prone to malfunction or drifting under the interference of external magnets, resulting in abnormal lighting switches or shifts.

Method used

By detecting the duration of the magnetic signal on the Hall switch, if it is shorter than the preset first time threshold (such as 300ms), it will remain in the initial state; if the duration is greater than the first time threshold, it is determined whether only one Hall switch is in action If so, the corresponding action will be performed, otherwise it is judged that there is external magnetic field interference and the current state will be maintained.

Benefits of technology

It effectively avoids interference with the Hall switch by external magnetic signals, prevents malfunction or drift, and ensures the stable switch and shifting functions of the lamp.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119449001A_ABST
    Figure CN119449001A_ABST
Patent Text Reader

Abstract

The invention provides a control method based on a Hall switch and a lamp, and the method comprises the steps: judging the input duration of a magnetic signal, and maintaining an initial state if the magnetic signal is a transient external magnetic signal; if the magnetic signal is an internal magnetic signal or a continuous external magnetic signal, obtaining the current state values of all Hall switches, further judging whether only one Hall switch is in an action state value, if so, executing the action, otherwise, further continuously detecting whether the magnetic signal leaves, and if not, keeping the initial state; if the magnetic signal is detected to leave, further detecting whether only one Hall switch is in an action state value, and if so, executing the action; otherwise, the continuous detection of magnetic signal leaving is continued. According to the method, the problem of abnormal switching or gear shifting of an electronic product caused by misoperation or drifting due to interference of an external magnetic signal on the Hall switch can be effectively avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a control method and a lamp based on a Hall switch. Background Art

[0002] Mechanical switches are commonly used gear adjustment switches in electronic products. However, existing sliding mechanical switches, whether they are single switches or assembled into the overall structure of electronic products, are difficult to meet waterproof requirements.

[0003] Taking lamps as an example, existing lamps can be turned on and off and adjusted in multiple gears through sliding mechanical switches; sliding mechanical switches need to be connected to the control components inside the lamp through the travel groove on the lamp body, and then by pushing the knob with the moving contact to slide, the moving contact piece is connected from one set of static contact pieces to another set of static contact pieces to realize circuit switching, so the inside of the lamp is connected to the outside world, and the sliding mechanical switch itself is not waterproof, so the overall lamp body structure is not waterproof or does not meet the waterproof requirements. However, the Hall switch converts the magnetic signal into an electrical signal through the contactless induction of a magnet and multiple Hall sensors to realize the gear adjustment function of the lamp, solving the waterproof problem of the existing sliding mechanical switch.

[0004] Generally speaking, the Hall switch assembly includes a sliding switch with a magnet and a switch plate corresponding to the sliding switch. The switch plate is provided with multiple Hall switches. When the sliding switch slides, the magnet triggers different Hall switches. The Hall switches send out electrical signals to switch the lamp on and off or switch different lighting gears. However, the Hall switch converts the magnetic signal into an electrical signal. When there is an external magnet close to the lamp in the external environment, it will interfere with the Hall switch, causing malfunction or drift, and causing the lamp to turn on abnormally. Summary of the invention

[0005] In view of this, an object of the present invention is to provide a control method and a lamp based on a Hall switch to solve the above problems.

[0006] The present invention adopts the following scheme:

[0007] The present application provides a control method based on a Hall switch, comprising the following steps:

[0008] Acquire the initial state value of each Hall switch; the state value includes an action state value and a non-action state value;

[0009] Detecting the magnetic signal acting on each Hall switch and obtaining the duration of the magnetic signal on each Hall switch;

[0010] Maintaining the state value of the Hall switch whose duration of the magnetic signal is not greater than a preset first time threshold value, and switching the state value of the Hall switch whose duration of the magnetic signal is greater than the first time threshold value;

[0011] The current state values ​​of all Hall switches are obtained; if only one of the Hall switches has an action state value, the action corresponding to the Hall switch is executed; otherwise, it is determined that there is external magnetic field interference and the current state is maintained.

[0012] Furthermore, it also includes: when it is determined that the external magnetic field interference disappears, after reaching a set second time threshold, obtaining the state values ​​of all Hall switches, and performing corresponding actions according to the state values ​​of all Hall switches.

[0013] Furthermore, when only one magnetic signal acting on all the Hall switches is detected, it is determined that the external magnetic field interference disappears.

[0014] Furthermore, the second time threshold is greater than the first time threshold.

[0015] Furthermore, the first time threshold is set to 300ms, and the second time threshold is set to 1S.

[0016] Furthermore, the number of the Hall switches is at least three.

[0017] Furthermore, when the magnetic signal acts on the Hall switch, the state value of the Hall switch is an action state value.

[0018] Furthermore, the initial state is off, and the Hall switch includes a first Hall switch, a second Hall switch and a third Hall switch; when the magnetic signal acts on the third Hall switch, it is off, and when it acts on the first or second Hall switch, it is on.

[0019] The present invention also provides a lamp, which includes a Hall switch component and a processor, wherein the Hall switch component includes a sliding switch with a magnet and a switch board corresponding to the sliding switch, and a plurality of Hall switches are arranged on the switch board, and the Hall switch is electrically connected to the processor; and the processor is configured to execute the control method.

[0020] Furthermore, the lamp body of the lamp comprises a plastic inner shell and a metal outer shell sleeved on the plastic inner shell; the metal outer shell is an extruded aluminum shell.

[0021] Furthermore, a storage bin and a removable cover body are provided on the storage bin; a groove is provided between the four sides of the storage bin and the outer wall, and a sealing ring is provided on the groove; and a protruding rib corresponding to the groove is provided on the inner side of the cover body.

[0022] Furthermore, the switch plate is arranged on one side of the accommodating compartment, and the Hall switch on the switch plate is arranged toward the outside, and a sliding switch is correspondingly arranged on the outside of the accommodating compartment, and the magnet on the sliding switch is placed on the side close to the Hall switch.

[0023] Furthermore, sliding grooves for the sliding switch to slide are arranged on the outer wall of the accommodating bin and the outer wall of the cover body; a plurality of gear grooves are arranged on the outer wall of the accommodating bin and / or the outer wall of the cover body at intervals along the sliding reverse direction of the sliding switch; and the sliding switch is provided with a gear card point which is adapted to the gear groove and has elasticity.

[0024] By adopting the above technical solution, the present invention can achieve the following technical effects:

[0025] The present invention provides a control method based on Hall switch, which judges the duration of magnetic signal input. If it is a short external magnetic signal, the initial state is maintained; if it is an internal magnetic signal or a continuous external magnetic signal, the current state value of all Hall switches is obtained, and further judges whether only one Hall switch is in the action state value. If so, the action is performed, otherwise, further continuous detection is performed to see whether there is a magnetic signal leaving, and if no magnetic signal leaves, the initial state is maintained; if it is detected that a magnetic signal leaves, further detection is performed to see whether only one Hall switch is in the action state value, and if so, the action is performed; otherwise, continuous detection of the magnetic signal leaving is continued. This method can effectively avoid the external magnetic signal from interfering with the Hall switch to cause malfunction or drift, which may cause abnormal switching or shifting of electronic products. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0027] Figure 1 is a flow chart of a control method based on a Hall switch according to an embodiment of the present invention;

[0028] Figure 2 is a Hall switch state value table of a lamp according to an embodiment of the present invention;

[0029] Figure 3 is a flow chart of a specific embodiment of a control method based on a Hall switch according to an embodiment of the present invention;

[0030] Figure 4 is a schematic structural diagram of a lamp according to an embodiment of the present invention;

[0031] Figure 5 is a schematic diagram of the exploded structure of a lamp according to an embodiment of the present invention;

[0032] Figure 6 It is a schematic diagram of the front structure of a plastic inner shell of a lamp according to an embodiment of the present invention;

[0033] Figure 7 It is a schematic structural diagram of a plastic inner shell of a lamp according to an embodiment of the present invention;

[0034] Figure 8 It is a schematic diagram of a cover structure of a lamp according to an embodiment of the present invention;

[0035] Fig. 9 This is a schematic diagram of the structure of a lamp without a metal shell according to an embodiment of the present invention;

[0036] Fig.10 It is a structural schematic diagram of a sliding switch of a lamp with a magnet according to an embodiment of the present invention;

[0037] Fig.11 It is a schematic diagram of the side structure of a lamp without a metal shell according to an embodiment of the present invention;

[0038] Icons: plastic inner shell 1, metal outer shell 2, accommodating compartment 3, cover body 4, groove 5, sealing ring 6, first rib 7, second rib 8, battery cover 9, sliding switch 10, lamp holder 11, clamping part 12, switch plate 13, Hall switch 14, push button 15, slider 16, boss 17, magnet 18, sliding part 19, elastic arm 20, gear position card point 21, gear position groove 22, sliding groove 23. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the scope of protection of the present invention. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the invention claimed for protection, but merely represents the selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the scope of protection of the present invention.

[0040] Example

[0041] Combination Figure 1 As shown, this embodiment provides a control method based on a Hall switch, which can be applied to an electronic device (such as a lamp) having a Hall switch and is executed by a processor of the electronic device to implement the following steps:

[0042] S101: Acquire the initial state value of each Hall switch; the state value includes an action state value and a non-action state value.

[0043] In this embodiment, the processor of the electronic device is electrically connected to each Hall switch and is capable of obtaining the state value of each Hall switch. The state value of the Hall switch includes an action state value and a non-action state value. When the magnetic signal acts on the Hall switch, the state value of the Hall switch is an action state value, and when the magnetic signal does not act on the Hall switch, the state value of the Hall switch is a non-action state value.

[0044] Take a lamp with three gears as an example, that is, it includes a first Hall switch, a second Hall switch and a third Hall switch, which are used to control the first gear, the second gear and off of the lamp lighting respectively. Specifically, in this embodiment, when the state value (RA) of the Hall switch is 0, it is an action state, and when the state value (RA) is 1, it is a non-action state. Figure 2 As shown in the table, when the state value (RA1) of the first Hall switch is 1, the state value (RA2) of the second Hall switch is 1, and the state value (RA3) of the third Hall switch is 0, the lamp is in the initial state (RA1=1, RA2=1, RA3=0), and the lamp lighting is turned off. When the state value of the first Hall switch is 0, the state value of the second Hall switch is 1, and the state value of the third Hall switch is 1, the lamp is in the first level lighting state (RA1=0, RA2=1, RA3=1); when the state value of the first Hall switch is 1, the state value of the second Hall switch is 0, and the state value of the third Hall switch is 1, the lamp is in the second level lighting state (RA1=0, RA2=1, RA3=0).

[0045] Of course, in other embodiments, the lamp may have only two states, on and off, that is, when the state value (RA1) of the first Hall switch is 1, the state value (RA2) of the second Hall switch is 1, and the state value (RA3) of the third Hall switch is 0, the lamp is in the off state (RA1=1, RA2=1, RA3=0); and when the state value (RA1) of the first Hall switch is 0, the state value (RA2) of the second Hall switch is 1, and the state value (RA3) of the third Hall switch is 1, or the state value (RA1) of the first Hall switch is 1, the state value (RA2) of the second Hall switch is 0, and the state value (RA3) of the third Hall switch is 1, the lamp is in the on state (RA1=0, RA2=1, RA3=1 or RA1=1, RA2=0, RA3=1).

[0046] S102: Detect the magnetic signal acting on each Hall switch, and obtain the duration of the magnetic signal on each Hall switch.

[0047] S103: Maintain the state value of the Hall switch whose duration of the magnetic signal is not greater than a preset first time threshold, and switch the state value of the Hall switch whose duration of the magnetic signal is greater than the first time threshold.

[0048] S104: Obtain the current state values ​​of all Hall switches; if only one of the Hall switches has an action state value, execute the action corresponding to the Hall switch; otherwise, determine that there is external magnetic field interference and maintain the current state.

[0049] In this embodiment, the sources of magnetic signals can be roughly divided into two types. One is generated by the sliding switch with a magnet corresponding to the Hall switch. This magnetic signal only acts on one Hall switch at a time and is relatively stable. The other is generated by an external magnetic interference source. The magnetic signal generated by the external magnetic interference source may be short-lived or continuous. In addition, it may be applied to multiple Hall switches at the same time, so it is necessary to filter the external magnetic field interference.

[0050] First, this embodiment determines the duration of the magnetic signal input. If the magnetic signal is not greater than the preset first time threshold, it means that the magnetic signal is a short-term external magnetic field interference and should be filtered. That is, under the action of this magnetic signal, although the Hall switch senses the magnetic signal, the processor will keep the state value of the Hall switch unchanged. For example, a Hall switch senses a magnetic signal, and its state value changes from 1 to 0, but changes back to 1 within the first time threshold. After processing, the processor still keeps the state value of the Hall switch as 1, and does not process the matter of 0.

[0051] In this embodiment, the first time threshold here can be set to 300ms, for example, which is an empirical value, and is the shortest reaction time required for a normal person to push the slide switch. Once it is lower than this shortest reaction time, it is considered that the magnetic signal is not generated by the user operating the slide switch.

[0052] In this embodiment, if the duration of the magnetic signal input is greater than the first time threshold, it means that the generation of the magnetic signal may be generated by a sliding switch with a magnet or by continuous external magnetic field interference. At this time, considering that normally there should be only one Hall switch in the action state value without interference, this embodiment further determines whether there is external magnetic field interference by determining whether there is only one Hall switch in the action state value, that is, if only one Hall switch has an action state value, it is considered that the magnetic signal is generated by the magnet on the sliding switch, and the action corresponding to the Hall switch is performed, such as turning off the lamp or switching the lighting state of the lamp. Otherwise, it is determined that there is external magnetic field interference, and the current initial state value is maintained.

[0053] Thereafter, when it is determined that the external magnetic field interference disappears, after reaching the set second time threshold, the state values ​​of all the Hall switches are obtained, and corresponding actions are performed according to the state values ​​of all the Hall switches.

[0054] In this embodiment, after determining that there is a continuous external magnetic field interference, all operations on the lamp will be temporarily regarded as invalid operations. However, after the external magnetic field interference, the user's operations need to be restored.

[0055] Specifically, when only one magnetic signal is detected acting on all the Hall switches, it is determined that the external magnetic field interference disappears. Then, after judging that the external magnetic field interference disappears and reaches a set second time threshold, the processor obtains the state values ​​of all the Hall switches again and performs corresponding actions according to the state values ​​of all the Hall switches.

[0056] This can effectively prevent external magnetic signals from interfering with the Hall switch and causing malfunction or drift, which could result in abnormal switching or shifting of electronic products.

[0057] To facilitate understanding of the present invention, the application of the present invention is described below with a practical example, wherein the practical example still takes a lamp with three gears as an example, but the use scenario of the present invention is not limited thereto.

[0058] Specific work process, such as Figure 3 As shown:

[0059] Take the initial state of the light-off state (ie, RA1=1, RA2=1, RA3=0) as an example.

[0060] When a magnet approaches, it is determined whether the magnetic signal input by the magnet lasts for the first set time threshold, such as 300ms; that is, it is detected whether the duration of the change of the state value of each Hall switch is greater than the first time threshold 300ms. If not, the initial light-off state is maintained, which means that the external magnetic field interference flashes by the lamp. If it is greater, the next step of judgment is carried out.

[0061] Obtain the state value of each Hall switch, and determine whether only the first Hall switch or the second Hall switch is in the action state (i.e., the state value RA=0). If only one of the Hall switches is in the action state, perform the action. Specifically, the state value of the first Hall sensor or the second Hall sensor changes from 1 to 0, and the state value of the third Hall sensor changes from 0 to 1, i.e., RA1=0, RA2=1, RA3=1, or RA1=1, RA2=0, RA3=1. At this time, the lamp is in the light-on state, i.e., the first gear lighting or the second gear lighting is turned on. This situation represents the normal state of pushing the lamp switch to switch the lamp.

[0062] If more than one of the Hall switches is in the action state, that is, the state values ​​of two or three of the Hall switches may be 0, which means that there is external magnetic field interference in the external environment near the lamp. At this time, the initial light-off state is maintained and the next step is carried out.

[0063] Continue to detect whether a magnetic signal leaves, that is, detect whether the state value of each Hall switch changes; if the magnetic signal is not detected to leave, that is, the state value of each Hall switch does not change, then continue to maintain the initial light-off state; if the magnetic signal is detected to leave, then the Hall state value will change, and proceed to the next step.

[0064] Detect whether only one of the Hall switches is in an action state, and determine whether the action state lasts for a set second time threshold, such as 1S. If the action state lasts for the set second time threshold, execute the action. Otherwise, execute the previous step to continue to detect whether the external magnetic field interference has left.

[0065] When the lamp is in the on state and there is magnetic input, the above steps are repeated to continue to determine whether the signal is an external magnetic signal or a magnetic signal on the lamp switch, and then determine whether to perform an action.

[0066] Among them, the first time threshold and the second time threshold can be set according to actual usage and external environment conditions, which will not be elaborated in detail here.

[0067] The second embodiment of the present invention further provides a lamp based on a Hall switch, such as Figures 4 to 11As shown, it includes a Hall switch component and a processor, wherein the Hall switch component includes a sliding switch 10 with a magnet 18 and a switch board 13 corresponding to the sliding switch 10, and a plurality of Hall switches 14 are arranged on the switch board 13, and the Hall switches 14 are electrically connected to the processor; the processor is configured to execute the steps in the control method.

[0068] Specifically, in this embodiment, Figure 5 As shown, the lamp body of the lamp includes a plastic inner shell 1 and a metal outer shell 2 sleeved on the plastic inner shell 1; the metal outer shell 2 is an extruded aluminum shell. The plastic inner shell 1 is injection molded with plastics such as PA6 and ABS; the extruded aluminum shell has the characteristics of thin and uniform thickness, and is sleeved on the plastic inner shell 1, so that users have a good metal grip feeling, and at the same time can reduce the weight of the product, and users will not feel uncomfortable when using it for a long time. At the same time, the process of combining the inner and outer shells is simple, the cost is low, and the production cost of the product can be effectively reduced.

[0069] In this embodiment, if Figures 5 to 8 As shown, the plastic inner shell 1 is provided with a storage bin 3 for installing various electronic components, and a cover body 4 which is detachably covered on the storage bin 3; a groove 5 is provided between the periphery of the storage bin 3 and the outer wall, and a sealing ring 6 is provided on the groove 5; a protruding first rib 7 is provided at the bottom of the groove 5; and a protruding second rib 8 corresponding to the groove 5 is provided on the inner side of the cover body 4. The cover body 4 is installed on the storage bin 3 by bolts, and specifically, a screw hole is provided on the storage bin 3, and the screw hole is connected with the groove 5; the sealing ring 6 has a screw hole sealing part surrounding the screw hole, and the screw hole sealing part is provided with a through hole corresponding to the screw hole for the bolt to pass through. The screw hole end surface on the cover body 4 is also provided with a protruding rib. When the cover body 4 is connected to the storage bin 3 by bolts, the protruding rib can better compact the sealing ring 6 to achieve the requirement of waterproof sealing. The two ends of the plastic shell are provided with a battery compartment with an end surface opening and a lamp holder 11 mounting compartment. The battery is detachably mounted in the battery compartment. The end surface opening of the battery compartment is detachably connected with a battery cover 9 for fixing the battery. The lamp holder 11 is mounted on the lamp body mounting compartment. The battery cover 9 is also provided with an elastic clamp 12 for convenient carrying by users.

[0070] In this embodiment, if Figure 5 and Fig. 9 and Fig.10As shown, a switch plate 13 is provided on one side of the storage compartment 3, and a plurality of Hall switches 14 are provided on the switch plate 13, and a corresponding sliding switch 10 is provided on the outer side of the storage compartment 3; a magnet 18 is provided on the sliding switch 10 for triggering the Hall switch 14. Specifically, a sliding groove 23 for the sliding switch 10 to slide is provided on the outer side wall of the storage compartment 3 and the outer side wall of the cover body 4. The sliding switch 10 includes a slider 16, and a push button 15 for the user to push is provided on the outer side of the slider 16; a boss 17 is provided on the inner side of the slider 16, and a mounting groove is provided on the boss 17, and a magnet 18 is fixed to the mounting groove; sliding parts 19 are provided on both sides of the boss 17, which can slide in the sliding groove 23.

[0071] Preferably, if Fig.10 and Fig.11 As shown, the inner shell is placed on the outer wall of the accommodating bin 3 and the outer wall of the cover body 4, and three gear grooves 22 are arranged at intervals along the sliding direction of the sliding switch 10; the front end of the boss 17 is provided with an elastic arm 20 extending forward, and the front end of the elastic arm 20 is provided with a gear card point 21; the gear card point 21 is adapted to the gear groove 22, and when the gear card point 21 moves to the position of each gear groove 22, the magnet 18 moves to the position of one of the Hall switches 14; when the sliding switch 10 is switched, the gear card point 21 falls into the gear groove 22, so as to realize clear gear switching.

[0072] The lamp adopts a Hall switch 14, and the Hall switch 14 is installed in the plastic housing, and the sliding switch 10 is arranged outside the plastic housing to realize contactless shifting; the housing is waterproofed as a whole through a sealing ring 6. At the same time, the control method is used to effectively avoid the external magnetic signal from interfering with the Hall switch 14 to cause malfunction or drift, thereby causing the lamp body to turn on abnormally.

[0073] The above are only preferred implementations of the present invention. The protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention.

[0074] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.

[0075] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0076] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0077] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may include that the first and second features are in direct contact, or may include that the first and second features are not in direct contact but are in contact through another feature between them. Moreover, a first feature being "above", "above" and "above" a second feature includes that the first feature is directly above and obliquely above the second feature, or simply indicates that the first feature is higher in level than the second feature. A first feature being "below", "below" and "below" a second feature includes that the first feature is directly below and obliquely below the second feature, or simply indicates that the first feature is lower in level than the second feature.

Claims

1. A control method based on Hall switch, characterized in that: The following steps are involved: Acquire the initial state value of each Hall switch; the state value includes an action state value and a non-action state value; Detecting the magnetic signal acting on each Hall switch and obtaining the duration of the magnetic signal on each Hall switch; Maintaining the state value of the Hall switch whose duration of the magnetic signal is not greater than a preset first time threshold value, and switching the state value of the Hall switch whose duration of the magnetic signal is greater than the first time threshold value; The current state values ​​of all Hall switches are obtained; if only one of the Hall switches has an action state value, the action corresponding to the Hall switch is executed; otherwise, it is determined that there is external magnetic field interference and the current state is maintained.

2. The control method based on the Hall switch according to claim 1 is characterized in that: Also includes: When it is determined that the external magnetic field interference disappears, after reaching the set second time threshold, the state values ​​of all the Hall switches are obtained, and corresponding actions are performed according to the state values ​​of all the Hall switches.

3. The control method based on the Hall switch according to claim 2 is characterized in that: When only one magnetic signal acting on all the Hall switches is detected, it is determined that the external magnetic field interference disappears.

4. The control method based on the Hall switch according to claim 2 is characterized in that: The second time threshold is greater than the first time threshold.

5. The control method based on Hall switch according to claim 3 is characterized in that: The first time threshold is set to 300ms, and the second time threshold is set to 1S.

6. The control method based on the Hall switch according to claim 3 is characterized in that: The number of the Hall switches is at least three.

7. The control method based on the Hall switch according to claim 6 is characterized in that: When the magnetic signal acts on the Hall switch, the state value of the Hall switch is an action state value.

8. The control method based on the Hall switch according to claim 7 is characterized in that: The initial state is off, and the Hall switch includes a first Hall switch, a second Hall switch and a third Hall switch; when the magnetic signal acts on the third Hall switch, it is off, and when it acts on the first or second Hall switch, it is on.

9. A lamp, comprising a Hall switch assembly and a processor, wherein the Hall switch assembly comprises a sliding switch with a magnet and a switch plate corresponding to the sliding switch, wherein a plurality of Hall switches are arranged on the switch plate, and the Hall switch is electrically connected to the processor; characterized in that: The processor is configured to execute the control method according to any one of claims 1-8.

10. The lamp according to claim 9, characterized in that: The lamp body of the lamp comprises a plastic inner shell and a metal outer shell sleeved on the plastic inner shell; the metal outer shell is an extruded aluminum shell.

11. The lamp according to claim 10, characterized in that: The plastic inner shell is provided with a storage bin and a cover body which is detachably covered on the storage bin; a groove is provided between the four sides of the storage bin and the outer wall, and a sealing ring is provided on the groove; and a protruding rib corresponding to the groove is provided on the inner side of the cover body.

12. The lamp according to claim 11, characterized in that: The switch plate is arranged at one side of the accommodating chamber, and the Hall switch on the switch plate is arranged toward the outside, and a sliding switch is correspondingly arranged on the outside of the accommodating chamber, and the magnet on the sliding switch is placed on a side close to the Hall switch.

13. The lamp according to claim 12, characterized in that: Sliding grooves for the sliding switch to slide are arranged on the outer wall of the accommodating bin and the outer wall of the cover body; a plurality of gear grooves are arranged on the outer wall of the accommodating bin and / or the outer wall of the cover body at intervals along the sliding reverse direction of the sliding switch; and the sliding switch is provided with a gear clamping point that is adapted to the gear groove and has elasticity.