A control method and system for RGB lamp
By collecting ambient light and user habit data, calculating the comprehensive dimming coefficient of RGB lamps, and generating PWM control signals, the problem of lack of refinement and intelligence in the RGB lamp control method is solved, personalized and efficient lighting adjustment is achieved, and user experience is improved.
Patent Information
- Application Number
- CN202411620747.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2044-11-13
AI Technical Summary
The existing RGB light control methods are difficult to achieve refined adjustment, lack intelligence and scene adaptability, making it difficult for users to manually call out ideal color effects, and fail to consider the user's usage habits and the adaptability of actual scenes.
The light sensor of the mobile terminal collects ambient light intensity, time and geographical location, combines user habit data, calculates the ambient light impact factor and user habit weight coefficient, determines the basic value of the RGB component and the comprehensive dimming coefficient of the RGB lamp, and generates a PWM control signal for lighting adjustment.
It realizes highly personalized lighting settings, significantly improves control accuracy and adaptability, provides intelligent lighting adjustment, and enhances user experience and visual comfort.
Smart Images

Figure CN119562402B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of lighting control, and in particular to a control method, system and electronic equipment for an RGB lamp. Background Art
[0002] Today, RGB lights are typically controlled through a simple switch and color adjustment system, using a basic PWM (pulse width modulation) control circuit to adjust the brightness of each color to achieve a color mixing effect.
[0003] However, manually selecting colors and modes often makes it difficult for users to intuitively achieve the desired color effect, especially in scenarios with high light requirements. Existing control methods lack refined adjustment capabilities. Furthermore, many RGB lights fail to consider user habits and adaptability to actual scenarios, lacking intelligent adjustment and failing to provide an automated, scene-adaptive lighting experience. Summary of the Invention
[0004] The present invention addresses the technical problems existing in the prior art and provides a method, system and electronic device for controlling RGB lamps, which can improve the efficiency, accuracy and flexibility of controlling RGB lamps.
[0005] The technical solution of the present invention to solve the above technical problems is as follows:
[0006] The present invention provides a method for controlling an RGB lamp, the method comprising:
[0007] The light sensor of the mobile terminal collects the ambient light intensity of the RGB lamp, the current time and the geographical location coordinates, and obtains the user usage habit data of the user using the RGB lamp;
[0008] Determining an ambient light impact factor of the RGB lamp according to the ambient light intensity and the time;
[0009] Determining a user habit weight coefficient of the RGB light according to the user usage habit data and the time;
[0010] Determining basic values of RGB components of the RGB lamp according to the ambient light influencing factor, the user habit weight coefficient, and the geographic location coordinates;
[0011] Determining a comprehensive dimming coefficient for the RGB lamp according to the ambient light influencing factor and the user habit weight coefficient, and determining a final RGB output value of the RGB lamp according to the comprehensive dimming coefficient;
[0012] The final RGB output value is converted into a PWM control signal and sent to a controller, which controls the switching and color adjustment of the RGB lamp.
[0013] Furthermore, determining the ambient light impact factor of the RGB lamp according to the ambient light intensity and the time includes:
[0014] Obtaining a first adjustment coefficient, a second adjustment coefficient, and a third adjustment coefficient that affect the ambient light intensity;
[0015] The ambient light intensity is adjusted according to the first adjustment coefficient, the second adjustment coefficient, and the third adjustment coefficient to determine the ambient light impact factor of the RGB lamp.
[0016] Furthermore, determining the user habit weight coefficient of the RGB lamp based on the user usage habit data and the time includes:
[0017] Determining a basic weight value corresponding to the user usage habit data according to the user's usage habit of the RGB lamp;
[0018] Determine a user habit weight coefficient of the RGB lamp according to the user usage habit data and the basic weight value.
[0019] Furthermore, determining a comprehensive dimming coefficient for the RGB lamp based on the ambient light influencing factor and the user habit weight coefficient includes:
[0020] Obtain the standard light intensity of the environment where the RGB lamp is located;
[0021] determining a first dimming coefficient according to the ambient light intensity and the standard light intensity;
[0022] A comprehensive dimming coefficient for the RGB lamp is determined according to the first dimming coefficient, the ambient light impact factor, and the user habit weight coefficient.
[0023] Furthermore, determining the final RGB output value of the RGB lamp according to the comprehensive dimming coefficient includes:
[0024] Get the red component, green component and blue component of the base value of the RGB component;
[0025] Obtaining the initial red value, initial green value, and initial blue value of the RGB component;
[0026] Obtaining a normalization coefficient for adjusting the initial red value, an attenuation coefficient for adjusting the initial green value, and a diffusion coefficient for adjusting the initial blue value;
[0027] The final RGB output value of the RGB lamp is determined based on the red component, green component and blue component in the basic value of the RGB component, the initial red value, initial green value and initial blue value of the RGB component, the ambient lighting influencing factor, the user habit weight coefficient, and the normalization coefficient, the attenuation coefficient and the diffusion coefficient.
[0028] Furthermore, the user usage habit data includes: user color preference data, light usage time period data and light intensity preference data.
[0029] The present invention also provides a control system for an RGB lamp, the system comprising:
[0030] A data acquisition module is used to collect the ambient light intensity of the RGB lamp, the current time and the geographical location coordinates through the light sensor of the mobile terminal, and obtain the user usage habit data of the user using the RGB lamp;
[0031] A factor determination module, configured to determine an ambient light impact factor of the RGB lamp based on the ambient light intensity and the time;
[0032] a weight determination module, configured to determine a user habit weight coefficient of the RGB light according to the user usage habit data and the time;
[0033] A basic value module, configured to determine basic values of the RGB components of the RGB lamp according to the ambient light influencing factor, the user habit weight coefficient, and the geographic location coordinates;
[0034] an output value module, configured to determine a comprehensive dimming coefficient for the RGB lamp based on the ambient light influencing factor and the user habit weight coefficient, and determine a final RGB output value of the RGB lamp based on the comprehensive dimming coefficient;
[0035] The light adjustment module is used to convert the final RGB output value into a PWM control signal and send it to the controller, so as to control the switching and color adjustment of the RGB lamp through the controller.
[0036] Furthermore, the system further comprises:
[0037] Mobile terminal, used to collect environmental data, user data and calculate control parameters;
[0038] A controller, configured to receive and execute control instructions;
[0039] RGB lights, used to output corresponding lighting effects according to the control instructions;
[0040] Wherein, the mobile terminal further includes:
[0041] A light sensor, used to collect the ambient light intensity of the environment where the RGB lamp is located;
[0042] A processor, configured to calculate various parameters of the RGB lamp;
[0043] The wireless communication module is used for data transmission with the controller.
[0044] The beneficial effects of the present invention are:
[0045] (1) By analyzing user habits, such as color preferences and usage time, the present invention can provide users with highly personalized lighting settings to meet the needs of different scenes and situations.
[0046] (2) The present invention significantly improves control accuracy and adaptability by comprehensively considering multiple factors such as ambient light, time, geographical location, and user habits, thus overcoming the limitations of traditional RGB lamp control methods.
[0047] (3) The present invention collects ambient light intensity in real time and calculates ambient light influencing factors, so that RGB lamps can automatically adapt to changes in ambient light, provide optimal lighting effects, and improve visual comfort. By introducing a comprehensive dimming coefficient and combining ambient light and user feedback, the lighting adjustment is more intelligent, achieving smoother brightness transitions, avoiding abrupt changes in light intensity, and enhancing user experience.
[0048] In summary, the present invention enables the RGB lamp control method to not only meet the user's personalized needs in terms of functionality, but also significantly improves environmental adaptability and operational convenience, greatly enhancing the user experience and satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 A scene diagram of a method for controlling an RGB lamp provided by the present invention;
[0050] Figure 2 A flow chart of a method for controlling an RGB lamp provided by the present invention;
[0051] Figure 3 A schematic diagram of the structure of a control system for an RGB lamp provided by the present invention;
[0052] Figure 4 A schematic diagram of the hardware structure of a possible electronic device provided by the present invention. DETAILED DESCRIPTION
[0053] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present invention.
[0054] See also Figure 1 , Figure 1 This is a scene diagram of a method for controlling an RGB lamp provided by the present invention. Figure 1 As shown, this scenario may include a terminal, a server, and a Christmas tree equipped with RGB lights. The Christmas tree, terminal, and server are connected via a network, such as a wired or wireless network. Terminals may include, but are not limited to, portable devices such as mobile phones and tablets running various network platform applications, as well as fixed terminals such as computers, kiosks, and advertising machines. The server provides various services to users, including service push servers and user recommendation servers.
[0055] It should be noted that Figure 1 The scenario diagram of a method for controlling an RGB light is merely an example. The terminal, server, and application scenario described in the embodiments of the present invention are intended to more clearly illustrate the technical solution of the embodiments of the present invention and do not constitute a limitation on the technical solution provided by the embodiments of the present invention. Persons skilled in the art will recognize that as systems evolve and new business scenarios emerge, the technical solutions provided by the embodiments of the present invention will be equally applicable to similar technical problems. In this scenario, the RGB light control method of the present invention can be executed by a terminal or server to achieve efficient, flexible, and accurate control of the RGB lights used to decorate a Christmas tree.
[0056] Both the terminal and the server can be used for:
[0057] The light sensor of the mobile terminal collects the ambient light intensity of the RGB lamp, the current time and the geographical location coordinates, and obtains the user usage habit data of the user using the RGB lamp;
[0058] Determining an ambient light impact factor of the RGB lamp according to the ambient light intensity and the time;
[0059] Determining a user habit weight coefficient of the RGB light according to the user usage habit data and the time;
[0060] Determining basic values of RGB components of the RGB lamp according to the ambient light influencing factor, the user habit weight coefficient, and the geographic location coordinates;
[0061] Determining a comprehensive dimming coefficient for the RGB lamp according to the ambient light influencing factor and the user habit weight coefficient, and determining a final RGB output value of the RGB lamp according to the comprehensive dimming coefficient;
[0062] The final RGB output value is converted into a PWM control signal and sent to a controller, which controls the switching and color adjustment of the RGB lamp.
[0063] See also Figure 2 , provides a flow chart of a control method for an RGB lamp of the present invention, comprising the following steps:
[0064] Step 201: The ambient light intensity of the RGB lamp, the current time and the geographical location coordinates are collected through the light sensor of the mobile terminal, and the user usage habit data of the user using the RGB lamp is obtained.
[0065] The user usage habit data may include: the user's color preference data, light usage time period data, and light intensity preference data.
[0066] In practice, the mobile terminal's built-in light sensor measures the ambient light intensity E in real time. This data is used to assess the current ambient brightness, enabling appropriate adjustments when adjusting the RGB lighting. For example, in brighter environments, the light intensity may need to be reduced, while in darker environments, the light brightness may need to be increased.
[0067] The system time function allows mobile terminals to obtain the current time t in real time. Time information is an important factor in adjusting lighting effects. For example, users may prefer warmer lighting at night and cooler lighting during the day. This information helps the system make intelligent adjustments based on time of day.
[0068] Mobile terminals can use GPS or other positioning technologies to obtain the user's geographic coordinates (x, y). Geographic location also affects lighting adjustments. For example, different regions have different hours and intensities of sunlight. The system can optimize lighting output based on the user's location information to adapt to local environmental conditions.
[0069] In some embodiments, the system can analyze and record the user's color choices in different time periods and scenarios through the user's historical operation records. These data help the system understand the user's color preferences in different environments, thereby providing personalized lighting color settings. The system can record the time periods when the user uses the RGB lamp, for example, the user usually uses the light between 7 and 10 pm. This data helps the system predict the user's usage habits and automatically adjust the lighting settings to suit the user's pace of life. The user's preference for light intensity can also be recorded. For example, some users may prefer soft light, while others may prefer bright light. The system can use this information to provide light intensity settings that best meet the user's needs in different scenarios.
[0070] Through the above methods, the present invention can comprehensively collect data on ambient light intensity, current time, geographic location coordinates, and user usage habits, enabling your smart RGB lighting control system to achieve more precise and personalized lighting adjustment. This multi-dimensional data collection not only improves the adaptability and flexibility of the lighting, but also significantly improves the user experience, making it more in line with the user's actual needs.
[0071] Step 202: Determine the ambient light impact factor of the RGB lamp according to the ambient light intensity and the time.
[0072] In some embodiments, step 202 may include:
[0073] Obtaining a first adjustment coefficient, a second adjustment coefficient, and a third adjustment coefficient that affect the ambient light intensity;
[0074] The ambient light intensity is adjusted according to the first adjustment coefficient, the second adjustment coefficient, and the third adjustment coefficient to determine the ambient light impact factor of the RGB lamp.
[0075] In some embodiments, the ambient light impact factor can be expressed as:
[0076]
[0077] Among them, α is the ambient light influencing factor, k1, k2, and k3 are the first adjustment coefficient, the second adjustment coefficient, and the third adjustment coefficient, respectively. E is the ambient light intensity, and t is time.
[0078] In practice, ambient light intensity E represents the intensity of the current ambient light, typically expressed in lux. The higher the light intensity, the brighter the ambient light, and vice versa. This value directly impacts the adjustment of the RGB lights, ensuring appropriate lighting effects under varying lighting conditions.
[0079] The time t can be expressed in hours. This variable is obtained by using the sine function The purpose of this processing is to simulate the changing pattern of daytime light. For example, the difference in light intensity between day and night. The characteristics of the sine function make the changes in light intensity between morning and evening smoother.
[0080] The first adjustment coefficient k1 is used to adjust the degree of influence of ambient light on the lighting effect. When E is low, the first adjustment coefficient k1 can help increase the value of α to ensure that the RGB lamp still provides appropriate brightness in low-light environments.
[0081] The second adjustment coefficient k2 is used to adjust the impact of E on α. It controls the weight of ambient light intensity in the calculation of the impact factor. If it is set higher, the effect of ambient light intensity on the impact factor will be enhanced.
[0082] The third adjustment coefficient, k3, is used to adjust the base value of the formula to ensure that the calculation of the impact factor remains reasonable in extreme cases (such as when the ambient light is zero). It helps prevent the value of α from becoming negative, ensuring the stability of the formula.
[0083] The structure of shows that the influence of ambient light intensity E is time-dependent. When t represents morning and evening, the output of the sine function varies between 0 and 1, reflecting the changes in light intensity during the morning and evening hours. Adding the adjustment factor k1 ensures that the output does not drop too low in low light conditions.
[0084] k2×E+k3 ensures the stability of the entire formula. In low ambient light conditions (e.g., when E is close to 0), k3 prevents division by zero. The adjustment factor k2 ensures that the effect of ambient light intensity on α is adjusted according to the set ratio.
[0085] As you can understand, the calculated ambient light impact factor α will be used for subsequent RGB lighting adjustments. A higher α value indicates high ambient light intensity, requiring the RGB light brightness to be reduced; a lower α value indicates insufficient ambient light, requiring the RGB light brightness to be increased to meet the user's visual needs.
[0086] Through the above methods, the present invention can achieve modeling of the complex relationship between light intensity and time, so that RGB lamps can be flexibly adjusted under different ambient lighting conditions, providing a more personalized and comfortable lighting experience.
[0087] Step 203: Determine a user habit weight coefficient of the RGB light according to the user usage habit data and the time.
[0088] In some embodiments, step 203 may be expressed as:
[0089] Determining a basic weight value corresponding to the user usage habit data according to the user's usage habit of the RGB lamp;
[0090] Determine a user habit weight coefficient of the RGB lamp according to the user usage habit data and the basic weight value.
[0091] In some embodiments, the user habit weight coefficient can be expressed as:
[0092]
[0093] Among them, β is the user habit weight coefficient, m is the basic weight value, U is the user usage habit data, and t is time.
[0094] In specific implementations, user usage habit data U represents user behavior when using RGB lights, including color preferences, usage time, and light intensity preferences. This data can be obtained by analyzing historical user usage records. The value of U is typically standardized using a quantitative method to ensure accuracy.
[0095] Here t is the current time in hours. The image is processed to reflect the influence of different times of day on user preferences. For example, warm colors may be more preferred at night, while cool colors may be preferred during the day.
[0096] m is a fixed value that represents the base weight of a user's usage habits. This ensures that even if the user's habit data U is zero, β will still have a base value, preventing the formula from outputting a negative number. This value can be adjusted based on actual conditions to meet the needs of different users.
[0097] ln(U+1) expresses the natural logarithm of user usage habits, ensuring that the impact of user habits on β is nonlinear. The logarithmic function reduces the impact as U increases, meaning that even extreme values of usage habits do not inflate the weight coefficient.
[0098] Represents the temporal changes in user preferences. As time changes, user preferences may also change. The cosine function can naturally simulate this change, forming a cyclical effect, helping the system better understand user needs at different times.
[0099] The numerator is squared, which means that the user habit weight coefficient β is sensitive to changes and can emphasize the impact of larger user usage habit data and time changes. This squaring process can help the system emphasize the user's strong preferences when optimizing lighting settings.
[0100] Finally, the addition of the base weight m ensures that the user habit weight coefficient always remains within a reasonable range, preventing β from becoming unstable due to low user habit data. This design provides the system with a basic and stable starting point when processing user preferences.
[0101] The calculated user habit weight coefficient β will be used in subsequent RGB lighting adjustment decisions. A higher β value indicates a strong user habit, and the system should place greater emphasis on the user's preference when adjusting the lighting; a lower β value indicates a weak user preference, and other factors should be considered when adjusting the lighting.
[0102] Through the above approach, the present invention can quantify user preferences, enabling RGB lighting to intelligently adapt to user needs at different times and in different situations. This significantly enhances the user experience and provides each user with a customized lighting solution.
[0103] Step 204: Determine the basic values of the RGB components of the RGB lamp according to the ambient light impact factor, the user habit weight coefficient, and the geographic location coordinates.
[0104] In some embodiments, the base values of the RGB components of an RGB lamp may be expressed as:
[0105]
[0106] Where R is the red component, R0 is the initial red value, d is the normalization coefficient, G is the green component, G0 is the initial green value, c is the attenuation coefficient, B is the blue component, B0 is the initial blue value, and p is the diffusion coefficient.
[0107] In the specific implementation, the initial component values R0, G0, and B0 are the initial output values of the RGB lamp, indicating the basic brightness of each color when there are no other influencing factors.
[0108] The normalization coefficient d is used to normalize the output of the red component to ensure that the final red value is within a reasonable range. It helps adjust the scale of R to make it adaptable to different environmental conditions.
[0109] The attenuation coefficient c controls the attenuation of the green component G as the distance varies. As |xy| increases, the output of the green component decays exponentially, reflecting the effect of distance on light intensity.
[0110] The diffusion coefficient p is used to calculate the blue component B and determines the degree of diffusion of the blue component output with position differences. When |xy| is large, the output blue component will gradually weaken.
[0111] The ambient light impact factor α represents the impact of ambient light on RGB light regulation. It dynamically adjusts the brightness of different components through a combination of sine, cosine, and tangent functions.
[0112] The user habit weight coefficient β reflects the user's lighting usage habits. As time t changes, the adjustment of the lighting component is weighted accordingly.
[0113] The coordinates (x, y) represent the spatial position of the lamp and are used to calculate the lighting differences between different positions, thereby affecting the output of the RGB components.
[0114] The output of R is regulated by the ambient lighting influence factor α and the user habit weight coefficient β, ensuring that the distance in different environments (x, y) affects the final value of red and ensures the difference in light intensity at different spatial locations.
[0115] The green component G uses the cosine function cos(βt) to represent the time dependence of green. Changes in user habits can cause the brightness of green to vary over time. By controlling the influence of |xy| on the green component using an exponential function, we achieve a smoother attenuation of brightness with distance, adapting to different spatial layouts.
[0116] The introduction of makes the blue component change over time, providing a more delicate adjustment effect. Controls the diffusion of blue light, ensuring smooth and natural changes in the intensity of blue light at different locations.
[0117] This formula comprehensively considers ambient lighting, user habits, time of day, and spatial location, ensuring that RGB lights provide a personalized, precise lighting experience under different conditions. This multi-dimensional adjustment mechanism makes the user experience more user-friendly and adaptable to diverse environments and needs.
[0118] Through the above approach, the present invention achieves precise control of RGB lighting, providing an intelligent lighting solution based on the environment and user habits. This approach not only improves the user experience, but also ensures that RGB lights can operate efficiently and flexibly in various environments.
[0119] Step 205: Determine a comprehensive dimming coefficient for the RGB lamp based on the ambient light influencing factor and the user habit weight coefficient, and determine a final RGB output value of the RGB lamp based on the comprehensive dimming coefficient.
[0120] In some embodiments, step 205 may include the following steps:
[0121] Obtain the standard light intensity of the environment where the RGB lamp is located;
[0122] determining a first dimming coefficient according to the ambient light intensity and the standard light intensity;
[0123] A comprehensive dimming coefficient for the RGB lamp is determined according to the first dimming coefficient, the ambient light impact factor, and the user habit weight coefficient.
[0124] In some embodiments, the comprehensive dimming coefficient is expressed as:
[0125]
[0126] Among them, γ is the comprehensive dimming coefficient, E0 is the standard light intensity, E is the ambient light intensity, α is the ambient light influencing factor, and β is the user habit weight coefficient.
[0127] In practice, the integrated dimming coefficient γ is used to comprehensively adjust the RGB lighting output, determining the final lighting effect. Ambient light intensity E, measured by a sensor, directly influences the RGB lighting output. The standard light intensity E0 is compared with the ambient light intensity E to determine the required adjustment. α represents the degree of influence of ambient light on the RGB lighting, reflecting how changes in lighting conditions affect the lighting output. β reflects user preference, taking into account user habits and time factors when using RGB lighting.
[0128] Specifically, By adding the squares of α and β and taking the square root, we comprehensively consider the impact of environmental factors and user habits on lighting adjustment. This square root calculation ensures that these influences do not linearly add up during adjustment, but rather interact in a more complex manner. This nonlinear combination allows for more flexible and natural lighting adjustments as the environment or user habits change. For example, if the user habit weight β is high, indicating a strong preference for lighting, then γ will be large, making it more likely that the lighting adjustment will meet the user's needs.
[0129] pass The ratio of the current ambient light intensity to the standard light intensity reflects this ratio. This ratio determines the degree of dimming. The characteristics of the inverse tangent function ensure that when the ambient light intensity is close to the standard light intensity, the dimming amplitude changes slowly; when the ambient light intensity is low or high, the dimming amplitude changes more significantly. This design makes lighting adjustment more natural and avoids visual discomfort caused by excessive dimming.
[0130] The calculated dimming coefficient γ directly impacts the RGB lamp's output, determining how the light changes under varying environmental conditions and user preferences. By comprehensively considering ambient light intensity, user habits, and environmental factors, the RGB lamp can intelligently and flexibly adapt to various usage scenarios, thereby enhancing the user's lighting experience.
[0131] Through the above approach, the present invention enables precise control of RGB light output, making lighting adjustment more user-friendly and intelligent. The introduction of this coefficient enables RGB lights to provide personalized lighting effects under changing environmental conditions and user needs, improving the overall user experience.
[0132] In some embodiments, step 205 may further include the following steps:
[0133] Get the red component, green component and blue component of the base value of the RGB component;
[0134] Obtaining the initial red value, initial green value, and initial blue value of the RGB component;
[0135] Obtaining a normalization coefficient for adjusting the initial red value, an attenuation coefficient for adjusting the initial green value, and a diffusion coefficient for adjusting the initial blue value;
[0136] The final RGB output value of the RGB lamp is determined based on the red component, green component and blue component in the basic value of the RGB component, the initial red value, initial green value and initial blue value of the RGB component, the ambient lighting influencing factor, the user habit weight coefficient, and the normalization coefficient, the attenuation coefficient and the diffusion coefficient.
[0137] In some embodiments, the final RGB output value of the RGB lamp is expressed as:
[0138]
[0139] Among them, R final is the final red value, G final is the final green value, B final is the final blue value, R is the red component, G is the green component, B is the blue component, γ is the comprehensive dimming coefficient, and t is time.
[0140] In the implementation, the three output color components are guaranteed not to exceed 255 (the maximum value of the RGB color model). The three color components R, G, and B are based on the previously calculated base color values and represent the basic color intensity of the light. γ reflects the combined influence of environmental factors and user habits, affecting the final color output. Time t is used to dynamically adjust the lighting effect.
[0141] In the red and green outputs, sine and cosine functions are used to achieve periodic changes in the lighting effect. As time changes, the brightness and color of the light will fluctuate regularly. For example, the sine function and cosine functions The use of RGB lights allows them to undergo a complete brightness change cycle every 12 hours. This periodic adjustment can simulate natural light changes and enhance the user's visual experience.
[0142] By multiplying the primary color components R, G, and B, the combined dimming factor γ determines the current light intensity adjustment. A higher γ value increases the light's brightness, while a lower value decreases it. Using the min(255,…) function ensures that the final RGB value does not exceed 255, conforming to the RGB color model. This restriction prevents calculations that exceed the representable range and ensures that the output color value is within the valid range.
[0143] By designing the above formula, RGB lights can achieve dynamic and intelligent lighting adjustment, combining environmental conditions and user habits to create a personalized lighting experience. In particular, the introduction of time factors can make the lighting effects more natural and varied, improving user satisfaction.
[0144] Through the above approach, the present invention not only achieves precise dimming control by designing the final output value of the RGB lamp, but also enhances the user's visual experience under different time and environmental conditions. This intelligent adjustment can automatically adjust according to the real-time environment and user preferences, making the RGB lamp more suitable for user needs.
[0145] Step 206: Convert the final RGB output value into a PWM control signal and send it to a controller, so that the controller can control the switching and color adjustment of the RGB lamp.
[0146] In practice, PWM is a modulation technique that controls the average current by adjusting the width of the signal (the height of the pulse). For RGB lights, the PWM signal can precisely control the brightness of each color LED.
[0147] The PWM signal typically has a fixed period, such as 1 millisecond. Within this period, the duty cycle (the ratio of the duration of the high level to the period) of the modulation determines the brightness of the LED. For example, a duty cycle of 50% means that the LED will be on half the time, providing a medium brightness.
[0148] The generated PWM control signal is sent to the controller via a wireless communication protocol (such as WiFi, Bluetooth, etc.). After receiving the signal, the controller will analyze the PWM signal of each color and adjust the working state of the RGB light accordingly.
[0149] In some embodiments, a controller can be responsible for receiving PWM signals from a mobile terminal and parsing them into specific operational instructions to control the on / off state and color of the RGB lights. Based on the received PWM signals, the controller determines the on / off state of the RGB lights. If the duty cycle is 0, the lights are turned off; if the duty cycle is greater than 0, the corresponding color LED is turned on. The controller adjusts the brightness of each color LED based on the different color PWM signals. For example, when the red PWM signal has a higher duty cycle, the red LED will appear brighter, achieving the desired lighting effect.
[0150] In this way, RGB lamps can achieve precise brightness and color control, ensuring users receive an ideal lighting experience in different environments and at all times. The use of PWM control signals makes the dimming process smoother and more stable, avoiding flickering caused by current fluctuations. This invention can effectively convert the calculated final RGB output value into an executable PWM signal, and control and adjust the lighting through a controller. This intelligent control method enhances the operational flexibility and user experience of RGB lamps, enabling them to adapt to various usage scenarios and user needs.
[0151] See also Figure 3 , Figure 3 This is a structural schematic diagram of a control system for RGB lamps provided by the present invention.
[0152] like Figure 3 As shown, an RGB lamp control system proposed in an embodiment of the present invention includes:
[0153] The data acquisition module 301 is used to collect the ambient light intensity of the RGB lamp, the current time and the geographical location coordinates through the light sensor of the mobile terminal, and obtain the user usage habit data of the user using the RGB lamp;
[0154] A factor determination module 302 is configured to determine an ambient light impact factor of the RGB lamp based on the ambient light intensity and the time;
[0155] A weight determination module 303 is configured to determine a user habit weight coefficient of the RGB light according to the user usage habit data and the time;
[0156] A basic value module 304 is configured to determine basic values of the RGB components of the RGB lamp according to the ambient light influencing factor, the user habit weight coefficient, and the geographic location coordinates;
[0157] An output value module 305 is configured to determine a comprehensive dimming coefficient for the RGB lamp based on the ambient light influencing factor and the user habit weight coefficient, and determine a final RGB output value of the RGB lamp based on the comprehensive dimming coefficient;
[0158] The light adjustment module 306 is used to convert the final RGB output value into a PWM control signal and send it to the controller, so as to control the switching and color adjustment of the RGB light through the controller.
[0159] In some embodiments, the RGB lamp control system may further include:
[0160] Mobile terminal, used to collect environmental data, user data and calculate control parameters;
[0161] A controller, configured to receive and execute control instructions;
[0162] RGB lights, used to output corresponding lighting effects according to the control instructions;
[0163] Wherein, the mobile terminal further includes:
[0164] A light sensor, used to collect the ambient light intensity of the environment where the RGB lamp is located;
[0165] A processor, configured to calculate various parameters of the RGB lamp;
[0166] The wireless communication module is used for data transmission with the controller.
[0167] See also Figure 4 , Figure 4 Schematic diagram of an embodiment of an electronic device provided by an embodiment of the present invention. Figure 4 As shown, an embodiment of the present invention provides an electronic device 400, including a memory 410, a processor 420, and a computer program 411 stored in the memory 410 and executable on the processor 420. When the processor 420 executes the computer program 411, the following steps are implemented:
[0168] The light sensor of the mobile terminal collects the ambient light intensity of the RGB lamp, the current time and the geographical location coordinates, and obtains the user usage habit data of the user using the RGB lamp;
[0169] Determining an ambient light impact factor of the RGB lamp according to the ambient light intensity and the time;
[0170] Determining a user habit weight coefficient of the RGB light according to the user usage habit data and the time;
[0171] Determining basic values of RGB components of the RGB lamp according to the ambient light influencing factor, the user habit weight coefficient, and the geographic location coordinates;
[0172] Determining a comprehensive dimming coefficient for the RGB lamp according to the ambient light influencing factor and the user habit weight coefficient, and determining a final RGB output value of the RGB lamp according to the comprehensive dimming coefficient;
[0173] The final RGB output value is converted into a PWM control signal and sent to a controller, which controls the switching and color adjustment of the RGB lamp.
[0174] It should be noted that, in the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0175] It will be appreciated by those skilled in the art that embodiments of the present invention may provide methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware.
Claims
1. A method for controlling an RGB lamp, characterized in that: The method comprises: The light sensor of the mobile terminal collects the ambient light intensity of the RGB lamp, the current time and the geographical location coordinates, and obtains the user usage habit data of the user using the RGB lamp; Determining the ambient light impact factor of the RGB lamp according to the ambient light intensity and the time includes: obtaining a first adjustment coefficient, a second adjustment coefficient, and a third adjustment coefficient that affect the ambient light intensity; adjusting the ambient light intensity according to the first adjustment coefficient, the second adjustment coefficient, and the third adjustment coefficient to determine the ambient light impact factor of the RGB lamp, where the ambient light impact factor is expressed as: Where α is the ambient light influencing factor, k1, k2, and k3 are the first, second, and third adjustment coefficients, respectively; E is the ambient light intensity; and t is time. Determining a user habit weight coefficient of the RGB light according to the user usage habit data and the time; Determining basic values of RGB components of the RGB lamp according to the ambient light influencing factor, the user habit weight coefficient, and the geographic location coordinates; Determining a comprehensive dimming coefficient for the RGB lamp according to the ambient light influencing factor and the user habit weight coefficient, and determining a final RGB output value of the RGB lamp according to the comprehensive dimming coefficient; The final RGB output value is converted into a PWM control signal and sent to a controller, which controls the switching and color adjustment of the RGB lamp.
2. The RGB lamp control method according to claim 1, characterized in that: The determining, based on the user usage habit data and the time, a user habit weight coefficient of the RGB lamp includes: Determining a basic weight value corresponding to the user usage habit data according to the user's usage habit of the RGB lamp; Determine a user habit weight coefficient of the RGB lamp according to the user usage habit data and the basic weight value.
3. The RGB lamp control method according to claim 2, characterized in that: The determining of the comprehensive dimming coefficient for the RGB lamp according to the ambient light influencing factor and the user habit weight coefficient includes: Obtain the standard light intensity of the environment where the RGB lamp is located; determining a first dimming coefficient according to the ambient light intensity and the standard light intensity; A comprehensive dimming coefficient for the RGB lamp is determined according to the first dimming coefficient, the ambient light impact factor, and the user habit weight coefficient.
4. The RGB lamp control method according to claim 3, characterized in that: The step of determining the final RGB output value of the RGB lamp according to the comprehensive dimming coefficient includes: Get the red component, green component and blue component of the base value of the RGB component; Obtaining the initial red value, initial green value, and initial blue value of the RGB component; A normalization coefficient for adjusting the initial red value, an attenuation coefficient for adjusting the initial green value, and a diffusion coefficient for adjusting the initial blue value are obtained.
5. The RGB lamp control method according to claim 4, characterized in that: The determining the final RGB output value of the RGB lamp according to the comprehensive dimming coefficient includes: The final RGB output value of the RGB lamp is determined based on the red component, green component and blue component in the basic value of the RGB component, the initial red value, initial green value and initial blue value of the RGB component, the ambient lighting influencing factor, the user habit weight coefficient, and the normalization coefficient, the attenuation coefficient and the diffusion coefficient.
6. The RGB lamp control method according to any one of claims 1 to 5, characterized in that: The user usage habit data includes: user's color preference data, light usage time period data and light intensity preference data.
7. A control system for an RGB lamp, configured to execute the control method for an RGB lamp according to any one of claims 1 to 6, characterized in that: The system comprises: A data acquisition module is used to collect the ambient light intensity of the RGB lamp, the current time and the geographical location coordinates through the light sensor of the mobile terminal, and obtain the user usage habit data of the user using the RGB lamp; A factor determination module is configured to determine the ambient light impact factor of the RGB lamp based on the ambient light intensity and the time, and further configured to obtain a first adjustment coefficient, a second adjustment coefficient, and a third adjustment coefficient that affect the ambient light intensity; and to adjust the ambient light intensity based on the first adjustment coefficient, the second adjustment coefficient, and the third adjustment coefficient to determine the ambient light impact factor of the RGB lamp. The ambient light impact factor is expressed as: Where α is the ambient light influencing factor, k1, k2, and k3 are the first, second, and third adjustment coefficients, respectively; E is the ambient light intensity; and t is time. a weight determination module, configured to determine a user habit weight coefficient of the RGB light according to the user usage habit data and the time; A basic value module, configured to determine basic values of the RGB components of the RGB lamp according to the ambient light influencing factor, the user habit weight coefficient, and the geographic location coordinates; an output value module, configured to determine a comprehensive dimming coefficient for the RGB lamp based on the ambient light influencing factor and the user habit weight coefficient, and determine a final RGB output value of the RGB lamp based on the comprehensive dimming coefficient; The light adjustment module is used to convert the final RGB output value into a PWM control signal and send it to the controller, so as to control the switching and color adjustment of the RGB lamp through the controller.
8. The RGB lamp control system according to claim 7, characterized in that: The system further comprises: Mobile terminal, used to collect environmental data, user data and calculate control parameters; A controller, configured to receive and execute control instructions; RGB lights, used to output corresponding lighting effects according to the control instructions; Wherein, the mobile terminal further includes: A light sensor, used to collect the ambient light intensity of the environment where the RGB lamp is located; A processor, configured to calculate various parameters of the RGB lamp; The wireless communication module is used for data transmission with the controller.
Citation Information
Patent Citations
Dimming and color temperature adjusting method and device for intelligent equipment
CN112437523A