Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING
Free library / Schemes of radio-electronic and electrical devices

Chronometer. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Measuring technology

Comments on the article Comments on the article

The design offered to the attention of readers is a high-precision device for measuring time, in other words, a chronometer, made in the dimensions of a wrist watch with autonomous power supply. It contains a relatively small number of public components. The printed circuit boards are made at home.

To fit into the dimensions of a wrist watch, the chronometer components are placed on two printed circuit boards. On the bottom board, the diagram of which is shown in Fig. 1 contains a DS3231M+ precision real time clock (DD1) and an ATtiny2313A-SU microcontroller (DD2). The microcontroller is clocked from the internal RC generator, which freed its PA0 and Pa1 pins for communication with the clock chip via the I interface2C.

Chronometer
Rice. 1. Precision clock chip

Port B of the microcontroller controls the elements of the numbers displayed by the LED indicator, and the anodes of the indicator discharges and control buttons are connected to the outputs of port D. The chronometer is powered by a single CR2032 lithium cell with a voltage of 3 V. The main supply voltage is supplied to the DD1 chip from the PD0 output of the microcontroller, and the backup (Vb) - through the Schottky diode VD1 from the lithium cell. This ensures the transition chip DD1 mode with low current consumption when the microcontroller DD2 in "sleep" mode.

Resistor R4 protects the PD0 output from a possible short circuit to a common wire when a button connected to it, located on another board, is pressed.

The drawing of the lower printed circuit board is shown in fig. 2. It is designed to install surface-mount elements - resistors and capacitors of size 1206, microcircuits in SOIC packages. The board provides contacts for connecting the microcontroller with the programmer.

Chronometer
Rice. 2. Drawing of the bottom PCB

The scheme of the upper board is shown in fig. 3. It has a four-digit LED indicator HG1, a battery G1 and buttons SB1-SB3. Board drawing - in fig. 4. The resistors on it are size 0805. The battery is placed in the CH224-2032 holder.

Chronometer
Rice. 3. Diagram of the top board

Chronometer
Rice. 4. Board drawing

The boards are made of fiberglass laminated on both sides with a thickness of 1 mm. After manufacturing, it is necessary to carefully check the printed conductors for open and short circuits. Board-to-board jumpers are soldered into the bottom board after the parts are mounted. Considering the high mounting density and the small width of the conductors, before connecting the boards to each other, it is necessary to make sure once again that there are no breaks or short circuits on them. An insulating gasket made of thin thick cardboard should be inserted between the boards.

After the power is turned on, the program puts the microcontroller into micro-consumption mode and turns off the main power supply of the clock chip. In the absence of the main power, this chip also goes into economy mode. The microcontroller "wakes up" on external interrupt requests. By interrupting INT0 from the SB1 button, the current time is displayed on the indicator, by interrupting INT1 from the SB2 button - setting the time. In the time setting mode, pressing the SB1 button changes the contents of the hour register, and pressing the SB2 button changes the contents of the minutes register. Change is possible only in the direction of increase.

Exit the time setting mode by pressing the SB3 button. When exiting, the program resets the seconds register of the clock chip. For this button to work, the program in the time setting mode switches the PD0 line from output to input and vice versa.

The HG1 indicator is controlled by the program using an eight-bit timer T0. Upon interrupt requests from the timer, information is displayed on the indicator, while the indicator operation time is being counted. The maximum duration of its continuous operation is set by the TimeDisp constant and is 4,7 s by default. The countdown of the indicator operation time (displaying the current time) starts from the moment the SB1 button is pressed.

For the convenience of checking the progress of the clock, a fragment can be activated in the program that allows you to turn the indicator on and off with the SB1 button. To do this, at the beginning of the Chronometer1 .asm source code file, uncomment (delete the semicolon character in the first position) the line

;#define No_time_limit_for_dispiay

After checking the clock, this line must be commented out again, since an accidental long-term inclusion of the indicator leads to a rapid discharge of the battery. Attached to the article are two versions of the boot file of the program. When creating one (Chronometer1 .hex), the specified line was commented out, and when creating another (Chronometer1NoUmit.hex), it was in effect.

The flashing of the separating colon is implemented in software. It is also provided for blanking out an insignificant zero in the discharge of tens of hours. In the time setting mode, there is no limit on the duration of the indicator, the colon is off.

Interface I2C operates at a frequency of 100 kHz, its software implementation is taken from the book by V. Trumpert "AVR-RISC microcontrollers" (Kyiv: MK-Press, 2006). The switching table of the indicator bits and the table of digit codes are located in the program memory of the microcontroller.

The DS3231M+ chip provides for the correction of the frequency drift of the quartz resonator as it ages. The correction is stored in the chip's Aging Offset Register. The chronometer program does not provide for such a correction, and 0 is written to the mentioned register (the SIGN=0 constant). You can change this constant if necessary. If the clock is fast, it should be assigned a positive value (the most significant bit is zero), if it is behind, a negative value (the most significant bit is equal to one). Jr unit

Discharging a constant changes the frequency of the clock's crystal oscillator by approximately 0,1 ppm. After changing the constant, you should retranslate the program and load the resulting HEX file into the microcontroller.

The configuration of the ATtiny2313A-sU microcontroller must match the table. The extended configuration byte remains unchanged.

Table

high byte low byte
Discharge Value Discharge Value
DWEN 1 CKDIV8 0
EESAVE 1 CKOUT 1
SPIE 0 SLJT1 1
WDTON 1 SUT0 0
BODLEVEL2 1 CKSEL3 0
BODLEVEL1 1 CKSEL2 1
BODLEVELO 1 CKSEL1 0
RSTDISBL 1 CKSEL0 0

