Design of second, minute and time adjustable clock based on single chip microcomputer

Today, I mainly do the MCU I like, oh, by the way, I will introduce the majors I have studied! Oh, what is the name of my major, "Automation"? It sounds ok! Actually, when you are volunteering, you don't know the specifics. What are you learning? After two or three years of exploration, I generally know what I should focus on, how to learn, what to do in the future. To tell the truth, it’s really hard to find out! I only understood one or two in more than two years. Maybe this is the punishment of the second-rate university when I was in high school. But it’s okay, I like this profession now, how to introduce this automation, I feel quite High-tech, in fact, nothing, everyone can see in real life, many of the social work processes are as automatic as possible, a button press to get the desired product from the original raw materials. What we have learned is how to make it happen, how each link works. Finally, digitalize each link to realize some complete systems that are controlled and displayed by the computer. However, it is impossible for one system to learn all. Can make a link in the period can be considered a master! ~ Oh

This article refers to the address: http://

This semester touched the microcontroller, which is a microprocessor, which integrates some functions of the computer. It can be seen everywhere in life: the induction cooker used in the kitchen integrates the control of the single-chip microcomputer, and the digital perpetual calendar hanging in the living room is also realized by the single-chip microcomputer! After understanding, I have great interest in this. The following is a simple demonstration of a single-chip-based experiment I have done. I hope to share the study together in this area!

Design of second, minute and time adjustable clock based on single chip microcomputer

This is the hardware design made with Proteus. I have probably used it for MCU. There are also software programs. If you compare this hardware to the appearance and hands and feet of the person (you can also control the stepper motor servo system and then use the motor). It is more like a robot to control some operations.) Then the software program is like a human brain. Below I also show my own program! Look at the expert guidance: it is written in C language.

This program should realize the precise timing of seconds, minutes and time. In addition, the P1 angle is also the left button of the MCU and there are three buttons to realize the hour, minute and second adjustment. The picture is not shown! Please post a part of the code below to download the code from http://dl.21ic.com/download/shiz5-rar-ic-106797.html

#include

Unsigned char code dispcode[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x40,};

Unsigned char disbitcode[]={0X00,0x10,0x20,0x30,0x40,0x50,0x60,0x70};//38 decoder digital chip

Unsigned char disbuf[8]={0,0,0,0,0,0,0,0};// Eight cycles are selected and turned on one by one.

Sbit OE=P2^6;

Sbit LE=P2^7;

Sbit K1=P1^0;

Sbit K2=P1^1;

Sbit K3=P1^2;

Unsigned char second;

Unsigned char minite;

Unsigned char hour;

Unsigned int tcnt;

Void delay(unsigned int N)

{

While(N--);

}

Void getbuff()

{

Disbuf[0]=second%10;

Disbuf[1]=second/10;

Disbuf[2]=10;

Disbuf[3]=minite%10;

Disbuf[4]=minite/10;

Disbuf[5]=10;

Disbuf[6]=hour%10;

Disbuf[7]=hour/10;

}

Void display()

{

Unsigned char i=0;

For(i=0;i<8;i++)

{

LE=1;

P3=disbitcode[i]; //Sequential chip selection by 38 decoder

P0=dispcode[disbuf[i]]; //Put the corresponding value into port P0

OE=0;

Delay(500);

}

}

Void key()

{

If(K1==0)

{

Delay(5000);

If(K1==0)

{

Second++;

If(second==60)

{

Second=0;

}

While(K1==0);

}

}

If(K2==0)

{

Delay(5000);

If(K2==0)

{

Minite++;

If(minite==60)

{

Minite=0;

}

While(K2==0);

}

}

If(K3==0)

{

Delay(5000);

If(K3==0)

{

Hour++;

If(hour==24)

{

Hour=0;

}

While(K3==0);

}

}

}

Void t0() interrupt 1 using 0

{

Tcnt++;

If(tcnt==4000)

{

Tcnt=0;

Second++;

If(second==60)

{

Second=0;

Minite++;

If(minite==60)

{

Minite=0;

Hour++;

If(hour==24)

{hour=0;}

}

}

}

}

Void main()

{

TMOD=0x02;

TH0=0x06;

TL0=0x06;

TR0=1;

ET0=1;

EA=1;

Second=0;

Minite=0;

Hour=0;

Tcnt=0;

While(1)

{

Key();

Getbuff();

Display();

}

}

After nearly two months of hard work, I still have a little sense of accomplishment! Indeed, I also made something! It’s a simple matter now! So I’m thinking about doing something complicated and useful, oh! It’s really hard to find out that I want to make a product that is still far worse. What I have done before should be classified as something in the experimental stage. I can’t take it out! Now when I start to do something concrete, I find that the things I learned before are too virtual. In the face of the master, I can't even say that I have learned more, not to mention it!

So I feel that learning things must be personally experienced, can not let go of some key details, think about when someone asks you what skills you will! Can you say that I am a master! Oh! When learning technology, must Be a little bit yourself, the more you want to learn, the better! Don't be tolerant of yourself, can't discount!

Things are often complicated after troubles! Just like the martial arts masters, there is no way to win!

Piezoelectric ceramic disc   

Quick delivery 

High performance

Application: flow meter measurement 


There are many kinds of USF used in closed pipeline according to the measuring principle, and the most commonly used are propagation time method and Doppler method. Among them, time difference ultrasonic flowmeter is used to measure fluid flow by the principle that the time difference of sound wave propagating downstream and countercurrent is proportional to the velocity of fluid flow. It is widely used in raw water measurement of rivers, rivers and reservoirs, process flow detection of petrochemical products, water consumption measurement of production process and other fields. According to practical application, time-difference ultrasonic flowmeter can be divided into portable time-difference ultrasonic flowmeter, fixed time-difference ultrasonic flowmeter and time-difference gas ultrasonic flowmeter.


Ultrasonic flow-meters use at least two transducers aligned so that ultrasonic pulses travel across the flow of liquid or gas in a pipe at a known angle to the flow. 



Technical data:

Electromechanical coupling coefficient Kp: > 0.62    

Dielectric Loss tg δ: <2%



Nominal Piezo discs for ultrasonic flowmeter: 

OD14.2*1MHz           PZT-51

OD14.6*1MHz           PZT-51

OD15*1MHz              PSnN-5

OD15*2MHz              PSnN-5

OD20*1MHz              PSnN-5 

OD20*2MHz             PSnN-5

OD15*1MHz              PZT-51 

OD15*2MHz              PZT-51

OD20*1MHz              PZT-51 

OD20*2MHz              PZT-51

Size,  Frequency and Electrode on request. 


20x2img 2019


28x1img 2040

Piezoelectric Discs For Flowmeter Sensor

Piezoelectric Ceramic Disc,Piezoelectric Discs For Flowmeter Sensor

Zibo Yuhai Electronic Ceramic Co., Ltd. , https://www.yhpiezo.com