Homemade multi-function LED electronic clock and multi-function timer circuit

LED light-emitting diode

1. The function drawing is an electronic clock controlled by AT89C51 (a little modification can also be used with P87LPC764). Its function is to track the time of the leap year, the size month and the week from 2000 to 2099, and display the year, month, day, week, hour, minute and second. The microcontroller is powered by the battery during a power outage and the timing is not lost. The electronic clock can also set a time switch that is turned on at a certain time and turned off at a certain time. 2. The working principle is completed by the single chip microcomputer. The data to be displayed is serial port RXD, and under the control of TXD and 74LS08, it is divided into two groups and output to string and convert registers D2 and D3 to drive the segment of the LED digital tube. The P1 port of the single-chip microcomputer outputs the digital tube bit code to realize dynamic display. In order to make the display brightness of the digital tube high and stable, the data is divided into two groups for transmission. In addition to the week, two digital tubes were selected at each moment. The figure uses a 0.5-inch high-brightness digital tube. If you want to use a large digital tube, you can adjust the drive circuit. In order to realize the display of the colon ":" between time and minute, the tenth and tenth digit digital tube should be wired according to the figure and rotated by 180°. The switch "mode", "bit flash left shift", "bit flash right shift", "plus one" complete time adjustment and timing setting. The system can be powered by a +5V DC regulated power supply or battery. When there is an external 5V power supply, 5V is 4.65V after dropping 0.35V on V1, which is higher than the 4.5V battery after dropping 0.35V on V2. V1 is turned on, and the power supply Vcc and V2 are cut off. The battery does not work (here the 锗 transistor VBE is less than 0.35V in this circuit operation and the minimum operating voltage of the AT89C51 is 4V, so V1 and V2 use 锗3AX21 or 3AX53). When the power is off, there is no external 5V, the battery turns V2 on, and the single-chip power supply Vcc, the system is not affected by power failure. This program sets a digital tube to flash when the call is lost after power failure, indicating that the power has been stopped. If there is no flashing of the digital tube when the call is requested after power failure, just connect the power supply terminal of the resistor connected to P3.3 from 5V to the b pole of V2. The internal timing accuracy of the microcontroller depends on the accuracy and stability of the 12MHz oscillation frequency, and the software can also be used to correct the time error. 3. Use the instructions to plug in the power, and press the reset button, the "Timed On Time" LED is on, enter the timed on time setting, the digital tube displays "02 07 18 4 000000". Press the “Bit flash right shift” button, the ten-digit “0” starts to flash. If you want to adjust the bit, press the “plus one” button. Each time you press it, the digit is incremented by one. After 9 to 9, press “Add”. One" becomes "0" again. If you don't adjust, press the “Bit Flash Right Shift” button. Each time you press “Bit Flash Right Shift”, the flashing bit shifts to the right by one bit. When you want to adjust the bit, press “Add One” to adjust. In the meantime, you can also press the “Bit flash right shift” button to move the flashing position and set the timing to open. After setting, press the “Mode” button again, the “Timed On Time” LED will be off, and the “Timed Off Time” LED will be on. When the timer is turned off, the digital tube will display “02 10 10 4 000000”. At this time, you can set the timing off time according to the above method. After setting, press the “Mode” button, the “Timed Off Time” LED will be off, the “Calibration Time” LED will be on, and the current time calibration will be entered. The digital tube will display “02 07 22”. 1 0000××”. After adjusting the time, press the “Mode” button, the “Calibration Time” LED will be off, and the circuit will enter the timing working state. Press the “Mode” button in the timed working state, return to the timed setting state, and then press the “Mode” button to return to the timed setting state. If you do not want to time, press the “Mode” button twice after reset to enter the time calibration state. After calibrating the time, press the “Mode” button again, and the circuit enters the timing working state. The above adjustments are made in bits, so sometimes the adjustments must be in order. For example, if the digital tube is displayed as “02 02 22 5 0000××”, it should be adjusted to “03 02 22 6 000000”, and the “bit flashing right shift” and “bit flash left shift” will make the year “2” flash. Move, then press "plus one" to adjust, the number will not change, you must first adjust the month's position to not "2", then adjust the year position, after the annual position is adjusted, then the month's unit is adjusted back to "2 ". For example, if the digital tube displays "02 08 22 4 0000××", it should be adjusted to "02 10 22 2 000000", and the "bit flashing right shift" and "bit flash left shift" make the October position "0" Flashing, press "plus one" to adjust, the number will not change, you must first adjust the month's ones to "1" or "2", then adjust the October position to "1", then the month's ones Adjust to "0". Second, the multi-function timer 1. Functions The multifunction timer can perform four functions depending on the software. DS1: 35 timing points can be set every day. Each timing point can be set to hour and minute. The timing can be set from 1 second to 59 minutes and 59 seconds. DS2: 30 time points can be set every day. Each time point can be set to hour and minute. The time can be set from 1 second to 59 minutes and 59 seconds. It can be set to irregular on Saturday and Sunday, irregular on Sunday, or It is timed every day. DS3: 9 or 9 time points can be set every day. Each time or each time point can be set to hour and minute. Each time or every point can be set to the time and minute. DS4: One time point can be set every day. The time, minute and second can be set at the time of opening, and the time can be set at any time, minute and second. If the user has special requirements, it can also be customized. 2. Working principle The working principle of the circuit is basically the same as that of the multi-function LED electronic clock (due to the layout relationship, the detailed circuit diagram cannot be published, and the readers who need it can contact the editorial department of the newspaper - editor). The difference is that since only 6 digital tubes are scanned, only one piece of 74LS164 is used, and at each moment, only one digital tube is selected. 3. Instructions for use DS1: Plug in the power, press the reset button to enter the timing time setting, the digital tube displays “all dark and full dark 0000”. Press the “Bit flash right shift”, “Plus one”, “Bit flash left shift” button to adjust the timing time, press the “Mode” button to enter the timing time 1 setting, the digital tube displays “000001”, you can start to set the first timing point. After adjusting the timing time 1, press the “Mode” button to enter the setting of the timing time 2, the digital tube displays “000002”, you can start to set the second timing point..., set 35 timing points (the second two digits of the digital tube) After setting the first timing point, press the “Mode” button to enter the calibration time. The “Calibration Time” LED is on. After adjusting the current time, press the “Mode” button. The “Calibration Time” LED will go out and enter the timing working state. If you press the “Mode” button in the timed operation state and return to the reset state, only the time and timing points are set, but they can be adjusted on the original basis. DS2: After power-on reset, the digital tube displays “770000”. The first digital tube on the left indicates the current day of the week. If it is not on week 7 (that is, Sunday), press “Bit to Right Shift” and “Add One”. The second digital tube on the left indicates whether the day of the week is 7 or not. Press “Bit to the right” and “Bit to the left” to make it flash. Press “Add one” to adjust. There are three indications: “0” means every day. Timing, "6" means that week 6 and week 7 are not regular, and "7" means that week 7 is not regular. The last four digits indicate the timing time, which can be set from 1 second to 59 minutes and 59 seconds. After setting, press the “Mode” button to enter the timing point setting. The digital tube displays “000001” (the right two digits indicate the set timing point), and the setting method is similar to DS1. DS3: After power-on reset, the digital tube displays “00001┏”, and the right two digits “1┏” indicate that it is set to the first timed on time. After setting the timed on time, press the “Mode” button to enter the timed off time setting. The digital tube displays “000001┓”, and the right two bits “1┓” indicate that it is set to the first time off time. After setting the first timed on/off time, set another 8 timed on/off times. The setting method is similar to that of DS1. DS4: After power-on reset, the digital tube displays “000000”, indicating that the timed on time setting is entered. After setting, press the “Mode” button, the digital tube will display “000000” again, and enter the timed off time setting. After setting the time off time, press the “Mode” button to enter the calibration time. The setting method is similar to that of DS1.

Stylus Pen Tip

Stylus Pen Tip,Stylus Pencil Tip,Carbon Fiber Pen Tip,Carbon Fiber Stylus Pen Tip

Shenzhen Ruidian Technology CO., Ltd , https://www.wisonens.com