CN109743813A - A kind of PWM control RGB lamp realizes the system and method for color transition - Google Patents

A kind of PWM control RGB lamp realizes the system and method for color transition Download PDF

Info

Publication number
CN109743813A
CN109743813A CN201910042145.0A CN201910042145A CN109743813A CN 109743813 A CN109743813 A CN 109743813A CN 201910042145 A CN201910042145 A CN 201910042145A CN 109743813 A CN109743813 A CN 109743813A
Authority
CN
China
Prior art keywords
rgb lamp
chip microcontroller
power supply
switch unit
electrically connected
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910042145.0A
Other languages
Chinese (zh)
Inventor
吴灵焱
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Pinchang Science And Technology Development Co Ltd
Original Assignee
Nanjing Pinchang Science And Technology Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Pinchang Science And Technology Development Co Ltd filed Critical Nanjing Pinchang Science And Technology Development Co Ltd
Priority to CN201910042145.0A priority Critical patent/CN109743813A/en
Publication of CN109743813A publication Critical patent/CN109743813A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B20/00Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
    • Y02B20/30Semiconductor lamps, e.g. solid state lamps [SSL] light emitting diodes [LED] or organic LED [OLED]

Landscapes

  • Circuit Arrangement For Electric Light Sources In General (AREA)

Abstract

The invention discloses the system and methods that a kind of PWM control RGB lamp realizes color transition, wherein, it includes single-chip microcontroller that PWM, which controls the system that RGB lamp realizes color transition, 1ms timer interruption, switch unit, power supply unit, detection unit, RGB lamp, the 1ms timer configuration is on single-chip microcontroller, the signal input port of switch unit is electrically connected with color control I/O port on single-chip microcontroller, power supply unit is electrically connected with switch unit, RGB lamp is electrically connected with power supply unit, opening or closing for single-chip microcontroller control switch unit then controls the bright or dark of RGB lamp, detection unit is electrically connected with switch unit, detection unit will test signal and be sent to single-chip microcontroller, signal is detected after single-chip microcontroller calculates, obtain the working condition of RGB lamp;The light that the headlamp produced using the present invention is issued is to be mixed using the blue three kinds of coloured light of red green according to different ratios, and the effect shown, which can be brought, more enriches true color sensation.

Description

