Using CD4040 to make colorful light
Source: InternetPublisher:睡不醒的小壮 Keywords: Lighting control CD4040 Updated: 2024/08/12
Using CD4040 to make colorful light
The colorful color-changing lamp made of CD4040 has the advantages of simple circuit, low power consumption, low cost, bright light, no need for debugging, etc. CD4040 is a 12-bit binary counter/divider. Figure 1 is the pin arrangement diagram of CD4040. The attached table is the function table of CD4040.
1. Working principle
The schematic diagram of the colorful color-changing lamp is shown in Figure 2, which consists of a power supply circuit, a counting pulse input circuit, a counter (including a driving circuit) all-off state elimination circuit, a load circuit, etc.
The mains is stepped down by R1 and C1 (R2 is a discharge resistor), bridge rectified by VD1-VD4, stabilized by VD5, filtered by C2, and outputs a 12V DC voltage to power the IC and three groups of light-emitting diodes. At the same time, the mains is divided by R5 and R7 from point A, and then input to the IC pin ⑩ through R6 as a 50Hz sine wave with a low amplitude. Here, it can be approximately regarded as a square wave. CD4040 is used as a divider, and the divided pulses are output from the (15), (14), and (12) pins of the IC. They are limited by R8, R9, and R10 and connected to the negative electrodes of the three groups of blue, green, and red light-emitting diodes, respectively. The output is valid at a low level. The (15) pin of the IC, i.e., Q11, divides the pulse input from the ⑩ pin by 2^(n-1) and outputs it. Its frequency is 50÷2^(n-1)Hz. Since the periodic pulse is divided by N, the frequency of the input pulse is reduced by N times, that is, the period of the input pulse is expanded by N times, which makes calculation convenient. Assume that the pulse periods output by IC (15), (14), (12) pins are T15, T14, T12 respectively. Since the period of the input pulse is T = 1/50s = 0.02s, then:
T15=0.02sx2^10=20.48s (approximately 20s)
T14=0.02sx2^9=10.24s (approximately 10s)
T12=0.02sx2^8=5.12s (approximately 5s)
If the IC's pin (11) is not connected as shown in Figure 2, but as shown in Figure 3, it will only be reset when powered on, and the IC will always be in the counting state.
The waveform, color mixing effect and color sequence of the 50Hz square wave divided by CD4040 are shown in Figure 4. As can be seen from Figure 4, there are eight states from white, cyan, purple, blue, yellow, green, red to all off, with a cycle of about 20 seconds, and each state lasts about 2.5 seconds.
The circuit for eliminating the all-off state is composed of R4 and VD6-VD8. The reset terminal (11) is connected to the positive power supply through R4. The negative electrodes of diodes VD6-VD8 are connected to the three output terminals respectively, forming an original three-input AND gate circuit. Pins (15), (14), and (12) are the input terminals of this AND gate respectively. Pin (11) is the output terminal of this AND gate. Since the logical function of the AND gate is: low is low, all highs are high. When the power is just turned on, pin (11) is high level, cleared, all three lights are on, and the mixed color effect is white. After that, when the six colors from blue to red are output, at least one of the three output terminals is low level, and the counter is in the counting state (the second row of the function table). When the red color ends, the three output terminals still have a tendency to output high level, so they are cleared again and the counter counts again. However, this clearing pulse is very narrow and occupies a very short time of white light. It cannot be detected by the human eye and can only be observed with the help of a low-frequency oscilloscope.
The actual output waveform is shown in Figure 5 (the shaded part is the clear pulse). Since the connection method of pin (11) changes the original output waveform of the three output terminals, the all-off state is cleared. The seven states of white, cyan, purple, blue, yellow, green and red form a cycle. One cycle is about 17.5 seconds, and each state still lasts about 2.5 seconds.
The load is composed of 4 blue, green and red high brightness LEDs (scattered type) connected in series. When the output end is at a low level, the LED is lit. According to the principle of three-primary color mixing, the purpose of color mixing can be achieved by using an opal light bulb. R8, R9 and R10 are current limiting resistors, and their resistance values are determined by the power supply voltage and the parameters of the LED (forward voltage, rated forward current) during debugging.
2. Production method
The lamp holder is a damaged energy-saving lamp holder, and a 32W lamp holder is selected (a 9W lamp holder has a circular circuit board with a diameter of only 34mm, and the components are dense, so it is difficult to make it manually). Carefully remove the lamp tube and the internal circuit board, hollow out the front end of the lamp holder, and use a 50mm diameter single-sided copper-clad board to make the circuit board, as shown in Figure 6 (a) (omitted). The light-emitting diode is installed on the plastic partition at the front end of the lamp holder, as shown in Figure 6 (b) (omitted). The center of the circuit board and the center of the plastic partition are drilled with holes about 3mm in diameter. The two are connected and fixed with a screw rod and a nut with a diameter of 3mm. The two are connected with four wires, as shown in Figure 6 (omitted), and installed in the lamp holder. The cream-colored bulb uses a plastic western medicine bottle (creamy color) with an outer diameter of about 50mm. Remove the bottleneck and fix it to the front end of the lamp holder with adhesive (it can be inside or outside the sleeve), and the color mixing effect is very good. Figure 7 is a real picture of the seven-color color-changing lamp made by the author.
3. Component selection
R1 is 2W, and the other resistors are all 1/8W; C1 is a 0.68uF/400V polypropylene capacitor. VD5 is a 12V, 1W voltage regulator diode, such as IN4742. LEDs are red, green, and blue high-brightness light-emitting diodes, and other components are selected according to the schematic diagram.
- A small improvement on the ordinary refrigerator motor starting circuit
- Starting method of asynchronous motor with external frequency-sensitive resistor
- Design and principle analysis of practical electric curtain remote control device
- Design and production of wireless multi-location control switch circuit
- Design and production of no-load automatic power-off device for household power supply
- Ultra-short wave item left behind reminder alarm
- Homemade anti-theft watchdog
- Range hood automatic controller
- A simple circuit diagram of abnormal mobile phone charging alarm
- A gas stove igniter circuit
- Agricultural spraying and insecticide control circuit
- Differential amplifier emitter negative feedback gain control circuit
- Flashing wall light control circuit
- Water and electricity saving infrared control circuit
- Chicken farm photoelectric control circuit
- 24h automatic switching capacitor control circuit
- Haier KFR-25GW air conditioner control circuit schematic diagram
- Relay control circuit a
- Detection and control circuit of electromagnetic stove
- Automatic sprinkler irrigation control circuit