Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING
Free library / Schemes of radio-electronic and electrical devices

Two-channel PC-based data acquisition and processing system. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Computers

Comments on the article Comments on the article

Once the author of the article needed to take the characteristics of the flame burning (radiation intensity in two narrow bands of the spectrum, the ratio between the intensities and their change in time depending on the speed of air movement, the volume of combustible substance, etc.). A digital oscilloscope could handle this task, but it was not available. I had to urgently develop a data acquisition and processing system that could make at least 100 measurements per second in each channel with a time delay between the same samples of no more than 0,5 ms. The output information is the signal voltage in each channel, the ratio of their levels and the difference between the previous and subsequent signal samples in each channel.

Of course, it is unlikely that many readers will need to solve the same problem, however, the proposed hardware and software system can be considered as an example of building a workable data collection system, and it can serve as an initial impetus for developing your own.

The described system consists of a device for collecting and transmitting data (let's call it DDD) and software for a PC. 1 (a photoconverter is conventionally not shown on it). It is based on the ATMEL AT90S4433-8PI (DDI) flash microcontroller, which includes a 10-bit ADC with an analog multiplexer. In this case, however, an external channel switch on integral keys DA1 is used. This seemed more convenient, as it allowed the use of one buffer amplifier on the op-amp DA3 with a variable gain Ku. The latter depends on the state of the DA4.1 key: if it is open, Ku = (R8/R6)+1, and if it is closed, Ku = [R8/(R6||R7)]+1 (here R6||R7 is the resistance in parallel connected resistors R6 and R7).

Two-channel PC-based data acquisition and processing system
(click to enlarge)

The input stage of the op-amp DA3 is built on MOS transistors. This made it possible to use protective resistors (R1 and R2) at the input of each channel without reducing the measurement accuracy caused by the input current (leakage current of the DA1 microcircuit keys is also negligible). Resistors are necessary so that the input protective diodes built into the DA1 chip do not fail when the measured signal exceeds the DA1 supply voltage (the maximum allowable current through these diodes is 10 mA).

Another important feature of the applied op-amp is that its input and output voltages can reach the supply voltage values ​​(the so-called rail-to-rail op-amp). Thanks to this, it is possible to use one power supply for the op-amp and the microcontroller without narrowing the dynamic range of the measured signal.

On the DA2 chip, a voltage regulator for the device is assembled, on DA5 - a source of exemplary voltage for the ADC of the microcontroller. The DA6 chip is used to communicate the universal asynchronous serial transceiver (UART) of the microcontroller with a PC via the RS232 serial interface. LEDs HL1 and HL2 - indicators of operating modes of the USD.

The XP1 connector is required for sequential programming of the microcontroller in the device, for example, with the AS1 in-circuit programmer. Through the connector XS1, the JCD is connected to the serial port of the PC.

Two-channel PC-based data acquisition and processing system

The program for the microcontroller is written in AVR assembler in the AVR-Studio environment, which is freely distributed by ATMEL. The Windows application responsible for communicating with the DDD and processing the received information was created in the Delphi 5 environment. When writing the program, R. Kusyapkulov's article "Working with Serial Ports in Windows 95" helped me a lot (Radio, 2000, No. 1, p. .23). In the Delphi environment window, the application looks as shown in Fig. 2.

Let's consider the operation of the software and hardware of the DRM in a complex. After the entire system is assembled and all the necessary connections are made, you can run the application. A window will appear on the computer monitor. At this time, the USD microcontroller is in the mode of constant polling of the UART receiver. The HL1 ("Ready to Receive") indicator lights up. The microcontroller program constantly checks the state of the RXC bit in the UCSRA register, waiting for it to go to a one state. The system is waiting for user action. It is possible either to change the gain of the DRD measuring path, or to start a measurement cycle. In the first case, you should "click" on the button "Ku=0,5" or "Ku=1". The components RadioButton 1 and Radiobutton 2 are responsible for switching the gain in the application program. For example, if you "click" on the button "Ku=0,5", the RadioButton2Click event handler will be launched and the Kamp variable will take the value 110. This code corresponds to the reduced gain (conditionally Ku=0,5). Now you can press the "Start" button (it is not visible in Fig. 2, since the "Complete" button is located on top of it), thereby starting the measurement cycle.

Here it is expedient to consider the general ideology of data exchange between DDD and PC. Once started, the measurement cycle must be stopped at some point. In the described system, the following tactic is adopted. The measurement is not carried out continuously, but at intervals of just over 2 s (set by the Interval property of the Timerl component in the application program). Three hundred measurements in each of the channels takes a little less than 2 s. Thus, if a measurement cycle is started by the Timer1Timer event (300 measurements in each channel), then after it ends, there will be a short time left until the next Timer1Timer event occurs, sufficient for the application to react to the bbCompleteKeyPress event (if the "Complete" button was pressed). Note that in one measurement cycle, the DDD will send 1200 bytes of information to the PC, since the result of each measurement consists of two bytes.

So, after clicking the "Start" button, a timer with a period of 110 ms is started (see the application program, procedure TForml bbStartClick). After this time, control passes to the Timer1Timer event handler. Code 110 or 130 (reduced or normal gain, respectively) is transmitted to the DDD through the serial port - the variable Kamr. The microcontroller receives this data, sets the required gain by closing or opening the DA4.1 key, and waits for new information to be received. At this time, the PC transmits code 100 (ActionKey variable in the application program) to the DRC. The microcontroller, having received this information, turns off the HL1 indicator, turns on the HL2 indicator (“Transmission in progress”) and starts the measurement cycle (action label in the microcontroller program) After making one measurement in each channel, the microcontroller transmits data to the PC and makes a short pause to ensure required signal sampling rate. Then the measurements, data transfer and pause are repeated 299 more times, after which the microcontroller goes into the mode of waiting for information from the PC (the HL2 indicator goes out, and HL1 lights up). If during the cycle (≈2,1 s) the "Complete" button was pressed, then immediately after the end of receiving the last of the 1200 bytes, control is transferred to the bbCompleteKeyPress handler. The computer transmits code 120 to the DDD, which is not recognized by the microcontroller as a known one, as a result of which the DRD remains in the mode of waiting for a command from the PC.

If the "Complete" button has not been pressed, then a new measurement cycle will start upon the occurrence of the Timer1Timer event. And so on until the "Complete" button is pressed.

The bbCompleteKeyPress handler also processes the received information and generates a text file in which the measurement results are presented in a convenient form. Each measurement cycle is named here as a block with a corresponding number. A fragment of the text file data_temp.txt is shown in fig. 3. The text contains some semblance of a "header" of the table, where "No. meas" is the measurement number (from 1 to 300 in the first block); IR - channel 1 signal voltage; dif IR - the difference between the previous and subsequent measurements of channel 1; cr - channel 2 signal voltage; dif cr - the difference between the previous and subsequent measurements of channel 2; dif - the ratio of the signal level of the first channel to the level of the second one.

Two-channel PC-based data acquisition and processing system

Establishing the DCD comes down to setting the voltage to +5 V by selecting the resistor R5 (it must be at least the exemplary one at the AREF DD1 input, but not more than 6 V)

The KR1157EN1 (DA2) microcircuit can be replaced with an imported analog LM317L, as well as any adjustable voltage regulator of positive polarity with an output current of at least 30 mA. Instead of OU KR1446UD1A (DA3), you can use KR1446UD4A; the use of modifications with other letter indices is undesirable due to the higher zero bias voltage.

Resistors - metal-dielectric C2-23, C2-33; capacitors C1-C3 - oxide-semiconductor tantalum K53-1, K53-4; the rest are ceramic KM, K10-17. Throttle L1 - unified DM, DPM. Connectors XP1 - PLD10, XS1 - DRB-9FB. Quartz resonator ZQ1-RK169MA-6AP-6000K.

Programs for the microcontroller (program 1) and PC (program 2)

Author: M.Bogdanov, Sarov, Nizhny Novgorod region.

See other articles Section Computers.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

Artificial leather for touch emulation 15.04.2024

In a modern technology world where distance is becoming increasingly commonplace, maintaining connection and a sense of closeness is important. Recent developments in artificial skin by German scientists from Saarland University represent a new era in virtual interactions. German researchers from Saarland University have developed ultra-thin films that can transmit the sensation of touch over a distance. This cutting-edge technology provides new opportunities for virtual communication, especially for those who find themselves far from their loved ones. The ultra-thin films developed by the researchers, just 50 micrometers thick, can be integrated into textiles and worn like a second skin. These films act as sensors that recognize tactile signals from mom or dad, and as actuators that transmit these movements to the baby. Parents' touch to the fabric activates sensors that react to pressure and deform the ultra-thin film. This ... >>

Petgugu Global cat litter 15.04.2024

Taking care of pets can often be a challenge, especially when it comes to keeping your home clean. A new interesting solution from the Petgugu Global startup has been presented, which will make life easier for cat owners and help them keep their home perfectly clean and tidy. Startup Petgugu Global has unveiled a unique cat toilet that can automatically flush feces, keeping your home clean and fresh. This innovative device is equipped with various smart sensors that monitor your pet's toilet activity and activate to automatically clean after use. The device connects to the sewer system and ensures efficient waste removal without the need for intervention from the owner. Additionally, the toilet has a large flushable storage capacity, making it ideal for multi-cat households. The Petgugu cat litter bowl is designed for use with water-soluble litters and offers a range of additional ... >>

The attractiveness of caring men 14.04.2024

The stereotype that women prefer "bad boys" has long been widespread. However, recent research conducted by British scientists from Monash University offers a new perspective on this issue. They looked at how women responded to men's emotional responsibility and willingness to help others. The study's findings could change our understanding of what makes men attractive to women. A study conducted by scientists from Monash University leads to new findings about men's attractiveness to women. In the experiment, women were shown photographs of men with brief stories about their behavior in various situations, including their reaction to an encounter with a homeless person. Some of the men ignored the homeless man, while others helped him, such as buying him food. A study found that men who showed empathy and kindness were more attractive to women compared to men who showed empathy and kindness. ... >>

Random news from the Archive

Another barrier to Mars 18.12.2011

Experts express justified skepticism about manned flights to Mars: astronauts will have to endure weightlessness and cosmic radiation for too long.

Glasses had to be sent to the International Space Station recently: it turned out that months spent in zero gravity cause eye disease in some people, and there is a danger that the crew will fly to Mars already blind. Of NASA astronauts who spent six months on the station, 35-60 percent experienced blurred vision.

The reason is retinal edema in the place where the optic nerve comes out on it. All but one of the astronauts regained their sight after returning to Earth, but in principle this disease, if left untreated, can lead to blindness.

The reasons are not entirely clear. It is believed that in zero gravity, the cerebrospinal fluid presses too hard on the brain. Instead of flowing down to the lower spine under the influence of gravity, it presses on the brain and the nerves extending from it, and they are not adapted for this.

Other interesting news:

▪ A new method for diagnosing anxiety disorders

▪ New type of biomolecule discovered

▪ Super-maneuverable Tsubame satellite

▪ Ultrabook hybrid Toshiba Portege Z10T

▪ The ISS will become a filling station for satellites

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ site section And then an inventor (TRIZ) appeared. Article selection

▪ article Dark kingdom. Popular expression

▪ article Which of the comets is the most famous? Detailed answer

▪ article Locksmith for the repair of technological refrigeration units. Standard instruction on labor protection

▪ article Antenna Lazy Delta (lazy delta). Encyclopedia of radio electronics and electrical engineering

▪ article Pulse low-voltage voltage converter. Encyclopedia of radio electronics and electrical engineering

Leave your comment on this article:

Name:


Email (optional):


A comment:





All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024