Method for detecting number of lamp beads, loudspeaker box, multimedia equipment and readable storage medium
By inputting preset parameters into the control module of the multimedia speaker, the number of LEDs on the LED strip is detected using the encoding bit characteristics of the LEDs, which solves the problem of not being able to generate the correct lighting effect control signal in the existing technology and improves the user experience.
Patent Information
- Application Number
- CN202411058225.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2026-02-03
AI Technical Summary
Existing multimedia speakers cannot detect the number of LEDs on external LED strips, thus failing to generate the correct lighting control signals and impacting user experience.
By inputting preset parameters into the control module, the system utilizes the encoding bit characteristics of the LED beads to transmit waveform signals to the LED strip and detects the rising edge of the DBACK pin to calculate the remaining encoding bits, thereby accurately calculating the number of LED beads.
It enables the generation of correct lighting effect control signals based on the number of LED beads, thus improving the user's lighting experience.
Smart Images

Figure CN121457500A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of multimedia sound boxes, and more particularly to a lamp bead number detection method, a sound box, a multimedia device and a readable storage medium. BACKGROUND
[0002] With the continuous development of LED technology, more and more multimedia sound boxes will increase the design of LED light bars, and through the change of colorful lights, consumers can enjoy better sound and vision. Especially when the lights move with the music, it can bring users a more immersive experience.
[0003] However, some customers are not satisfied with the design of the sound box with the light bar, and he also hopes that the sound box can provide light effect control for the external light bar through an expansion interface, which is used to enhance the effect of indoor and indoor decorative light bars. At this time, the number of lamp beads of the external light bar may be uncertain, so the multimedia sound box cannot generate the correct light effect control signal according to the number of lamp beads, thereby affecting the user experience. SUMMARY
[0004] The technical problem to be solved by the embodiments of the present application is that the existing multimedia sound box cannot detect the number of lamp beads on the external light bar, and cannot generate the correct light effect control signal, thereby affecting the user experience.
[0005] In order to solve the above technical problems, the embodiments of the present application provide a lamp bead number detection method, which adopts the following technical scheme:
[0006] A lamp bead number detection method for detecting the number of lamp beads on a light bar, comprising the following steps:
[0007] Input a preset parameter in the control module, wherein the preset parameter includes a preset number of lamp beads and a code bit number of a single lamp bead;
[0008] Connect the input end of the light bar with the DOUT pin of the control module, and connect the output end of the light bar with the DBACK pin of the control module;
[0009] The control module transmits a control signal to the input end of the light bar based on the preset parameter, wherein the control signal is a waveform signal;
[0010] The control module detects the rising edge of the DBACK pin and counts to obtain a remaining code bit number;
[0011] The control module calculates the number of lamp beads on the light bar based on the preset parameter and the remaining code number.
[0012] Further, the control module emits a control signal to the input end of the light bar based on the preset parameter, specifically including the following steps:
[0013] The control module calculates the total number of encoding bits required based on the preset parameter;
[0014] The control module inputs a control signal to the input end of the lamp bead based on the total number of encoding bits.
[0015] Further, the total number of encoding bits is calculated by the following formula:
[0016] N = (a + 1) * b;
[0017] Wherein, N is the total number of encoding bits; a is the preset number of lamp beads; b is the number of encoding bits of a single lamp bead.
[0018] Further, the waveform signal is a full 0 code waveform signal.
[0019] Further, in the step of calculating the number of lamp beads on the light bar based on the preset parameter and the remaining number of encoding bits, the number of lamp beads is calculated by the following formula:
[0020] M = a - (c / b - 1);
[0021] Wherein, M is the number of lamp beads, and M is a natural number; a is the preset number of lamp beads; b is the number of encoding bits of a single lamp bead; c is the number of remaining encoding bits; "*" represents rounding to the nearest integer.
[0022] Further, after the step of calculating the number of lamp beads on the light bar based on the preset parameter and the remaining number of encoding bits, the control module further includes the following steps:
[0023] When the number of lamp beads calculated by the control module is less than zero, the control module increases a variable value and adds the variable value to the currently stored preset number of lamp beads as an updated preset number of lamp beads, wherein the variable value is greater than zero and the variable value is a natural number.
[0024] Further, the model of the lamp bead is selected from at least one of WS2812, WS2813, WS2812B, SK6812, SK6813, SK6822, SK6815, PLK6812, PLK6815B;
[0025] The number of encoding bits of the lamp bead is 24 bits.
[0026] The embodiment of the application also provides a sound box which adopts the technical scheme as follows:
[0027] A sound box, comprising a body and a light bar, a control module is arranged in the body, the control module comprises a DOUT pin and a DBACK pin, the DOUT pin of the control module is connected with an input end of the light bar, and the DBACK pin of the control module is connected with an output end of the light bar.
[0028] The control module is used for executing the detection method of the number of lamp beads as described above.
[0029] The embodiment of the present application also provides a multimedia device, which adopts the technical scheme as described below.
[0030] A multimedia device, characterized by comprising the sound box as described above.
[0031] The embodiment of the present application also provides a readable storage medium, which adopts the technical scheme as described below.
[0032] A readable storage medium, the readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the detection method of the number of lamp beads as described above.
[0033] Compared with the prior art, the embodiment of the present application has the following beneficial effects:
[0034] The present application provides a detection method of the number of beads in a control module applied to a sound box, the detection method inputs a preset control signal to a light bar through the control module, utilizes the characteristic that the lamp beads on the light bar latch the set code bit number in sequence, makes the waveform signal remain on the lamp beads in the signal flow direction, and then accurately calculates the number of lamp beads on the light bar through the preset parameter and the remaining code number, so that the sound box can generate correct light effect based on the detected number of lamp beads, and improves the experience of users. BRIEF DESCRIPTION OF DRAWINGS
[0035] In order to more clearly illustrate the scheme of the present application, the drawings needed in the embodiment description will be briefly introduced below, and obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0036] Figure 1 is a flow chart of the detection method of the number of lamp beads of the embodiment of the present application;
[0037] Figure 2 is a circuit principle diagram of the sound box of the embodiment of the present application;
[0038] Figure 3 is a data structure of the lamp bead of the embodiment of the present application.
[0039] Reference signs:
[0040] 1, sound box; 11, control module; 12, sound output module; 13, signal transmission module; 2, light bar. DETAILED DESCRIPTION
[0041] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description herein is for describing particular embodiments only and is not intended to be limiting of the application; the present application will be described with reference to the drawings and terminology used by a person skilled in the art. The terminology used in the description herein is for describing particular embodiments only and is not intended to be limiting of the application. The words "comprising," "including," "having," and the like, as used in the specification are meant to be construed in a non- limiting fashion. The terms "first," "second," and the like, as used in the description herein, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
[0042] Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are they necessarily mutually exclusive of one another. As will be apparent to those of ordinary skill in the art, embodiments described herein can be combined with other embodiments.
[0043] In the prior art, the control of LED light bars mainly has the following three modes: 1, RGB full-color lamp beads; 2, full-color single-channel RGB light bar control; 3, light bar made of point control full-color RGB lamp beads.
[0044] Since the RGB full-color lamp beads are connected in series with 4 wires of different colors, and are installed in series by installers, in addition to the series of hundreds of full-color lamp beads, the installation assembly also includes a power supply and a controller, and the installation process is relatively complex and cumbersome, the installation cost is high, and it is not convenient to apply to LED light bars connected with sound boxes.
[0045] And the full-color single-channel RGB light bar control is single-channel control, if multiple-channel control is needed, each channel is directly not interacted and related, and the application of LED connected with a sound box lacks dynamic and has poor user experience.
[0046] The light bar made of point control full-color RGB lamp beads can realize "single-point control" of the full-color light bar. It can be seen that since the control data flow is unidirectional, this kind of light bar is suitable for making a marquee light, flowing along the direction of the light bar, etc. Because single-point control is adopted, in the case of different physical shapes of the light bar, the controller of this kind of light bar is programmed for different scenes, and very good colorful effect can be obtained, therefore, the light bar of this mode can be applied to LED light bars connected with sound boxes, and good light effect experience can be obtained based on users.
[0047] Due to the deviation of the manufacturing process, the number of lamp beads on the lamp strip made of point-controlled full-color RGB lamp beads may be different. Therefore, when the control module outputs a fixed number of lamp bead control signals to the lamp strip, it cannot control the lamp strip to emit the correct light effect, resulting in poor user experience. In addition, when the number of lamp beads is large, the staff cannot accurately count each one, so the staff cannot set the corresponding lamp bead control signal according to the actual number of lamp beads.
[0048] Please refer to Figure 1 Based on the above problems, the lamp bead number detection method provided by the embodiments of the present application is used to detect the number of lamp beads on the lamp strip using point-controlled full-color RGB lamp beads, so that the control module can output the corresponding lamp bead control signal according to the detected number of lamp beads, control the lamp strip to emit the correct light effect, and improve the user's light effect experience.
[0049] In some embodiments, the lamp bead number detection method comprises the following steps:
[0050] Step S100, input a preset parameter in the control module.
[0051] In some embodiments, the preset parameter includes a preset number of lamp beads and the number of code bits of a single lamp bead.
[0052] Step S200, connect the input end of the lamp strip to the DOUT pin of the control module, and connect the output end of the lamp strip to the DBACK pin of the control module.
[0053] Please refer to Figure 2 In some embodiments, the sound box 1 is provided with a control module 11, and the control module 11 has a DOUT pin and a DBACK pin. The DOUT pin is a data output pin for outputting a control signal, and the DBACK pin is a data receiving pin for receiving a control signal.
[0054] The lamp strip 2 is provided with at least one lamp bead, and the lamp bead has a VCC pin, a DIN pin, a DO pin and a GND pin. The VCC pin is a power supply pin, and the VCC pin is connected to an external power supply. The DIN pin is a data input pin for receiving the control signal input by the control module 11. The DO pin is a data output pin for outputting a control signal. The GND pin is a ground pin, and the GND pin is grounded.
[0055] In the embodiment, the lamp strip 2 comprises the first lamp bead LED1, the second lamp bead LED2 and the third lamp bead LED3 arranged in sequence on the lamp strip 2, the DIN pin of the first lamp bead LED1 is connected with the DOUT pin of the control module 11, the DO pin of the first lamp bead LED1 is connected with the DIN pin of the second lamp bead LED2, the DO pin of the second lamp bead LED2 is connected with the DIN pin of the third lamp bead LED3, and the DO pin of the third lamp bead LED3 is connected with the DBACK pin of the control module 11.
[0056] In step S300, the control module transmits a control signal to the input end of the lamp strip based on the preset parameter, wherein the control signal is a waveform signal.
[0057] In step S400, the control module detects the rising edge of the DBACK pin and counts the remaining code bit number.
[0058] In some embodiments, since the lamp strip 2 is provided with the point control full-color RGB lamp bead, when the control signal passes through the lamp bead, the lamp bead will latch b code bit numbers, and when the control signal passes through the lamp bead arranged on the lamp strip 2, the waveform signal of the control signal will be reduced by M×b code bit numbers, wherein M is the number of lamp beads on the lamp strip 2.
[0059] Since the control signal is a waveform signal, when the control signal output by the DOUT pin of the control module 11 passes through the lamp strip 2 and is input to the control signal from the DBACK pin, the control module 11 can detect the waveform data by detecting the rising edge of the DBACK pin, so as to count the remaining code bit number.
[0060] In step S500, the control module calculates the number of lamp beads on the lamp strip based on the preset parameter and the remaining code number.
[0061] The embodiment of the present application provides a detection method of the number of lamp beads in the control module 11 applied to the sound box 1, the detection method inputs a preset control signal to the lamp strip 2 through the control module 11, utilizes the characteristic that the lamp beads on the lamp strip 2 latch a set code bit number in sequence, makes the waveform signal remain on the lamp beads in the signal flow direction, and then calculates the number of lamp beads on the lamp strip 2 accurately through the preset parameter and the remaining code number, so that the sound box 1 can generate correct light effect based on the detected number of lamp beads, and the experience of the user is improved. In some embodiments, the model of the point control full-color RGB lamp bead arranged on the lamp strip is selected from at least one of WS2812, WS2813, WS2812B, SK6812, SK6813, SK6822, SK6815, PLK6812 and PLK6815B, and the code bit number of the lamp bead is 24 bits.
[0062] In the embodiment, the model of the lamp bead is WS2812, and a 24-bit data structure of the lamp bead is as shown in Figure 3
[0063] The lamp bead with 24-bit encoding bits used in the embodiment can realize 16777216 kinds of full-color display, and has the advantages of low driving voltage, environmental protection, high brightness, large scattering angle, high consistency, low power consumption, and long service life.
[0064] In some embodiments, the step S300, the control module transmits a control signal to the input end of the lamp strip based on the preset parameter, specifically comprising the following steps:
[0065] The control module calculates the total encoding bits required based on the preset parameter.
[0066] In some embodiments, the total encoding bits are calculated by the following formula:
[0067] N=(a+1)×b;
[0068] Wherein, N is the total encoding bits; a is the preset number of lamp beads, in the embodiment, a is 200; b is the encoding bits of a single lamp bead, in the embodiment, b is 24.
[0069] The control module inputs a control signal to the input end of the lamp bead based on the total encoding bits.
[0070] The total encoding bits calculated by the preset number of lamp beads combined with the encoding bits of a single lamp bead in the control module of the embodiment, since the preset number of lamp beads is far more than the upper limit of the number of lamp beads marked by the lamp strip itself, the total encoding bits calculated can realize the filling of the encoding bits of each lamp bead, so as to accurately obtain the number of lamp beads on the lamp strip subsequently.
[0071] In the embodiment, the waveform signal output by the control signal is a full-0 code waveform signal.
[0072] The embodiment outputs a full-0 code waveform signal, which can realize the detection of the number of lamp beads without lighting the lamp bead, avoiding the damage to the lamp bead caused by lighting the lamp bead.
[0073] In some embodiments, the step S500, the control module calculates the number of lamp beads on the lamp strip based on the preset parameter and the remaining encoding number, and the number of lamp beads is calculated by the following formula:
[0074] M=a-(c / b-1);
[0075] Wherein, M is the number of lamp beads, and M is a natural number; a is a preset number of lamp beads, in this embodiment, the a is 200; b is the number of coding bits of a single lamp bead, in this embodiment, the b is 24; c is the number of remaining coding bits; "*" represents rounding off.
[0076] The embodiment of the present application can accurately calculate the number of lamp beads on the lamp strip through the preset parameter and the number of remaining codes.
[0077] In other embodiments, when the number of lamp beads on the lamp strip is greater than the preset number of lamp beads, the number of lamp beads calculated by the step S500 is less than zero, at this time, the control module cannot obtain the number of lamp beads on the lamp strip, and the lamp effect control signal input by the control module cannot control all the lamp beads on the lamp strip to light up.
[0078] Therefore, in order to solve the above problems, the step S500 of the embodiment of the present application further includes the following steps after calculating the number of lamp beads on the lamp strip based on the preset parameter and the number of remaining codes:
[0079] When the number of lamp beads calculated by the control module is less than zero, the control module increases a variable value, and adds the variable value to the currently stored preset number of lamp beads to obtain an updated preset number of lamp beads, wherein the variable value is greater than zero, and the variable value is a natural number.
[0080] The control module of the embodiment of the present application can make the preset number of lamp beads greater than the number of lamp beads on the lamp strip by increasing the preset number of lamp beads at least once, so that the control module can accurately obtain the number of all lamp beads on the lamp strip after multiple detections, thereby facilitating the subsequent lamp effect control signal to control all the lamp beads on the lamp strip to light up, achieving the set lamp effect, and improving the user experience.
[0081] Please refer to Figure 2 Based on the above-provided lamp bead number detection method, the embodiment of the present application further provides a sound box 1, which comprises a body and a lamp strip 2, and the body is provided with a control module 11, the control module 11 comprises a DOUT pin and a DBACK pin, wherein the DOUT pin is a data output pin for outputting a control signal, and the DBACK pin is a data receiving pin for receiving a control signal, the DOUT pin of the control module 11 is connected with the input end of the lamp strip 2, and the DBACK pin of the control module 11 is connected with the output end of the lamp strip 2.
[0082] The control module 11 is used to execute the lamp bead number detection method as described above.
[0083] The sound box 1 provided in the embodiment of the present application has the function of detecting the number of lamp beads on the lamp strip 2 by setting the detection method of the number of lamp beads in the control module 11, so as to output the corresponding lamp effect control signal according to the specific number of lamp beads on the lamp strip 2, thereby enabling the lamp strip 2 to generate correct light effect and improving the user experience.
[0084] Please refer to Figure 2 As shown in the figure, in some embodiments, the lamp strip 2 is provided with at least one lamp bead, and the lamp bead has a VCC pin, a DIN pin, a DO pin and a GND pin. The VCC pin is a power supply pin, and the VCC pin is connected with an external power supply. The DIN pin is a data input pin for receiving the control signal input by the control module 11. The DO pin is a data output pin for outputting the control signal. The GND pin is a ground pin, and the GND pin is grounded.
[0085] In the embodiment, the lamp strip 2 includes a first lamp bead LED1, a second lamp bead LED2 and a third lamp bead LED3 arranged in sequence on the lamp strip 2. The DIN pin of the first lamp bead LED1 is connected with the DOUT pin of the control module 11. The DO pin of the first lamp bead LED1 is connected with the DIN pin of the second lamp bead LED2. The DO pin of the second lamp bead LED2 is connected with the DIN pin of the third lamp bead LED3. The DO pin of the third lamp bead LED3 is connected with the DBACK pin of the control module 11.
[0086] Please continue to refer to Figure 2 As shown in the figure, in some embodiments, the sound box 1 further includes a sound output module 12, and the sound output module 12 is connected with the control module 11. When the lamp strip 2 is installed on the sound box 1, the control module 11 outputs a sound control signal to the sound output module 12 and outputs a corresponding lamp effect control signal to the lamp strip 2, so that the light effect emitted by the lamp strip 2 can be matched with the sound, thereby improving the user experience.
[0087] In some embodiments, the sound box 1 further includes a signal transmission module 13, and the signal transmission module 13 is connected with the control module 11. The signal transmission module 13 receives the adjustment signal emitted by the user and transmits it to the control module 11. The control module 11 replaces the sound control signal and / or the lamp effect control signal based on the adjustment signal, so as to switch the emitted sound and / or light effect.
[0088] In some embodiments, based on the above-provided sound box, the embodiment of the present application further provides a multimedia device, which includes the sound box as described above.
[0089] In some embodiments, based on the detection method of the number of lamp beads provided above, the embodiment of the present application further provides a readable storage medium, the readable storage medium stores one or more programs, the one or more programs can be executed by one or more processors to implement the lamp bead unit number detection method as described above, to avoid repetition, which will not be described here.
[0090] Those of ordinary skill in the art understand that all or some steps in the method disclosed above can be implemented as software, firmware, hardware and appropriate combinations thereof. Some or all physical components can be implemented as software executed by a processor such as a central processor, a digital signal processor or a microprocessor, or as hardware, or as an integrated circuit such as an application specific integrated circuit. Such software can be distributed on a readable storage medium, which can include computer storage media (or non-transitory media) and communication media (or transitory media). As known to those of ordinary skill in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. In addition, as known to those of ordinary skill in the art, communication media generally includes computer readable instructions, data structures, program modules or other data in modulated data signals such as carriers or other transmission mechanisms, and can include any information delivery medium.
[0091] Obviously, the above described embodiments are only some of the embodiments of the present application, not all the embodiments, the preferred embodiments of the present application are given in the drawings, but do not limit the patent scope of the present application. The present application can be implemented in many different forms, and conversely, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions recorded in the foregoing specific embodiments, or make equivalent replacements to some technical features therein. Any equivalent structure made by using the content of the present application specification and drawings, directly or indirectly applied to other related technical fields, is also within the scope of the patent protection of the present application.
Claims
1. A method for detecting the number of LED beads, used to detect the number of LED beads on an LED strip, characterized in that, Includes the following steps: Input preset parameters into the control module, wherein the preset parameters include the preset number of LED beads and the number of bits of the code for a single LED bead; Connect the input terminal of the light strip to the DOUT pin of the control module, and connect the output terminal of the light strip to the DBACK pin of the control module; The control module sends a control signal to the input terminal of the light strip based on the preset parameters, wherein the control signal is a waveform signal; The control module detects the rising edge of the DBACK pin and counts the remaining number of bits. The control module calculates the number of LED beads on the light strip based on the preset parameters and the remaining number of codes.
2. The method for detecting the number of LED beads according to claim 1, characterized in that, The step of the control module transmitting a control signal to the input terminal of the light strip based on the preset parameters specifically includes the following steps: The control module calculates the total number of bits required for the input encoding based on the preset parameters; The control module inputs a control signal to the input terminal of the LED based on the total number of encoded bits.
3. The method for detecting the number of LED beads according to claim 2, characterized in that, The total number of bits in the encoding is calculated using the following formula: N = (a+1) × b; Where N is the total number of bits in the encoding; a is the preset number of LED beads; and b is the number of bits in the encoding of a single LED bead.
4. The method for detecting the number of LED beads according to claim 2, characterized in that, The waveform signal is a waveform signal with all zeros.
5. The method for detecting the number of LED beads according to claim 1, characterized in that, In the step where the control module calculates the number of LEDs on the light strip based on the preset parameters and the remaining number of codes, the number of LEDs is calculated using the following formula: M = a - ("c / b" - 1); Where M is the number of LEDs, and M is a natural number; a is the preset number of LEDs; b is the number of bits in the code for a single LED; c is the number of remaining code bits; "*" indicates rounding to the nearest integer.
6. The method for detecting the number of LED beads according to claim 5, characterized in that, After the control module calculates the number of LEDs on the light strip based on the preset parameters and the remaining code number, the following steps are also included: When the number of LEDs calculated by the control module is less than zero, the control module adds a variable value and adds the variable value to the currently stored preset number of LEDs to obtain the updated preset number of LEDs. The variable value is greater than zero and is a natural number.
7. The method for detecting the number of LED beads according to claim 1, characterized in that, The type of the LED is selected from at least one of WS2812, WS2813, WS2812B, SK6812, SK6813, SK6822, SK6815, PLK6812, and PLK6815B. The LED chip has a 24-bit encoding.
8. A speaker, characterized in that, The speaker includes a main body and an LED strip. The main body contains a control module, which includes a DOUT pin and a DBACK pin. The DOUT pin of the control module is connected to the input terminal of the LED strip, and the DBACK pin of the control module is connected to the output terminal of the LED strip. The control module is used to execute the method for detecting the number of LED beads as described in any one of claims 1 to 7.
9. A multimedia device, characterized in that, Includes the speaker as described in claim 8.
10. A readable storage medium, characterized in that, The readable storage medium stores one or more programs, which can be executed by one or more processors to implement the method for detecting the number of LED beads as described in any one of claims 1 to 7.