Light effect control method, control equipment and lamp
By sampling the circuit state in the music effect lamp and controlling the PWM signal, the problem of monotonous lighting effects in the prior art is solved, rich color and brightness changes are achieved, and the fun of the lighting effects is improved.
Patent Information
- Application Number
- CN202411934136.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-12-25
AI Technical Summary
The lighting effects of existing music effect lamps are too monotonous and lack rich color changes and brightness adjustments.
By sampling the frequency division state of the oscillator circuit in the lamp, the number of flips and the time of the comparator circuit, the output state, frequency and duty cycle of the PWM signal are controlled, thereby realizing the color change and brightness adjustment of red, green and blue light.
It realizes the change in lighting color, brightness and continuity, and enhances the fun and richness of the lighting effects.
Smart Images

Figure CN119521487A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of lighting technology, and in particular to a lighting effect control method, a control device and a lamp. Background Art
[0002] Some lights can produce different lighting effects as external signals change, such as lights that change with music. Usually, these lights will output fast light emitting diode (LED) signals when external signals change suddenly, or output slow LED signals when external signals are flat or absent. However, this lighting effect is too monotonous. Summary of the invention
[0003] Embodiments of the present application provide a lighting effect control method, a control device, and a lamp.
[0004] In the first aspect, an embodiment of the present application provides a lighting effect control method, the method comprising: sampling the frequency division state of an oscillation circuit in a lamp, the number of flipping times of a comparator circuit, and the flipping time of a comparator circuit within a certain period of time, the comparator circuit being used to compare an external signal voltage with a normal voltage, the comparator circuit flipping when the external signal voltage is greater than the normal voltage, the external signal voltage being the voltage of an external signal collected by a sensor in the lamp after being amplified by an amplifier circuit; controlling the output of a pulse width modulation (PWM) signal in the lamp according to the sampling result, the PWM signal being used to drive the red light, green light, and blue light emitted by the lamp, the output state of the PWM signal being determined according to the frequency division state, the output frequency of the PWM signal being determined according to the flipping times, and the output duty cycle of the PWM signal being determined according to the flipping time.
[0005] Optionally, the output of the PWM signal includes an output in a signal stage and an output in a no-signal stage, the comparator circuit flips at least once in the signal stage, and the comparator circuit does not flip in the no-signal stage, and controlling the output of the PWM signal in the lamp includes: controlling the output of the PWM signal in the signal stage.
[0006] Optionally, controlling the output of the PWM signal in the lamp further includes: controlling the output of the PWM signal within a period of time starting from the no-signal phase.
[0007] Optionally, the frequency division state is the frequency division state of the oscillation circuit in a no-signal stage.
[0008] Optionally, the output frequency of the PWM signal is proportional to the number of flipping times of the comparator.
[0009] Optionally, the output duty cycle of the PWM signal is proportional to the flipping time of the comparator.
[0010] Optionally, the output duty cycle of the PWM signal is 100% when the flip time of the comparator is greater than the first threshold.
[0011] Optionally, the external signal is a sound wave signal or a light signal.
[0012] In a second aspect, an embodiment of the present application provides a lighting effect control device, the device comprising:
[0013] The sampling module is used to sample the frequency division state of the oscillation circuit in the lamp, the number of flipping times of the comparator circuit, and the flipping time of the comparator circuit within a certain period of time. The comparator circuit is used to compare the external signal voltage with the normal voltage. The comparator circuit flips when the external signal voltage is greater than the normal voltage. The external signal voltage is the voltage of the external signal collected by the sensor in the lamp after being amplified by the amplifier circuit;
[0014] The control module is used to control the output of the pulse width modulation (PWM) signal in the lamp according to the sampling result. The PWM signal is used to drive the red light, green light and blue light emitted by the lamp. The output state of the PWM signal is determined according to the frequency division state, the output frequency of the PWM signal is determined according to the number of flipping times, and the output duty cycle of the PWM signal is determined according to the flipping time.
[0015] Optionally, the output of the PWM signal includes an output in a signal stage and an output in a no-signal stage. The comparator circuit flips at least once in the signal stage, and the comparator circuit does not flip in the no-signal stage. The control module is used to control the output of the PWM signal in the signal stage.
[0016] Optionally, the control module is further configured to control the output of the PWM signal within a period of time starting from the no-signal phase.
[0017] Optionally, the frequency division state is the frequency division state of the oscillation circuit in a no-signal stage.
[0018] Optionally, the output frequency of the PWM signal is proportional to the number of flipping times of the comparator.
[0019] Optionally, the output duty cycle of the PWM signal is proportional to the flipping time of the comparator.
[0020] Optionally, the output duty cycle of the PWM signal is 100% when the flip time of the comparator is greater than the first threshold.
[0021] Optionally, the external signal is a sound wave signal or a light signal.
[0022] In a third aspect, an embodiment of the present application provides a lamp, the lighting effect of the lamp is controlled by a method as described in any one of the methods in the first aspect.
[0023] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising at least one processor coupled to at least one memory, wherein the at least one memory can be used to store computer programs or instructions, and when the computer programs or instructions are executed by the at least one processor, the electronic device implements any method as described in the first aspect above.
[0024] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method as described in any one of the above-mentioned first aspects.
[0025] In a sixth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes any one of the methods described in the first aspect above.
[0026] In the lighting effect control method of the present application, the output state of the PWM signal is controlled according to the frequency division state of the oscillator circuit in the lamp, so that the red light, green light and blue light emitted by the lamp can be changed, thereby realizing the change of the light color. At the same time, the output frequency and output duty cycle of the PWM are controlled according to the flip number and flip time of the comparator circuit in the lamp, so that the brightness and continuity of the light emitted by the lamp can change with the sudden change of the external signal. Based on the changes in light color, light brightness and continuity, richer lighting effects can be achieved, which increases the fun of the lighting effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for describing the embodiments are briefly introduced below.
[0028] Figure 1 This is a schematic diagram of the internal structure of a traditional music effect lamp.
[0029] Figure 2 This is a schematic diagram of the internal circuit of a traditional music effect lamp.
[0030] Figure 3 It is a flowchart of the lighting effect control method provided in an embodiment of the present application.
[0031] Figure 4 It is a schematic diagram of the frequency division state of the oscillation circuit provided in an embodiment of the present application.
[0032] Figure 5 Schematic diagram of the waveform of the PWM signal provided in the embodiment of the present application.
[0033] Figure 6 It is a schematic diagram of the internal structure of the music effect lamp provided in an embodiment of the present application.
[0034] Figure 7 It is a structural schematic diagram of a lighting effect control device provided in an embodiment of the present application.
[0035] Figure 8 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] The technical solution of the embodiment of the present application will be described below in conjunction with the drawings in the embodiment of the present application.
[0037] Some lights can produce different lighting effects as external signals change, such as lights that change with music. Usually, these lights will output fast LED signals as external signals change suddenly, or output slow LED signals when external signals are flat or absent. However, this lighting effect is too monotonous.
[0038] The following takes a light that changes with music (hereinafter referred to as a music effect light) as an example to introduce the above problem in detail.
[0039] The internal structure of the traditional music effect lamp can be Figure 1 As shown, its internal circuit can be Figure 2 As shown, VDD represents the power supply voltage, 104 represents a 100nf capacitor, MIC represents a MIC sound sensor, GND represents ground, R represents red (red, R), G represents green (green, G), B represents blue (blue, B), and RLED, GLED, and BLED represent LEDs that emit red light, green light, and blue light, respectively.
[0040] Music effect lights are evolved from voice-controlled LED lights. The key to voice-controlled LED lights is the microphone (MIC) sound sensor, which has a built-in capacitive electret microphone that is sensitive to sound. External sound waves can make the electret film in the microphone vibrate, causing the capacitance to change, and generate a small voltage that changes accordingly. The voice-controlled LED light collects external sound waves through the MIC sound sensor and converts them into voltage signals, which are then amplified to V by the amplifier circuit. MIC , and then through the comparator to V MIC Compare with the normal stable voltage.
[0041] When the external sound wave changes suddenly, the MIC sound sensor generates a sudden voltage. If V MIC If the voltage is greater than the normal stable voltage, the comparator flips, samples the external sound wave signal, and generates a certain regular LED signal. If there is no sound wave or the sound wave is gentle, the MIC sound sensor will not generate or generate a very small sudden voltage, V MIC No change or little change, VMIC It is not greater than the normal stable voltage, the comparator does not flip, no external sound wave signal is sampled, and the voice-controlled LED light does not generate an LED signal.
[0042] The music effect light also collects external music through the MIC sound sensor and converts it into a voltage signal, which is then amplified to V by the internal amplifier circuit. MIC and through the comparator V MIC Compared with the built-in normal voltage. When the external music suddenly changes, the MIC sound sensor generates a sudden voltage. If V MIC If the voltage is greater than the built-in stable voltage, the comparator flips and samples the external music signal, and the music effect light generates a certain regular fast LED change signal. If there is no music or the music is slow, the MIC sound sensor will not generate or generate a very small sudden voltage, V MIC No change or little change, V MIC It is not greater than the built-in normal voltage, the comparator does not flip, no external music signal is sampled, and the music effect light does not generate an LED signal or generates a flat LED signal. In addition, the red-green-blue (RGB) constant current output of the music effect light makes the light color consistent within a certain voltage range. However, this lighting effect is too monotonous, with only fixed fast-frequency LED and slow-frequency LED changes. If multiple music effect light chips are used at the same time, the performance will be more obvious.
[0043] Based on this, Figure 3 It is shown that an embodiment of the present application provides a lighting effect control method, which can be used to control the lighting effect of a lamp.
[0044] like Figure 3 As shown, the method may include steps S310-S320.
[0045] In step S310, the frequency division state of the oscillator circuit in the lamp, the number of flipping times of the comparator circuit, and the flipping time of the comparator circuit within a certain period of time are sampled. The length of the certain period of time is not limited, for example, the certain period of time can be 10 milliseconds (ms). The oscillator circuit and the comparator circuit are circuit elements in the chip of the lamp.
[0046] The oscillator circuit is a circuit element in the chip of the lamp. The oscillator circuit is a circuit that generates a sinusoidal output voltage by self-oscillation without an external input signal. Frequency division is the process of converting a higher frequency signal into a lower frequency signal. When the signal is divided, the frequency is reduced, while the signal still maintains its original form (waveform). The frequency of the signal after frequency division is a fraction of the original frequency. For example, dividing by two can reduce the original frequency to half, and the period is doubled accordingly.
[0047] For example, the states after the oscillation circuit is divided by 1, 2, 4, and 8, respectively, can be as follows: Figure 4 As shown. Figure 4 For the sampling point in , the frequency division state of the oscillation circuit is 0000.
[0048] The comparator circuit is also a circuit element in the chip of the lamp. The comparator circuit can be used to compare the external signal voltage with the normal voltage. The comparator circuit flips when the external signal voltage is greater than the normal voltage. The external signal voltage is the voltage of the external signal collected by the sensor in the lamp after being amplified by the amplifier circuit. Optionally, the external signal is a sound wave signal or a light signal.
[0049] Taking the external signal as a sound wave signal as an example, usually when there is no sound wave signal or the sound wave signal is flat, the comparator circuit will not flip. However, when the external sound wave signal changes suddenly, the comparator circuit will flip. According to the number of flips of the comparator circuit within a certain period of time, the number of times the external sound wave signal suddenly changes can be determined. According to the flip time of the comparator circuit within a certain period of time, the duration of the sudden change of the external sound wave signal can be determined. Therefore, the number of flips and flip time of the comparator circuit can reflect the changes of the external signal.
[0050] When the comparator circuit flips, the comparator circuit will output a level greater than a certain threshold. Therefore, the number of flips of the comparator circuit within a certain period of time can be determined by the number of times the level output by the comparator circuit is greater than the threshold, and the flip time of the comparator circuit within a certain period of time can be determined by the total time that the level output by the comparator circuit is greater than the threshold.
[0051] In step S320, the output of a pulse width modulation (PWM) signal in the lamp is controlled according to the sampling result. The output state of the PWM signal can be determined according to the frequency division state of the oscillation circuit, the output frequency of the PWM signal can be determined according to the number of flipping times of the comparator circuit, and the output duty cycle of the PWM signal can be determined according to the flipping time of the comparator circuit.
[0052] The PWM signal can be used to drive the red light, green light and blue light emitted by the lamp. Optionally, the PWM signal can include three signals, and the three signals are used to control the red light, green light and blue light respectively. Optionally, the light emitting element of the lamp can be an LED.
[0053] The output state of the PWM signal can determine whether the lamp emits red, green, or blue light. Taking three PWM signals as an example, if the output state of the PWM signal is 010, the lamp emits green light. If the output state of the PWM signal is 011, the lamp emits both green and blue light. Therefore, the output state of the PWM signal is different, and the color of the light emitted by the lamp is different.
[0054] like Figure 5 As shown in the figure, the PWM signal consists of a periodic square wave with a fixed frequency and a rectangular pulse with a variable duty cycle. The high level of the square wave represents the signal "1", and the low level represents the signal "0". One cycle consists of a high level and a low level. The width of the rectangular pulse represents the duration of the high level, and the duty cycle is determined by the proportion of the duration of the high level to the entire cycle. The frequency of the PWM signal refers to the number of times the PWM signal changes from high level to low level and then back to high level within 1 second, that is, how many cycles the PWM signal has in one second.
[0055] The brightness of a lamp is proportional to the current intensity passing through its light-emitting element. The PWM signal can accurately control the current intensity passing through the light-emitting element, thereby achieving precise control of the brightness of the light. During the high level period of the PWM signal, the light-emitting element is powered and the brightness increases; during the low level period of the PWM signal, the light-emitting element is powered off and the brightness decreases. By adjusting the proportion of the high level to the entire cycle, that is, the output duty cycle of the PWM, the brightness of the light-emitting element can be adjusted and controlled.
[0056] The output frequency of the PWM signal also has a certain impact on the lighting effect. When the output frequency of the PWM signal is low (such as a few hundred hertz (Hz) or less), the human eye may perceive the flickering or jittering of the light. This is because the PWM signal switches between on and off at a slow frequency, allowing the human eye to capture this change. As the output frequency of the PWM signal increases, the flickering phenomenon perceived by the human eye will gradually weaken. When the frequency reaches a high enough level (such as between a few hundred Hz and a few thousand Hz), the human eye is usually unable to perceive the flicker, and the lighting effect will appear to be more stable and continuous.
[0057] By determining the output state of the PWM signal according to the frequency division state of the oscillation circuit, the output states of different PWM signals can be different, and the lamp can be randomly emitted from one or more of red, green and blue lights to achieve the change of light color. Taking the three-way PWM that controls red, green and blue light as an example, when the output state of the three-way PWM is 010, the light is only green. When the output state of the three-way PWM is 110, the light is composed of red and green light.
[0058] There is no limitation on how to determine the output state of the PWM signal according to the frequency division state of the oscillation circuit, and it can be determined according to specific needs. Figure 4 Take the frequency division state of the oscillation circuit and three-way PWM as an example. Figure 4 The frequency division state obtained by sampling the sampling points shown is 0000, so the output state of the three-way PWM can be 100, that is, the light is only red.
[0059] By determining the output frequency of the PWM signal according to the number of flips of the comparator circuit, the output frequency of the PWM signal can be changed as the number of mutations of the external signal changes. The more the comparator circuit flips, the more mutations of the external signal occur, that is, the more frequently the external signal changes. Conversely, the fewer the comparator circuit flips, the fewer mutations of the external signal occur, that is, the less frequently the external signal changes.
[0060] Since the output frequency of the PWM signal is different, the continuity of the light perceived by the human eye is different. Therefore, by changing the output frequency of the PWM signal with the number of times the external signal changes suddenly, the continuity of the light can be changed in response to the change of the external signal.
[0061] By determining the output duty cycle of the PWM signal according to the flip time of the comparator circuit, the output duty cycle of the PWM signal can be changed as the duration of the sudden change of the external signal changes. The longer the flip time of the comparator circuit, the longer the duration of the sudden change of the external signal. Conversely, the shorter the flip time of the comparator circuit, the shorter the duration of the sudden change of the external signal.
[0062] Since the output duty cycle of the PWM signal is different, the brightness of the light is different. Therefore, the output duty cycle of the PWM signal is changed as the duration of the sudden change of the external signal changes, so that the brightness of the light can respond to the change of the external signal.
[0063] In the lighting effect control method of the present application, the output state of the PWM signal is controlled according to the frequency division state of the oscillator circuit in the lamp, so that the red light, green light and blue light emitted by the lamp can be changed, thereby realizing the change of the light color. At the same time, the output frequency and output duty cycle of the PWM are controlled according to the flip number and flip time of the comparator circuit in the lamp, so that the brightness and continuity of the light emitted by the lamp can change with the sudden change of the external signal. Based on the changes in light color, light brightness and continuity, richer lighting effects can be achieved, which increases the fun of the lighting effects.
[0064] Optionally, the output of the PWM signal includes an output in a signal stage and an output in a no-signal stage, the comparator circuit flips at least once in the signal stage, and the comparator circuit does not flip in the no-signal stage. Controlling the output of the PWM signal in the lamp in step S320 may include: controlling the output of the PWM signal in the signal stage.
[0065] In the signal stage, the comparator circuit flips at least once, indicating that the external signal has at least one mutation, that is, the stage when the external signal has a mutation is the signal stage. In the no-signal stage, the comparator circuit does not flip, indicating that the external signal has not a mutation, that is, the stage when the external signal has no mutation is the no-signal stage.
[0066] Take the case where the external signal is a sound wave signal. When there is no sound wave or the sound wave is gentle, the comparator circuit will not flip, so when there is no sound wave or the sound wave is gentle, it is a no-signal stage. When the sound wave mutates, the comparator circuit will flip, so when the sound wave mutates, it is a signal stage. It can be understood that the signal stage and the no-signal stage usually appear alternately. That is, when the signal stage stops, the no-signal stage begins; when the no-signal stage stops, the signal stage begins.
[0067] In the no-signal stage, the comparator circuit does not flip, and the flip time and flip number of the sampled comparator circuit are both 0, so the output frequency and output duty cycle of the PWM signal cannot be controlled according to the flip number and flip time respectively.
[0068] Therefore, the control of the output of the PWM signal in step S320 is for the signal-existing stage, and the flipping times and flipping time of the comparator circuit are sampled and acquired in the signal-existing stage.
[0069] Optionally, if controlling the output of the PWM signal in the lamp in step S320 includes controlling the output of the PWM signal in the signal phase, the output frequency and output duty cycle of the PWM signal in the no-signal phase may be preset, thereby preventing the lamp from having no lighting effect in the no-signal phase.
[0070] There is no limitation on how to preset the output frequency and output duty cycle in the no-signal stage. For example, the output frequency and output duty cycle in the no-signal stage can be controlled based on the historical data of the sound wave stage obtained by sampling. For another example, the output frequency and output duty cycle in the no-signal stage can also be randomly set. It should be noted that the output state of the PWM signal in the no-signal stage can be determined by the frequency division state of the oscillation circuit in the no-signal stage, or it can be preset.
[0071] Optionally, the output of the PWM signal in the signal stage includes an initial state and a changed state, and the above-mentioned control of the output of the PWM signal in the signal stage may include: controlling the changed state of the PWM signal, and the initial state may be preset.
[0072] The initial state may be the state of the PWM signal within a certain period of time after the signal phase begins, for example, within 50 ms. The changed state may be the state of the PWM signal within a period of time after the initial state ends in the signal phase.
[0073] During a certain period of time at the beginning of the signal phase, the number of flips and flip time of the comparator circuit may not be immediately available, so the lighting effect during this period can be compensated by presetting the initial state. There is no limitation on how to preset the initial state.
[0074] Optionally, if controlling the output of the PWM signal in the lamp in step S320 includes controlling the output of the PWM signal in the signal phase, then controlling the output of the PWM signal in the lamp may also include: controlling the output of the PWM signal for a period of time starting from the no-signal phase. That is, after the signal phase ends, the lighting effect of the lamp will not stop immediately, but will continue to be output for a period of time starting from the no-signal phase. Based on this, the change of the lighting effect when the two phases alternate will not be too abrupt.
[0075] Optionally, the frequency division state of the oscillation circuit is the frequency division state of the oscillation circuit in the no-signal stage. That is, the output state of the PWM signal in the signal stage can be determined according to the frequency division state of the oscillation circuit in the no-signal stage. It can be understood that the no-signal stage here is the no-signal stage before the signal stage. The time of the no-signal stage is random, so controlling the output state of the PWM signal according to the frequency division state of the oscillation circuit in the no-signal stage can increase the randomness of the color change of the light, which helps to improve the interest of the lighting effect.
[0076] Optionally, the output state of the initial state of the PWM signal in the signal stage can be determined according to the frequency division state of the oscillating circuit in the no-signal stage, and the output state of the changing state of the PWM signal in the signal stage can be preset. That is, within a certain period of time at the beginning of the signal stage, the output state of the PWM signal can be determined according to the frequency division state of the oscillating circuit in the no-signal stage; after a certain period of time from the beginning of the signal stage, the output state of the PWM signal can be preset. How to preset the output state of the PWM signal is not limited and can be preset according to demand. For example, the preset output state can make the light color change more harmonious and comfortable. Based on this, the initial color of the light in the signal stage can be made random, and then the color changes as required.
[0077] Optionally, the frequency division state of the oscillator circuit in the no-signal stage can be sampled at the boundary between the signal stage and the no-signal stage. For example, the oscillator circuit is divided in the no-signal stage until the sound wave signal is sampled, i.e., the signal stage begins, and the frequency division of the oscillator circuit is stopped. The last moment of the frequency division is the boundary between the signal stage and the no-signal stage.
[0078] Optionally, the lamp can have multiple control chips, each of which has an oscillation circuit, and the output state of the PWM signal can be determined according to the frequency division state of the multiple oscillation circuits. Due to the influence of process and other factors, the oscillation frequency of different chips in the oscillation circuit inside the chip has a certain deviation. Therefore, when the frequency division multiple is the same, the frequency division sampling state of the oscillation frequency of the oscillation circuits of different chips at the same sampling point may be different. For example, the frequency division sampling state of the first chip may be 0000, the frequency division sampling state of the second chip may be 0010, and the frequency division sampling state of the third chip may be 0001. These different frequency division sampling states correspond to different LED output states, realizing random LED output initial states of different chips. The oscillation deviation of the oscillation circuit is random, so determining the output state of the PWM signal according to the frequency division state of the oscillation circuits of multiple chips can increase the randomness of the light color change.
[0079] How to determine the output state of the PWM signal according to the frequency division state of multiple oscillator circuits is not limited. Taking the frequency division sampling state of the oscillator circuit and the PWM output as an example, when the frequency division sampling state of the oscillator circuit is 0000, the PWM output state can be 001 (blue light is on) or 101 (red light and blue light are on).
[0080] Optionally, the output frequency of the PWM signal is proportional to the number of flipping times of the comparator. That is, the more times the comparator flips, the greater the output frequency of the PWM signal, the higher the continuity of the light perceived by the human eye, and the smoother the light. Alternatively, the fewer times the comparator flips, the smaller the output frequency of the PWM signal, the lower the continuity of the light perceived by the human eye, and the less smooth the light. As can be seen from the foregoing, the number of flipping times of the comparator is proportional to the number of times the external signal undergoes sudden changes. Therefore, by making the output frequency of the PWM signal proportional to the number of flipping times of the comparator, it is possible to achieve a continuous change in the light in response to the sudden changes of the external signal.
[0081] The proportionality coefficient between the output frequency of the PWM signal and the number of flipping times of the comparator is not limited. Optionally, the output frequency of the PWM signal can be equal to the number of flipping times of the comparator, that is, the proportionality coefficient is 1. For example, if the comparator flips twice within a certain period of time, the output frequency of the PWM signal can be 2HZ, and the corresponding period of the PWM signal is 0.5 seconds (s), that is, the number of times the PWM signal changes from high level to low level and then back to high level within 1 second is 2 times.
[0082] Optionally, the output duty cycle of the PWM signal is proportional to the flip time of the comparator. That is, the longer the flip time of the comparator, the greater the output duty cycle of the PWM signal, and the greater the brightness of the light. Alternatively, the shorter the flip time of the comparator, the smaller the output duty cycle of the PWM signal, and the smaller the brightness of the light. As can be seen from the foregoing, the flip time of the comparator is proportional to the duration of the sudden change of the external signal. Therefore, by making the output duty cycle of the PWM signal proportional to the flip time of the comparator, it is possible to achieve a change in the brightness of the light in response to the change in the sudden change time of the external signal. The proportional coefficient between the output duty cycle of the PWM signal and the flip time of the comparator is not limited.
[0083] Optionally, the output duty cycle of the PWM signal is 100% when the flip time of the comparator is greater than the first threshold. The output duty cycle of the PWM signal is 100%, that is, the PWM signal is always at a high level, so the light will appear to be always on. The flip time of the comparator is greater than the first threshold, which means that the duration of the sudden change of the external signal is longer, that is, the sudden change of the external signal is more prominent. Therefore, when the flip time of the comparator is greater than the first threshold, the output duty cycle of the PWM signal is 100%, and the external signal with a more prominent sudden change can be highlighted by the always-on light. Among them, the size of the first threshold is not limited. Exemplarily, the first threshold can be 100ms.
[0084] Combine the following Figure 6 , taking the music effect light (ie the external signal is music) as an example, the lighting effect control method of the present application is introduced by way of example.
[0085] As an example, the circuit structure of the music effect lamp provided in the embodiment of the present application can be as follows: Figure 6 The music effect light can collect the sound waves of external music through the MIC sound sensor and convert them into voltage signals, which are then amplified into V by the internal amplifier circuit. MIC , and then through the comparator V MIC Compare with the built-in normal voltage.
[0086] When the external music changes suddenly, the MIC sound sensor generates a sudden voltage, and the comparator will amplify the signal V MIC Compare with the built-in normal voltage. If the amplified signal V MIC If it is greater than the built-in normal voltage, the comparator flips and samples the external music signal. This is the signal stage.
[0087] In the signal stage, the number of times the comparator flips within a certain period of time corresponds to the number of sudden changes in the external sound and music signal. This data can control the scanning frequency of the PWM signal output. The more sudden changes in the external music signal within a certain period of time, the more times the comparator flips, and the faster the scanning frequency of the PWM signal output can be controlled; the fewer sudden changes in the external music signal within a certain period of time, the fewer times the comparator flips, and the slower the scanning frequency of the PWM signal output can be controlled. Based on this, the continuous change of the light can respond to the sudden changes in the music.
[0088] In the signal stage, the time when the comparator flips within a certain period of time corresponds to the duration of the sudden change of the external music signal. This data can control the duty cycle of the PWM signal output. The longer the sudden change of the external music signal within a certain period of time, the more time the comparator flips, and the higher the duty cycle of the PWM signal output can be controlled, and the brighter the light brightness; the shorter the sudden change of the external music signal within a certain period of time, the shorter the comparator flips, and the lower the duty cycle of the PWM signal output can be controlled, and the darker the light brightness. Based on this, the brightness change of the light can be made to respond to the sudden change of the music.
[0089] It should be noted that the above control of the scanning frequency of the PWM signal output and the duty cycle of the PWM signal output corresponds to the changing state of the PWM signal in the signal stage, that is, the state after a period of time from the start of the signal stage. However, in the period of time at the beginning of the signal stage, that is, the initial state of the PWM signal, the number and time of the comparator flipping have not been sampled. Therefore, the initial state of the PWM signal in the signal stage can be determined according to a preset state.
[0090] When there is no music or the music is gentle, the MIC sound sensor does not generate or generates a very small sudden voltage, V MIC No change or little change, V MIC It is not greater than the built-in normal voltage, the comparator does not flip, and no external music signal is sampled. This is the no-signal stage.
[0091] In the no-signal stage, since the output frequency and output duty cycle of the PWM signal cannot be controlled according to the flipping number and flipping time, the output frequency and output duty cycle of the PWM signal in the no-signal stage can be preset. For example, the flipping number and flipping time of the sampler can be determined according to the preset music, and the output frequency and output duty cycle of the PWM signal in the no-signal stage can be controlled accordingly.
[0092] In the signal phase, the output state of the PWM signal can be determined according to the frequency division state of the oscillator circuit in the previous signal-free phase. 8The state obtained after frequency division. The frequency division state of the oscillation circuit is uncertain, so the color of the light can also be uncertain.
[0093] In the no-signal stage, the output state of the PWM signal may be preset. Alternatively, in the no-signal stage, the output state of the PWM signal may also be determined according to the frequency division state of the oscillating circuit in the no-signal stage.
[0094] When the signal phase ends, the output state, output frequency and output duty cycle of the PWM signal may continue for a period of time, such as 3 seconds, in the no-signal phase.
[0095] Based on the above method, the continuous change and brightness change of the music effect light can be realized to respond to the sudden change of music, and the light color is uncertain, realizing a changeable, random and interesting light effect.
[0096] The method provided in the embodiment of the present application is described in detail above. The device provided in the embodiment of the present application is described in detail below with reference to the accompanying drawings.
[0097] like Figure 7 As shown, the embodiment of the present application provides a lighting effect control device. The lighting effect control device 700 may include a sampling module 710 and a control module 720 .
[0098] The sampling module 710 can be used to sample the frequency division state of the oscillation circuit in the lamp, the number of flipping times of the comparator circuit, and the flipping time of the comparator circuit within a certain period of time. The comparator circuit is used to compare the external signal voltage with the normal voltage. The comparator circuit flips when the external signal voltage is greater than the normal voltage. The external signal voltage is the voltage of the external signal collected by the sensor in the lamp after being amplified by the amplifier circuit.
[0099] The control module 720 can be used to control the output of the PWM signal in the lamp according to the sampling results. The PWM signal is used to drive the red light, green light and blue light emitted by the lamp. The output state of the PWM signal is determined according to the frequency division state, the output frequency of the PWM signal is determined according to the number of flipping times, and the output duty cycle of the PWM signal is determined according to the flipping time.
[0100] Optionally, the output of the PWM signal includes an output in a signal stage and an output in a no-signal stage. The comparator circuit flips at least once in the signal stage, and the comparator circuit does not flip in the no-signal stage. The control module 720 is used to control the output of the PWM signal in the signal stage.
[0101] Optionally, the control module 720 is further configured to control the output of the PWM signal within a period of time starting from the no-signal phase.
[0102] Optionally, the frequency division state is the frequency division state of the oscillation circuit in a no-signal stage.
[0103] Optionally, the output frequency of the PWM signal is proportional to the number of flipping times of the comparator.
[0104] Optionally, the output duty cycle of the PWM signal is proportional to the flipping time of the comparator.
[0105] Optionally, the output duty cycle of the PWM signal is 100% when the flip time of the comparator is greater than the first threshold.
[0106] Optionally, the external signal is a sound wave signal or a light signal.
[0107] The present application also provides a lamp, the lighting effect of which is controlled by the lighting effect control method as described above.
[0108] The present application also provides an electronic device. Figure 8 As shown, the electronic device 800 includes: at least one processor 801, a memory 802, and a computer program 803 stored in the memory 802 and executable on the at least one processor 801. When the processor 801 executes the computer program 803, the method provided in the present application is implemented.
[0109] Exemplarily, the computer program 803 may be divided into one or more modules / units, one or more modules / units are stored in the memory 802, and are executed by the processor 801 to complete the present application. One or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device 800.
[0110] Those skilled in the art will understand that Figure 8 It is only an example of the electronic device 800 and does not constitute a limitation of the electronic device. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 800 may also include input and output devices, network access devices, buses, etc.
[0111] The processor 801 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0112] The memory 802 may be an internal storage unit of the electronic device 800, such as a hard disk or memory of the electronic device 800. The memory 802 may also be an external storage device of the electronic device 800, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 800. Further, the memory 802 may also include both an internal storage unit of the electronic device 800 and an external storage device. The memory 802 is used to store computer programs and other programs and data required by the electronic device 800. The memory 802 may also be used to temporarily store data that has been output or is to be output.
[0113] The electronic device 800 provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0114] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned lighting effect control method can be implemented.
[0115] The embodiment of the present application also provides a computer program product. When the computer program product is run on an electronic device, the electronic device implements the steps in the above-mentioned lighting effect control method when executing the computer program product.
[0116] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above method embodiments, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above method embodiments can be implemented. Among them, the computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / electronic device, recording medium, computer memory, ROM (read-only memory), RAM (random access memory), CD-ROM (compact disc read-only memory), magnetic tape, floppy disk and optical data storage device. The computer-readable storage medium mentioned in the present application can be a non-volatile storage medium, in other words, a non-transient storage medium.
[0117] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0118] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0119] In the embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0120] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0121] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0122] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0123] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0124] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A lighting effect control method, characterized in that: include: Sampling the frequency division state of the oscillation circuit in the lamp, the number of flipping times of the comparator circuit, and the flipping time of the comparator circuit within a certain period of time, wherein the comparator circuit is used to compare the external signal voltage with the normal voltage, and the comparator circuit flips when the external signal voltage is greater than the normal voltage, and the external signal voltage is the voltage of the external signal collected by the sensor in the lamp after being amplified by the amplification circuit; The output of the pulse width modulation (PWM) signal in the lamp is controlled according to the sampling result, the PWM signal is used to drive the red light, green light and blue light emitted by the lamp, the output state of the PWM signal is determined according to the frequency division state, the output frequency of the PWM signal is determined according to the number of flipping times, and the output duty cycle of the PWM signal is determined according to the flipping time.
2. The method according to claim 1, characterized in that: The output of the PWM signal includes an output in a signal phase and an output in a no-signal phase, the comparator circuit flips at least once in the signal phase, and the comparator circuit does not flip in the no-signal phase, and the output of the PWM signal in the control lamp includes: Controlling the output of the PWM signal in the signal-existing phase.
3. The method according to claim 2, characterized in that The controlling the output of the PWM signal in the lamp further comprises: The output of the PWM signal is controlled during a period of time starting from the no-signal phase.
4. The method according to claim 3, characterized in that: The frequency division state is the frequency division state of the oscillation circuit in the no-signal stage.
5. The method according to claim 1, characterized in that The output frequency of the PWM signal is proportional to the flipping times of the comparator.
6. The method according to claim 1, characterized in that The output duty cycle of the PWM signal is proportional to the flipping time of the comparator.
7. The method according to claim 6, characterized in that The output duty cycle of the PWM signal is 100% when the flip time of the comparator is greater than the first threshold.
8. The method according to any one of claims 1 to 7, characterized in that The external signal is a sound wave signal or a light signal.
9. A lighting effect control device, characterized in that: include: A sampling module, used to sample the frequency division state of the oscillation circuit in the lamp, the number of flipping times of the comparator circuit, and the flipping time of the comparator circuit within a certain period of time. The comparator circuit is used to compare the external signal voltage with the normal voltage. The comparator circuit flips when the external signal voltage is greater than the normal voltage. The external signal voltage is the voltage of the external signal collected by the sensor in the lamp after being amplified by the amplifier circuit; A control module is used to control the output of a pulse width modulation (PWM) signal in the lamp according to the sampling result, the PWM signal is used to drive the red light, green light and blue light emitted by the lamp, the output state of the PWM signal is determined according to the frequency division state, the output frequency of the PWM signal is determined according to the number of flipping times, and the output duty cycle of the PWM signal is determined according to the flipping time.
10. A lamp, characterized in that: The lighting effect of the lamp is controlled by the method according to any one of claims 1-8.
Citation Information
Patent Citations
Three-color rgb led color mixing and control by variable frequency modulation
CN102239745A
Digital dimming control system for light-emitting diode (LED) and method thereof
CN103313491A
Input short-circuit protecting circuit for PWM (Pulse-Width Modulation) type audio power amplifier
CN104836192A
LED atmosphere lamp
CN107734756A
Lamp control method and device, lamp and storage medium
CN113709934A