Microcontroller Based Data Acquisition System

DOI : 10.17577/IJERTV2IS70678

Download Full-Text PDF Cite this Publication

Text Only Version

Microcontroller Based Data Acquisition System

Sayantan Dutta

Department of Applied Electronics and Instrumentation Engineering, University Institute of Technology, Burdwan University

Rishabh Das

Department Of Electrical Engineering, University Institute of Technology, Burdwan University

Anusree Sarkar

Department of Applied Electronics and Instrumentation Engineering, University Institute of Technology, Burdwan University


Data acquisition systems (DAS) are the basis for building monitoring tools that enable supervision of local and remote systems. The present paper describes the design of a cost effective, better resolution DAS which is compatible to most of the PC and laptops. A low cost DAS has been designed using Atmega8 Microcontroller. A suitable Graphical user interface (GUI) is generated by using a Visual Basic program connected to a homemade data converter board using the AVR microcontroller.

Keywords- Data Acquisition System, Atmega8, Graphical user interface, Converter board.


    Technology has given us the freedom to use microcontrollers and integrated circuits as per requirements in the designing of low cost systems. A low cost PC based real time data logging system can be used in the laboratories for measurement, monitoring and storage of data for slowly varying signals in science and engineering stream [1]. Data logging and recording is a very common measurement application. In its most basic form, data logging is the measurement and recording of physical or electrical parameters over a period of time [2]. In [3] we get a manual giving us a generalised idea of DAS.A conceptual model of DAS and a wireless operational DAS are described in [4] and [5] respectively. In our proposed system we have developed an efficient way of retrieving, storing and also creating a graphical representation of a single parameter, i.e. temperature.


    The System has been divided into 3 modules:

    1. Temperature Sensor (LM335)

    2. Microcontroller Unit

    3. Computer (Software)

Fig.1 Block Diagram Of The System

The hardware consists of the ATmega8, the temperature sensor (LM335), and the serial interface. The on chip firmware controls reading the ADC converter, receives commands from PC and sends the reading to PC. The microcontroller is running with 8MHz crystal oscillator, if we use the internal RC oscillator, the external crystal may be omitted. The ATmega8 DIP version has 6 channels analog input. If you need up to 8 ADC input, you can use ATmega8 in TQFP package, or you can use another AVR microcontroller with the on-chip ADC.

  1. Temperature Sensor (LM335)

    We use LM335 temperature sensor. It can measure the temperature using two wires remotely. The chip produces an output signal that is proportional to the Celsius temperature scale. The trimmer POT is used to calibrate the correct output voltage at known temperature, for example 2.98V @ 25° C.



    RS232 line type and logic level

    RS232 voltage

    TTL voltage to/from MAX232

    Data transmission (Rx/Tx) logic 0

    +3 V to +15 V

    0 V

    Data transmission (Rx/Tx) logic 1

    -3 V to -15 V

    5 V

    Control signals (RTS/CTS/DTR/DSR) logic 0

    -3 V to -15 V

    5 V

    Control signals kjnic 1

    +3 V to +15 V

    0 V

    The Microcontroller unit has been connected to the following components:

    1. MAX232: The MAX232 is an IC, first created by Maxim Integrated Products, that converts signals from anRS-232 serial port to signals suitable for use in TTL compatible digital logic circuits. When a MAX232 IC receives a TTL level to convert, it changes a TTL logic 0 to between +3 and +15 V, and changes TTL logic 1 to between -3 to -15 V, and vice versa for converting from RS232 to TTL. Table 1 gives the respective voltage values for the MAX232 IC.

    2. DB9 Connector: The DB9 (originally DE-9) connector is an analog 9-pin plug of the D-Sub miniature connector family (D-Sub or Sub-D). The DB9 connector is mainly used for serial connections, allowing for the asynchronous transmission of data as provided for by standard RS-232 (RS-232C).

      Fig 2. DB9 Connector pins

    3. In-System Programming (ISP) is the ability of some programmable logic devices, microcontrollers, and other embedded devices to be programmed while installed in a complete system, rather than requiring the chip to be programmed prior to installing it into the system. The primary advantage of this feature is that it allows manufacturers of electronic devices to integrate programming and testing into a single production phase, and save money, rather than requiring a separate programming stage prior to assembling the system.

