The phenomenon of electron spin resonance was discovered in the late 1940s. After decades of research and development, it has formed a new discipline called magnetic resonance spectroscopy with nuclear magnetic resonance, ferromagnetic resonance, and optical pump magnetic resonance. As a practical technology, it has been widely used in chemistry, physics, biology and medicine. In recent years, it has been combined with computer technology to make a great contribution to humanity.
The article deals with the electron spin resonance experiment in the modern physical experiment of ordinary colleges and universities. In the experiment, it is required to observe the phenomenon of electron spin resonance and observe the influence of paramagnetic ion on the resonance signal. Measure DPPH (radical diphenyl trinitrophenylhydrazine) ) The electron g factor (hv = gJμB) and the use of electron spin resonance to measure the vertical and horizontal components of the Earth's magnetic field. Accurately obtaining these experimental data is very important. In the article, it is proposed to use PC to communicate with the embedded single chip to transmit data, and to draw the acquired data into a visualized resonance line graph, by reading the coordinate values ​​of the resonance line. Obtain the data needed for the experiment, and generate the experimental report with the experimental data. Greatly improve the accuracy and automation of the experiment.
1 Intelligent Electron Spin Resonance Instrument
The intelligent electronic spin resonance apparatus is superior to the traditional electronic spin resonance apparatus. It uses the single-chip microcomputer system to judge the resonance point. The Helmholtz coil replaces the traditional solenoid coil to measure the magnetic field strength B0, and the measurement is accurate and convenient.
In order to observe the resonance phenomenon, a high-frequency probe needs to be used. The oscillation coil provides energy (hv) for the energy level transition of the measured object DPPH. When resonance occurs, the energy of the oscillator is absorbed by the sample, and the oscillation amplitude occurs. The change, which is detected after detection and low-frequency amplification, can be observed on an external oscilloscope or PC (also called resonant line). The front end of the instrument uses an edge oscillator to detect the resonant signal. The signal is sent to the waveform conversion module after detection amplification, generating a CMOS level signal pulse, and then sent to the I/O port of the microprocessor. The width of the rectangular pulse is calculated by the software. When the peak signals appear at equal intervals, the widths of adjacent pulses are equal. At this time, it is determined that B0 has been aligned and the indication of reading data is given, and the data is put into the memory at the same time.
2 Signal Measurement 2.1 Communication Principle
The experimental instrument is embedded with AT89C52 single-chip microcomputer (lower unit), responsible for data acquisition, processing and control. The PC monitor (upper computer) performs on-site visual inspection and adopts master-slave serial communication between them. The serial communication on the PC carries out the transceiving, conversion and transmission of the binary data through the RTS signal of the port RS232. The serial data in the lower computer is output from the TXD pin at the specified baud rate. When the data is received, the RXD pin is monitored. Once the “0†bit occurs, the data sent from the peripheral device is stored at the specified baud rate. However, there is a full-duplex asynchronous serial I/O port in the 8051 microcontroller. Its input and output use 5V logic instead of RS-232 voltage, so the MAX485 dedicated chip is used for conversion. As shown in Figure 1, SCM and peripheral serial communication schematic.
2.2 Data Communication Program Design 2.2.1 Communication Protocol
The system serial communication uses asynchronous communication. The agreement is as follows:
1) One frame of data consists of 1 start bit, 8 data bits, no parity, and 1 stop bit.
2) The baud rate is set to 2400 bps. The serial port of the one-chip computer works according to the mode 1, the baud rate is controlled by the timer T1.
The serial port baud rate of the PC is set through the Settings property of the VB communication control. In order to ensure the accuracy of data transmission, the baud rates of the two must be the same.
2.2.2 Lower Computer Communication and Programming
The microcontroller can use the interrupt mode or query RI (receive interrupt flag bit) or TI (transmit interrupt flag bit) data communication. The system uses the query method, in the timer T2 interrupt subroutine query RI, once detected RI = 1 then transferred to receive data subroutine, in the subroutine, the microcontroller reads the communication command sent from the host computer, read the record Numbers and other data, after correct verification, will be uploaded from the ATC256 memory history record data to the PC.
UcharcomReceive(void)
{while(RI==0)// indicates not received, need to wait for RI=0;//remove the next data after receiving (SBUF)
2.2.3 upper computer communication and programming
The upper computer uses VisualBasic8.0 programming. There are two methods to develop serial communication program with VB8.0, one is to use Windows API function; the other is to use VB8.0 communication control MSComm. The use of API functions to write serial communication programs is more complex and requires a lot of communication knowledge. Its advantages are richer functions and wider application area. It is suitable for writing more complex low-level communication programs. The MSComm communication control of VB8.0 provides standard event processing functions, events, and methods, and sets the serial port parameters through the control attributes, which easily solves the serial communication problem.
This system adopts event-driven method for serial communication design.
This experiment receives data such as the current value sent from the microcontroller and gives it an array. Part of the code is as follows:
At this point, the collection of data in the experimental system is completed, the next step will be the visual monitoring of the collected data, using the host computer to complete the experiment in the magnetic field, g factor and other calculations.
3 signal monitoring
The data collected from the SCM is transmitted to the storage array of the PC, and then each group of data is plotted as a resonance line, and the experimental data is obtained by reading the coordinates of the resonance line. The drawing of real-time curves in VB is usually done by means of the Timer control. Using the Timer control, the data monitored in the intelligent electron spin resonance analyzer is sent to pic_main periodically, and the curve is drawn as a line chart, using the Line of PictureBox1. Method drawing. Use the Line method to draw a line or draw a rectangle on a form or picture frame.
The general format of the Line method:
[object name.] Line(x1,y1)-(x2,y2)[,color]
Among them, (x1, y1) is the coordinates of the starting point; (x2, y2) is the coordinates of the ending point; the color can use the RGB function to specify the color of the drawing line or the rectangle. Part of the code is as follows:
4 Generation of experiment report
After the end of this system experiment, the electronic spin resonance experiment report is automatically generated by the system as a WORD document. It avoids the error caused by the traditional manual input. The information content of the experiment report: name, title, form, graph, date, experimental calculations, and measurement results.
4.1 New Document
The Documents collection contains all open documents. To create a new document, use the Add method to add a Document object to the Documents collection.
One of the ways to create a new document is to use the Add method. The Add method will return a Document object that references the new document.
4.2 Add text
Next, add text to the empty document, which will use the Paragraphs collection object to do this work. The following code adds a paragraph somewhere in the document and formats this paragraph:
In addition to the basic information, the WORD document generated in the electron spin resonance experiment system also contains some form information. The table information part code is as follows:
5 experimental results
Since the intelligent electronic spin resonance instrument is embedded in a single-chip microcomputer system, many data collections are automatically performed by computers, which greatly improves the experimental efficiency and minimizes experimental errors. Through the communication between the embedded single-chip microcomputer and the PC, the data transmission is realized. The experimental resonance line diagram is intuitively depicted on the PC, as shown in Fig. 2 (resonance line). The first peak value and the third one are shown in the figure. The wave peaks are the same. At this time, the values ​​of the coordinates C0 and C1 are taken and the values ​​of the g factor and the magnetic field are calculated. At the same time automatically generate experimental documents to save or print, as shown in Figure 3 (experimental report).
6 Conclusion
The event-driven method of Visual Basic can be used to conveniently develop the data acquisition and monitoring system of the intelligent electronic spin resonance system. This system utilizes the powerful monitoring and management functions of the PC and communicates with the embedded single-chip microcomputer through the monitor to acquire experimental data in real time. . At the same time, the coordinates of the resonance line graph are read by the mouse to obtain the data required for various calculations such as magnetic field calculation and g-factor calculation in the experiment, thereby avoiding errors when manually added. An experiment report with pictures and texts was generated, and the system model can also be applied to other fields of magnetic field resonance spectroscopy.
The article deals with the electron spin resonance experiment in the modern physical experiment of ordinary colleges and universities. In the experiment, it is required to observe the phenomenon of electron spin resonance and observe the influence of paramagnetic ion on the resonance signal. Measure DPPH (radical diphenyl trinitrophenylhydrazine) ) The electron g factor (hv = gJμB) and the use of electron spin resonance to measure the vertical and horizontal components of the Earth's magnetic field. Accurately obtaining these experimental data is very important. In the article, it is proposed to use PC to communicate with the embedded single chip to transmit data, and to draw the acquired data into a visualized resonance line graph, by reading the coordinate values ​​of the resonance line. Obtain the data needed for the experiment, and generate the experimental report with the experimental data. Greatly improve the accuracy and automation of the experiment.
1 Intelligent Electron Spin Resonance Instrument
The intelligent electronic spin resonance apparatus is superior to the traditional electronic spin resonance apparatus. It uses the single-chip microcomputer system to judge the resonance point. The Helmholtz coil replaces the traditional solenoid coil to measure the magnetic field strength B0, and the measurement is accurate and convenient.
In order to observe the resonance phenomenon, a high-frequency probe needs to be used. The oscillation coil provides energy (hv) for the energy level transition of the measured object DPPH. When resonance occurs, the energy of the oscillator is absorbed by the sample, and the oscillation amplitude occurs. The change, which is detected after detection and low-frequency amplification, can be observed on an external oscilloscope or PC (also called resonant line). The front end of the instrument uses an edge oscillator to detect the resonant signal. The signal is sent to the waveform conversion module after detection amplification, generating a CMOS level signal pulse, and then sent to the I/O port of the microprocessor. The width of the rectangular pulse is calculated by the software. When the peak signals appear at equal intervals, the widths of adjacent pulses are equal. At this time, it is determined that B0 has been aligned and the indication of reading data is given, and the data is put into the memory at the same time.
2 Signal Measurement 2.1 Communication Principle
The experimental instrument is embedded with AT89C52 single-chip microcomputer (lower unit), responsible for data acquisition, processing and control. The PC monitor (upper computer) performs on-site visual inspection and adopts master-slave serial communication between them. The serial communication on the PC carries out the transceiving, conversion and transmission of the binary data through the RTS signal of the port RS232. The serial data in the lower computer is output from the TXD pin at the specified baud rate. When the data is received, the RXD pin is monitored. Once the “0†bit occurs, the data sent from the peripheral device is stored at the specified baud rate. However, there is a full-duplex asynchronous serial I/O port in the 8051 microcontroller. Its input and output use 5V logic instead of RS-232 voltage, so the MAX485 dedicated chip is used for conversion. As shown in Figure 1, SCM and peripheral serial communication schematic.
2.2 Data Communication Program Design 2.2.1 Communication Protocol
The system serial communication uses asynchronous communication. The agreement is as follows:
1) One frame of data consists of 1 start bit, 8 data bits, no parity, and 1 stop bit.
2) The baud rate is set to 2400 bps. The serial port of the one-chip computer works according to the mode 1, the baud rate is controlled by the timer T1.
The serial port baud rate of the PC is set through the Settings property of the VB communication control. In order to ensure the accuracy of data transmission, the baud rates of the two must be the same.
2.2.2 Lower Computer Communication and Programming
The microcontroller can use the interrupt mode or query RI (receive interrupt flag bit) or TI (transmit interrupt flag bit) data communication. The system uses the query method, in the timer T2 interrupt subroutine query RI, once detected RI = 1 then transferred to receive data subroutine, in the subroutine, the microcontroller reads the communication command sent from the host computer, read the record Numbers and other data, after correct verification, will be uploaded from the ATC256 memory history record data to the PC.
UcharcomReceive(void)
{while(RI==0)// indicates not received, need to wait for RI=0;//remove the next data after receiving (SBUF)
2.2.3 upper computer communication and programming
The upper computer uses VisualBasic8.0 programming. There are two methods to develop serial communication program with VB8.0, one is to use Windows API function; the other is to use VB8.0 communication control MSComm. The use of API functions to write serial communication programs is more complex and requires a lot of communication knowledge. Its advantages are richer functions and wider application area. It is suitable for writing more complex low-level communication programs. The MSComm communication control of VB8.0 provides standard event processing functions, events, and methods, and sets the serial port parameters through the control attributes, which easily solves the serial communication problem.
This system adopts event-driven method for serial communication design.
This experiment receives data such as the current value sent from the microcontroller and gives it an array. Part of the code is as follows:
At this point, the collection of data in the experimental system is completed, the next step will be the visual monitoring of the collected data, using the host computer to complete the experiment in the magnetic field, g factor and other calculations.
3 signal monitoring
The data collected from the SCM is transmitted to the storage array of the PC, and then each group of data is plotted as a resonance line, and the experimental data is obtained by reading the coordinates of the resonance line. The drawing of real-time curves in VB is usually done by means of the Timer control. Using the Timer control, the data monitored in the intelligent electron spin resonance analyzer is sent to pic_main periodically, and the curve is drawn as a line chart, using the Line of PictureBox1. Method drawing. Use the Line method to draw a line or draw a rectangle on a form or picture frame.
The general format of the Line method:
[object name.] Line(x1,y1)-(x2,y2)[,color]
Among them, (x1, y1) is the coordinates of the starting point; (x2, y2) is the coordinates of the ending point; the color can use the RGB function to specify the color of the drawing line or the rectangle. Part of the code is as follows:
4 Generation of experiment report
After the end of this system experiment, the electronic spin resonance experiment report is automatically generated by the system as a WORD document. It avoids the error caused by the traditional manual input. The information content of the experiment report: name, title, form, graph, date, experimental calculations, and measurement results.
4.1 New Document
The Documents collection contains all open documents. To create a new document, use the Add method to add a Document object to the Documents collection.
One of the ways to create a new document is to use the Add method. The Add method will return a Document object that references the new document.
4.2 Add text
Next, add text to the empty document, which will use the Paragraphs collection object to do this work. The following code adds a paragraph somewhere in the document and formats this paragraph:
In addition to the basic information, the WORD document generated in the electron spin resonance experiment system also contains some form information. The table information part code is as follows:
5 experimental results
Since the intelligent electronic spin resonance instrument is embedded in a single-chip microcomputer system, many data collections are automatically performed by computers, which greatly improves the experimental efficiency and minimizes experimental errors. Through the communication between the embedded single-chip microcomputer and the PC, the data transmission is realized. The experimental resonance line diagram is intuitively depicted on the PC, as shown in Fig. 2 (resonance line). The first peak value and the third one are shown in the figure. The wave peaks are the same. At this time, the values ​​of the coordinates C0 and C1 are taken and the values ​​of the g factor and the magnetic field are calculated. At the same time automatically generate experimental documents to save or print, as shown in Figure 3 (experimental report).
6 Conclusion
The event-driven method of Visual Basic can be used to conveniently develop the data acquisition and monitoring system of the intelligent electronic spin resonance system. This system utilizes the powerful monitoring and management functions of the PC and communicates with the embedded single-chip microcomputer through the monitor to acquire experimental data in real time. . At the same time, the coordinates of the resonance line graph are read by the mouse to obtain the data required for various calculations such as magnetic field calculation and g-factor calculation in the experiment, thereby avoiding errors when manually added. An experiment report with pictures and texts was generated, and the system model can also be applied to other fields of magnetic field resonance spectroscopy.
Automation Application Sensors
Widely used in the field of industrial automation, such as automatic precision assembly, automatic grinding, automatic sorting device, automatic filling system, textile equipment tension monitoring, and torque torque.
Zhejiang Nanhua Electronic Technology Co., Ltd , https://www.nhloadcells.com