A kind of PWM control RGB lamp realizes the system and method for color transition
Technical field
The present invention relates to consumer electronics, smart home, LED display fields, and in particular to a kind of PWM control RGB lamp realization The circuit and method of color transition.
Background technique
With the increasing living standards of the people, public that the aesthetic conceptions of life are increasingly focused on, the illumination to light Demand is increasingly turned to arbitrarily to control the color of light and intensity, and PWM control RGB lamp is used to realize the scheme of color transition just Well can color to light and intensity control.
Current current life style kind, there are shortcomings for LED light:
(1) color is single, and color is only pure white light or certain color;
(2) the light bar service life is short;
(3) power consumption is high.
And RGB lamp is then to be mixed using the blue three kinds of coloured light of red green according to different ratios, is shown Effect can bring and more enrich true color sensation.The case where according to use environment, different colours can be set Meet consumer demand with intensity, by weaken light colour brightness may be implemented increase LED light service life and Reduce power consumption.
Summary of the invention
To solve the above problems, the present invention provides the circuit and method of a kind of PWM control RGB lamp realization color transition, with Solve the problem in above-mentioned background technique.
The invention discloses the systems that a kind of PWM control RGB lamp realizes color transition, including in single-chip microcontroller, 1ms timer Disconnected, switch unit, power supply unit, detection unit, RGB lamp, the 1ms timer configuration is on single-chip microcontroller, the letter of switch unit Number entrance is electrically connected with color control I/O port on single-chip microcontroller, and power supply unit is electrically connected with switch unit, RGB lamp and power supply unit Electrical connection, opening or closing for single-chip microcontroller control switch unit then control the bright or dark of RGB lamp, and detection unit is electrically connected with switch unit It connects, detection unit will test signal and be sent to single-chip microcontroller, detects signal after single-chip microcontroller calculates, obtains the work shape of RGB lamp State.
As present invention further optimization, the switch unit includes three metal-oxide-semiconductors, the grid difference of three metal-oxide-semiconductors It controls I/O port with three colors of single-chip microcontroller by the resistance of three similar resistances to be electrically connected, the source electrode of three metal-oxide-semiconductors connects altogether Be electrically connected together and with the signal input part of detection unit, be parallel between the grid and source electrode of each metal-oxide-semiconductor one it is identical The drain of the resistance of resistance value, three metal-oxide-semiconductors is electrically connected with power supply unit respectively.
As present invention further optimization, the power supply unit includes 12V power supply and CON4 stand, 12V power supply with The connection of CON4 stand, RGB lamp are connected on CON4 stand, and switch unit is controlled by the connecting and disconnecting of the circuit in control CON4 stand RGB lamp it is bright or dark.
As present invention further optimization, the detection unit includes parallel circuit, a capacitor, two external electricity Parallel resistance described in resistance, 3.3V power supply is made of four resistor coupled in parallel, the signal output of a termination switch unit of parallel circuit End, other end ground connection, two latter termination 3.3V power supplys of external resistance series connection, another signal input connect in parallel circuit On end, between the outer connecting resistance of an end Jie two of capacitor, the other end is grounded, and passes through conducting wire and single-chip microcontroller between two outer connecting resistances The connection of the port MISO.
A kind of method that PWM control RGB lamp realizes color transition, the specific method is as follows:
The timer that a 1ms is configured on single-chip microcontroller interrupts, and single-chip microcontroller executes cyclic program, timer interruption keeping count 255 Secondary is a cycle period, and single-chip microcontroller controls the lasting flashing times of RGB lamp, the lasting flashing time of setting RGB lamp in single-chip microcontroller Number, when the I/O port of single-chip microcontroller exports high level, RGB lamp is bright, conversely, then RGB lamp goes out, reaches when RGB lamp continues flashing times Or when being more than setting value, single-chip microcontroller I/O port exports low level, and single-chip microcontroller continues to run program, until completing a circulating cycle Phase continues next circulation followed by.
As present invention further optimization, when a certain millisecond exports high level, light bar is bright, when a certain millisecond is defeated Out when low level, light bar is gone out, but the time of RGB lamp on/off is very short, and 1ms human eye identifies to come at all, the view based on human eye Feel persists effect, the light that RGB lamp seen by person issues be it is lasting, if permanent High level, color is most bright;If low electricity The flat time is longer, then color can darkness deepens.
As present invention further optimization, the RGB lamp includes three luminescence chips of red, green, blue, each luminescence chip Luminous intensity range in 0-255.
Beneficial effects of the present invention: the light that the headlamp produced using the present invention is issued is to utilize red green blue What three kinds of coloured light were mixed according to different ratios, the effect shown, which can be brought, more enriches true color Impression the case where according to use environment, can be set different colours and intensity to meet consumer demand, pass through and weaken light Colour brightness may be implemented increase LED light service life and reduce power consumption.
Detailed description of the invention
Fig. 1 is circuit diagram of the invention;
Fig. 2 is flow chart of the method for the present invention.
Specific embodiment
Below in conjunction with specific preferred embodiment, the invention will be further described, but not thereby limiting the invention Protection scope.
As shown in Figure 1, a kind of system that PWM control RGB lamp realizes color transition, including in single-chip microcontroller, 1ms timer Disconnected, switch unit, power supply unit, detection unit, RGB lamp, the 1ms timer configuration is on single-chip microcontroller, the letter of switch unit Number entrance is electrically connected with color control I/O port on single-chip microcontroller, and power supply unit is electrically connected with switch unit, RGB lamp and power supply unit Electrical connection, opening or closing for single-chip microcontroller control switch unit then control the bright or dark of RGB lamp, and detection unit is electrically connected with switch unit It connects, detection unit will test signal and be sent to single-chip microcontroller, detects signal after single-chip microcontroller calculates, obtains the work shape of RGB lamp State.
Switch unit includes three metal-oxide-semiconductors, and the grid of three metal-oxide-semiconductors passes through the resistance and monolithic of three similar resistances respectively Three colors control I/O port electrical connection of machine, the source electrode of three metal-oxide-semiconductors are connected together altogether and input with the signal of detection unit End electrical connection is parallel with the resistance of a similar resistance, the drain point of three metal-oxide-semiconductors between the grid and source electrode of each metal-oxide-semiconductor It is not electrically connected with power supply unit.
Refering to what is shown in Fig. 1, further, the grid of M1 passes through the port RED1 of resistance R2 connection single-chip microcontroller, the grid of M2 By the port BLUE1 of resistance R4 connection single-chip microcontroller, the grid of M3 passes through the port GREEN1 of resistance R6 connection single-chip microcontroller, and three The model AO3400 of metal-oxide-semiconductor.
Power supply unit includes 12V power supply and CON4 stand, and 12V power supply is connect with a contact pin of CON4 stand, RGB lamp Four stitch are connected on four contact pins of CON4 stand, and the drain of three metal-oxide-semiconductors is connect with three contact pins on CON4 stand, In the present invention, metal-oxide-semiconductor is as electrical switch element, when RED1, BLUE1, GREEN1 one-chip machine port export high level, AO3400 Conducting, then 12V is for electric energy normal through when RED1, BLUE1, GREEN1 one-chip machine port export low level, AO3400 is closed It closes, then when 12V power supply is unable to normal use, RED1, BLUE1, GREEN1 one-chip machine port while input high level, RGB lamp hair The high level situation of white light out, adjustment RED1, BLUE1, GREEN1 one-chip machine port can control the luminescent color of RGB lamp, example Such as, BLUE1, GREEN1 one-chip machine port export low level, and RED1 one-chip machine port exports high level, then RGB lamp issues red Light.
Detection unit includes parallel circuit, and a capacitor, two outer connecting resistances, 3.3V power supply, the parallel resistance is by four A resistor coupled in parallel is constituted, the signal output end of a termination switch unit of parallel circuit, other end ground connection, two external resistance strings Join latter termination 3.3V power supply, another to connect on the signal input part of parallel circuit, the external electricity of an end Jie two of capacitor Between resistance, the other end is grounded, and is connect by conducting wire with the port single-chip microcontroller MISO between two outer connecting resistances, more specifically, such as Fig. 1 Shown, when light bar works normally, R75, R76, R20, R21 have electric current to pass through, then the voltage that MISO one-chip machine port detects Value maintains a higher level;When light bar open circuit, sampling resistor R75 no current passes through, and MISO monolithic generator terminal detects Voltage value be then fixed as 1.65V, the program in single-chip microcontroller can judge the work shape of RGB lamp by judging sampled value State, so that RGB lamp is repaired and replaced in time.
A kind of method that PWM control RGB lamp realizes color transition, the specific method is as follows: configuring a 1ms's on single-chip microcontroller Timer interrupts, and single-chip microcontroller executes cyclic program, and timer interruption keeping count 255 times are a cycle period, single-chip microcontroller control The lasting flashing times of RGB lamp processed, the lasting flashing times of the interior setting RGB lamp of single-chip microcontroller, the high electricity of I/O port output of single-chip microcontroller Usually, RGB lamp is bright, conversely, then RGB lamp goes out, when RGB lamp, which continues flashing times, meets or exceeds setting number, single-chip microcontroller IO Port exports low level, and RGB lamp goes out, and single-chip microcontroller continues to run program, until a cycle period is completed, followed by, under continuing One circulation.
Refering to what is shown in Fig. 2, more specifically, control program is stored in single-chip microcontroller, the operational process of program is as follows: setting is just Initial value N=0 runs N+1 program later, and threshold value 255 is compared in setting in program, and light intensity is written into program by interface microcontroller Setting value (CurSetValue), judges the numerical values recited of N+1 and 255, and as N+1 >=255, program returns to N=0, as N+1 < When 255, the numerical values recited of N and CurSetValue are judged, as N < CurSetValue, the color of single-chip microcontroller controls I/O port Low level is exported, waits and goes out, as N >=CurSetValue, single-chip microcontroller color controls I/O port and exports high level, and lamp is bright, single-chip microcontroller After color controls I/O port output signal, timer interruption is delayed 1ms, and program returns to N+1 step after 1ms, continue on State operation.
In order to better understand the present invention, following to provide the code for realizing function of the present invention:
In the present embodiment, when a certain millisecond exports high level, light bar is bright, when a certain millisecond exports low level, light bar It goes out, but the time of RGB lamp on/off is very short, 1ms human eye identifies to come at all, the persistence of vision effect based on human eye, human eye The light that the RGB lamp seen issues is continuously if that, permanent High level, color is most bright;If the low level time is longer, Color can darkness deepens.
RGB lamp includes three luminescence chips of red, green, blue, by the high/low ratio of control single chip computer IO output level, is come The display intensity of three kinds of primary colours of RGB lamp is controlled, the combination of R, G, B varying strength color can form different colors, every kind of face The luminous intensity range of color has 255 in 0-255, entire RGB lamps and lanterns3Kind of color, i.e., 16777216 kinds, for example, when R=255, G= 255, when B=255, RGB lamp issues most bright white light, and as R=255, G=000, B=000, RGB lamp issues most bright feux rouges.
The light that the headlamp produced using the present invention is issued is using the blue three kinds of coloured light of red green according to difference Ratio mix, the effect shown can be brought more enriches true color sensation, according to using ring The case where border, different colours and intensity can be set to meet consumer demand, the colour brightness by weakening light can be with It realizes the service life for increasing LED light and reduces power consumption.
Although the present invention has been indicated and described referring to specific preferred embodiment, shall not be construed as to the present invention The limitation of itself without prejudice to the spirit and scope of the invention as defined in the appended claims can be to it in device shape Various combination variations are made in formula, in material, in details.

