Digital number selection machine
Source: InternetPublisher:sigma Keywords: CD4046 digital generation circuit Updated: 2024/10/29
1. Circuit Principle
1. Circuit diagram
The circuit is shown in the figure below. This work can randomly select a number from 0 to 9; its characteristic is that during a number selection process, the digital sequence displayed by the digital tube gradually slows down until it stops and the result is obtained.
2. Circuit Principle
The circuit mainly consists of two parts: voltage-controlled oscillator and digital display, supplemented by button operation circuit and sound prompt circuit.
IC1 is a phase-locked loop integrated circuit. 4046, in this circuit, only its voltage-controlled oscillator function is used. Press the operation button AN1, and after releasing it, the input voltage of the 9th pin of 4046 will gradually change from high to low; this voltage controls the oscillator inside 4046 to output a clock pulse signal with a frequency that gradually slows down and finally stops oscillating. Input this pulse signal to the 4033 counter/decoder to drive the digital tube to display the output result. When the frequency of the clock pulse signal is high, the digital tube quickly displays the 10-digit sequence from "0" to "9"; as the frequency of the clock signal gradually decreases and finally reaches zero, the last number displayed by the digital tube will stop at a number from 0 to 9, generating a number selection result. Since the clock signal frequency is several hundred hertz at the beginning, the operator cannot use buttons to control the final result of the number, and the number obtained can be considered random.
3. Button operation circuit
When using, press the button switch AN. At this time, the power supply voltage is added to the 9th foot of 4046 through the resistor R4, and the voltage rises rapidly; the voltage-controlled oscillator works. After releasing AN, due to the function of the integration circuit composed of R3 and C2 on this foot, the voltage on the 9th foot gradually decreases until the voltage is zero; at this time, the pulse frequency output by the voltage-controlled oscillator gradually decreases until it is zero. The number selection process of this circuit is about 3 seconds; the values of the integration circuit R3 and C2 can be changed to obtain different change speeds. The role of the resistor R4 is to prevent the charging current through the capacitor C2 from damaging the switch every time the button switch is pressed.
4. Sound prompt circuit and power supply voltage stabilization circuit
In addition to being output to 4033, the pulse output from pin 4 is also output to the input of the phase comparator I at pin 3. By connecting one end of a piezoelectric ceramic piece YD to the output of the phase comparator I at pin 2 and the other end to ground, the working status of the voltage-controlled oscillator can be monitored.
2. Assembling the number selection machine
The whole machine can be assembled on a half breadboard.
The push button switch AN should have a double-leg length of 10mm and can be directly inserted into the bread hole; the piezoelectric ceramic sound-generating piece is also packaged and can be directly inserted into the breadboard.
3. Number Selection Randomness Verification Experiment
Theoretically, the numbers generated by this circuit are random, but this conclusion needs to be verified through experiments.
It is recommended to test whether the circuit has achieved the expected design through at least 500 operations. The test method is to first make an experimental record table, as shown in the following table.
Carry out the number selection experiment for a total of 1000 times, and record the number of times each number from 0 to 9 appears in Table 1; you can use the word "positive" to record the results. After the experiment is completed, count the total number of times each number appears; then calculate the percentage of each number in the total number of times.
Number Selection Machine Randomness Verification Table | 1000 experiments) | ||||||||
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 |
just | just | just | just | _ | just | _ | just | _ | |
102 | 88 | 131 | … | … |
Finally, the experimental results are evaluated. A properly usable number selection machine requires that the probability of selecting 10 numbers is the same. In a total of 1,000 experiments, if the difference between the most selected number and the least selected number and the average value of 100 does not exceed 50%, the work can be considered successful. If the number of times a certain number is selected is much lower or much higher than the average value of 100, the work is unsuccessful.
4. Production Center Issues
1. Preliminary conception of the digital number selection machine
The initial digital number selection mechanism is relatively simple in concept, and its circuit is shown in the figure below.
In the process of high-speed counting, 4033 theoretically displays ten numbers from 0 to 9 in turn, but it looks like one number: 8. This work lacks authenticity and interest and is unsatisfactory.
Therefore, a circuit for displaying digital data with a slow-down effect was developed using the 4069 voltage-controlled oscillator, as shown in the figure below.
After the circuit is built and successfully runs, random verification is performed. It is found that the number "1" appears significantly less than other numbers. In the total 1000 experiments, it only appeared 19 times.
The reason is that the total current supplied by the power supply changes at any time due to the different number of segments lit up for the 7-segment digital tube for 10 digits; due to the internal resistance of the power supply, the working voltage of the circuit also fluctuates with the generation of different digits. The number 1 displays a small current, a high power supply voltage, and a low probability of stopping vibration.
Even if an electrolytic capacitor of more than 4700μF is connected in parallel to the power supply, the unfairness of the number selection results still exists.
2. A solution through timing circuit
In order to solve the above problem, a timer circuit is used to solve the time of generating the number selection result; for example, a 2-second timer composed of 4060 can be added to make the result of each number selection process fixed within 2 seconds. The circuit design is proved to be feasible through random number verification experiments.
3. Design and production of multi-digit number selection machine
Multiple clock pulses can be used to drive multiple single-digit displays respectively, or one clock pulse can be used to drive a multi-digit display.
- LED Night Light
- LED Bicycle Lights
- Sunday Reminder
- NE5532 standard linear preamplifier IC circuit features and application schematics
- AD108 frequency multiplier capable of inputting asymmetric square wave
- Digital control frequency division circuit composed of MC4018
- Broadband transconductance operational amplifier and buffer OPA660 common collector (common-C) amplifier circuit
- Typical application circuit of LM4911 for dual-channel amplifier
- Current feedback amplifier circuit of broadband transconductance operational amplifier and buffer OPA660
- 4-channel single-ended output amplifier circuit composed of TDA8580J
- PLL FM demodulation composed of CD4046
- A frequency meter circuit diagram composed of CD4046
- 555 square wave oscillation circuit
- 555 photo exposure timer circuit diagram
- Introducing the CD4013 washing machine timer circuit diagram
- Simple level conversion circuit diagram
- 555 electronic guide speaker circuit diagram for blind people
- Circuit diagram of disconnection alarm composed of 555
- Analog circuit corrector circuit diagram
- color discrimination circuit