Design of RC measurement system using 555 timer and single chip microcomputer

Publisher:达文西happyLatest update time:2017-07-07 Source: 21ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

This paper introduces a design scheme of digital display resistance and capacitance measurement system based on 555 timer and single chip microcomputer. The system uses 555 and the resistance or capacitance to be measured to form a multivibrator, measures the period of the 555 output signal through the single chip microcomputer, calculates the resistance or capacitance value according to the mathematical relationship between the period and the resistance or capacitance to be measured, and then displays it on LCD1602. Finally, the simulation results show that the measurement system has the advantages of simple structure, convenience and practicality, and can measure the resistance and capacitance values ​​within a certain range.

1 Introduction

In the manufacturing and use of electronic instruments and meters, there are a large number of printed circuit boards that need to be debugged, measured and repaired, and the values ​​of resistance and capacitance need to be tested.

This paper introduces a design scheme of digital resistance and capacitance measurement system based on AT89C51 single-chip microcomputer and 555 timer, and then makes a circuit to realize the function of the system. The system uses 555 timer and the resistance (or capacitance) to be measured to form a multivibrator, measures the period of 555 output signal through the single-chip microcomputer timer, calculates the resistance (or capacitance) value according to the mathematical relationship between the period and the resistance (or capacitance) to be measured, and then displays it through the 1602 LCD display. The simulation results show that the measurement system has the advantages of simple structure, convenience and practicality.

2. Design and Principle

2.1 Overall design plan

The whole measuring system is composed of several circuit modules such as the single chip minimum system, buttons, resistors, capacitors, multivibrators composed of 555, and liquid crystal display, as shown in Figure 1.

2.2 Multivibrator Principle

As shown in Figure 2, when measuring capacitance, a multivibrator is formed by using 555, the capacitor CX to be measured, and resistors R1 and R2 (R1 and R2 are known resistors), so that a periodic square wave is output from the output terminal Q of 555 and connected to the oscilloscope, as shown in Figure 2 (b). This signal is not a square wave with a duty cycle of 50%. According to reference 2, the duration of the high level time in one cycle T is:

When measuring resistance, use another 555 to form a multivibrator circuit, connect the resistor to be measured RX to the position of R1 (or connect RX and a known resistor in series), and replace CX with a known capacitor C. The cycle time is:

2.3 MCU Timing Principle

The periodic square wave signal output by 555 is sent to the microcontroller for timing, and the signal cycle time T is measured. Then, the above mathematical relationship is used for calculation and processing to obtain the capacitance or resistance value to be measured. The principle of microcontroller timing is: using the microcontroller's external interrupt 0 and timer 0. The output signal of 555 is connected to the microcontroller's external interrupt 0 pin P3.2, and it is set to falling edge trigger. When the output signal of 555 is a falling edge, the external interrupt is triggered, and the microcontroller's timer 0 is turned on to start timing until the next falling edge arrives, that is, a cycle is reached, and the timing is stopped. At this time, the timer records the length of a cycle.

3. Hardware module design

3.1 MCU Minimum System

The core controller of the system uses the AT89C51 single-chip microcomputer. Figure 3 shows the minimum system of the single-chip microcomputer, including the single-chip microcomputer and the crystal oscillator circuit and reset circuit required for the normal operation of the single-chip microcomputer. In Proteus, the power supply and ground of the single-chip microcomputer are connected by default, so they are omitted in the figure.

3.2 Button Circuit

The key circuit is used to determine whether to measure capacitance or resistance. As shown in Figure 4, a single-pole double-throw key is used. When the key is pressed to the upper pin P3.6 of the microcontroller, it is used to measure capacitance; when it is pressed to the lower pin P3.7, it is used to measure resistance.

3.3 555 Multivibrator

As shown in Figure 5, a multivibrator is formed by using 555 and the capacitor or resistor to be measured. The periodic square wave generated by 555 is output from the Q pin and then connected to the external interrupt INT0 pin of the microcontroller, that is, the P3.2 pin. During measurement, only one of the two circuits is connected to the microcontroller, which is used to measure capacitance and resistance respectively.

3.4 LCD Display Circuit

The measurement results need to be displayed. This system uses LCD1602 as the display. Figure 6 shows the connection circuit between LCD1602 and the microcontroller. The P0 port is connected to a pull-up resistor as the data port; the first 3 bits of the P2 port are used as the control pins for reading, writing and enabling.

4. Software Design

The system software flow chart is shown in Figure 7. After the power is turned on, the first thing to do is to initialize, including the initialization of timer T0, external interrupt 0 and LCD1602. Then start the 555 chip, and use the microcontroller to determine whether there is an interrupt request. If not, continue to wait for the interrupt request; if so, start the timer to start timing until there is an interrupt request and stop timing. After obtaining the timing value, that is, one cycle of the 555 output signal, determine whether to measure resistance or capacitance. After judgment, the resistance or capacitance value is displayed by LCD1602.

5. Simulation results

The above circuit modules are integrated together to form a measurement system. After the program is written correctly in Keil, the circuit is simulated in Proteus. The simulation results of measuring a 50kΩ resistor and a 150μF capacitor are shown in Figure 8. It can be seen that there is a certain error in the measurement, which is mainly because the approximate value is taken when the previous formula is used for calculation. After the simulation is passed, the required components are purchased according to the simulation circuit and the physical circuit is made.

6. Conclusion

This paper introduces a design of a resistance and capacitance measurement system based on a 555 timer and a single-chip microcomputer. In the design and simulation of the system, two software platforms, Keil and Proteus, are used. The program is written in C language in Keil, and the function of the system circuit is simulated using Proteus. The measurement circuit is simple and reliable, easy to implement, and can measure resistance and capacitance values ​​within a certain range, thus proving the practicality of this design.


Reference address:Design of RC measurement system using 555 timer and single chip microcomputer

Previous article:How to solve the four major misunderstandings of 51 single-chip microcomputers? A novice can advance by just reading this article
Next article:Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer

Latest Microcontroller Articles
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号