Design of Hall Sensor Performance Test System Based on VB

Publisher:CuriousTravelerLatest update time:2012-07-04 Source: 61ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Hall sensor is a semiconductor element that works by using the Hall effect. Due to the high conversion efficiency, fast response speed, wide dynamic range, good frequency characteristics and low noise of Hall element, Hall sensor is widely used in motor detection, magnetic field meter, speed controller, position detection and automatic control. In many occasions, it is necessary to understand the various performances of Hall sensor. This test system uses Visual Basic visual programming language and RS-232 serial communication between single chip microcomputer and 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.

Test system hardware structure

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.

Signal processing schematic

Figure 2 Signal processing schematic diagram

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, measure the output voltage
of the Hall sensor Y2—test signal, measure 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 can be calculated through computer calculations. 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 RS-232 serial port of the computer. This chip can convert the 0V and +5V voltages of the microcontroller into the logic "1" level (-3 to -15V) and logic "0" level (+3 to +15V) of the RS232 interface. As shown in Figure 3, C1 – C5 are all 1μF.

Application of MAX232 chip

Figure 3 Application of MAX232 chip

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 data transmission and reception process. The CommEvent property is accessed to understand the type of communication event. [page]

2.3 Programming of VB Communication Controls

Private Sub Form_Lopad() ;Serial port initialization program
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 in 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 receive buffer to trigger the receive event
End Sub ;Program ends
The above is the initialization program of the serial port of VB, as well as the data sending and receiving programs. The data sending program is The computer sends 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

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 start
SETB ES; Serial port enables interrupt
MOV SCON, #50H; Set the working mode of serial port 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

Using thermistors as temperature sensors , thermistors have high sensitivity and low thermal inertia, and can quickly and correctly measure temperature values. The electric heater uses a resistance wire to heat with 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 has 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.

Reference address:Design of Hall Sensor Performance Test System Based on VB

Previous article:Application of atmospheric pressure sensor TP015P in altitude measurement
Next article:Research on LED chip packaging defect detection method

Latest Test Measurement 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号