Design of small resistance tester based on C8051F005 single chip microcomputer

Publisher:码字奇思Latest update time:2012-05-26 Source: 21ic Keywords:C8051F005 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

In the process of circuit testing, it is often encountered that there is a large error between the experimental data and the theoretical value due to the neglect of the influence of some small resistances, thus affecting the test effect. For example, copper resistance often exists in inductors and transformers, and the resistance of subway rails; due to its small value, it cannot be measured by a general pointer multimeter; usually a bridge is used for measurement in the laboratory, but the operation procedure of the bridge is cumbersome, and the resistance value of the measured resistance cannot be directly read. In view of this, we adopted a single-chip microcomputer and designed the measuring instrument by taking advantage of the single-chip microcomputer. The measuring instrument can read the measured resistance value directly from the LCD display screen, with a measurement range of 10μΩ~2.9999kΩ. At the same time, the test data can be stored and then sent to the host computer through the serial port. Through the powerful functions of the host computer, the measured data can be analyzed and processed. The measurement accuracy of the tester is as high as ±0.1%, and the four-terminal measurement method is adopted. The resistance value is not affected by the length of the lead and the contact resistance. Not only is the measurement simple and the reading is intuitive, but the measurement accuracy and resolution are also higher than those of general bridges. It can be used in laboratories and research institutes, especially on the job site.

2. Test Principle


As shown in the figure above, the basic principle of this machine is to use a known constant current to pass through the measured resistor, take out the voltage drop on the measured resistor, amplify it through the amplifier and convert it into a 0-3V DC voltage, then send it to the input end of the C8051F005A/D converter, process it through the microcontroller, and finally directly display the resistance value through the LCD display.

Since the measurement of tiny resistance is to be realized, the amplifier is required to have high resolution (up to 10μV), good linearity, high input impedance, low drift, strong noise suppression and anti-interference capabilities. For this reason, we designed a differential amplifier as shown in the signal processing circuit in Figure 2. This amplifier consists of op amps A1 and A2 to form the first-stage differential circuit, A3 to form the second-stage differential circuit, R3, R4, and RW to form a feedback network, and introduces deep voltage series negative feedback, so it has a higher input impedance, and A1 and A2 both select the same phase end as the input end, then their common-mode output voltage and drift voltage are also equal, and then through the differential circuit composed of A3, they can offset each other, so it has a strong common-mode suppression capability and a small output drift voltage; A4 is a voltage reverse follower, and its function is to isolate the front and back stages. The following equation can be obtained by analyzing this circuit.

When R5= R7, R6= R8, the above equation can be simplified to:

From formula (3), we know that the output voltage U4 is proportional to the measured resistance RX. The amplifier multiple is determined by R3, R4, and RW. Since the input voltage of the A/D converter is 0~3V, the amplifier multiple of this instrument is set to 10 times, and a DC voltage of 0~3V is obtained at the U4 terminal. In order to ensure the resolution and stability of the amplifier, in addition to the advantages of the above-mentioned circuit itself, the integrated operational amplifiers A1, A2, and A3 use high-precision, low-noise, and low-drift max495. The resistors of the feedback branch are all high-precision, low-temperature coefficient precision resistors. In addition, some shielding measures are taken to effectively suppress noise and interference. During the test, the four-terminal wiring method is used between the measured resistor and the test instrument. The constant current source current is input through IN1 and output from IN2. When measuring, four dedicated wires are connected to the measured resistor Rx. When the measured resistance is small, in order to avoid the influence of wire resistance and contact resistance, the four connecting wires must have consistent characteristics and the same impedance, so that the influence of wire resistance and contact resistance can be eliminated. 3. Hardware design of small resistance tester

The core part of the instrument is the circuit board that can realize various functions. It uses the C8051F005 single-chip microcomputer of CYGNAL. The system mainly includes power supply circuit, signal acquisition circuit, signal amplification circuit, LCD drive and display circuit, serial communication circuit, system reset circuit and C8051F005 single-chip microcomputer system circuit (including analog-to-digital conversion circuit). The detailed circuits of each part of the system are shown in Figure 2.