Claims (7)

1. the system that a kind of PWM control RGB lamp realizes color transition, which is characterized in that including single-chip microcontroller, 1ms timer interruption, Switch unit, power supply unit, detection unit, RGB lamp, on single-chip microcontroller, the signal of switch unit enters the 1ms timer configuration Mouth is electrically connected with color control I/O port on single-chip microcontroller, and power supply unit is electrically connected with switch unit, and RGB lamp is electrically connected with power supply unit It connecing, opening or closing for single-chip microcontroller control switch unit then controls the bright or dark of RGB lamp, and detection unit is electrically connected with switch unit, Detection unit will test signal and be sent to single-chip microcontroller, detects signal after single-chip microcontroller calculates, obtains the working condition of RGB lamp.
2. the system that a kind of PWM control RGB lamp according to claim 1 realizes color transition, which is characterized in that described to open Closing unit includes three metal-oxide-semiconductors, and the grid of three metal-oxide-semiconductors passes through the resistance of three similar resistances and three face of single-chip microcontroller respectively The electrical connection of color control I/O port, the source electrode of three metal-oxide-semiconductors are connected together altogether and are electrically connected with the signal input part of detection unit, often Be parallel with the resistance of a similar resistance between the grid and source electrode of a metal-oxide-semiconductor, the drain of three metal-oxide-semiconductors respectively with power supply unit Electrical connection.
3. the system that a kind of PWM control RGB lamp according to claim 2 realizes color transition, which is characterized in that the electricity Source unit includes 12V power supply and CON4 stand, and 12V power supply is connect with CON4 stand, and RGB lamp is connected on CON4 stand, switch Unit controls the bright or dark of RGB lamp by the connecting and disconnecting of the circuit in control CON4 stand.
4. the system that a kind of PWM control RGB lamp according to claim 2 realizes color transition, which is characterized in that the inspection Surveying unit includes parallel circuit, and a capacitor, two outer connecting resistances, parallel resistance described in 3.3V power supply are by four resistor coupled in parallel structures At, the signal output end of a termination switch unit of parallel circuit, other end ground connection, two latter terminations of external resistance series connection 3.3V power supply, it is another to connect on the signal input part of parallel circuit, it is another between the outer connecting resistance of an end Jie two of capacitor End is grounded, and is connect by conducting wire with the port single-chip microcontroller MISO between two outer connecting resistances.
5. a kind of method that PWM control RGB lamp realizes color transition, which is characterized in that the specific method is as follows: configuring on single-chip microcontroller The timer of one 1ms interrupts, and single-chip microcontroller executes cyclic program, and timer interruption keeping count 255 times are a cycle period, Single-chip microcontroller controls the lasting flashing times of RGB lamp, the lasting flashing times of setting RGB lamp, the I/O port of single-chip microcontroller in single-chip microcontroller When exporting high level, RGB lamp is bright, conversely, then RGB lamp goes out, when RGB lamp, which continues flashing times, meets or exceeds setting number, Single-chip microcontroller I/O port exports low level, and RGB lamp goes out, and single-chip microcontroller continues to run program, until completing a cycle period, in addition Afterwards, continue next circulation.
6. the method that a kind of PWM control RGB lamp according to claim 5 realizes color transition, which is characterized in that when a certain When millisecond output high level, light bar is bright, and when a certain millisecond exports low level, light bar is gone out, but the time of RGB lamp on/off Very short, 1ms human eye identifies to come at all, the persistence of vision effect based on human eye, and the light that RGB lamp seen by person issues is to connect Continuous, if permanent High level, color is most bright;If the low level time is longer, color can darkness deepens.
7. the system that a kind of PWM control RGB lamp according to claim 1 realizes color transition, which is characterized in that described RGB lamp includes three luminescence chips of red, green, blue, and the luminous intensity scope control of each luminescence chip is in 0-255.
CN201910042145.0A 2019-01-17 2019-01-17 A kind of PWM control RGB lamp realizes the system and method for color transition Pending CN109743813A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910042145.0A CN109743813A (en) 2019-01-17 2019-01-17 A kind of PWM control RGB lamp realizes the system and method for color transition

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910042145.0A CN109743813A (en) 2019-01-17 2019-01-17 A kind of PWM control RGB lamp realizes the system and method for color transition