C. Computer (software)

Features of the software are as follows.

  1. Adjustable sampling interval,

  2. Real time view in single graph or multiple graph,

  3. Record the data, save, and open the recorded database,

  4. Get statistically reading, print the record and graph (or export it as the metafile, JPG),

  5. Serial control window for monitoring and manually data transfer.

The full version PC software is designed for capturing up to 16 channels. In this version, the PC software will read 8 channels. For the ATmega8 in DIP version, it can display only 6 channels. Figure 3 shows the output window that has been created using Visual Basic.

Fig 3. The Visual Basic Window


The complete hardware schematic for the ADC board is shown in Figure 5.

The LM335 senses the temperature and generates a voltage signal. Each signal has a different value of temperature. This voltage signal is received by the microcontroller which then transmits it to the Computer via the MAX232 IC and the DB9 connector pin. The MAX232 driver IC uses some external capacitors to enhance the voltage levels to RS232 level. A 9 Pin D Type female connector is used to connect to the COM port of the PC. The circuit is made into a PCB using Express PCB and the DAS is fabricated.

The AVR program was written in assembly language. The main code running waits the serial command from PC. The speed is set to19200 8n1 format. If the board receives character '>', the AVR must echo the character '>' to the PC. This step is used to check the hardware is connected or not. Another command is 'r' (read), the microcontroller reads 8 channel ADC and sends them to PC serially.

Data transferring between ADC board and PC uses the following protocol.

  • For the first time connecting, after opening serial port, PC try to connect the ADC board. The PC send a character '>' (0x3E) and the board will echo it back.

  • After the connection has been established, we can send the command to the ADC board. For command read, PC sends character 'r' (0x72), and the board responses with ADC reading as: '\rD' + 2byte(ADC0) + 2byte(ADC1) + + 2byte(ADC7), total 18 bytes length. The reading is 16-bit data, (10-bit resolution) with high byte send first followed with low byte.

For proper acquisition of the data by the PC, graphical display and saving into a file an aplication program is developed in Visual Studio 6.0. It uses the MSComm component to communicate through the comm port of the PC.

Fig4: The real-time circuit

A real time image of the implemented circuit is given in figure 4 above. The various parts are listed below

  1. Microcontroller, Atmega 8, 8Mhz

  2. Level Converter, MAX232

  3. Stabilizer, 7805

  4. Crystal, 8Mhz

  5. Control LED

  6. Power LED

  7. Power connection

  8. Coil connection

  9. Reset button

  10. ISP connection

  11. RS 232 connector

Fig 5. The Circuit Diagram


    The result of the proposed system is the DAS window that has been build for graphical representation of the parameter (temperature) under consideration. It also stores and generates values for the ADC pins interfaced to the suitable ports. The microcontroller along with the MAX232 and the DB9

    connector helps in achieving the main objective. Figure 6 gives a Output window of our system including the result of an experimental setup.

    Fig 6: Main screen of Data Acquisition program


    The idea behind this paper was just to create an efficient and cost effective way of making a Data Acquisition System. Only one parameter is used for measurement in the system that has been proposed but there is scope to determine at least 6 such parameters for all the empty ADC pins. The Visual Basic software can be changed to incorporate more ports as per requirement. This simple concept will help connect and interface PC with any Analog Sensor.


[1]. Singh, N. Monoranjan, Sarma, K. C., 2009 Low Cost PC Based Real Time Data Logging System Using PCs Parallel Port For Slowly Varying Signals, Proceedings of 54th Annual Technical Session of Assam Science Society, pp48

[2]. http://zone.ni.com/devzone/cda/tut/p/id/2693,- A Review of PC-Based Data Logging and Recording Techniques

[3]. "Data Acquisition Hanbook, Third edition", Measurement Computing publications, 2004-2012, The united States of America

[4]. "Microcontroller Based Data Acquisition Using the TLC2543 12-Bit Serial-Out ADC", Texas Instruments, July 1995

[5]. Dr. Aditya Goel,Ravi Shankar Mishra, "Remote Data Acquisition Using Wireless – Scada System", International Journal of Engineering (IJE), Volume (3), Issue (1).

Leave a Reply