cABKRdK32Z

【Hunan Industrial Vocational and Technical College】Simple stopwatch + Mao Shaoyu

 
Overview

Chapter 1 Design Task
1 Content and Requirements
(1) The simple stopwatch has a display function and can display 0-99 milliseconds, 0-59 seconds, and 0-59 minutes.
(2) It has a timing function. When the millisecond meter reaches 99, it starts again from 0 and the seconds digit advances by 1. When the seconds digit reaches 59, it starts again from 0 and the minutes digit advances by 1. This cycle is repeated and the timing is accurate.
(3) It has a button function. Start button: After pressing, the stopwatch can start timing from 0s. Pause button: After pressing, the stopwatch can be paused immediately at any time and the current timing time can be displayed. Reset button: After pressing, the stopwatch can stop timing at any time and the displayed time will be reset to zero.
(4) It has a function of reporting the time every minute. When the seconds digit displays 59 and 01, the buzzer and light-emitting diode will sound and light up for 1s.
(5) It can control the display and extinguishing of the digital tube, and the timing function works normally.
(6) It can manually set the start time of the minutes and seconds digits.
Chapter 2 Design Plan
2.1 Overall idea:
The design of this topic is to make a counter that can display minutes, seconds, and milliseconds, with power charging function, manual minute carry, second carry function, timing function, hourly time telling function, start, pause and reset function, and backlight function. Then this circuit mainly includes 6 parts: the first part is the power supply and lithium battery charging and discharging circuit, which provides power for the circuit; the second part provides a periodic pulse signal; the third part is a combination counter with the second part as the input source; the fourth part is the display part, which displays the result of the third part in a certain way; the fifth part is the key function part, which realizes start, pause, reset, manual carry, and backlight display through buttons; the sixth part is the hourly time telling part, which tells the time at 59 and 01 seconds by monitoring the signal of the display part.
2.2 Design Plan
Use the synchronous adder counter CD4518 to form a 100-base adder counter as the first-level (millisecond) counter. At the moment when the millisecond unit digit counts to 10, a clear signal is sent to the unit digit, and a carry pulse is sent to the tens digit at the same time. The millisecond ten-digit adder counter sends a reset signal to the current position at the moment of counting to 100, and sends a carry pulse to the second position at the same time. This constitutes a cascaded 100-base adder counter with carry and reset.
The second position and minute position are different from the millisecond position. They are counted in 60-base, so the reset and counting methods need to be changed: at the moment when the second position and minute position count 9, a falling edge carry signal will be sent to the ten position. At the moment when the second position and minute position ten-digit adder counter count to 60, a reset signal is sent to the current position through the AND gate, and a carry pulse is sent to the lower position at the same time. This constitutes a cascaded 60-base adder counter with carry and reset.
Chapter 3 Circuits of Each Part
3.1 Power Supply
Considering the working voltage of each component, the circuit uses USB5V power input. At the same time, lithium batteries are used for power supply. Because lithium batteries need to be charged, we use TC4056 to step down and charge lithium batteries. The chip has an automatic stop function when fully charged. DW01FA and 8205S are used to provide overcharge and over-discharge protection for lithium batteries. MT3608 is used to increase the voltage of the lithium battery to 5V to provide power for the circuit. The circuit diagram is as follows
 
3.2 Pulse signal
The pulse signal is generated by a multivibrator composed of NE555 to generate a 100Hz pulse signal to provide a counting pulse for CD4518. The output frequency of NE55 is determined by RP1, R13 and C5. The calculation formula F=1.44/(RP1+2R13)*C5. RP1 uses a precision adjustable potentiometer, which can be used with an oscilloscope to accurately adjust the output frequency. The circuit diagram is as follows
 