Publications (1)

Publication Number Publication Date
CN109743813A true CN109743813A (en) 2019-05-10

Family

ID=66365143

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910042145.0A Pending CN109743813A (en) 2019-01-17 2019-01-17 A kind of PWM control RGB lamp realizes the system and method for color transition

Country Status (1)

Country Link
CN (1) CN109743813A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111521223A (en) * 2020-06-02 2020-08-11 天津维创微智能科技有限公司 Automatic detection system and method
CN111800916A (en) * 2020-06-24 2020-10-20 苏州浪潮智能科技有限公司 System and method for calibrating colors of port lamps of data center switch

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1874634A (en) * 2006-06-09 2006-12-06 姚荣湘 Controllable LED illuminator, and method for controlling luminescence
CN201220626Y (en) * 2008-04-28 2009-04-15 上海晨阑光电器件有限公司 PWM type lighteness adjustable module group for LED automobile tail lamp
CN102869157A (en) * 2012-09-06 2013-01-09 安顺市安银科技有限公司 Method for setting color of LED (light-emitting diode) lamp by on-off encoding of power supply switch
CN204362361U (en) * 2014-12-17 2015-05-27 天津翔宇润达科技有限公司 A kind of LED plant growth lamp
CN106132002A (en) * 2016-06-27 2016-11-16 佛山市毅丰电器实业有限公司 Control LED color color-mixture device and method thereof
WO2017100793A1 (en) * 2015-12-10 2017-06-15 Osram Sylvania Inc. A multi string controller with independent current setting for each string

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1874634A (en) * 2006-06-09 2006-12-06 姚荣湘 Controllable LED illuminator, and method for controlling luminescence
CN201220626Y (en) * 2008-04-28 2009-04-15 上海晨阑光电器件有限公司 PWM type lighteness adjustable module group for LED automobile tail lamp
CN102869157A (en) * 2012-09-06 2013-01-09 安顺市安银科技有限公司 Method for setting color of LED (light-emitting diode) lamp by on-off encoding of power supply switch
CN204362361U (en) * 2014-12-17 2015-05-27 天津翔宇润达科技有限公司 A kind of LED plant growth lamp
WO2017100793A1 (en) * 2015-12-10 2017-06-15 Osram Sylvania Inc. A multi string controller with independent current setting for each string
CN106132002A (en) * 2016-06-27 2016-11-16 佛山市毅丰电器实业有限公司 Control LED color color-mixture device and method thereof

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111521223A (en) * 2020-06-02 2020-08-11 天津维创微智能科技有限公司 Automatic detection system and method
CN111800916A (en) * 2020-06-24 2020-10-20 苏州浪潮智能科技有限公司 System and method for calibrating colors of port lamps of data center switch

