LED drive circuit and the method in conjunction with mains switch change glow color thereof
Technical field
The present invention relates to technical field of LED illumination, particularly a kind of mains switch that utilizes is to change LED drive circuit and the driving method of LED light device color.
Background technology
LED due to have energy-saving and environmental protection, can the lot of advantages such as light-operated, solidification, long-life, be widely used in various lighting field in the today of advocating low-carbon (LC) life.
In the prior art, the holder structure of LED is generally designed to identical holder structure such as illuminating lamp original in incandescent lamp, electricity-saving lamp etc., LED directly can be replaced original illuminating lamp like this, is not only convenient to install, and does not change the structure of original illuminator.
After but LED directly replaces original illuminating lamp, the dimming function of the LED after replacement cannot play, if carry out light modulation to LED, dimmer must be accessed in addition in original illuminator, which adds the use cost of LED, and also need when mounted LED lamp the installation personnel of specialty that dimmer is installed, install complicated.Further, after directly replacing original illuminating lamp by LED, existing standard machinery Switch Controller LED cannot be utilized to carry out variable color control.
Summary of the invention
Instant invention overcomes above-mentioned the deficiencies in the prior art, provide a kind of without the need to changing current wiring, not needing additional any peripheral dimmer switch or equipment, direct LED drive circuit and the driving method that can be realized light color conversion by common power switch motion.
Technical scheme of the present invention is achieved in that
A kind of LED drive circuit, for driving the LED light device including RGB three kinds of color LED lamp bead, and described LED drive circuit connects AC power and mains switch, LED drive circuit comprises filter unit and rectification unit, described LED drive circuit receives AC power input, obtain direct voltage after unit and rectification unit after filtering, described LED drive circuit also comprises:
Transformer unit, is connected with rectification unit, and transformer unit comprises elementary and secondary;
On off state detecting unit, connection transformer unit, for detecting the operate condition of mains switch;
Color control unit, is connected with the secondary of described transformer unit and on off state detecting unit, and described color control unit receives the switch monitors signal of the action of instruction mains switch, and exports a feedback signal according to described switch monitors signal; And:
Switching tube, is connected with flyback control unit and the elementary of transformer unit respectively, for the elementary break-make of control transformer unit;
Flyback control unit, is connected with the elementary of transformer unit, for receiving the feedback signal from described color control unit, and according to described feedback signal control switch pipe, thus controls to output to the secondary voltage levels of transformer unit;
Voltage detection unit, is connected with color control unit, and for detecting the supply power voltage of color control unit, when described supply power voltage is lower than minium operation voltage value, this voltage detection unit will stop color control unit work, and LED light device is closed simultaneously.
As preferably, described switching tube is field effect transistor, and it comprises grid, drain electrode and source electrode, and described grid is connected with described flyback control unit, and described drain electrode is connected with the elementary of described transformer unit.
As preferably, described LED drive circuit also comprises constant current unit, and this constant current unit is connected between described color control unit and LED light device.The lamp pearl of LED light device always has three tunnels, be respectively red, blue and green, the electric current of this three street lamps pearl is controlled by constant current unit, constant current unit is received pwm signal that color control unit exports and is regulated by the high accuracy that the change of its duty ratio realizes RGB three paths of LEDs lamp pearl electric current, and when the curent change of three street lamp pearls, the brightness of three kinds of colors will be different, mixed by the color relation that goes out can be different, thus realize the effect of multiple color display.
As preferably, the resistance that described constant current unit comprises the first field effect transistor, the second field effect transistor and is connected with the first field effect transistor and the second field effect transistor; Described first field effect transistor and the second field effect transistor are N-type field effect transistor, include grid, drain electrode and source electrode; The grid of described first field effect transistor is connected with the source electrode of the second field effect transistor, the drain electrode of the first field effect transistor is connected with the grid of the second field effect transistor, and the grid of the second field effect transistor is connected color control unit and receives the pwm signal from color control unit with the drain electrode of the first field effect transistor.
As preferably, described on off state detecting unit is connected between the elementary of transformer unit and color control unit.The detection position point of on off state detecting unit is that high-pressure side detects.
As preferably, described on off state detecting unit is connected between the secondary of transformer unit and color control unit.The detection position point of on off state detecting unit is that low-pressure end detects.
As preferably, described LED drive circuit also comprises the light-coupled isolation unit in order to electrical isolation, this light-coupled isolation unit is connected between described flyback control unit and color control unit, described flyback control unit receives described feedback signal from described light-coupled isolation unit, and according to the output voltage of this feedback signal control transformer unit.
As preferably, the primary and secondary of described transformer unit is isolation.Isolation refers to that AC mains electricity input end and final output meet safety requirement, and secondary is safety low-pressure, directly touches the secondary danger that can not produce electric shock.
As preferably, the primary and secondary of described transformer unit is non-isolated state.Non-isolated then AC mains electricity input end and secondary be electrical connection, directly touch the secondary danger that can produce electric shock, separately need add protection.
Changed a driving method for LED light device color by mains switch, comprise the steps:
Step 1: system initialization:
1. system mode is constant color state;
2. high-speed switch counting resets continuously;
3. the color of preserving before reading power-off;
Step 2: on off state detecting unit detects the state of mains switch;
Step 3: if mains switch attonity, continues the state detecting mains switch;
Step 4: if detect that mains switch is closed, then according to the signal of voltage detection unit, color control unit can judge that whether its supply power voltage is lower than minium operation voltage value;
Step 5: if voltage detection unit detects the lower limit of the supply power voltage of color control unit lower than color control unit operating voltage, then LED light device is closed; If not lower than the lower limit of color control unit operating voltage, then return step 2, continue sense switch state;
Step 6: if mains switch is opened, then color control unit judges whether continuous high-speed switch number of times has exceeded the assigned switch number of times completed within the time of setting.Within the time of setting, the assigned switch number of times that completes can be changed according to actual product demand in a program, such as can be defined in 2 seconds that to carry out 2 switch motions be critical point.Under mains switch open mode, close and open meter work No. 1 switch again.
Step 7: if high-speed switch number of times has exceeded the assigned switch number of times completed within the time of setting continuously, then all Parameter reconstruction preset values of system, color is certain default constant color, and operating state is constant color state.In 2 seconds, such as carried out 3 times, 4 times even more times continuous switch motions, namely carry out switch more fast, then all Parameter reconstruction preset values of system, color is certain default constant color, and operating state is constant color state.
Step 8: if high-speed switch number of times does not exceed the assigned switch number of times completed within the time of setting continuously, then the operating state of circuit before judging; Such as in 2 seconds, continuous on-off times only has 1 time, and switch motion is slower; The operating state of circuit before then judging;
Step 9: if the operating state of circuit is constant color state before, then change current state, circulate variable color by current color, then returns the state that step 2 continues to detect mains switch;
Step 10: if the operating state of circuit is circulation color change state before, then change current state, the color that display is preserved, then returns the state that step 2 continues to detect mains switch.
Compared to prior art, the present invention is without the need to changing current wiring, not needing additional any peripheral dimmer switch or equipment, and directly can realize the conversion of LED light device color by common power switch motion on wall, LED light device directly can replace conventional illumination sources, cost is low, easy to use.
Accompanying drawing explanation
Fig. 1 is the structured flowchart of LED drive circuit first embodiment of the present invention;
Fig. 2 is the structured flowchart of LED drive circuit second embodiment of the present invention;
Fig. 3 is the structured flowchart of LED drive circuit of the present invention 3rd embodiment;
Fig. 4 is the structured flowchart of LED drive circuit of the present invention 4th embodiment;
Fig. 5 is the structured flowchart of LED drive circuit of the present invention 5th embodiment;
Fig. 6 is the structured flowchart of LED drive circuit of the present invention 6th embodiment;
Fig. 7 is LED drive circuit working state figure of the present invention;
Fig. 8 is the schematic flow sheet of LED driving method of the present invention.
Embodiment
The specific embodiment of the present invention is as follows:
Fig. 1 is the structured flowchart of LED drive circuit first embodiment of the present invention, as shown in Figure 1, LED drive circuit of the present invention is used for driving LED lighting device, described LED light device comprises the LED lamp bead of RGB three kinds of colors, the actual LED light device glow color seen has to be mixed by these three primary colors and produces, and this LED drive circuit is connected with AC power 1 and common power switch 2, mains switch 2 refers to the switch of ON/OFF conventional in life, wherein, AC power 1 and mains switch 2 are existing structures in the market, LED drive circuit of the present invention comprises filter unit 3, rectification unit 4, transformer unit 5, on off state detecting unit 6, flyback control unit 7, color control unit 8, constant current unit 9, switching tube 10 and voltage detection unit 13.
Described transformer unit 5 comprise with the elementary of the connection of rectification unit 4 and be connected with LED light device secondary.Described flyback control unit 7 is connected between the elementary of transformer unit and color control unit 8.Described on off state detecting unit 6 is connected between the secondary of transformer unit 5 and color control unit 8, switch monitors signal for the action by instruction mains switch 2 inputs to color control unit 8, color control unit 8 according to switch monitors signal export one flow through the electric current of LED light device feed back signal to flyback control unit 7, flyback control unit 7 according to this feedback signal control switch pipe 10, thus controls the voltage levels outputting to transformer unit 5 levels.Voltage detection unit 13, be connected with color control unit 8, for detecting the supply power voltage of color control unit 8, when described supply power voltage is lower than minium operation voltage value, stopping color control unit 8 works by this voltage detection unit 13, and LED light device is closed simultaneously.
Concrete driving process is as follows: LED drive circuit is rectified into direct current signal through rectification unit 4 after first unit 3 carries out filtering after filtering by input ac voltage signal again, and this direct current signal is converted to the voltage be applicable to required for output and provides power supply to flyback control unit 7 and color control unit 8 by transformer unit 5.Flyback control unit 7 passes through the control of switch tube 10 to arrive the stable of output voltage.
In the present embodiment, described switching tube 10 is field effect transistor, comprises grid, drain electrode and source electrode, and the grid of switching tube 10 is connected with described flyback control unit 7, and the drain electrode of switching tube 10 is connected with transformer unit 5 is elementary; The secondary of transformer unit 5 is connected with LED light device, switching tube 10 is field effect transistor, and it is a kind of operating state of high frequency, and frequency is at tens KHz, carry out control switch pipe 10 by flyback control unit 7 to open and shutoff, control energy transferring to transformer secondary and output.The control command of flyback control unit 7 to switching tube 10 combines produced from the elementary voltage recorded of transformer unit 5 and the electric current flowing through switching tube 10 (namely flowing through the voltage that the ohmically electric current that is connected to field effect transistor source electrode produces).
In the present embodiment, LED light device comprises RGB three paths of LEDs lamp pearl.In addition, the secondary of transformer unit 5 is also connected in parallel an electric capacity 11.Because the capacitance of electric capacity 11 is comparatively large, after stopping is for its charging, the release of its electric energy is comparatively slow, when power supply is cut off, can continues as color control unit 8 and power thus.
After powering on for the first time, color control unit 8 resets and lights LED light device according to the color stored in flash memory (color of preserving when the last time turns off the light), the color of LED light device inputs different electric currents to RGB three paths of LEDs lamp pearl by constant current unit 9 respectively, realize the ratio converting RGB brightness separately, thus reach the change of color.
When mains switch 2 action, on off state detecting unit 6 can detect corresponding action and pass to color control unit 8, and color control unit 8 exports corresponding pwm signal according to current operating state (constant color state or circulation color change state).If carry out quick continuous print switch motion, then system can recover preset value (fix certain color and operating state reverts to constant color state).Color control unit 8 is especially by output three road pwm signal to constant current unit 9, and the high accuracy that constant current unit 9 realizes RGB three paths of LEDs lamp pearl electric current by the change in duty cycle of three road PWM controls, thus realizes the display of multiple color.The resistance that described constant current unit 9 comprises the first field effect transistor, the second field effect transistor and is connected with the first field effect transistor and the second field effect transistor; Described first field effect transistor and the second field effect transistor are N-type field effect transistor, include grid, drain electrode and source electrode; The grid of described first field effect transistor is connected with the source electrode of the second field effect transistor, the drain electrode of the first field effect transistor is connected with the grid of the second field effect transistor, and the grid of the second field effect transistor is connected color control unit 8 and receives the pwm signal from color control unit 8 with the drain electrode of the first field effect transistor.
When mains switch 2 is closed, because input power is cut off, LED drive circuit cannot work, LED light device will be closed, but now electric capacity 11 will continue as color control unit 8 and power, so now color control unit 8 will work on, until time the voltage of this electric capacity 11 is lower than a certain limit value, color control unit 8 just can reset.During color control unit 8 continuous firing, after mains switch 2 is opened again, this signal can be passed to color control unit 8 by off state detecting unit 6, color control unit 8 is judged and switches current operating state by the pwm signal changing its output.
Figure 2 shows that the structured flowchart of LED drive circuit second embodiment of the present invention, LED drive circuit shown in Fig. 2 and Fig. 1 similar, difference is only: the LED drive circuit shown in the second embodiment also comprises a light-coupled isolation unit 12, this light-coupled isolation unit 12 is connected between described flyback control unit 7 and color control unit 8, described flyback control unit 7 receives from described light-coupled isolation unit 12 feedback signal that instruction flows through the electric current of LED light device, and according to the output voltage of this feedback signal control transformer unit 5.
Figure 3 shows that the structured flowchart of LED drive circuit of the present invention 3rd embodiment, the LED drive circuit shown in Fig. 3 and Fig. 1 similar, difference be only: the LED drive circuit shown in the 3rd embodiment is by the primary and secondary non-isolated of described transformer unit 5.
Figure 4 shows that the structured flowchart of LED drive circuit of the present invention 4th embodiment, LED drive circuit shown in Fig. 4 and Fig. 3 similar, difference is only: the LED drive circuit shown in the 4th embodiment also comprises a light-coupled isolation unit 12, this light-coupled isolation unit 12 is connected between described flyback control unit 7 and color control unit 8, described flyback control unit 7 receives from described light-coupled isolation unit 12 feedback signal that instruction flows through the electric current of LED light device, and according to the output voltage of this feedback signal control transformer unit 5.
Figure 5 shows that the structured flowchart of LED drive circuit of the present invention 5th embodiment, LED drive circuit shown in Fig. 5 and Fig. 1 similar, difference is only: in the 5th embodiment, described on off state detecting unit 6 is connected between the elementary of transformer unit 5 and color control unit 8.
Figure 6 shows that the structured flowchart of LED drive circuit of the present invention 6th embodiment, LED drive circuit shown in Fig. 6 and Fig. 5 similar, difference is only: the LED drive circuit shown in the 6th embodiment also comprises a light-coupled isolation unit 12, this light-coupled isolation unit 12 is connected between described flyback control unit 7 and color control unit 8, described flyback control unit 7 receives instruction from light-coupled isolation unit 12 and flows through the feedback signal of the electric current of LED light device, and according to the output voltage of this feedback signal control transformer unit 5.
Fig. 7 is LED drive circuit working state figure of the present invention, as shown in Figure 7, concrete switch motion toning process is as follows: power on (apart from last power-off more than more than 2 seconds) for the first time, LED drive circuit operating state is constant color state, and under this state, LED light device is constant color.Opening power again when mains switch 2 power cutoff and in 2 seconds, now drive circuit works state will become as circulation color change state, varying cyclically color gradually by the color of fixing last time, color control unit 8 is not by stopping to change the respective ratio of red-green-blue thus reaching the conversion of color.Under this state when mains switch 2 power cutoff and in 2 seconds again opening power time, color will immobilize, and shown color is flashy color before turning off the light during dynamic change before.
Fig. 8 is the schematic flow sheet of LED driving method of the present invention, and as shown in Figure 8, the process step that the present invention changes LED light device color by mains switch is as follows:
Step 810: system initialization:
(1), system mode is constant color state;
(2), continuous high-speed switch counting resets;
(3) color of preserving before, reading power-off;
Step 811: the state detecting mains switch;
Step 812: if mains switch attonity, continues the state detecting mains switch;
Step 813: if detect that mains switch is closed, then according to the signal of voltage detection unit, color control unit can judge that whether its supply power voltage is lower than minium operation voltage value;
Step 814:; If voltage detection unit detects the lower limit of the supply power voltage of color control unit lower than color control unit operating voltage, then LED light device is closed; If not lower than the lower limit of color control unit operating voltage, then return step 811, continue sense switch state;
Step 815: if mains switch is opened, then color control unit judges whether continuous high-speed switch number of times has exceeded the assigned switch number of times completed within the time of setting.Within the time of setting, the assigned switch number of times that completes can be changed according to actual product demand in a program, such as can be defined in 2 seconds that to carry out 2 switch motions be critical point.Under mains switch open mode, close and open meter work No. 1 switch again.
Step 816: if high-speed switch number of times has exceeded the assigned switch number of times completed within the time of setting continuously, then all Parameter reconstruction preset values of system, color is certain default constant color, and operating state is constant color state.In 2 seconds, such as carried out the continuous switch motion being more than or equal to 3 times, namely carry out switch more fast, then all Parameter reconstruction preset values of system, color is certain default constant color, and operating state is constant color state;
Step 817: if high-speed switch number of times does not exceed the assigned switch number of times completed within the time of setting continuously, then the operating state of circuit before judging; Such as in 2 seconds, continuous on-off times only has 1 time, and switch motion is slower; The operating state of circuit before then judging;
Step 818: if the operating state of circuit is constant color state before, then change current state, circulate variable color by current color, then returns the state that step 811 continues to detect mains switch; The stopping when again carrying out switch motion is also fixed as a kind of color;
Step 819: if the operating state of circuit is circulation color change state before, then change current state, the color that display is preserved, then returns the state that step 811 continues to detect mains switch.
The preferred embodiment of the present invention just sets forth the present invention for helping.Preferred embodiment does not have all details of detailed descriptionthe, does not limit the embodiment that this invention is only described yet.Obviously, according to the content of this specification, can make many modifications and variations.This specification is chosen and is specifically described these embodiments, is to explain principle of the present invention and practical application better, thus makes art technical staff can utilize the present invention well.The present invention is only subject to the restriction of claims and four corner and equivalent.Be only several specific embodiments of the application above, but the application is not limited thereto, the changes that any person skilled in the art can think of, all should drops in the protection range of the application.