The manufactured chronometer with the indicator on and a supply voltage of 3 V consumes an average current of 5 mA, in the "sleep" mode - 1 μA. Temperature correction of the generator frequency is performed every 64 s, the duration of the temperature measurement process is 125 ... 200 ms, the current consumed at this time is 575 μA. 492750 temperature measurements and frequency corrections are performed per year, which consumes about 16 mAh of electricity. With a battery capacity of 200 mAh, it will be enough to operate the chronometer for at least two years.

After assembly, the chronometer must be connected to the programmer, download the program to the microcontroller and set its configuration. After turning off the programmer and connecting the battery, you can press the SB1 button, the indicator will display "_0:00" with a flashing colon. By pressing the SB2 button, enter the time setting mode. Then, by pressing the SB1 button, set the current hour, and the current minute by pressing the SB2 button. Exit the time setting mode by pressing the SB3 button. In this case, the internal register of seconds of the DD1 microcircuit will be reset to zero, which allows you to synchronize the chronometer with a control clock or precise time signals. Pressing the SB1 button again, you will see the set time on the indicator.

To check the accuracy of the chronometer, you will have to be patient for at least a month. During this time, his readings should not go more than 3 s. Otherwise, you can change the value in the Aging Offset Register. How to do this is described above.

Checking the accuracy of the chronometer can also be done using an accurate frequency meter, the frequency output of 32768 Hz in the microcircuit is software activated. To measure the frequency between the contacts "32768 Hz" and "17" on the microcontroller board, you must temporarily connect a resistor with a nominal value of 10 kOhm, and between the contacts "32768 Hz" and "16" - a frequency meter. During the test, two AA size elements can be used to power the chronometer. It is also necessary to measure the consumed current in different operating modes and check the operation of the temperature frequency correction; during its normal operation, a microammeter connected in series with the power source will show surges of the consumed current with a period of 64 s.

Microcontroller programs can be downloaded from ftp://ftp.radio.ru/pub/2016/08/chrono.zip.

Author: N. Salimov

See other articles Section Measuring technology.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

The world's tallest astronomical observatory opened 04.05.2024

Exploring space and its mysteries is a task that attracts the attention of astronomers from all over the world. In the fresh air of the high mountains, far from city light pollution, the stars and planets reveal their secrets with greater clarity. A new page is opening in the history of astronomy with the opening of the world's highest astronomical observatory - the Atacama Observatory of the University of Tokyo. The Atacama Observatory, located at an altitude of 5640 meters above sea level, opens up new opportunities for astronomers in the study of space. This site has become the highest location for a ground-based telescope, providing researchers with a unique tool for studying infrared waves in the Universe. Although the high altitude location provides clearer skies and less interference from the atmosphere, building an observatory on a high mountain poses enormous difficulties and challenges. However, despite the difficulties, the new observatory opens up broad research prospects for astronomers. ... >>

Controlling objects using air currents 04.05.2024

The development of robotics continues to open up new prospects for us in the field of automation and control of various objects. Recently, Finnish scientists presented an innovative approach to controlling humanoid robots using air currents. This method promises to revolutionize the way objects are manipulated and open new horizons in the field of robotics. The idea of ​​controlling objects using air currents is not new, but until recently, implementing such concepts remained a challenge. Finnish researchers have developed an innovative method that allows robots to manipulate objects using special air jets as "air fingers". The air flow control algorithm, developed by a team of specialists, is based on a thorough study of the movement of objects in the air flow. The air jet control system, carried out using special motors, allows you to direct objects without resorting to physical ... >>

Purebred dogs get sick no more often than purebred dogs 03.05.2024

Caring for the health of our pets is an important aspect of the life of every dog ​​owner. However, there is a common assumption that purebred dogs are more susceptible to diseases compared to mixed dogs. New research led by researchers at the Texas School of Veterinary Medicine and Biomedical Sciences brings new perspective to this question. A study conducted by the Dog Aging Project (DAP) of more than 27 companion dogs found that purebred and mixed dogs were generally equally likely to experience various diseases. Although some breeds may be more susceptible to certain diseases, the overall diagnosis rate is virtually the same between both groups. The Dog Aging Project's chief veterinarian, Dr. Keith Creevy, notes that there are several well-known diseases that are more common in certain breeds of dogs, which supports the notion that purebred dogs are more susceptible to disease. ... >>

Random news from the Archive

Prostheses that feel heat and touch 08.06.2018

3D printing and the latest robotic developments have already made prostheses more comfortable and functional, but now they will have a quality that was previously unavailable - sensitivity.

A team of researchers from Stanford and Seoul Universities has developed an artificial nervous system that can process information from the outside world like the human body. This will restore the sense of touch in amputees and give the robots some type of reflex ability.

“We take the skin for granted, but it is a complex system of perception, signals, and decision making,” says Zhenan Bao, professor of chemical engineering and member of the research. “This artificial sensory nervous system is a step towards creating skin-like sensory neural networks.” for various applications."

Other interesting news:

▪ The updated line of Wireless Plus from Seagate

▪ Fullerene will not conduct current

▪ Heatwaves became more frequent and lengthened

▪ Samurai watching the crowd

▪ A camera with a resolution of 1 GPU has been developed

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ section of the site Your stories. Article selection

▪ article by the grace of God. Popular expression

▪ How is the periodization of the history of the Middle Ages presented? Detailed answer

▪ article Big spoon of nature. Children's Science Lab

▪ article Receiver in infrared communication line. Encyclopedia of radio electronics and electrical engineering

▪ article Molisch color reaction. Chemical experience

Leave your comment on this article:

Name:


Email (optional):


A comment:





All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024