Similar Documents

Publication Publication Date Title
CN109640459B (en) Switch color temperature adjusting control circuit based on LED illumination linear driving condition
CN205017658U (en) Mixing of colors temperature of adjusting luminance LED lamp
CN109743813A (en) A kind of PWM control RGB lamp realizes the system and method for color transition
CN206993459U (en) Switch toning control circuit, chip and switch toning LED drive system
CN212992655U (en) Switch segmentation dimming and color mixing control circuit and LED lighting device
CN107135579B (en) A kind of Width funtion LED lamp drive circuit of tunable optical
CN103363431B (en) Full-color adjusting method of LED lamp and full-color LED lamp
CN209627758U (en) A kind of LED control circuit of compatible light modulation color-temperature regulating
CN209593838U (en) It is a kind of based on infrared RGB light bar controller and attaching plug
CN215773647U (en) Light and color adjusting circuit, driving device and lamp
CN207652742U (en) A kind of light modulator with intelligent dimming and hand-operating light
CN109699105A (en) A kind of LED filament circuit for lamp of remote-controlled light modulation
CN110035586A (en) It is a kind of to realize the color circuit and its implementation of color-temperature regulating toning suitable for high efficiency
CN202818739U (en) Non-stroboflash energy-saving light control circuit for illuminating lamp
CN209218430U (en) RGBW driving circuit
CN204398735U (en) Automatic induction LED dynamic stereograph
CN106231729B (en) A kind of LED illumination effect handover control system
US10455673B1 (en) Light string with a non-extinguishing function and an independent LED blinking function
CN208210370U (en) A kind of two I/O ports control the circuit of two-way bicolored light
CN207070400U (en) A kind of Width funtion LED lamp drive circuit with emergency function
CN218998334U (en) High-voltage lamp string controller
CN207460541U (en) The driving circuit of Bluetooth remote control LED light and Bluetooth remote control LED light
CN109219188A (en) A kind of RGBW driving circuit
CN213880348U (en) Wireless TV controller
CN208634831U (en) A kind of light bar and luminescence component

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190510