3.3 Counter
Since CD4518 is a binary and decimal (8421 encoding) synchronous add counter, it contains two units of add counters. Each single unit has two clock input terminals CLK and EN, which can be triggered by the rising or falling edge of the clock pulse. As long as a clock pulse is input, the counting unit Q1 flips once; when Q1 is 1 and Q4 is 0, the counting unit Q2 flips once for each clock pulse input; when Q1=Q2=1, Q3 flips once for each clock pulse input; when Q1=Q2=Q3=1 or Q1=Q4=1, Q4 flips once for each clock pulse input. In this way, starting from the initial state ("0" state), the counting unit automatically returns to the "0" state after every 10 clock pulses are input. If the output terminal Q4A of the first add counter is used as the clock pulse signal of the input terminal ENB of the second add counter, a two-bit 8421 encoding counter can be formed, and multi-bit serial counting can be performed in sequence.
This experimental design is to design 60- and 100-base add counters, which are larger than the counting range of a CD4518 and need to be cascaded. With the help of RESET to clear the counter, 60- and 100-base counting can be achieved. When and only when the tens digit of the millisecond counts to 9, that is, when 1001 is output, it will automatically clear to 0, and at the same time generate a falling edge signal to send a carry pulse to the hundreds digit. Because the hundreds digit of the millisecond is also decimal, it has the same carry method as the ones digit. To achieve 60-base counting, the ones digit counting method of seconds and minutes is the same as the millisecond digit carry method. The AND gate collects the BCD code of seconds and minutes. When the tens digit CD4518 of seconds and minutes outputs 0110, the AND gate will output a rising edge signal, send a clear signal to this digit, and give a carry signal to the next level. The circuit diagram is as follows
3.4 Display circuit
The display circuit uses CD4511 to decode the BCD code of CD4518 and drive the digital tube display. At the same time, a switch is used to control the level of the BI terminal of CD4511 to control the digital tube display. The circuit diagram is as follows
3.5 Button function
The reset, start, and pause functions are realized by using the dual JK flip-flop 74ls112.
After pressing the start button, the 3rd pin (J pin) of 74LS112 is connected to a high level, the 2nd pin (K pin) is a low level, and the high level is output through the 5th pin (Q pin) output terminal to the 74LS08 AND gate input terminal. The other input terminal is connected to the NE555 pulse signal. When the output is high level, the output of the pulse signal is controlled by the AND gate, and the pulse signal is sent to the CLK terminal of CD4518. When the button is released, the JK terminal of 74LS112 will become a low level, and the output of the Q terminal will remain high, thereby realizing the start function.
After pressing the pause button, the K pin is connected to a high level, the J pin is a low level, and the low level is output through the Q pin, controlling the 74LS08 to output 0 all the time, so that the CP terminal of CD4518 cannot receive the pulse signal and pause counting, thereby realizing the pause function.
 
 
 
3.6 Hourly time reporting function
Connect the output of CD4518 to CD4069 and 74LS21 to output high level at 59 and 01 seconds, and use 74LS32 or gate drive transistor to realize buzzer and light-emitting diode to ring and emit light for 1 second at 59 and 01 seconds. The circuit diagram is as follows
3.7 Manual carry function
Connect the carry end of seconds and minutes through the key. When the key is triggered, a pulse signal will be generated, so that CD4518 can count and realize the manual carry function. The circuit diagram is as follows
 
 
Summary
This nearly 20-day project design has come to an end. In this course design, we have a lot of feelings. Course design is a practical training for the comprehensive application of our professional knowledge, a summary and inspection of professional knowledge, and an indispensable process for future learning.
When we first got the design topic, we were still confused and felt that we had no idea where to start. So we didn't rush to start, but spent a day analyzing the topic, designing its general operating principle, and making certain demonstrations and improvements. After the plan was determined, we went to consult the information, selected the chip, and re-improved the design plan through the parameters and functions of the selected chip. In addition, we continued to improve and innovate on the basic functions and added new functions. We designed a total of three sets of plans. The first set of plans added millisecond counting to the basic functions, and had 59 seconds and 01 seconds flashing lights and buzzing; the second set of plans added batteries and charging circuits to the first set; the third set of plans added manual seconds and minutes carry, and backlight functions.
In this course design, we also encountered many problems, such as being careless in drawing circuit diagrams, connecting pins to unnecessary places, causing problems with the digital tube display after soldering the components, and unclear ideas in writing documents, not grasping the key points, causing confusion in the text content, but this design has made us a lot of progress. Through this design, we closely linked theory and practice together, and felt that the depth of learning was deeper than the textbook. For some things, only when we really do them can we truly master them and understand them more deeply. Optical theoretical knowledge is far from enough.
In general, although there were setbacks in this course design, it was still fruitful.
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-24 06:31:43

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号