introduction
Hall sensors are semiconductor components that work using the Hall effect. Due to the high conversion efficiency, fast response speed, wide dynamic range, good frequency characteristics, and low noise of Hall components, Hall sensors are widely used in motor detection, magnetic field meters, speed controllers, position detection, and automatic control. In many cases, it is necessary to understand the various performances of Hall sensors. This test system uses Visual Basic visual programming language and RS-232 serial communication between the microcontroller and the computer to realize automatic measurement, recording, and analysis of Hall sensor parameters.
1 Test system structure
1.1 System hardware structure and principle
The hardware structure of the Hall sensor performance test system is shown in Figure 1. On the one hand, the signal processing circuit board receives the measurement signal of the Hall sensor and processes it into a standard signal to transmit to the single-chip microcomputer. On the other hand, it generates corresponding control signals based on the data transmitted by the single-chip microcomputer to make the Hall sensor work under specified conditions. The single-chip microcomputer transmits measurement signals to the computer through the RS-232 serial communication port and receives control signals. The computer is used to display, analyze and store the performance test data of the Hall sensor.
Figure 1 Test system hardware structure
1.2 Signal processing principles
This system has two test parameters: the sensitivity KH of the Hall sensor and the temperature coefficient α of the Hall potential. The signal processing is shown in Figure 2.
Figure 2 Signal processing schematic diagram
[page]
X1—control signal, adjust the resistance R, control the magnetic field strength X2—control signal, adjust the excitation current of the Hall sensor
X3--control signal, control the power switch X4--control signal, adjust the heater voltage to control the temperature
Y1—test signal, measuring the output voltage of the Hall sensor Y2—test signal, measuring the ambient temperature of the test system
When the control signals X3, X1 and X2 are output, the Hall sensor works under the conditions of a fixed magnetic field strength and different excitation currents, or under the conditions of a fixed excitation current and different magnetic field strengths. The sensor will output a series of no-load Hall potentials, and the sensitivity KH under different conditions is calculated through computer calculation. Under the conditions of a fixed magnetic field strength and excitation current, the Hall potential temperature coefficient α of the sensor is measured by changing the voltage of the electric heater and measuring the ambient temperature signal Y2 of the test system through the control signal X4.
2. RS-232 serial communication implementation
2.1 Implementation of serial communication
Data transmission between the microcontroller and the computer is achieved through the RS-232 serial port. The computer transmits control commands and data to the microcontroller, which transmits the signal to the signal processing circuit board, and then measures the output signal of the signal processing circuit board and transmits it back to the computer through the serial port. The serial port data communication protocol is: data transmission rate is 9600bps, 1 start bit, 8 data bits, 1 stop bit, and no parity bit. Since only the microcontroller and the computer transmit information to each other, the RS-232 serial port only needs three wires: receiving, transmitting and grounding. The microcontroller uses the AT89C52 chip, and its logic level is inconsistent with the RS-232 interface level of the computer. It is necessary to design a MAX232 chip between the microcontroller and the computer's RS-232 serial port. This chip can convert the 0V and +5V voltages of the microcontroller into the logic "1" level (-3----15V) and logic "0" level (+3---+15V) of the RS232 interface. As shown in Figure 3, C1–C5 are all 1μF.
Figure 3 Application of MAX232 chip
[page]
2.2 Application of VB
VB (Visual Basic) is the main development language in computer systems. It is efficient, easy to learn, and has powerful graphics functions. It supports object-oriented programming, has a structured event-driven programming model and a good human-computer interface, and provides a powerful communication control MSCOMM. Therefore, the application of VB language can easily design applications that require a large number of graphic displays. The MSCOMM control can be used to set the data transmission and reception of serial communication, and to set the serial port status and the information format and protocol of serial communication. The MSCOMM control is a standard 10-bit serial port communication. The OnComm event is triggered during the process of sending and receiving data. The CommEvent property is accessed to understand the type of communication event.
2.3 Programming of VB Communication Controls
Private Sub Form_Lopad() ;Serial port initialization procedure
Comm1.CommPort=1; Set serial port 1
Comm1.Settings="9600,n,8,1" ; Set baud rate, parity, data bits and stop bits
Comm1.InputLen=0 ; Read data from the receive buffer
Comm1.InBufferSize=255 ;Set the size of the receive buffer
Comm1.OutBufferSize=255 ; Set the size of the send buffer
Comm1.PortOpen=True ;Open serial port 1
Comm1.Sthreshold=1; buffer empty trigger
Comm1.Rthreshold=1; Data enters the receiving buffer to trigger the receiving event
End Sub ; End of program
The above is the initialization program of VB's serial port, as well as the data sending and receiving programs. The data sending program is the computer sending control commands and data to the microcontroller, and the receiving program is to receive data detected by the microcontroller.
2.4 MCU serial communication program design
[page]
For serial communication between the microcontroller and the computer, the serial port controller SCON of AT89C52 needs to be set to SCON=50H, working in the 10-bit asynchronous communication mode of serial mode 1, and the interrupt bit EA of the interrupt enable register IE of AT89C52 needs to be set to 1 to allow serial port interrupts. The serial port initialization procedure is as follows:
CXK: MOV TH1, #0FDH; Set the baud rate
MOV TL1, #00H;
MOV TMOD, #20H; Set the working mode of timer 2 to 2
MOV TCON, #40H; timer starts
SETB ES; serial port interrupt enable
MOV SCON, #50H; Set the serial port working mode to 1
RET
3. Several aspects that require attention
3.1 Generation and regulation of magnetic field strength
In Figure 2, the power source E should remain stable, and the potentiometer for adjusting the magnetic field strength adopts a digital potentiometer, which can accurately adjust the field strength. Before use, use a field strength meter with a higher level of accuracy to measure the magnetic field strength under different resistance values of the digital potentiometer, and store the corresponding data of the two in the computer as the basis for adjusting the magnetic field strength.
3.2 Temperature measurement and control
Thermistors are used as temperature sensors. Thermistors have high sensitivity and small thermal inertia, and can quickly and correctly measure temperature values. Electric heaters use resistance wires to provide heat through 220V AC. In order to reduce the thermal inertia of the heater and facilitate temperature control, the resistance wire is wound on a plane and a small fan is used to make the temperature distribution in the test system uniform and the temperature of the Hall sensor reach a stable state relatively quickly. A single-loop closed-loop control system is used. Since the Hall potential temperature coefficient α refers to the change when the temperature changes by 1°C, the measurement and control of the system temperature have relatively high requirements.
4. Conclusion
In the design of the Hall sensor performance test system, the role of the single-chip microcomputer and the computer is fully utilized, and the graphic function of VB is fully utilized, so that the test system has a very friendly user interface.
The author's innovation: Due to the use of computers, it is possible to design a variety of test plans according to the test requirements without changing the hardware structure. It can store and record a large amount of test data and can easily analyze the measurement data. Through VB programming, the test process can be fully automated, which cannot be achieved by using only a single-chip microcomputer.
Previous article:Automotive electronics single-chip solution based on mixed-signal technology
Next article:Making engines greener: Sensor technology to reduce diesel emissions
Recommended ReadingLatest update time:2024-11-16 22:00
- Popular Resources
- Popular amplifiers
- MATLAB and FPGA implementation of wireless communication
- Siemens Motion Control Technology and Engineering Applications (Tongxue, edited by Wu Xiaojun)
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Handbook of Multisensor Data Fusion: Theory and Practice
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- 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
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- 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
- TI dsp clock circuit selection principles
- 【LAUNCHXL-CC1350-4】- 3: Build the development environment
- [nRF52840 DK Review] +52840 NFC (Part 2)
- What domestic chips are needed to DIY a fast-charging chromium iron or an electric chromium iron that works as a laptop power supply?
- Bluetooth module communicates with mobile phone
- The compilation of the program sent by serial communication always fails
- Does the clearance below the crystal oscillator refer to the layer where the chip is located or all layers?
- Lecture 2 Introduction to SOPC development process and development platform.pdf
- Has your iPhone 13 arrived? Here comes the real iPhone 13 series disassembly
- EEWORLD University Hall ---- Industrial innovation applications based on DLP