Lab VIEW Based Interrupt Driven Wireless Instrumentation For Zigbee And Bluetooth Hardware

DOI : 10.17577/IJERTV2IS1343

Download Full-Text PDF Cite this Publication

Text Only Version

Lab VIEW Based Interrupt Driven Wireless Instrumentation For Zigbee And Bluetooth Hardware

Ms. Snehal Upadhye

CSIR-National Chemical Laboratory, Instrumentation & Communication Unit, Pune, India

Ms. Pooja Kulkarni

CSIR-National Chemical Laboratory, Instrumentation & Communication Unit, Pune, India

Dr. (Mrs). Neelima Iyer CSIR-National Chemical Laboratory, Instrumentation

& Communication Unit, Pune, India

Abstract

This paper presents a scheme for establishing serial communication between PC and LabVIEW for real time interrupt driven systems. Work is focused on LabVIEW based developments for Chemical Engineering applications where user has to monitor and control different vital parameters such as temperature, pressure, motor RPM etc. Proposed work focuses on developing applications that include Temperature monitoring and data logging, by implementing wireless communication with Zigbee modules, Bluetooth modules, ARM embedded systems. The central controller is PC based LabVIEW VI developed for these real time systems. With LabVIEW VI real time wireless communication is achieved by interrupt driven system for control and data acquisition as well as feedback from wireless and embedded systems. The LabVIEW VI running on PC receives real time data and bifurcates to or from which ZigBee or Bluetooth modules the communication has taken place. At National Chemical Laboratory (NCL), Pune development work is ongoing for project on wireless instrumentation using IEEE 802.15.4 standard.

