Design of Digital Multimeter Based on Single Chip Microcomputer

Publisher:CelestialLightLatest update time:2011-10-19 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1DS1629 structure characteristics and working principleDS1629
is a chip designed for digital temperature measurement, and also has the function of real-time clock/calendar. The wide power supply range and extremely low power consumption of DS1629 are very suitable for battery-powered applications. Its clock function can be 12-hour or 24-hour mode, and it has AM/PM indication in the 12-hour mode. When the temperature reaches or exceeds the upper limit TH set by the program or the time reaches the moment set by the program, the chip generates an open-drain alarm output.
DS1629 consists of six parts: digital temperature sensor, real-time clock, two-wire serial interface, data register, temperature and clock alarm comparator, clock divider and buffer. The
temperature sensor calibrated by the manufacturer does not require external devices. The chip starts temperature conversion as soon as it is powered on, and then continues to convert. The host (usually a single-chip microcomputer) can periodically read the latest converted temperature value in the temperature register, and since the conversion is performed in the "background", reading the data does not affect the conversion process. The host can modify the chip configuration, such as not starting conversion immediately after power-on and continuous conversion mode, which is very beneficial for occasions that require power saving. The real-time clock/calendar provides BCD values ​​for seconds, minutes, hours, weeks, dates, months, and years, which requires an internal oscillator/divider and an external 32.768kHz crystal. Months with less than 31 days are automatically adjusted at the end of the month, and leap year compensation is not until 2100. The real-time clock can be turned off by clearing the control bit in the clock register. The clock alarm output can be turned off by reading/writing the clock register or the clock alarm register.
Binary data is read/written via a two-wire bus, with the high bit first, and each register is accessed using an 8-bit command protocol. The functions of each chip pin are shown in Table 1.
?
2.1 Hardware Design
From the previous discussion, it can be seen that DS1629 has the functions of digital temperature sensor and real-time clock/calendar, and the working voltage is 2.2~5.5V. Therefore, it can be combined with the single-chip microcomputer to design a digital temperature meter with digital clock function. The single-chip microcomputer adopts AT89C2051, which is packaged as 20DIP and has an operating voltage range of 2.7~5.5V. The display part uses a 6-digit digital tube to display data such as time, date or temperature. In order to simplify the circuit, reduce the chip and reduce power consumption, the display part adopts a dynamic cycle scanning method and is driven by a 4~7 segment decoder CD4543. The working voltage of CD4543 is 3~18V, and the whole circuit is powered by two dry batteries. The hardware structure of the system is shown in Figure 1. In the figure, the SCL and SDA terminals of DS1629 are connected to P3.0 and P3.1 of the microcontroller respectively, R1 and C1 form a power-on automatic reset circuit, P3.2~P3.4 are connected to 3 buttons, C2, C3 and a 6MHz crystal oscillator form an oscillation circuit, P3.5, P3.7, P1.0~P1.3 are connected to the common terminals of the 6-digit digital tubes (the 3 digital tubes LED2~LED4 are not drawn in the figure) as bit selection signals, P1.4~P1.7 are connected to the BCD code input terminal of CD4543, and the data input terminals a~g of the 6 digital tubes are connected in parallel to the data output terminals a~g of CD4543.
The functions of the digital meter include temperature measurement and display and clock, so they should be considered simultaneously in software design. The temperature meter and clock functions are selected by button S3. The default state after power-on is to automatically display the measured temperature. Press S3 once to switch to time display, and press it again to return to temperature display. In the default state, button S2 is a stopwatch function key. Press it once to start timing, press it twice to stop timing, press it three times to clear to 0, and press it again to return to the initial state. In the default state, button S1 is a function key for adjusting time. Press S1 once to set the hour. At this time, S2 is the plus 1 key. Press it once to add 1 to the hour. S3 is the minus 1 key. Press it once to subtract 1 from the hour. Press S1 twice to set the minute. At this time, the functions of S2 and S3 are the same as before. Press S1 three times to return to the initial state. According to these functions, the software design consists of several parts such as initialization, function key processing, time display, temperature measurement and display. The initialization part completes the initial configuration of the microcontroller interrupt, timer, on-chip storage unit and DS1629; the function key processing part performs keyboard scanning and corresponding processing; the time and temperature display reads the time and temperature parameters of DS1629, converts them and sends them for display. The following is a program segment for the microcontroller to operate DS1629. Assume that P3.1 of the microcontroller is connected to SDA, P3.0 is connected to SCL, the working mode of DS1629 is set to single conversion mode, the clock output is disabled, and the temperature and clock are both high-level alarms. The corresponding program segment is as follows:
From the previous discussion, it can be seen that DS1629 brings great convenience to the measurement and control of digital temperature based on single-chip microcomputer, greatly simplifies the design of the system, and has high practical value.
Reference address:Design of Digital Multimeter Based on Single Chip Microcomputer

Previous article:Smart instrument for solar water heater based on single chip microcomputer
Next article:Automatic temperature and humidity monitoring system composed of 51 single chip

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号