Design of Hall Sensor Performance Test System Based on VB

Publisher:BlissfulMomentsLatest update time:2009-11-24 Source: 微计算机信息 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.


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

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

AT89C51 of 1602LCD of program
/*******************************************************************  AT89C51 MCU drives 128x64 LCD display in C language **************************************************************/ #include AT89x51.h #define uchar unsigned char /********************************************* Circuit connection P1------DB0~D
[Microcontroller]
Development of Metal Tube Float Flowmeter Selection System Based on VB
1 Overview As an important parameter of modern industrial control, flow rate is increasingly showing its importance. Metal tube float flowmeter is used to continuously measure the volume flow of liquid and gas in closed pipes. It has a solid and reliable structure and can adapt to flow measurement in various occasions
[Test Measurement]
Development of Metal Tube Float Flowmeter Selection System Based on VB
Latest Automotive Electronics 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号