Design of electronic clock based on STC15w408AS

In the previous period, the small generation sent an article on the headline called "How to design an electronic product with a single-chip microcomputer", which mentioned that we use a DIY electronic clock as an example to explain. Today we will talk about this DIY electronic in detail. The making of the clock.

First, the demand analysis

I have already said it before, we have designed three functions. Can display time + date + temperature; can automatically adjust the brightness; can adjust the time + alarm.

1, a clock can display the year, month, day, hour, minute, temperature;

2, can adjust the time, has an alarm clock function, with a button tone;

3, the brightness can be automatically adjusted with the ambient light;

Second, the principle and circuit design

After the demand, we select components according to the requirements, the microcontroller we choose STC15w408AS, this chip integrates high-precision RC oscillator circuit and high-reliability reset circuit, the direct external crystal and reset circuit can be omitted, the chip is powered on. After that, it can work directly; the MCU comes with ADC conversion, ready for temperature measurement and digital tube brightness adjustment; the display part is driven by a simple common digital tube; to achieve adjustment time, so you need to press the button; There are sounding components, here we use a simple active buzzer; the source of the clock is generated by the DS1302 clock chip, the temperature measurement is a thermistor, and a photoresistor is needed to illuminate the light to achieve the brightness of the digital tube. Variety.

With the above main components, we need some auxiliary components to complete the whole design. For example, we need to consider the interface problem in the power supply part. We use DC1.2 core power socket for this model, and the power supply is connected with 100u and 104. Capacitor is used for power supply filtering. The digital tube uses a triode 8050 to control the position of the cathode. The buzzer also uses the 8050 triode for switching. The specific circuit schematic is shown below:

How to make an electronic clock with a single chip microcomputer

The above circuit is designed by Protel 99 software. This version is relatively old, but it is still very practical for beginners, and the general circuit board can be completed. After having the circuit schematic diagram, we can transfer from software to PCB diagram. After placing the components, we can route them. Note that the wiring should not be automatically routed. The boards for automatic wiring are basically not used. If you are too lazy to wire, It can be automatically changed first and then manually. Here's a screenshot of our design:

How to make an electronic clock with a single chip microcomputer

In order to increase the strength and electrical conductivity of the board, we have made copper for the power ground (GND) on the top and bottom layers. The red part in the above figure is the copper layer on the top layer. Here's what the software 3D looks like:

How to make an electronic clock with a single chip microcomputer

Third, the sample test

After all the design is finished, if there is any error in the second inspection, you can find the manufacturer to make the sample after it is correct. Now the real industry is in the big price reduction, each family can automatically calculate the price online, you can compare the pricing, the general sample 50 Yuan is still 包邮. Remind everyone, there is no need to find someone to do on Taobao, and find the manufacturer directly. The proofing time is 3-4 days, the express delivery is 3-4 days, and the week has passed. After waiting for a week, the heart is itching. After receiving the board, everyone must be excited, so start testing.

How to make an electronic clock with a single chip microcomputer

Open the box first to check the appearance of the board, silk screen, etc. There is no problem (usually no problem, unless the board of the small workshop); then test the power supply VCC and GND directly connected, the theoretical resistance is infinite. If these are all right, prepare the components for soldering. The general order of soldering is: short and high. How to say, is the height of the component on the board, now welding from the shortest, then welding the medium height, and finally welding the highest components. Come to Zhang Quanjiafu before welding.

How to make an electronic clock with a single chip microcomputer

Fourth, programming and testing

Programming is white is programming, we first write a test program into it, test the various parts have no problems, can work. The program written now is the MCU reads the DS1302 clock data, displays the time on the digital tube, the second display uses the timing, lights up 200ms per second, and the buzzer sounds once every second. Photosensitive, thermal and button are relatively simple circuits, generally no problem, not tested. After programming is completed, it is programmed into the microcontroller. The running effect is as follows: the digital tube photo is not clear, so try to add a filter after debugging.

How to make an electronic clock with a single chip microcomputer

The running program can see that the digital tube display is normal, the buzzer sounds normal, and the test is completed. Followed by we followed the test and perfection of the entire DIY electronic clock program.

VEIIK Micko Vape Series

VEIIK Micko is one of the best flavor-rich, TPD-compliant disposable vape pens in the world. Its main features:
- High-quality material: 304 stainless steel, original Japanese OCC.
- The flavor stays fresh for more than six months.
- Long-lasting: 1.5ml capacity cartridge, 310mAh capacity battery. Lasts 400+ puffs.
- Perfect flavor with the big vapor production.
- OEM support service.

The vaporizer pen is more and more popular in the international market. Because this kind of small vape is

very compact and portable, extremely convenient to use. Vaping E pen wholesale, contact us for details.


veiik micko vape,veiik micko vape pen,veiik micko disposable vaporizer,veiik micko vape bar,veiik micko vape kit

Ningbo Autrends International Trade Co.,Ltd. , https://www.vapee-cigarettes.com