Share this

Small resistance tester based on C8051F005 microcontroller

2026-04-06 04:47:44 · · #1
1. Introduction In circuit testing, significant errors often arise between experimental and theoretical values ​​due to neglecting the influence of small resistances, thus affecting test results. For example, inductors and transformers often contain copper resistance, as do subway rails; due to their small values, ordinary pointer multimeters cannot measure them. While a bridge circuit is typically used in laboratories, its operation is cumbersome and the resistance value cannot be directly read. Therefore, we designed this measuring instrument using a microcontroller, leveraging its advantages. This instrument can directly read the measured resistance value from the LCD display, with a measurement range of 10μΩ to 2.9999kΩ. It can also store the test data and send it to a host computer via a serial port. The host computer's powerful functions allow for data analysis and processing. The instrument boasts a measurement accuracy of ±0.1% and employs a four-terminal measurement method, ensuring the resistance value is unaffected by lead length or contact resistance. It is not only simple to measure and provides intuitive readings, but also offers higher measurement accuracy and resolution than a typical bridge circuit. It can be used in laboratories and research institutes, and is especially suitable for field work. 2. Testing Principle As shown in the diagram above, the basic principle of this machine is to pass a known constant current through the resistor being measured, extract the voltage drop across the resistor, amplify it to a 0-3V DC voltage, and then send it to the input of the C8051F005A/D converter. After processing by the microcontroller, the resistance value is directly displayed on the LCD screen. Because it needs to measure very small resistances, the amplifier is required to have high resolution (up to 10μV), good linearity, high input impedance, low drift, strong noise suppression, and strong anti-interference capabilities. Therefore, we designed a differential amplifier as shown in the signal processing circuit in Figure 2. This amplifier consists of operational amplifiers A1 and A2 forming the first stage differential circuit, A3 forming the second stage differential circuit, and R3, R4, and RW forming the feedback network. It introduces deep voltage series negative feedback, resulting in a high input impedance. Since A1 and A2 are both selected as non-inverting inputs, their common-mode output voltage and drift voltage are equal. After passing through the differential circuit formed by A3, they cancel each other out, thus providing strong common-mode rejection and a small output drift voltage. A4 is a voltage inverting follower, its function being to isolate the preceding and following stages. Analyzing this circuit yields the following equations. When R5 = R7 and R6 = R8, the above equations can be simplified to: From equation (3), we know that the output voltage U4 is proportional to the measured resistance RX. The amplifier's gain is determined by R3, R4, and RW. Since the input voltage of the A/D converter is 0–3V, this instrument sets the amplifier's gain to 10, resulting in a 0–3V DC voltage at U4. To ensure the amplifier's resolution and stability, in addition to the advantages of the circuit itself, the integrated operational amplifiers A1, A2, and A3 are all high-precision, low-noise, and low-drift MAX495s. The resistors in the feedback branch are all high-precision, low-temperature-coefficient precision resistors. Furthermore, shielding measures are implemented to effectively suppress noise and interference. During testing, a four-terminal connection method is used between the resistor under test and the testing instrument. The constant current source inputs through IN1 and outputs through IN2. Four dedicated wires are used to connect to the resistor under test, Rx. When the resistor under test is small, to avoid the influence of wire resistance and contact resistance, the four connecting wires must have consistent characteristics and the same impedance, thus eliminating the influence of wire resistance and contact resistance. The core of this instrument is the circuit board that enables various functions. It uses the CYGNAL C8051Fxxx microcontroller C8051F005. The system mainly includes a power supply circuit, a signal acquisition circuit, a signal amplification circuit, an LCD driver and display circuit, a serial communication circuit, a system reset circuit, and the C8051F005 microcontroller system circuit (including an analog-to-digital conversion circuit). The detailed circuit diagram of each part of the system is shown in Figure 2. An analog comparator can realize voltage comparison or reference voltage output. The ADC12 is a 12-bit precision A/D conversion module with sample-and-hold function, featuring high speed and versatility. It has 8 external signal sampling channels and 4 internal channels. The signal output from the differential amplifier is input to the microcontroller through channel 0. The clock, conversion mode, and reference voltage source of the A/D conversion can all be set by the user via software. Because the microcontroller integrates numerous peripheral modules, it not only simplifies the circuit design but also greatly reduces the size of the circuit board. Furthermore, a JTAG interface is reserved on the circuit board, and with a common PC, system software debugging can be easily achieved. 3.2 Serial Communication Circuit The C8051F005 microcontroller integrates two general-purpose serial synchronous/asynchronous modules, USART0 and USART1, both supporting two different serial protocols: Universal Asynchronous Protocol (UART) and Synchronous Protocol (SPI). This circuit uses the UART protocol and communicates with the PC through an RS232 interface chip, MAX3221E. The MAX3221E is a single-channel RS-232 transceiver with an operating voltage of +3.0~+5.5V, requiring only 1μA of supply current and featuring an automatic shutdown function. A key feature of the C8051F005 microcontroller is its low power consumption, offering multiple programmable power consumption states. The MAX3221E is also a low-power interface device; the EN, FORCEON, and FORCEOFF pins control the operating state of the driver and receiver, enabling or disabling the automatic power reduction function, thus allowing it to operate in different power consumption states to reduce power consumption. 3.3 Power Supply Circuit: This system is battery powered, ensuring stable and reliable system operation and facilitating use in environments outside the laboratory. 3.3 LCD Driver and Display Circuit: The LCD display uses an SMS0501C segment display driver. The LCD monitor uses a two-wire serial interface and a reflective display mode, operating at a voltage of 2.7V to 5.5V. 3.4 Other Circuits Besides the main circuits mentioned above, the system also includes a power undervoltage detection circuit and a system reset circuit. The power undervoltage detection circuit uses the analog comparator integrated within the C8051F005 microcontroller. The system reset circuit uses a button reset, utilizing the charging and discharging of a capacitor to correctly reset the microcontroller. When the button is pressed, the RST pin of the C8051F005 microcontroller is low; as long as this low level is maintained for more than two machine cycles, the microcontroller will reset correctly. 4. Software Design The software design of this system adopts a modular design approach. The entire program includes a main program, a data acquisition program, a data processing program, a serial communication program, a timer interrupt program, and an LCD display program. All programs are written in C language, allowing for easy debugging and code downloading. Due to space limitations, only the flowchart of the main program is shown in Figure 3. The main program of the system primarily initializes the C8051F005 microcontroller system, sets the system clock and interrupt words, calls the keyboard handling program, and jumps to the corresponding service program based on different key presses to complete different functions, such as data acquisition and processing, serial communication, and historical record querying. The serial communication subroutine not only transmits data stored in the microcontroller to the PC for processing and analysis, but also allows users to set the amount of data to be tested and the test duration from the PC. 5. Conclusion Based on the circuit principle described above, a prototype was developed. Experiments have proven that the instrument has low power consumption, thus greatly increasing battery life; it is small in size and lightweight, making it easy to carry and very suitable for use in the field and work sites; the test is accurate, and the instrument exhibits good reading stability and high measurement accuracy when testing small resistances from 10μΩ to 10Ω.
Read next

CATDOLL 115CM Hedi TPE

Height: 115cm Weight: 19.5kg Shoulder Width: 29cm Bust/Waist/Hip: 57/53/64cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm An...

Articles 2026-02-22
CATDOLL Katya Soft Silicone Head

CATDOLL Katya Soft Silicone Head

Articles
2026-02-22
CATDOLL 115CM Nanako TPE

CATDOLL 115CM Nanako TPE

Articles
2026-02-22
CATDOLL 138CM Miho Silicone Doll

CATDOLL 138CM Miho Silicone Doll

Articles
2026-02-22