Knob coding switch and intelligent dimming method
Technical Field
The invention relates to the technical field of LED light sources, in particular to a knob coding switch and an adjusting method thereof.
Background
The LED has the characteristics of energy conservation, environmental protection, long service life, small volume and the like, is very wide in application, and people hope to adjust the brightness of the light source in the use process, so that the electric energy is saved, the waste is reduced, the LED lamp is prevented from working in an overload state for a long time, and the running efficiency and the service life of the LED are improved.
Currently, some LED lamps or LED light sources in the market have dimming functions, and dimming modes thereof include:
(1) And the silicon controlled rectifier is used for dimming. The mode considers that the silicon controlled rectifier power supply generated by the silicon controlled rectifier dimmer of the original old incandescent lamp is not changed, the efficiency of the LED power supply is low, 1-100% dimming cannot be realized, the dimming is started to be large from small to large each time, no memory exists, and the efficiency of the power supply and the manual dimming time are wasted each time.
(2) And (5) dimming by a remote control switch. The mode needs to install a driver matched with the remote controller on the lamp, and dimming cannot be realized once the remote controller is not provided, so that the cost is high.
(3) And controlling a circuit dimming mode based on the integrated IC. In this way, although no additional equipment is needed, the device needs to be continuously turned on and off for multiple times within a set time (generally 0-2 seconds), and has no memory function, and the device needs to be repeatedly set before each use, so that the device is troublesome to use and has poor user experience.
(4) The dimming of 0-10v/1-10v requires additional dimmer and 4 wires of additional stay wires, has high cost, and adjusts the required dimming brightness from the minimum power or the maximum power from off every time the dimmer is used;
(5) Resistance dimming requires an external potentiometer and cannot control multiple lamps one;
therefore, how to solve various problems of the conventional LED dimming method and design a dimming method with simpler operation is an important issue for those skilled in the art.
Disclosure of Invention
Aiming at various problems of the existing dimming mode, the invention provides a knob coding switch and an intelligent dimming method, wherein the switch is combined with a programmable controller through a resistance change circuit, the working power P is stored at any time, the power is used according to the last time when the switch is opened, the working power P is gradually increased or reduced with certain preset precision by rotating clockwise and anticlockwise, when the dimming difference is large, the dimming precision changes within a range of 10% when a user rotates rapidly, and when the dimming brightness is close to that of dimming, the dimming precision changes within a range of 1% when the knob rotates slowly, so that more accurate brightness output is realized; meanwhile, the user presses the switch to keep for more than 3 seconds, the system senses that the user needs to turn off the lamp at regular time, and the user turns off the lamp after leaving the switch for a period of time, so that the adjustment and the use are simpler and more practical.
The technical scheme adopted by the invention for solving the technical problems is as follows: a rotary encoder switch, comprising: a resistance change circuit; outputting a varying resistance; the programmable controller comprises a logic unit, a storage unit and a clock unit, and is used for receiving the change rule and the change rate of the resistance, outputting PWM signals and converting the PWM signals into working power P; the logic unit judges the change rule of the resistance; the storage unit stores real-time working power P; the clock unit records the change time of the resistor and corresponds to the change precision of the real-time working power P of the storage unit.
Wherein, the preferable scheme is as follows: the resistance change circuit outputs the change values of a fixed value resistor R3, a resistor R2, a resistor R1, a zero resistor, a resistor R3-R2-R3-R2-R3 …, a resistor R3-R1-R3-R1-R3 … and the like, and the change values are judged and compiled into the on/off states of the corresponding switch and the increase or decrease of the working power P through the programmable controller.
Wherein, the preferable scheme is as follows: the resistance change circuit is connected with the rotary button, and the on/off and clockwise/anticlockwise rotation of the rotary button is corresponding to the fixed value, zero and resistance output by the resistance change circuit to be gradually increased or decreased and change according to a certain rule.
Wherein, the preferable scheme is as follows: the change precision of the working power P stored in the storage unit can be freely set and judged by the programmable controller through the rotation speed of the switch button.
Wherein, the preferable scheme is as follows: the change precision changes with 0.1% -1% precision when the rotating speed rotates slowly; the accuracy of the rotation varies from 5% to 10% when it is fast.
Wherein, the preferable scheme is as follows: the resistance change circuit comprises an encoder, the encoder comprises a node A, B, C, D, E, wherein the node A is connected with a first resistor R1, the node C is connected with a second resistor R2, the first resistor R1 and the second resistor R2 are connected in series, the node E is connected with a third resistor R3, the node B and the node D are grounded, the button is rotated clockwise, the output resistor of the resistance change circuit is changed from the resistance value of R3 to the resistance value of R2, and R3-R2-R3-R2-R3 …; the button switch is rotated anticlockwise, the output resistance of the resistance change circuit is changed from the R3 resistance value to the R1 resistance value, and the R3-R1-R3-R1-R3 …; if the press is released, the output resistance of the resistance change circuit is directly changed from the R3 resistance value to 0k ohm, and R3-0-R3; pressing for more than 3 seconds, and R3-0 (more than 3 seconds) -R3, so as to realize the timing turn-off of the lamp.
The invention also comprises an intelligent dimming method of the intelligent rotary switch, which is characterized by comprising the following steps: s101, adjusting the real-time working power P of a light source according to the changed resistance; s102a, outputting variable working power according to a change rule of the resistor; s103, after receiving the switching signal of closing by the user, the working power P1 is saved, and the next time the working power P1 is opened, the working power P1 is output.
Wherein, the preferable scheme is as follows: the method further comprises the step of S102b of recording the change rate of the resistor, and corresponding to the change precision of the real-time working power P according to the recorded change time.
Wherein, the preferable scheme is as follows: the varying resistance may output a fixed value, zero, gradually increasing or decreasing.
Wherein, the preferable scheme is as follows: the change accuracy of the working power can be customized according to the speed of the resistance change.
The invention has the advantages that: the switch is combined with a programmable controller through a resistance change circuit, the working power P is stored at any time, the working power P is used according to the last power when the switch is turned on each time, the working power P is gradually increased or reduced with certain preset precision by rotating clockwise and anticlockwise, when the dimming distance is large, the dimming precision changes within the range of 5% -10% when a user rotates rapidly, and when the dimming brightness is close to that of the user, the dimming precision changes within the range of 0.1% -1% by slowly rotating a knob, so that more accurate brightness output is realized; pressing down for more than 3 seconds, the system perceives that the user needs to turn off the lamp at regular time, and the user turns off the lamp after leaving the switch for a period of time, so that the adjustment and the use are simpler and more practical.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a schematic diagram of a rotary encoder switch of the present invention;
Fig. 2 is a schematic diagram of a first embodiment of a resistance change circuit 11 according to the present invention;
FIG. 3 is a flow chart of a method of adjusting a rotary encoder switch of the present invention;
fig. 4 is a flowchart of a first embodiment of the method of adjusting a rotary encoder switch of the present invention.
Detailed Description
The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only some embodiments of the present invention, not all the implementation modes. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The invention relates to a freely adjustable rotary coding switch, which is shown in fig. 2: the rotary switch 10 includes: a resistance change circuit 11, wherein the resistance change circuit 11 can output a fixed value, zero, and gradually increases or decreases resistance; a programmable controller 12 for receiving the rate of change and the rate of change of the resistance, outputting a PWM signal, and converting the PWM signal into operating power P;
Wherein the programmable controller 12 includes a logic unit 120 for judging a change rule of the resistance; a storage unit 121 is used for storing the operating power P selected by the switch in real time to light the LED light source, and a clock unit 122 is used for recording the time used for the changing process of the resistor R3-R2-R3-R2 … or R3-R1-R3-R1 …, which corresponds to the changing precision of the operating power P of the storage unit 121.
The output fixed resistance value and the zero value of the resistance change circuit 11 are directly output to the programmable controller 12 through voltage change, and the programmable controller 12 outputs a switching signal.
Fig. 2 is a first embodiment of the resistance change circuit 11, as shown in fig. 2: the resistance change circuit 11 includes an encoder 111, where the encoder 111 includes a node A, B, C, D, E, where the node a is connected to a first resistor R1, the node C is connected to a second resistor R2, the first resistor R1 and the second resistor R2 are connected in series, the node E is connected to a third resistor R3, and the node B and the node D are grounded, for example, the resistor of R1 is 10k ohms; the resistance of R2 is 5.1K ohms and the resistance of R3 is 20K ohms. The circuit realizes: node DE outputs 0k ohms; node E outputs 20k ohms; the node AB outputs 10K ohms, the node BC outputs 5.1K ohms, the button is rotated clockwise, the output resistance of the resistance change circuit 11 is changed from 20K ohms to 10K ohms, the button switch is rotated anticlockwise, the output resistance of the resistance change circuit 11 is changed from 20K ohms to 5.1K ohms, if the button switch is released by pressing, the output resistance of the resistance change circuit 11 is directly changed from 20K ohms to 0K ohms, the button switch is pressed to keep the output of more than 3 seconds to the MCU for 0 ohms for 3 seconds, the MCU judges that the input of more than 0 ohms is carried out for 3 seconds, the lamp signal is turned off to the power supply unit signal after 5 minutes, and then the lamp is turned off.
The speed of the output resistance of the resistance change circuit 11 from 20K ohms to 10K ohms is recorded by the clock unit 122 of the programmable controller 12, and the change time corresponds to the set precision, and the change precision in the embodiment is +/-1% and is quickly converted into +/-10%; in addition, the variation accuracy can be +/-0.5%, and the variation accuracy can be quickly converted into +/-5%.
The resistance change circuit 11 is connected with the programmable controller 12 through two lines, the resistance change circuit 11 can increase a group of resistances, and the resistance change circuit is connected with the programmable controller 12 through three lines to realize the change output of 2 groups of resistances, and likewise, the change output of a plurality of groups of resistances can be increased, which is not exhaustive here.
The resistance change circuit 11 in this embodiment is not limited to the circuit structure thereof, and can be changed in various ways only by satisfying the requirement of rotating the button clockwise, the output resistance of the resistance change circuit 11 is changed from the R3 resistance value to the R2 resistance value, the button switch is rotated counterclockwise, the output resistance of the resistance change circuit 11 is changed from the R3 resistance value to the R1 resistance value, if the button switch is released by pressing, the output resistance of the resistance change circuit 11 is directly changed from the R3 resistance value to 0 ohm, the button switch is pressed to maintain for 3 seconds or more and output for 0 ohm for 3 seconds to the programmable controller 12, and the programmable controller 12 determines that the 0 ohm signal is input for 3 seconds or more, then the lamp signal is turned off to the power supply unit signal after 5 minutes, and then the lamp is turned off.
As shown in fig. 3: the invention also provides an intelligent dimming method of the knob coding switch, which comprises the following steps: s101, pressing a switch, and outputting the last stored working power P; s102a, rotating the coding switch, and outputting variable working power according to different change rules of the resistor; s103, storing the working power P1 after receiving a switching signal closed by a user, and outputting according to the P1 after opening next time; and S102b, recording the change time of the resistor, and corresponding to the change precision of the real-time working power P according to the change rate.
Illustrating a method of adjusting the switch 20, as shown in fig. 4: pressing down the rotary switch 10, firstly working according to the last stored working power P1, and if the rotary switch 10 is loosened within 3 seconds (can be set in a self-defining way) after being pressed down, turning off the switch 10; if the switch is released after being pressed for more than 3 seconds, the switch 10 is closed after being timed for 5 minutes; if the rotary switch 10 is rotated clockwise, the output operating power P is slowly rotated with +1% accuracy or is rapidly rotated with +10% accuracy; if the rotary switch 10 is rotated counterclockwise, the output operating power P is slowly rotated with-1% accuracy or rapidly rotated with-10% accuracy to be reduced, and the determined output operating power P2 is adjusted and stored to complete a dimming process.
The switch of the invention is combined with the programmable controller 12 through the resistance change circuit 11, the working power P is stored at any time, the switch is rotated anticlockwise to realize the gradual increase or decrease of the working power P according to the last power use when being opened, and the working power P is output in the range of 1-100% of dimming precision, so that a user obtains the required light brightness and automatically memorizes and stores the light brightness. The LED dimming method breaks through the technical bottleneck of the brightness adjusting range, greatly improves the practicability and convenience of the dimming method, and has the outstanding substantial advantage that the adjustment is simpler and more practical.
The foregoing description of the preferred embodiments of the invention is not intended to limit the scope of the invention, but rather is intended to cover all modifications and variations within the scope of the present invention as defined in the appended claims.