Intelligent Digital Electronic Clock Design Based on AT89S52 Microcontroller

(1) The digital clock realizes the timing device for the year, month, day, hour, minute, second and week display. Due to the development of digital integrated circuits and the wide application of quartz crystal oscillator, the accuracy of digital clock is far more than that of old-fashioned The digitization of timepieces and clocks has brought great convenience to people's production and life, and greatly expanded the original timekeeping function of watches.

(2) Such as timed automatic alarm, time program automatic control, automatic starting and closing street lights, on-off power equipment, and even automatic activation of various timing electrics, all of which are based on digitalization of clocks. Therefore, studying digital clocks and expanding their applications has very real significance. The electronic clock is realized by the AT89S52 single-chip microcomputer and the LCD1602 electronic display, which can be switched by the button and switched in 12/24 hours.

Features:

(1) Realize the display of year, month, day, week, hour, minute and second;

(2) Implementing the time adjustment function;

(3) Implement 12/24 hour system switching;

(4) Realize the hourly chime function.

Design:

System Block Diagram

Device selection (main device)

(1) AT89S52 microcontroller

(2) LCD1602 LCD screen

AT89S52 Design - Intelligent Digital Electronic Clock

AT89S52

The 1602LCD is divided into two types: backlit and non-backlit. The majority of the base controller is HD44780. The backlight is thicker than the backlight. There is no difference in the application with backlight. 1602LCD main technical parameters: display capacity: 16 & TImes; 2 characters, chip operating voltage: 4.5-5.5V, working current: 2.0mA (5.0V), module best working voltage: 5.0V, character size: 2.95 & TImes; 4.35 ( W&TImes;H)mm

AT89S52 Design - Intelligent Digital Electronic Clock

LCD1602 pin diagram

Pin 1: VSS is the ground power.

Pin 2: VDD is connected to 5V positive power supply.

Pin 3: VL is the LCD contrast adjustment end. When the positive power is connected, the contrast is the weakest. When the grounding is the highest, the contrast is too high. When the contrast is too high, “ghosting” will occur. When using it, the contrast can be adjusted by a 10K potentiometer.

Pin 4: RS is the register selection. When the high level is selected, the data register is selected, and when the low level is selected, the instruction register is selected.

Pin 5: R/W is the read/write signal line. When it is high, it performs a read operation, and when it is low, it performs a write operation. When RS and R/W are low together, the instruction or display address can be written. When RS is low, R/W is high, the busy signal can be read. When RS is high, R/W is low. Data can be written.

Pin 6: The E terminal is the enable terminal. When the E terminal changes from a high level to a low level, the liquid crystal module executes the command.

Pins 7 to 14: D0 to D7 are 8-bit bidirectional data lines.

Pin 15: The backlight is positive. Pin 16: Backlight negative.

AT89S52 Design - Intelligent Digital Electronic Clock

System total circuit simulation

Module circuit design:

The minimum system consists of a reset circuit and a clock circuit. The clock circuit provides a 12 MHz clock signal. The reset circuit uses a manual button reset circuit to reset the microcontroller without turning off the power.

AT89S52 Design - Intelligent Digital Electronic Clock

smallest system

D0 to D7 of the LCD display are connected to the P0 port of the MCU. Since the P0 port is used as the output port, an external pull-up resistor is required. RS is connected to P2.0 and EN is connected to P2.1. VEE external 4K slip to adjust the display contrast.

AT89S52 Design - Intelligent Digital Electronic Clock

LCD circuit

The module uses a separate keyboard. When the keyboard is pressed, the corresponding I/O port level changes from high to low, and the detection button is pressed once. Four independent buttons are connected to the P3.0-P3.3 port of the MCU.

AT89S52 Design - Intelligent Digital Electronic Clock

Keyboard input function selection circuit

The function of the buzzer is to generate an alarm sound on time. The LED lights up when the seconds are even or when the function key is pressed. The buzzer is connected to the P2.2 port of the single chip microcomputer, and the LED lamp is connected with the P2.3 port of the single chip microcomputer.

AT89S52 Design - Intelligent Digital Electronic Clock

buzzer

Software design flow chart:

The code should be written as follows

Relax E-cigarette

This is a kind of functional e-cigarette - relaxing e-cigarette that makes you relax and calm down. Of course, it doesn't contain nicotine.

The effect will be better to take a few deep breaths after smoking this relax electronic cigarette. Moreover, it is small in size, simple in appearance,

and easy to carry.

We are China leading manufacturer and supplier of Disposable Vapes puff bars, relax vape pen,relax e-cigarette kit,

relax disposable vape, and e-cigarette kit, and we specialize in disposable vapes, e-cigarette vape pens, e-cigarette kits, etc.

relax vape pen,relax e-cigarette kit,relax disposable vape, relax e-cigarette vaporizer, relax bar vape

Ningbo Autrends International Trade Co.,Ltd. , https://www.ecigarettevapepods.com