When using electronic components, you must first understand its parameters. Resistors have resistance values and capacitors have capacitance values. This requires the ability to accurately measure the parameters of components. The resistance value of a resistor is relatively easy to measure, and it can be accurately measured using the volt-ampere method. However, measuring capacitance is more troublesome. Initially, people used a multimeter to estimate the capacitance value. This method is not only troublesome but also has low measurement accuracy. With the rapid development of microelectronics technology, computer technology, and software technology and their application in electronic measurement technology and instruments, new test theories, new test methods, new test fields, and new instrument structures are constantly emerging. People's requirements for instruments are also gradually increasing. This article designs a more intelligent, smaller, and more powerful portable RC measuring instrument.
2. Hardware circuit design and implementation
The overall hardware circuit mainly includes four parts: sinusoidal signal circuit, front-end control circuit, single-chip microcomputer control circuit and LCD display circuit.
2.1 Main control chip
This system uses PIC16F877 microcontroller as the control core. PIC16F877 microcontroller is a mid-level product of PIC series microcontrollers. It uses RISC instruction system, with only 35 single-word instructions in total, which is simple and easy to use; it has a fast working speed, can receive DC-20MHz clock input, and the instruction cycle can reach 200ns; it has a large storage space, with up to 8K words of FLASH program memory and 368 bytes of data memory. In addition, it has 14 internal/external interrupt sources and 8-level hardware stacks for easy programming; it has a monitoring timer with an on-chip RC oscillator to ensure its reliable operation; different oscillator working modes can be selected according to different needs to reduce power consumption, and at the same time, many functions such as A/D, internal EEPROM memory, comparison output, capture input, PWM output, SP1 interface, asynchronous serial communication (USART) interface, analog voltage comparator , LCD driver, etc. are added under the premise of keeping the price low.
2.2 Sinusoidal signal circuit design
The measuring instrument uses sine wave as the measurement signal for orthogonal sampling by the single-chip microcomputer. The frequency of the sine wave directly affects the measurement accuracy. The sine wave frequency accuracy is required to be high, and the spectrum purity and stability must also be high. Therefore, this system uses the DDS synthesis chip AD9850 to generate sine waves. AD9850 is a highly integrated DDS synthesis chip produced by AD Company in the United States. It uses a 32-bit phase accumulator, truncated to 14 bits, input into the sine lookup table, and the lookup table output is truncated to 10 bits and input into the DAC. The DAC outputs two complementary analog currents and connects to the filter. However, the signal amplitude directly generated by AD9850 is only about 2V, and it is unipolar. What is needed during the test is a bipolar sine signal, so the signal output by DDS must be isolated and amplified. The signal output by AD9850 passes through an RC high-pass filter to filter out the DC component and output an AC signal, which is then amplified by an amplifier, and the voltage follows the output, and a signal source with appropriate amplitude and strong load capacity is output. The circuit is shown in Figure 1.
Figure 1 System circuit schematic diagram 1
Figure 2 System circuit schematic diagram 2
2.3 Front-end circuit module
The front-end circuit is mainly used to switch the range resistor and control the gain. This solution uses the resistor voltage division method. The range resistor and the element to be measured are divided, and then the single-chip microcomputer controls the analog switch to select the signal channels of the range resistor and the element to be measured respectively, and the signals obtained by their voltage division are sent to the differential amplifier circuit respectively. The sine wave from the differential amplifier circuit passes through the potential boost circuit and is then collected by the single-chip microcomputer. In this process, the automatic switching of the range resistor and the reduction of the error caused by the analog switch to the test process are the difficulties of the design. The front-end circuit is the key to affecting the measurement range and measurement accuracy of the system. [page]
Figure 3 Software Flowchart
2.3.1 Design of range resistance selection scheme
The switching of the range resistance R is achieved by controlling the analog switch CD4052 through a single-chip microcomputer. The analog switch has on-resistance and leakage current. If it is too large, it will have a great impact on the test accuracy. When RS+Zx is small, the on-resistance of the analog switch cannot be ignored. Therefore, it is very important to eliminate the influence of the on-resistance on the circuit. Through experiments, the principle circuit shown in Figure 2 is adopted. In Figure 2, a 4X2 analog switch is selected, Ron(1,2,3,4) and Ron(1,2,3,4) are the on-resistances of the analog switch; RS(1,2,3,4) is the standard resistance; and Z is the component under test. The use of this circuit reduces the influence of the on-resistance on the test accuracy.
2.3.2 Gain Control
During measurement, if the amplitude of the sinusoidal signal becomes smaller for some reason, it is possible that the signal obtained by a certain component during voltage division will be very small. Since the microcontroller can perform 8-bit A/D conversion on analog signals of 0-5V, the accuracy of A/D conversion can be calculated as 5/256=0.02V, which means that if the signal is too small and lower than 0.02V, the A/D conversion will produce conversion errors, so we need to control the gain so that the measuring instrument can still work normally when the amplitude of the sinusoidal signal changes.
The gain control circuit is shown in Figure 2. The signals after voltage division are sent to a differential amplifier circuit composed of an integrated operational amplifier. Because the differential amplifier circuit amplifies the difference between the two input terminals and has a strong inhibitory effect on the common-mode signal of the interference signal input, using it as an amplifier circuit can effectively improve the measurement accuracy and the anti-interference ability of the measuring instrument.
2.4 Potential boost circuit
This design uses the PIC's ADC module to realize data acquisition of analog signals, and selects the power supply voltage (5V) as the reference voltage, so the microcontroller can only correctly collect voltages between 0 and 5 volts, and the sine wave input is an AC signal, which has a negative potential in the negative half cycle, making it impossible for the microcontroller to sample correctly. Therefore, before sending the signal to the microcontroller, the AC signal needs to be boosted so that the potential of the entire sinusoidal signal at any time is greater than or equal to 0, and the potential boosting circuit.
The input signal passes through an integrated operational amplifier with an amplification factor of 1. R1 and R3 provide a DC potential at the signal input pin 3 of the operational amplifier. The DC potential is adjusted to 2.5V by changing the resistance value of R1. In this way, the sinusoidal signal can be adjusted to the shape shown in Figure 2 and then supplied to the microcontroller for sampling.
The values obtained by the microcontroller sampling the signal after the potential is increased cannot be calculated directly, but it is necessary to subtract the DC potential of 2.5V from these values before they can be calculated.
2.5 LCD Display Circuit
The display circuit uses the LCD module RC1602, which is mainly composed of three parts: dot matrix liquid crystal display (LCD), microcontroller, and drive circuit. The circuit is shown in Figure 1.
3. Software design and implementation
According to the functional requirements of each part, the software program of the whole system consists of subroutines such as initialization program, range resistance selection program, AD conversion program, gain control program, data processing program, ASII code conversion program and display program. Finally, each module is called and connected to form an organic whole, so as to realize the full management function of the instrument. Based on the ideas described above, the flow chart of the whole software program design is finally obtained through research, as shown in Figure 3.
4. Conclusion
This measuring instrument can automatically identify whether the component to be measured is a resistor or a capacitor. The single-chip microcomputer controls the automatic conversion to the appropriate reference resistance level according to the reactance value of the component to be measured, so as to realize the automatic conversion of the measuring range. This solves the problem that the old measuring instrument needs to manually judge the parameter range of the component to be measured before measurement, and then manually select the appropriate range level.
Previous article:Design and simulation of digital thermometer based on PIC microcontroller
Next article:Design of automobile switch box based on CAN bus and PIC microcontroller
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Sandia Labs develops battery failure early warning technology to detect battery failures faster
- Ranking of installed capacity of smart driving suppliers from January to September 2024: Rise of independent manufacturers and strong growth of LiDAR market
- Industry first! Xiaopeng announces P7 car chip crowdfunding is completed: upgraded to Snapdragon 8295, fluency doubled
- P22-009_Butterfly E3106 Cord Board Solution
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- The national programmer salary for April 2020 is released. Why are we always averaged? ? ?
- Problems encountered with diode step-down
- DK_MINI_GW1N-LV4LQ144C6I5_V1.1 User Manual
- Confused question about inductor
- Programming with Ada on the Adafruit STM32 Feather Development Board
- Free download in the last day | Example: How IoT technology integrates isolated industrial automation islands
- Make DSP C++ programs as simple and clear as ARM/MCU
- Sharing of power management solutions, please take a look if you are interested.
- The meaning of each section of the TMS320F2812 CMD file
- I really want to participate! Learn!!