Data Logger to PC via Serial Port


A data logger is an electronic device that is used to record the value measured over time. It is simply plug into a serial port on your PC. By connecting suitable sensors, data logger can be used as acquisition products that can be used to measure temperature, pressure, relative humidity, light, resistance, current, power, speed, vibration... in fact, anything that you need to measure. The output data from data logger is a periodic stream in simple text or hexadecimal with customized data format we need. Simply capture the data to a text file and then import it into Excel to produce tables and charts over time. 
If the data sent to the PC is a text data, you can use HyperTerminal to receive the data. Some control characters like tabs and carriage returns can be used here. For this purpose, the data which is usually a binary or hexadecimal numbers must be converted into ASCII format. Here you can use the binary / hexadecimal to ASCII data converter .
In order to obtain higher transmission speeds, the data sent should still use binary or hexadecimal format. To receive this data, we should use receiver that can receive binary or hexadecimal data. We can make this program with programming tools such as Delphi, Visual Basic or Visual C. If necessary, the program can convert binary / hex to ASCII.
In the application we build, data from microcontroller ATmega8535 was sent to the PC using a serial transmission. This data is fed to PC via serial port. Data emited from TXD pin (PD1) of microcontroller. In the future, we must also be able to receive data from the PC. Such data can be received through the RXD pin (PD0) microcontroller. Of data to and from the microcontroller using TTL level, while data from and to the PC serial port using RS-232 level. To interface between the microcontroller and a serial port, we can use the CMOS / TTL - RS-232 converter, for example is MAX-232.
We can determine the speed of data to be sent. Here we use the speed of 9600bps. Because a single ASCII characters using 8-bit data format, then we can send about 1000 ASCII characters per second. The speed of data and data length can be changed. In this application, the microcontroller is operated at a clock frequency of 11.0592 MHz. On this frequency, some variation in the data transmission speeds will have 0% error.
The data that we send do not have to be continuous. Here, we will send data every 100ms. Data that we send are ASCII characters that located at memory location pointed to by the index_start until index_end constant. Such data will be sent 10 times per second. This data transfer speed is usually quite adequate for a data logger. However, if necessary, we can increase the speed.
In some applications like data logger, it may take time high accuracy in data transmission speed. A precision data logger can send appropriate data 10 times per second which means exactly 100 times per 10 seconds or right 36 000 times per hour. We can make the data transmission speed precisly. We can use 8-bit timer for this purpose. This is similar to building a precision frequency generator. Further discussion of this matter, you can click here.
This application can be combined with other applications that shown in this blog. By integrating the application with a True RMS meter, we can build a True RMS meter with data logger to a PC. By integrating these applications with the phase difference meter, we can build the phase difference meter with data logger to a PC. And
by integrating these applications with the compass tracker, we can build the compass tracker with data logger to a PC.

No comments:

Post a Comment