Keywords IEEE 802.15.4 standard, Interrupt, Laboratory Virtual Instrumentation Engineering Workbench (LabVIEW), Virtual Instrumentation Software Architecture (VISA), Wireless, Zigbee.

  1. INTRODUCTION

    Wireless operations permit services, such as long-range communications, that are impossible or impractical to implement with the use of wires. IEEE 802.15.4 is a packet-based radio protocol. It addresses the communication needs of wireless applications that have low data rates and low power consumption requirements.

    802.15.4 defines operation in three license-free Industrial Scientific Medical (ISM) frequency bands namely 868 MHz, 915 MHz, 2.4GHz. Of the three ISM frequency only the 2.4 GHz band operates world-wide. It is the foundation on which ZigBee is built.

    LabVIEW is a proprietary product from National Instruments since its origin in 1986. It is a system design platform and development environment for a visual programming language. The programming language used in LabVIEW, also referred to as G, is a dataflow programming language. LabVIEW programs are called virtual instruments, or VIs, because their appearance and operation imitate physical instruments, such as oscilloscopes and multimeters. One of the benefits of using LabVIEW over other development environments is the extensive support for accessing instrumentation hardwares such as RS232 instruments, data acquisition, vision, and motion control devices etc.

    For the work in discussion, the software code development is done using LabVIEW 2011 SP1 Developer Suite which is one of the latest LabVIEW versions with some of the advanced features available in it. LabVIEW Developer Suite (LDS) 2011 has many new features over previously available versions of LabVIEW at NCL and are as follows:

    1. Enhancements in Creating SubVIs

      To use a VI as a subVI, it is necessary to build a connector pane. The connector pane is a set of terminals that corresponds to the controls and indicators of that VI. The connector pane defines the inputs and outputs you can wire to the VI so you can use it as a subVI. In previous versions of LabVIEW, when you create a subVI from a block diagram selection, you must clean up the connector pane and front panel of the new subVI manually. In LabVIEW 2011, LabVIEW automatically builds the connector pane and front panel of the subVI according to the following LabVIEW programming conventions: A 4×2×2×4 connector pane pattern, unless the subVI requires more terminals, error in and error out terminals in the lower corners of the connector pane, Refnum or class terminals in the upper corners of the connector pane, Controls aligned on the left side of the front panel , Indicators aligned on the right side of the front panel etc.

    2. New and Changed VIs, Functions, and Nodes

    LabVIEW 2011 includes the following new and changed VIs, functions, and nodes.

    1. Application Builder VIs- The Application Control palette includes the new Application Builder palette with the following new VIs: Build , Clean , Deploy

    2. Application Control VIs and Functions-The Application Control palette includes the following new nodes: Start Asynchronous Call, Wait on Asynchronous Call .

  2. SYSTEM DESCRIPTION

    The unit on field side consists of a temperature sensor-K type thermocouple, signal conditioning circuit, LPC2148 microcontroller hardware along with Zigbee transmitter. ZigBee RF module, PC & LabVIEW together form a receiver. Data acquisition, control and monitoring are done wirelessly through LabVIEW software so that user can monitor and/or control a process from his desk. Interfacing of ZigBee with LabVIEW is done via RS232 standard. Phillips LPC2148 microcontroller with ARM7 core on field side acquires and processes data and is

    transmitted via ZigBee transmitter. This wirelessly transmitted data is received by ZigBee receiver connected to PC which is a user side. PC receives the data through COM port. The data is collected and monitored in LabVIEW. System protocols can be extended to have communications with more than one ZigBee module pair and Bluetooth pair using LabVIEW interrupts driven design.

    Figure 1: System Block Diagram

    The main system block is LPC2148 with 32bit RISC ARM7 core. As per application requirement K-type thermocouple is used for temperature reading and data logging. Wireless connectivity for data transmission is achieved through ZigBee Transmitter-Receiver pair. If number of ZigBee modules at process side increases; the module on receiver side will communicate according to proper addressing structure that is compatible with modules at the other side. The system hardware and software development for Process side and User side is explained as follows:

    1. Process Side

      The main hardware blocks on the process side comprises of-

      1. Temperature sensor

        K-type thermocouple is used as a sensing element. K-type thermocouple has a range of -270 to 1200 °C. The weak signal output from thermocouple is further amplified using signal conditioning circuit.

      2. Signal conditioning circuit

        Signal conditioning circuit consists of AD595 which is a Monolithic Thermocouple Amplifier with Cold Junction Compensation. It is a complete instrumentation amplifier and combines an ice point reference with a precalibrated amplifier to produce a high level (10 mV/°C) output directly from a thermocouple signal.

      3. Phillips LPC2148 microcontroller

        Phillips LPC2148 microcontroller, with 32bit ARM7 TDMI core, runs on 60MHz clock, is a major block of this system. On-chip 10 bit SAR-ADC, with 3.3V Vref. and internal clock source of 15MHz is used to read output of signal conditioning circuit.

      4. ZigBee Module (Transmitter)

      The ZigBee wireless module based on 4214A-XBEE from MaxStream has a 3.3V TTL compatible serial interface, which is interfaced with the UART of LPC2148. The RF module is programmed to operate for transmission protocols of 8 data bits, 1 stop bit and 9600 baud rate.

      24*4 LCD

      Zigbee Module

      K-Type Thermocouple

      K-Type Thermocouple

      LPC2148

      Microcontroller

      Signal Conditioning Circuit

      Signal Conditioning Circuit

      Figure 2: Process Side Block Diagram

      Figure 3: Process Side setup

    2. User Side

    User side consists of a ZigBee receiver and a LabVIEW VI running on PC. It facilitates user to observe and control chemical process parameters remotely from his desk.

    1. Hardware

      Figure 4: User Side Block Diagram

      1. ZigBee Module (Receiver)

        ZigBee receiver module wirelessly receives data from ZigBee on field side. This receiver module is connected to PC through RS232 cable.

      2. Computer Interface

      By virtue of PC motherboard design since beginning, four number of COM ports can be made functional for serial communication RS232 standard protocol system. With new Pentium motherboard architecture, COM ports are physically not present. For such cases, USB port can be used by using USB to serial adapter (BAFO). On BAFO installation, it prompts for virtual COM port in LabVIEW. For NCL program, it is shown as COM6 after BAFO installation. This varies from PC to PC and for Laptop. User side setup consists of LabVIEW VI and ZigBee module as shown in following figure 5.

      LabVIEW VI Running On PC

      USB to Serial Adapter ZigBee Receiver Module

      Figure 5: User Side Setup

    2. Software

    The software application is developed in LabVIEW developer suite 2011. ZigBee modules, Bluetooth modules and embedded modules are interfaced with LabVIEW using COM port. With proper addressing structure, LabVIEW communicates with these modules in a real time domain due to interrupt driven design. LabVIEW VI consists of two parts namely, Front panel and Block Diagram. Front Panel serves as a User Interface with all the controls and indicators on the display; while Block diagram contains actual source code which is developed using different functions as per application requirements.

    Most important part of the source code is that; it checks and handles any events occurrence programmatically and at that instance due to interrupt driven programming. Traditional methods would involve continuously polling for data until the data is available on port; which increases processor and resource usage and prevents other loops in the program from executing smoothly. This issue is resolved by using VISA (Virtual Instrumentation Software Architecture) events very properly and in a methodological way. A VISA event is generated on arrival of a byte at COM port.

    LabVIEW block diagram code consists of four main parts; initialization, write, read and event handlers. The block diagram components are described as follows:

    1. VISA Configure Serial Port- Initializes the selected serial port to the specified settings. It consists of different settings such as Port Number, data bits, baud rate, parity etc.

    2. VISA Write Writes data to the COM port.

    3. VISA Serial Read- Reads the specific number of bytes from the device and returns the data in the read buffer.

    4. Event Handlers

      1. VISA Enable Event- Enables notification of a specified event type.

      2. VISA Wait on Event- Suspends execution of an application thread and waits for an event type for a time period not to exceed that specified by timeout. For NCL real time system application, timeout for LabVIEW VISA is programmed for substantially high value.

    Serial communication protocol for this application is developed as a proprietary protocol. Data is wirelessly transmitted and received by ZigBee and Bluetooth hardware as a packet format. This packet consists of data format as: Start code, data bytes, stop code. This data is

    properly checked by LabVIEW for particular wireless hardware data. Further data conversion, display and plotting are done by LabVIEW.

  3. ZIGBEE INTERFACE METHODOLOGY

    ZigBee configuration

    The ZigBee wireless module consists of different configurable commands which are used to set different network parameters. These parameters are stored in nonvolatile memory and can be modified by using AT Command. ZigBee addressing along with some of the major commands like MY, DL, DH, PANID, CH are described below.

    1. ZigBee Addressing: The ZigBee module supports both short 16-bit addressing and long 64-bit addressing. A unique 64-bit IEEE source address (SL + SH) is assigned at the manufacturers side and 16bit address can be assigned by using AT commands.

    2. Source Address: MY or source address of RF module is a 16-bit address, which is unique for particular PAN.

    3. Destination Address: In the same way DL and DH together form a destination address. In 16-bit addressing mode, DH must be zero and DL ranges from 0 – 0xFFFE, but if DL parameter of FFD is assigned 0xFFFF value, then it signifies that the message will be broadcasted to all nodes in network. Similarly, for 64-bit addressing, Destination Address (DL + DH) on the sender must match the Source Address (SL + SH) of the desired receiver.

    4. PANID: An RF data network that consists of one Coordinator and one or more End Devices form a PAN (Personal Area Network). Only modules with matching PAN IDs can communicate with each other. Unique PAN IDs enable control of which RF packets are received by a module.

    5. CH (Channel No.): To improve security and reduce interference from other PANs, CH parameter is used. This parameter defines the actual frequency band from 2.40 – 2.4835 GHz to be used for a particular PAN.

  4. RESULTS

    VI is developed with a predefined protocol to synchronize with microcontrollers, ZigBee and Bluetooth modules. An executable file is built to facilitate user to run this process on another PC at remote location where LabVIEW software is not available. Similarly, the same VI can be published worldwide using Web Publishing Tool in LabVIEW so that user at any place can monitor and control the process through his desktop or smart phone.

    Figure 6 shows the LabVIEW VI front panel on which temperature from two different channels is displayed and plotted simultaneously.

    Figure 6: Temperature Display on LabVIEW Front Panel

  5. CONCLUSION

    The full system is checked and tested for interrupt time domain of 5 milliseconds at present. This time domain can be further reduced based on application complexity. The acquired temperature is continuously displayed and plotted with auto scaling the important feature of LabVIEW. Temperature data log has been created in the excel file so that chemical engineers can further process this data for their applications and for final conclusions.

  6. FUTURE SCOPE

