Data Acquisition, Controlling and Wired Remote Data Display

Embed Size (px)

Citation preview

  • 7/27/2019 Data Acquisition, Controlling and Wired Remote Data Display

    1/5

    International Journal of Engineering Trends and Technology (IJETT) Volume 4 Issue 6- June 2013

    ISSN: 2231-5381 http://www.ijettjournal.org Page 2458

    Data Acquisition, Controlling and Wired Remote

    Data Display

    Chetan B. Bambhroliya#1

    ,Prof. Sarman K. Hadia*2#Communication System Engineering, Charusat University

    At & Po: Changa-388421, Dist-Anand, India

    * Associate Professor,

    Communication System Engineering, Charusat University

    At & Po: Changa-388421, Dist-Anand, India

    AbstractData acquisition, controlling and its monitoring hasalways been a field of interest in the industrial area. There aremany traditional methods to accomplish this task but this work

    presents an embedded implementation of Data acquisition,

    Controlling and its monitoring. We have used PSoC to developembedded Data acquisition and controlling system whichprovides reasonably good and reliable results. PSoC

    (Programmable System on Chip) is a technological advancement

    in the field of Embedded Systems which consists ofProgrammable Gain Amplifiers (PGA), Analog to Digitalconvertors (ADC), UART, LCD Display module etc on Chipwhich can be programmed as required to accomplish the tasksfor various applications.

    Keywords PSoC,

    I. INTRODUCTIONData acquisition has always been a field of interest in

    manufacturing industrial area. It can be done for various

    processes like temperature, flow, position, pressure etc usingtheir respective transducers.[6] This work is carried out bytaking temperature in account and we are using LM-35 as

    transducer for the detection of temperature. Output of thetransducer is monitored by PSoC [2]. Work is divided in twosections, one is transmitter and other is receiver. Block

    diagram of transmitter is illustrated in figure 1 below.

    Serial data

    Figure.1 Block diagram of transmitter.

    Voltage output from the LM-35 is given to the PGA block of

    the PSoC. Then ADC converts the analog data into the digitalformat; which is converted to decimal format to be displayedon the LCD module.

    Output from the ADC is also coupled to UART so as toconvert the parallel digital data to serial data so can betransmitted to the remote display panel with a pair ofwire.Figure.2 illustrates Block diagram of the receiver module.

    SerialData

    Figure.2 Block diagram of receiver module.

    The transmitted data over a two wire system at the remote

    display system is given to the PGA of the receiving PSoC[2].

    This data is converted to parallel digital data form and givento the LCD display module for its monitoring.An ON-OFF type controller is programmed at the transmitter

    side for the control of the measured temperature variable.

    II. SYSTEMDESCRIPTIONANDHARDWARE.

    A. LM35The LM-35 series are precision integrated circuit

    temperature sensors whose output voltage is linearlyproportional to the Celsius temperature [1]. The LM-35

    requires no external calibration since it is internally calibrated.It outputs 10 mV for each degree of Celsius temperature. The

    LM35 does not require any external calibration or trimming toprovide typical accuracies of 14Cat room temperature and

    34C over a full 55 to +150Ctemperature range. TheLM35s low output impedance, linear output and preciseinherent calibration make interfacing to readout or control

    circuitry especially easy. Figure.3 illustrates typicalapplication of the LM-35 IC.

    LM-35 PGA ADC

    LCD

    DISPLAY

    UART

    UART LCD

    DISPLAYPGA

  • 7/27/2019 Data Acquisition, Controlling and Wired Remote Data Display

    2/5

    International Journal of Engineering Trends and Technology (IJETT) Volume 4 Issue 6- June 2013

    ISSN: 2231-5381 http://www.ijettjournal.org Page 2459

    Figure.3 Basic centigrade temperature sensor

    B. PSoC.PSoC is abbreviated form of the Programmable System

    on Chip, which is a technological advancement in the field ofembedded systems which consists of many Digital as well as

    Analog blocks which can be placed and programmed toachieve various applications. The PSoC family consists ofmany Mixed-Signal Array with On-Chip Controller devices.

    These devices are designed to replace multiple traditionalMCU-based system components with one, low cost single-chip programmable component. A PSoC kit features an

    evaluation board and MiniProg programming unit. Theevaluation board includes an LCD module, potentiometer,LEDs and plenty of bread board. The MiniProg unit will

    program PSoC devices directly on the evaluation board or onthe other boards via a 5-pin header. The MiniProg is small andcompact and connected to the users PC via a provide USB

    2.0 cable. The PSoC device includes configurable blocks ofanalog and digital logic, as well as programmable interconnect.We need to set global parameters in the PSoC designer which

    are common to all the analog and digital blocks used for anyapplication. Figure.4 illustrates the global parameters window

    and Figure.5 illustrates a PSoC EVal kit. This architectureallows the user to create customized peripheral configurations,to match the requirements of each individual application.

    Figure.4 Global parameters setting window

    C. PGAIn a data acquisition system the signal inputs to various

    channels may not normally be at same level. If all the signalswere to be of the same level, the gain required of the amplifier

    can be fixed value. But if the level of the signals defer by anorder of magnitude or more, it is essential to have a

    programmable gain amplifier whose gain can be varied forsignal conditioning.

    Figure.5 A typical PSoC EVal kit

    D. ANALOG TO DIGITAL CONVERTER.The PSoC kit consists of several Analog to Digital

    converter blocks with different resolutions. Resolution is themost important issue of an ADC as it decides amount ofchange in input variable to be detected. It has a variableresolution analog to digital converter named ADCINC.The

    ADCINC is a differential or single input ADC that returns a 6to 14 bit result.9 bit resolution of ADCINC and 5V referencesupply, and

    Resolution (1)

    Hence the resolution is equal to 0.09765 V.As transducer LM-

    35 gives a change 10mv per degree change in temperature; it

    is the best suitable resolution selection.

    E. LCD DISPLAYThe LCD User Module uses a single I/O port to interface

    to an industry standard Hitachi HD44780A LCD controller.This type of display has a simple interface consisting of 8 databits, read/write (R/W), register select "RS," and an enable "E"

    signal. The LCD Tool Box User Module is a set of libraryroutines that writes text strings and formatted numbers to acommon two- or four-line LCD module. This module was

    developed specifically for the industry standard HitachiHD44780 two-line by 16 character LCD display driver chip,

  • 7/27/2019 Data Acquisition, Controlling and Wired Remote Data Display

    3/5

    International Journal of Engineering Trends and Technology (IJETT) Volume 4 Issue 6- June 2013

    ISSN: 2231-5381 http://www.ijettjournal.org Page 2460

    but will work for many other four-line displays. The figure.6shows an interface of PSoC IO port to LCD display module.

    Figure.6 Block diagram of LCD to PSoC interface

    F. UART.The UART User Module is an 8-bit Universal

    Asynchronous Receiver Transmitter that supports duplex RS-232-compliant, data format serial communications over twowires. Received and transmitted data format includes a start

    bit, optional parity, and a stop bit. Programmable clocking andselectable interrupt or polling style operation is supported.Application Programming Interface (API) firmware routines

    are provided to initialize, configure, and operate the UART.Figure.7 below illustrates the functional block diagram of theUART.

    Figure.7 Functional block diagram of the UART

    The UART User Module implements a serial transmitterand receiver. The UART maps onto two PSoC blocks

    designated TX and RX, in the PSoC Designer Device Editor.The TX PSoC block provides transmitter functionality and theRX PSoC block provides receiver functionality.RX and TXoperate independently. Each have their own Control and

    Status register, programmable Interrupts, I/O, Buffer register,and Shift register. They share the same enable, clock, and dataformat. Enabling and disabling is performed using the API

    provided functions. The UART User Module clock is sharedby both the RX and TX components. The clock frequency

    selected must be eight times the frequency of the required databit rate. The clock is configured using the PSoC Designer

    Device Editor. The data received and transmitted is a bitstream that consists of a start bit, eight data bits, an optionalparity bit, and a stop bit. The parity may be set to none, even,or odd, and is set using the PSoC Designer Device Editor or

    using the UART API.

    1. RX - UART Receiver.The receiver uses the RX Buffer, RX Shift, and RX

    Control registers of a Digital Communications type PSoCblock. The RX Control register is initialized and configuredusing the UART User Module firmware API routines.

    Initialization of the RX consists of setting the UART parity,optionally enabling the interrupt on the Rx Register Fullcondition, and then enabling the UART. When a start bit is

    detected on the RX input, a divide-by-eight bit clock is startedand synchronized to sample the data in the centre of thereceived bits. On the rising edge of the next eight-bit clock,

    the input data is sampled and shifted into the RX Shiftregister. If parity is enabled, the next bit clock samples theparity bit. The sampling of the stop bit, on the next clock,

    results in the received data byte transfer to the RX Bufferregister and the triggering of one or more of the followingevents:

    Rx Register Full bit in the RX Control register is set,and if the interrupt for the RX is enabled, then theassociated interrupt is triggered.

    If the stop bit is not detected at the expected bitposition in the data stream, then the Framing Errorbit in the RX Control register is set.

    If the Buffer register has not been read, before thestop bit of the currently received data, then theOverrun Error bit in the RX Control register is set.

    If a parity error was detected, then the Parity Errorbit is set in the RX Control register.

    For polling detection of a completely received data byte, theRx Register Full bit in the RX Control register should bemonitored. Data must be read out of the RX Buffer register,

    before the next byte is completely received, to prevent theoverrun error condition.

    2.TX UART Transmitter.The transmitter uses the TX Buffer, TX Shift, and TX

    Control registers of a Digital Communications type PSoCblock. The TX Control register is initialized and configuredusing the UART User Module firmware API routines. When

    the Enable bit in the TX Control register is set, an internaldivide-by-eight bit clock is generated. A data byte to transmitis written by an API routine into the TX Buffer register,

    clearing the Tx Buffer Empty status bit in the TX Controlregister. This status bit can be used to detect and preventtransmit overrun errors. The rising edge of the next bit clocktransfers the data to the Shift register and sets the Tx BufferEmpty bit in the TX Control register. If the interrupt enablemask is enabled, an interrupt will be triggered. This interrupt

  • 7/27/2019 Data Acquisition, Controlling and Wired Remote Data Display

    4/5

    International Journal of Engineering Trends and Technology (IJETT) Volume 4 Issue 6- June 2013

    ISSN: 2231-5381 http://www.ijettjournal.org Page 2461

    enables the queuing of the next byte to transmit, so that uponcompletion of transmission of the current data byte, the new

    byte will be transmitted on the next available transmit clock.The start bit is transmitted at the same time that the data byteis transferred from the TX Buffer register to the TX Shiftregister. Successive bit clocks shift a serial bit stream to the

    output. The stream is composed of each bit of the data byte,least significant bit first, an optional parity bit, and a final stop

    bit. Upon completion of transmission of the stop bit, the TXControl register's Tx Complete status bit is set. This bit willremain valid until read. If a new data byte has been written tothe TX Buffer register, the data byte will be transferred to theTX Shift register and transmission of the data will begin onthe next rising edge of the bit clock.

    3.ClockUART is clocked by one of 16 possible sources. The clock

    rate must be set to eight times the desired bit rate. One data bitis received or transmitted every ten clocks cycles.

    4.Baud RateBaud rate is an important parameter in serial

    communication as it provides the synchronization between thetransmitter and the receiver. After making a tradeoff between

    the clock required by ADC and UART in the globalparameters we made the following calculations,Now,

    Sysclk frequency = 24MHz

    From the global parameter window

    (As N=8) then VC1=3MHz (2)

    (As N=2) then VC2=1.5MHz (3)

    Now keeping VC2 as the source for VC3 and VC3 divider as41 then

    Hence (4)

    VC3=36.585 KHzThe clock parameter of the UART must be selected eight

    times the bit rate required hence

    So, choosing VC3 as the clock source for the UART we get

    (5)

    = 4575 bits per second

    III. RESULTS

    Following are the results obtained during carrying out thework.

    Input = Laboratory Oven Temperature.Measured by thermometer = 29C.

    Measured output of LM-35 by DMM = 29.85mV.Output displayed on LCD display of PSoC = 29C.The figures below illustrate the setup of the work, resultsdisplayed on both sides that is transmitter as well as receiver,

    output at the UART etc.

    Figure.8 Displaying temperature result on PSoC kit

    Figure.9 The setup including a handmade oven, transmitter

    and receiver with connecting wire

    Figure.10 Illustration of same result on both transmitter aswell as receiver

  • 7/27/2019 Data Acquisition, Controlling and Wired Remote Data Display

    5/5

    International Journal of Engineering Trends and Technology (IJETT) Volume 4 Issue 6- June 2013

    ISSN: 2231-5381 http://www.ijettjournal.org Page 2462

    Figure.11 Serial data signal output of UART on DSO.

    IV. TEMPERATURE CONTROLLING.

    The other objective of the work is to control the

    temperature variable under observation. This task isaccomplished by employing a simple ON-OFF controllerwhose circuit is given in the figure.12.

    Figure.12 Schematic diagram of ON-OFF control circuit

    A. Circuit operation. Control circuit is a combination of electronic and

    electro-mechanical switch. For electronics it istransistor and for electro-mechanical it is the relay

    Control voltage is generated at the PSoC IO pinaccording to the reference temperature values set inthe program for the application. And here this

    reference values are 50C (upper limit) and 47C(lower limit). The temperature of the Lab Type Ovenhas to be maintained in the range of this reference

    values.

    When temperature of oven goes above 50C at thattime PSoC IO pin goes high which is connected tobase terminal of the of transistor through a current

    limiting base resistor R; which turns the transistor toON state.

    When transistor is in ON state at that time its work asshort circuit between collector and emitter. Hencecurrent will start flowing through relay and coil of

    relay is energized. A diode is used for the removal ofthe back current or back emf produce in coil of relay.

    Because of the flow of the current in the coil, NC(normally closed) state of the relay becomes NO(normally open) state and hence, circuit is openresulting in switching OFF heater element (Bulb

    here).

    Similarly when temperature goes bellow 47C at thattime output of PSoC IO pin goes low resulting inswitching transistor OFF.

    Because of this state of relay will change its state, itwill go normally close switching ON the heatingelement.

    This control circuit will keep the temperature value within thereference range by switching the heating element ON and

    OFF.

    V. CONCLUSION AND FUTURE WORK.

    Data acquisition, Controlling and Wired RemoteDisplay system is accomplished with the use of PSoC

    embedded system and it has also given satisfactory and

    reliable output results. This task has also leaded us to thestudy of new advancements in the embedded technology. Thiswired work can further be developed to wireless system byemploying suitable modulators like FSK or QPSK with poweramplifier to increase the range of coverage area. Furthermore

    multiplexer blocks are also available in the PSoC embeddedmodule so the data acquisition can be made multi channel dataacquisition system. Controllers like P, PD, PI, and PID can

    also be designed on chip.

    ACKNOWLEDGMENT

    The author is thankful to Prof Brijesh N. Shah, Head of theDepartment of E.C of CHARUSAT for giving full support and

    motivation during research work.

    REFERENCES

    [1] Process Control Instrumentation Technology, Eight editions, by CurtisD. Johnson.

    [2] N C Nair, V K Thakar, N M Patel A Novel Scheme for Non-ContactLevel Measurement using Load Cell, Journal of Engineering and

    Technology ,SPU, VOL 13, March 2000.

    [3] Gayakwad, Op-Amps & Linear Integrated Circuits, Prentice Hall Inc.[4] Balagurusamy, E. Programming in ANSI C., Tata McGraw-Hill Inc.[5] Bela G Laptac, Process control- Instrument engineers Handbook,

    Asian books Pvt. Ltd.[6] Douglas M.Considine Process/Industrial Instruments & controls,

    McGraw-Hill Inc.