A dimming control method, device and terminal equipment for potentiometer analog-to-digital conversion
By calculating the sample value and resistance value of the potentiometer and generating light adjustment instructions in combination with the algorithm, the problem of inaccurate dimming of the potentiometer is solved, and the accuracy and efficiency of light adjustment are improved.
Patent Information
- Application Number
- CN202210935059.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-04
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2042-08-04
AI Technical Summary
In the prior art, the potentiometer dimming control has the problem of inaccurate dimming, especially when there is a problem with the circuit, it is difficult to accurately identify the position and dimming value of the potentiometer.
By obtaining the first sample value and the second sample value of the potentiometer, the resistance value of the potentiometer is calculated using the preset first resistance algorithm and the second resistance algorithm, and the dimming value is calculated in combination with the parameters, and the lighting adjustment instructions are generated to achieve accurate lighting adjustment.
The dimming control of potentiometer analog-to-digital conversion is realized, which improves the accuracy and efficiency of lighting adjustment, and can obtain the rotation position of the potentiometer in real time and generate accurate dimming values.
Smart Images

Figure CN115460747B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of dimming control, and in particular to a dimming control method, device and terminal equipment for analog-to-digital conversion of a potentiometer. Background Art
[0002] In addition to using console dimming for stage lighting, more and more customers are asking for quick and convenient dimming, so adding knobs for quick and convenient dimming is also a trend.
[0003] Existing technology generally uses knobs for dimming, including encoder knobs and potentiometer knobs. Encoder knobs rely on voltage level changes to identify rotation, resulting in infinite rotation. However, the current position cannot be determined, requiring the addition of a storage IC. Potentiometer knobs, on the other hand, are mostly based on electronic circuits to achieve dimming. When circuit problems occur, dimming is prone to inaccurate and difficult to troubleshoot.
[0004] Therefore, a dimming control strategy based on potentiometer analog-to-digital conversion is urgently needed to solve the problem of inaccurate dimming. Summary of the Invention
[0005] The embodiment of the present invention provides a dimming control method based on potentiometer analog-to-digital conversion to improve the accuracy of light adjustment.
[0006] In order to solve the above problem, an embodiment of the present invention provides a dimming control method using potentiometer analog-to-digital conversion, comprising:
[0007] Obtaining a first sampling value and a second sampling value of a target potentiometer; wherein the target potentiometer is connected to a preset circuit structure;
[0008] Obtaining a first resistance value of the target potentiometer by using a preset first resistance algorithm according to the first sampling value and the second sampling value;
[0009] Obtaining a second resistance value of the target potentiometer using a preset second resistance algorithm according to the first sampling value;
[0010] According to the first resistance value and the second resistance value of the target potentiometer, the dimming value is calculated by preset parameters, and a light adjustment instruction is generated according to the dimming value. The light adjustment instruction is sent to the lighting device so that the lighting device adjusts the brightness according to the light adjustment instruction.
[0011] As can be seen from the above, the present invention has the following beneficial effects:
[0012] The present invention provides a dimming control method using potentiometer analog-to-digital conversion. The method collects sampled values of a potentiometer, calculates a first resistance value and a second resistance value of the potentiometer using a preset first resistance algorithm and a preset second resistance algorithm, calculates a dimming value using preset parameters, and finally generates a light adjustment instruction based on the dimming value, thereby completing light adjustment of a lighting device. The present invention calculates the potentiometer resistance value based on the sampled values of the potentiometer, causes a change in the sampled values through changes in the potentiometer resistance, and then calculates the change in the potentiometer value by identifying the sampled values. Compared to existing technologies, the method can obtain the rotational position of the potentiometer in real time and generate an accurate dimming value, thereby improving the accuracy and efficiency of light adjustment and meeting user needs for light adjustment.
[0013] As an improvement to the above solution, the preset circuit structure includes: a potentiometer, a first resistor, a second resistor, a third resistor, a fourth resistor, a first voltage zener diode, a second voltage zener diode, a first capacitor, a second capacitor, a first voltage input terminal, a second voltage input terminal, a first analog-to-digital pin of the MCU, and a second analog-to-digital pin of the MCU, specifically:
[0014] The first pin of the potentiometer is respectively connected to one end of the first resistor and one end of the second resistor; the first voltage input end is connected to the other end of the first resistor; the other end of the second resistor is respectively connected to the cathode of the first voltage stabilizing diode, one end of the first capacitor, and the first analog-to-digital pin of the MCU;
[0015] The third pin of the potentiometer is respectively connected to one end of the third resistor and one end of the fourth resistor; the second voltage input end is connected to the other end of the third resistor; the other end of the fourth resistor is respectively connected to the cathode of the second voltage stabilizing diode, one end of the second capacitor, and the second analog-to-digital pin of the MCU;
[0016] The second pin of the potentiometer, the anode of the first voltage stabilizing diode, the anode of the second voltage stabilizing diode, the other end of the first capacitor, and the other end of the second capacitor are grounded.
[0017] By implementing the improved solution of this embodiment, this embodiment forms a stable circuit structure through the connection relationship between the potentiometer, the first resistor, the second resistor, the third resistor, the fourth resistor, the first voltage zener diode, the second voltage zener diode, the first capacitor, the second capacitor, the first voltage input terminal, the second voltage input terminal, the first analog-to-digital pin of the MCU, and the second analog-to-digital pin of the MCU, so that the first pin and the third pin of the potentiometer can be accurately collected by the first analog-to-digital pin of the MCU and the second analog-to-digital pin of the MCU to collect the collected values, thereby improving the accuracy of the collected values at both ends of the potentiometer, and the circuit structure can be applied to the connection between all potentiometers and MCUs, which is convenient for promotion.
[0018] As an improvement to the above solution, the preset first resistance algorithm is specifically:
[0019]
[0020] Among them, R 总 is the total resistance of the potentiometer, R 分压 is the resistance of the first voltage-dividing resistor or the second voltage-dividing resistor, AD1 is the first sampling value, AD2 is the second sampling value, and F is the sampling value resolution of the MCU.
[0021] By implementing the improved solution of this embodiment, the present application calculates the total resistance of the potentiometer based on the first sampling value and the second sampling value of the potentiometer, thereby avoiding the problem of different resistance values of mass-produced potentiometers, accurately measuring the resistance value of each potentiometer, and improving the calculation accuracy of the total resistance of the potentiometer, thereby laying the foundation for the calculation of the dimming value.
[0022] As an improvement to the above solution, the preset second resistance algorithm is specifically:
[0023]
[0024] Among them, R1 is the current resistance of the potentiometer, R 分压1 is the resistance of the first voltage divider resistor, AD1 is the first sampling value, and F is the sampling value resolution of the MCU.
[0025] By implementing the improved solution of this embodiment, this embodiment can accurately obtain the position of the potentiometer by calculating the current resistance value of the potentiometer based on the first collected value without any other operation. While ensuring the accuracy of the calculation of the current resistance value of the potentiometer, the efficiency of the internal calculation of the circuit is improved.
[0026] Accordingly, an embodiment of the present invention further provides a dimming control device for potentiometer analog-to-digital conversion, comprising: a data acquisition module, a first calculation module, a second calculation module, and a third calculation module;
[0027] The data acquisition module is used to acquire a first sampling value and a second sampling value of a target potentiometer; wherein the target potentiometer is connected to a preset circuit structure;
[0028] The first calculation module is configured to obtain a first resistance value of the target potentiometer according to the first sampling value and the second sampling value by using a preset first resistance algorithm;
[0029] The second calculation module is used to obtain a second resistance value of the target potentiometer according to the first sampling value through a preset second resistance algorithm;
[0030] The third calculation module is used to calculate the dimming value according to the first resistance value and the second resistance value of the target potentiometer through preset parameters, and generate a light adjustment instruction according to the dimming value, and send the light adjustment instruction to the lighting device so that the lighting device adjusts the brightness according to the light adjustment instruction.
[0031] As an improvement to the above solution, the preset circuit structure includes: a potentiometer, a first resistor, a second resistor, a third resistor, a fourth resistor, a first voltage zener diode, a second voltage zener diode, a first capacitor, a second capacitor, a first voltage input terminal, a second voltage input terminal, a first analog-to-digital pin of the MCU, and a second analog-to-digital pin of the MCU, specifically:
[0032] The first pin of the potentiometer is respectively connected to one end of the first resistor and one end of the second resistor; the first voltage input end is connected to the other end of the first resistor; the other end of the second resistor is respectively connected to the cathode of the first voltage stabilizing diode, one end of the first capacitor, and the first analog-to-digital pin of the MCU;
[0033] The third pin of the potentiometer is respectively connected to one end of the third resistor and one end of the fourth resistor; the second voltage input end is connected to the other end of the third resistor; the other end of the fourth resistor is respectively connected to the cathode of the second voltage stabilizing diode, one end of the second capacitor, and the second analog-to-digital pin of the MCU;
[0034] The second pin of the potentiometer, the anode of the first voltage stabilizing diode, the anode of the second voltage stabilizing diode, the other end of the first capacitor, and the other end of the second capacitor are grounded.
[0035] As an improvement to the above solution, the preset first resistance algorithm is specifically:
[0036]
[0037] Among them, R 总 is the total resistance of the potentiometer, R 分压 is the resistance of the first voltage-dividing resistor or the second voltage-dividing resistor, AD1 is the first sampling value, AD2 is the second sampling value, and F is the sampling value resolution of the MCU.
[0038] As an improvement to the above solution, the preset second resistance algorithm is specifically:
[0039]
[0040] Among them, R1 is the current resistance of the potentiometer, R 分压1 is the resistance of the first voltage divider resistor, AD1 is the first sampling value, and F is the sampling value resolution of the MCU.
[0041] Correspondingly, an embodiment of the present invention also provides a computer terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a dimming control method of potentiometer analog-to-digital conversion as described in the present invention.
[0042] Correspondingly, an embodiment of the present invention further provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute a dimming control method of potentiometer analog-to-digital conversion as described in the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 1 is a flow chart of a dimming control method using analog-to-digital conversion of a potentiometer provided in one embodiment of the present invention;
[0044] Figure 2 1 is a schematic structural diagram of a dimming control device for analog-to-digital conversion using a potentiometer provided in one embodiment of the present invention;
[0045] Figure 3 1 is a structural diagram of a dimming control circuit provided by an embodiment of the present invention;
[0046] Figure 4 1 is a flow chart of a dimming control method using potentiometer analog-to-digital conversion provided by another embodiment of the present invention;
[0047] Figure 5 This is a schematic diagram of the structure of a terminal device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0048] 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. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0049] Example 1
[0050] See also Figure 1 , Figure 1 FIG. 1 is a flow chart of a dimming control method for analog-to-digital conversion of a potentiometer provided by an embodiment of the present invention. Figure 1 As shown, this embodiment includes steps 101 to 104, and each step is specifically as follows:
[0051] Step 101: Acquire a first sampling value and a second sampling value of a target potentiometer; wherein the target potentiometer is connected to a preset circuit structure.
[0052] In a specific embodiment, the sampling value of the target potentiometer is obtained through the analog-to-digital pin of the MCU. Since the voltage across the potentiometer changes according to the internal resistance of the potentiometer, the MCU can obtain the sampled value across the potentiometer through a preset circuit structure based on the voltage across the potentiometer.
[0053] In a specific embodiment, the specific formula for converting the obtained voltage into the collected value by the MCU is as follows:
[0054]
[0055] Among them, AD is the collected value, U 电位器 is the voltage distributed by the potentiometer, U 输入 is the input external voltage, R 电位器 is the current resistance of the potentiometer, R 分压 is the voltage divider resistor of the circuit, and n is the parameter preset by the MCU.
[0056] In this embodiment, the preset circuit structure includes: a potentiometer, a first resistor, a second resistor, a third resistor, a fourth resistor, a first voltage zener diode, a second voltage zener diode, a first capacitor, a second capacitor, a first voltage input terminal, a second voltage input terminal, a first analog-to-digital pin of an MCU, and a second analog-to-digital pin of an MCU, specifically:
[0057] The first pin of the potentiometer is respectively connected to one end of the first resistor and one end of the second resistor; the first voltage input end is connected to the other end of the first resistor; the other end of the second resistor is respectively connected to the cathode of the first voltage stabilizing diode, one end of the first capacitor, and the first analog-to-digital pin of the MCU;
[0058] The third pin of the potentiometer is respectively connected to one end of the third resistor and one end of the fourth resistor; the second voltage input end is connected to the other end of the third resistor; the other end of the fourth resistor is respectively connected to the cathode of the second voltage stabilizing diode, one end of the second capacitor, and the second analog-to-digital pin of the MCU;
[0059] The second pin of the potentiometer, the anode of the first voltage stabilizing diode, the anode of the second voltage stabilizing diode, the other end of the first capacitor, and the other end of the second capacitor are grounded.
[0060] In a specific embodiment, see Figure 3 , Figure 3 This is a structural diagram of the dimming control circuit provided in this embodiment, as shown in FIG. Figure 3 As shown: the 1, 2, and 3 interfaces of the potentiometer in the figure represent the first, second, and third pins of the potentiometer respectively; the voltage divider resistor 1 (10K) represents the first resistor, the fixed resistor (1K) located on the upper side represents the second resistor, the voltage divider resistor 2 (10K) represents the third resistor, and the fixed resistor (1K) located on the lower side represents the fourth resistor; the voltage regulation values of the first Zener diode and the second Zener diode are both 5.6V; the first capacitor and the second capacitor are both 0.1uF; AD2 represents the first analog-to-digital pin of the MCU; AD1 represents the second analog-to-digital pin of the MCU; the first voltage input source and the second voltage input source are both +3.3V;
[0061] Among them, the 3.3V voltage will be distributed to the voltage divider resistor and the potentiometer resistor. When the resistance value of the potentiometer changes, the voltage at the AD1 (AD2) end will change according to the change in the resistance of the potentiometer. The microcontroller can collect the AD values at both ends based on the voltage value of AD1 (AD2).
[0062] In a specific embodiment, there is no special requirement for the voltage divider resistor. Generally, for the convenience of calculation, the resistance value is consistent with that of the potentiometer.
[0063] In a specific embodiment, methods for changing the resistance of the potentiometer include, but are not limited to: being able to adjust the resistance of the potentiometer by turning a knob; adjusting the resistance of the potentiometer by sliding a slider;
[0064] Step 102: Obtain a first resistance value of a target potentiometer according to the first sampling value and the second sampling value by using a preset first resistance algorithm.
[0065] In this embodiment, the preset first resistance algorithm is specifically:
[0066]
[0067] Among them, R 总 is the total resistance of the potentiometer, R 分压 is the resistance of the first voltage-dividing resistor or the second voltage-dividing resistor, AD1 is the first sampling value, AD2 is the second sampling value, and F is the sampling value resolution of the MCU.
[0068] In a specific embodiment, the first resistance value is R 总 (i.e. the total resistance of the potentiometer).
[0069] In a specific embodiment, the sampling value resolution is configured by the MCU port itself: it is configured when the MCU port is configured during system initialization, and commonly used resolutions include 8 bits (256), 10 bits (1024), and 12 bits (4096).
[0070] Step 103: Obtaining a second resistance value of the target potentiometer according to the first sampling value through a preset second resistance algorithm;
[0071] In this embodiment, the preset second resistance algorithm is specifically:
[0072]
[0073] Among them, R1 is the current resistance of the potentiometer, R 分压1 is the resistance of the first voltage divider resistor, AD1 is the first sampling value, and F is the sampling value resolution of the MCU.
[0074] In a specific embodiment, the second resistance value is R1 (ie, the current resistance value of the potentiometer).
[0075] Step 104: Calculate a dimming value based on the first resistance value and the second resistance value of the target potentiometer using preset parameters, generate a light adjustment instruction based on the dimming value, and send the light adjustment instruction to the lighting device so that the lighting device adjusts the brightness according to the light adjustment instruction.
[0076] In this embodiment, the preset parameter is 255, and the dimming value is calculated by a preset dimming value formula. The preset dimming value formula is as follows:
[0077]
[0078] Among them, R1 is the current resistance of the potentiometer, R 总 is the total resistance of the potentiometer, D 调光 is the dimming value; generating a light adjustment instruction according to the dimming value is a prior art, and the innovation of the present invention lies in the method of inferring the light adjustment value by collecting the value, so the light adjustment instruction is not described in detail.
[0079] For better explanation, see Figure 4 , Figure 4 A flowchart of a dimming control method using potentiometer analog-to-digital conversion according to another embodiment of the present invention includes the following steps 401 to 405:
[0080] Step 401: Dimming control starts, and the analog-to-digital port (i.e., AD port) of the MCU is configured;
[0081] Step 402: Read the AD value of AD1 and the AD value of AD2, and infer the total resistance of the potentiometer using the first resistance algorithm;
[0082] Step 403: Read the AD value of AD1, and then use the second resistance algorithm to infer the current resistance value of the potentiometer knob;
[0083] Step 404: Compare the current resistance of the potentiometer to the proportion of the total resistance of the potentiometer using the preset parameter value, and calculate the dimming value;
[0084] Step 405: Send the dimming value to the LED for dimming operation, and finally the dimming control ends.
[0085] This embodiment collects sampled values from a potentiometer, calculates the potentiometer's first and second resistance values using a preset first and second resistance algorithms, and then calculates a dimming value based on preset parameters. Finally, a light adjustment command is generated based on the dimming value, thereby achieving light adjustment for the lighting device. This embodiment, combined with a dimming control method and a dimming circuit structure, achieves stable dimming based on the modulus of the potentiometer, improving the accuracy of existing light adjustment methods and facilitating their widespread adoption in various dimming devices containing potentiometers.
[0086] Example 2
[0087] See also Figure 2 , Figure 2 1 is a schematic structural diagram of a dimming control device for analog-to-digital conversion of a potentiometer provided in one embodiment of the present invention, comprising: a data acquisition module 201, a first calculation module 202, a second calculation module 203, and a third calculation module 204;
[0088] The data acquisition module 201 is used to acquire a first sampling value and a second sampling value of a target potentiometer; wherein the target potentiometer is connected to a preset circuit structure;
[0089] The first calculation module 202 is configured to obtain a first resistance value of the target potentiometer according to the first sampling value and the second sampling value by using a preset first resistance algorithm;
[0090] The second calculation module 203 is configured to obtain a second resistance value of the target potentiometer according to the first sampling value by using a preset second resistance algorithm;
[0091] The third calculation module 204 is used to calculate a dimming value based on the first resistance value and the second resistance value of the target potentiometer using preset parameters, generate a light adjustment instruction based on the dimming value, and send the light adjustment instruction to the lighting device so that the lighting device adjusts the brightness according to the light adjustment instruction.
[0092] As an improvement to the above solution, the preset circuit structure includes: a potentiometer, a first resistor, a second resistor, a third resistor, a fourth resistor, a first voltage zener diode, a second voltage zener diode, a first capacitor, a second capacitor, a first voltage input terminal, a second voltage input terminal, a first analog-to-digital pin of the MCU, and a second analog-to-digital pin of the MCU, specifically:
[0093] The first pin of the potentiometer is respectively connected to one end of the first resistor and one end of the second resistor; the first voltage input end is connected to the other end of the first resistor; the other end of the second resistor is respectively connected to the cathode of the first voltage stabilizing diode, one end of the first capacitor, and the first analog-to-digital pin of the MCU;
[0094] The third pin of the potentiometer is respectively connected to one end of the third resistor and one end of the fourth resistor; the second voltage input end is connected to the other end of the third resistor; the other end of the fourth resistor is respectively connected to the cathode of the second voltage stabilizing diode, one end of the second capacitor, and the second analog-to-digital pin of the MCU;
[0095] The second pin of the potentiometer, the anode of the first voltage stabilizing diode, the anode of the second voltage stabilizing diode, the other end of the first capacitor, and the other end of the second capacitor are grounded.
[0096] As an improvement to the above solution, the preset first resistance algorithm is specifically:
[0097]
[0098] Among them, R 总 is the total resistance of the potentiometer, R 分压 is the resistance of the first voltage-dividing resistor or the second voltage-dividing resistor, AD1 is the first sampling value, AD2 is the second sampling value, and F is the sampling value resolution of the MCU.
[0099] As an improvement to the above solution, the preset second resistance algorithm is specifically:
[0100]
[0101] Among them, R1 is the current resistance of the potentiometer, R 分压1 is the resistance of the first voltage divider resistor, AD1 is the first sampling value, and F is the sampling value resolution of the MCU.
[0102] This embodiment uses a data acquisition module to acquire sampled values from both ends of the potentiometer. Based on these sampled values, a first calculation module and a second calculation module calculate the total resistance and current resistance of the potentiometer. Finally, a third calculation module obtains a dimming value, which is then used to generate a light adjustment command for the lighting device, thereby adjusting the brightness of the lighting device. Compared to existing technologies, this embodiment can obtain the potentiometer's rotational position in real time and generate accurate dimming values, improving the accuracy and efficiency of light adjustment and thus meeting user needs for light adjustment.
[0103] Example 3
[0104] See also Figure 5 , Figure 5 It is a schematic diagram of the terminal device structure provided by one embodiment of the present invention.
[0105] A terminal device of this embodiment includes: a processor 501, a memory 502, and a computer program stored in the memory 502 and executable on the processor 501. When the processor 501 executes the computer program, the steps of the dimming control method for analog-to-digital conversion of each potentiometer in the embodiment are implemented, for example Figure 1 Alternatively, when the processor executes the computer program, the functions of the modules in the above-mentioned device embodiments are realized, for example: Figure 2 The potentiometer analog-to-digital conversion shown is all modules of the dimming control device.
[0106] In addition, an embodiment of the present invention further provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to perform the dimming control method of potentiometer analog-to-digital conversion as described in any of the above embodiments.
[0107] Those skilled in the art will understand that the schematic diagram is merely an example of a terminal device and does not constitute a limitation on the terminal device. The terminal device may include more or fewer components than shown in the diagram, or a combination of certain components, or different components. For example, the terminal device may also include input and output devices, network access devices, buses, etc.
[0108] The processor 501 may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor. The processor 501 is the control center of the terminal device, connecting various parts of the entire terminal device using various interfaces and lines.
[0109] The memory 502 can be used to store the computer programs and / or modules. The processor 501 implements various functions of the terminal device by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory 502. The memory 502 can mainly include a program storage area and a data storage area. The program storage area can store an operating system and at least one application required for a function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created based on the use of the mobile phone (such as audio data, a phone book, etc.). In addition, the memory can include a high-speed random access memory and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state storage device.
[0110] Wherein, if the module / unit integrated in the terminal device 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 invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0111] It should be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, in the drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art can understand and implement the present invention without inventive effort.
[0112] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A dimming control method using potentiometer analog-to-digital conversion, characterized in that: include: Obtain a first sampling value and a second sampling value of a target potentiometer; wherein the target potentiometer is connected to a preset circuit structure; the preset circuit structure includes: a potentiometer, a first resistor, a second resistor, a third resistor, a fourth resistor, a first voltage zener diode, a second voltage zener diode, a first capacitor, a second capacitor, a first voltage input terminal, a second voltage input terminal, a first analog-to-digital pin of an MCU, and a second analog-to-digital pin of an MCU, specifically: the first pin of the potentiometer is respectively connected to one end of the first resistor and one end of the second resistor; the first voltage input terminal is connected to the other end of the first resistor; the other end of the second resistor is respectively connected to the negative electrode of the first voltage zener diode, the negative electrode of the first voltage zener diode, the negative electrode of the second voltage zener diode, and the negative electrode of the second voltage zener diode. One end of a capacitor and the first analog-to-digital pin of the MCU are connected; the third pin of the potentiometer is respectively connected to one end of the third resistor and one end of the fourth resistor; the second voltage input end is connected to the other end of the third resistor; the other end of the fourth resistor is respectively connected to the negative electrode of the second voltage-stabilizing diode, one end of the second capacitor, and the second analog-to-digital pin of the MCU; the second pin of the potentiometer, the positive electrode of the first voltage-stabilizing diode, the positive electrode of the second voltage-stabilizing diode, the other end of the first capacitor, and the other end of the second capacitor are grounded; the first resistor is a voltage-dividing resistor, the third resistor is a voltage-dividing resistor, and the resistance values of the first resistor and the third resistor are the same; Obtaining a first resistance value of the target potentiometer by using a preset first resistance algorithm according to the first sampling value and the second sampling value; Obtaining a second resistance value of the target potentiometer using a preset second resistance algorithm according to the first sampling value; According to the first resistance value and the second resistance value of the target potentiometer, the dimming value is calculated by preset parameters, and a light adjustment instruction is generated according to the dimming value. The light adjustment instruction is sent to the lighting device so that the lighting device adjusts the brightness according to the light adjustment instruction.
2. The dimming control method of potentiometer analog-to-digital conversion according to claim 1, characterized in that: The preset second resistance algorithm is specifically: Among them, R1 is the current resistance of the potentiometer, R 分压1 is the resistance of the first voltage divider resistor, AD1 is the first sampling value, and F is the sampling value resolution of the MCU.
3. A dimming control device with potentiometer analog-to-digital conversion, characterized in that: include: A data acquisition module, a first calculation module, a second calculation module, and a third calculation module; The data acquisition module is used to obtain the first sampling value and the second sampling value of the target potentiometer; wherein the target potentiometer is connected to a preset circuit structure; the preset circuit structure includes: a potentiometer, a first resistor, a second resistor, a third resistor, a fourth resistor, a first voltage stabilizing diode, a second voltage stabilizing diode, a first capacitor, a second capacitor, a first voltage input terminal, a second voltage input terminal, a first analog-to-digital pin of the MCU, and a second analog-to-digital pin of the MCU, specifically: the first pin of the potentiometer is respectively connected to one end of the first resistor and one end of the second resistor; the first voltage input terminal is connected to the other end of the first resistor; the other end of the second resistor is respectively connected to the negative terminal of the first voltage stabilizing diode The first and second analog-to-digital pins of the MCU are connected; the third pin of the potentiometer is connected to one end of the third resistor and one end of the fourth resistor respectively; the second voltage input terminal is connected to the other end of the third resistor; the other end of the fourth resistor is connected to the negative electrode of the second voltage stabilizing diode, one end of the second capacitor, and the second analog-to-digital pin of the MCU respectively; the second pin of the potentiometer, the anode of the first voltage stabilizing diode, the anode of the second voltage stabilizing diode, the other end of the first capacitor, and the other end of the second capacitor are grounded; the first resistor is a voltage dividing resistor, the third resistor is a voltage dividing resistor, and the resistance values of the first resistor and the third resistor are the same; The first calculation module is configured to obtain a first resistance value of the target potentiometer according to the first sampling value and the second sampling value by using a preset first resistance algorithm; The second calculation module is used to obtain a second resistance value of the target potentiometer according to the first sampling value through a preset second resistance algorithm; The third calculation module is used to calculate a dimming value based on the first resistance value and the second resistance value of the target potentiometer through preset parameters, generate a light adjustment instruction based on the dimming value, and send the light adjustment instruction to the lighting device so that the lighting device adjusts the brightness according to the light adjustment instruction.
4. The dimming control device of potentiometer analog-to-digital conversion according to claim 3, characterized in that: The preset second resistance algorithm is specifically: Among them, R1 is the current resistance of the potentiometer, R 分压1 is the resistance of the first voltage divider resistor, AD1 is the first sampling value, and F is the sampling value resolution of the MCU.
5. A computer terminal device, characterized in that: The device comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the dimming control method of the potentiometer analog-to-digital conversion as claimed in any one of claims 1 to 2 is implemented.
6. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the dimming control method of potentiometer analog-to-digital conversion according to any one of claims 1 to 2.
Citation Information
Patent Citations
Potentiometer precision control method and device, storage medium and electronic equipment
CN110874066A
Control circuit of 0-10V light modulator
CN215121275U