Further to LabVIEW developer suite, in the development line of National Instruments, the same work is going to be initiated soon using LabVIEW RT. National Instruments LabVIEW with the LabVIEW Real-Time Module and RT Series hardware delivers deterministic, real-time performance for data acquisition and control systems. LabVIEW Real-Time targets include an embedded processor with RTOS running, onboard memory, local storage, and connections to peripheral devices such as serial, Ethernet, and GPIB. With LabVIEW RT, the interrupt time domain can be further reduced for deterministic performance. LabVIEW RT would be essential to develop total LabVIEW based system for final system.

Present work is completed by using only one COM port of PC. Different COM ports can be used for reading data from ZigBee, Bluetooth and embedded modules. This can

be achieved by using NI Serial card with PC with number of COM ports (8/16/32).

ACKNOWLEDGEMENT

We are extremely thankful to Dr. Sourav Pal, Director, National Chemical Laboratory for his constant encouragement. We extend our sincere thanks to Dr. Vivek Ranade, Deputy Director and Chair Chemical Engineering & Process Development Division, NCL, for believing in wireless instrumentation for chemical processes & allowing us for implementation of this application for Chemical Engineering process. We acknowledge active support and suggestions from Dnyanesh Joshi and Rahul More, Research Interns, Instrumentation and Communication Unit, NCL, Pune.

REFERENCES

  1. Winn L. Rosch, The Winn L. Rosch Hardware Bible, 2nd Edition, Prentice Hall of India Private Ltd.

  2. Getting Started With LabVIEW- User Manual, National Instruments.

  3. Jeffrey Travis, LabVIEW for Everyone, 2nd edition December 15, 2001, Prentice Hall

  4. LabVIEW 7 Express- User Manual, National Instruments.

  5. Product Manual v1.xCx – 802.15.4 Protocol (XBee®/XBee- PRO® OEM RF Modules)

  6. Analog Devices, Inc. (1999) AD595-Monolithic Thermocouple Amplifiers with Cold Junction Compensation.

  7. www.zigbee.org.

Leave a Reply