3.1、C8051F005 MCU system circuit

This system uses C8051F005, which has the following features:

The chip has up to 60KB Flash ROM and 2KB RAM, so users do not need to expand the memory externally;

A 12-bit A/D converter ADC12 with built-in sample-and-hold function;

Two-channel serial communication interface, can be used in asynchronous or synchronous mode;

An analog comparator that can output voltage comparison or reference voltage.

ADC12 is a 12-bit precision A/D conversion module with a sampling and holding function, which is high-speed and universal. It has 8 external signal sampling channels and 4 internal channels. The signal output by the differential amplifier is input into the microcontroller through channel 0. The clock, conversion mode and reference voltage source of the A/D conversion can be set by the user using software.
Since the microcontroller integrates many peripheral modules, it not only simplifies the circuit design, but also greatly reduces the size of the circuit board. In addition, a JTAG interface is reserved on the circuit board, and with an ordinary PC, it is very convenient to debug the system software.

Figure 2. System detailed circuit diagram [page]

3.2 Serial communication circuit

The C8051F005 microcontroller integrates two universal serial synchronous/asynchronous modules USART0 and USART1, both of which support two different serial protocols, namely; universal asynchronous protocol (UART protocol) and synchronous protocol (SPI protocol). This circuit uses the UART protocol and communicates with the PC through an RS232 interface chip MAX3221E.

MAX3221E is a single RS-232 transceiver with an operating voltage of +3.0~+5.5V, a supply current of only 1μA and an automatic shutdown function. One of the major features of the C8051F005 microcontroller is its low power consumption. It has multiple power consumption states that can be programmed and controlled. MAX3221E is also an interface device with low power consumption characteristics. Through the EN, FORCEON, and FORCEOFF pins, the working state of the driver and receiver can be controlled, and the automatic power reduction function can be enabled or disabled, so that it can work in different energy consumption states to achieve the purpose of reducing power consumption.

3.3 Power supply circuit

The system is powered by batteries, which can not only keep the system running stably and reliably but also be convenient for use outside the laboratory.

3.3 LCD drive and display circuit

The LCD display uses the SMS0501C segment code display driver. The interface mode of the LCD display is a two-wire serial interface, the display mode is a reflective positive display, and the operating voltage is 2.7V~5.5V.

3.4 Other circuits

In addition to the above main circuits, the system also has a power undervoltage detection circuit and a system reset circuit. The power undervoltage detection circuit is implemented using the analog comparator integrated inside the C8051F005 microcontroller. The system reset circuit uses a button reset to correctly reset the microcontroller by charging and discharging the capacitor. When the button is pressed, the RST pin of the C8051F005 microcontroller is at a low level. As long as this low level is maintained for more than 2 machine cycles, the microcontroller can be correctly reset. 4. Software Design

The software design of this system adopts a modular design method. The entire program includes the main program, data acquisition program, data processing program, serial communication program, timer interrupt program, and LCD display program. All programs are written in C language, which can be easily debugged and downloaded. Due to space limitations, this article only gives the flow chart of the main program, as shown in Figure 3.

The main program of the system mainly completes the initialization of the C8051F005 single-chip microcomputer system, sets the system clock and interrupt word, calls the keyboard processing program, and switches to the corresponding service program according to different keystrokes to complete different functions, such as data collection and processing, serial communication, and historical record query. Among them, the serial communication subroutine can not only transmit the data stored in the single-chip microcomputer to the PC for processing and analysis, but the user can also set the amount of data to be tested and the length of the test time from the PC according to the situation.

The test is accurate. The instrument has good reading stability and high measurement accuracy when testing small resistances of 10μΩ to 10Ω.

According to the circuit principle described above, a prototype was developed. Experiments have shown that the instrument has low power consumption, which greatly increases the battery life. It is small in size, light in weight, easy to carry, and very suitable for use in the field and on the job site.

Keywords:C8051F005 Reference address:Design of small resistance tester based on C8051F005 single chip microcomputer

Previous article:Atmel MCU Parallel Port Download Cable Production
Next article:Design of soft starter for three-phase asynchronous motor using single-chip microcomputer AT89C51

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号