Data Acquisition, Controlling and Wired Remote Data Display

advertisement
International Journal of Engineering Trends and Technology (IJETT) – Volume 4 Issue 6- June 2013
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
Abstract—Data acquisition, controlling and its monitoring has
always been a field of interest in the industrial area. There are
many 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 develop
embedded Data acquisition and controlling system which
provides reasonably good and reliable results. PSoC
(Programmable System on Chip) is a technological advancement
in the field of Embedded Systems which consists of
Programmable Gain Amplifiers (PGA), Analog to Digital
convertors (ADC), UART, LCD Display module etc on Chip
which can be programmed as required to accomplish the tasks
for various applications.
Serial
Data
PGA
UART
LCD
DISPLAY
Figure.2 Block diagram of receiver module.
Keywords— PSoC,
I. INTRODUCTION
Data 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 using
their respective transducers.[6] This work is carried out by
taking temperature in account and we are using LM-35 as
transducer for the detection of temperature. Output of the
transducer is monitored by PSoC© [2]. Work is divided in two
sections, one is transmitter and other is receiver. Block
diagram of transmitter is illustrated in figure 1 below.
LCD
DISPLAY
LM-35
Voltage output from the LM-35 is given to the PGA block of
the PSoC. Then ADC converts the analog data into the digital
format; which is converted to decimal format to be displayed
on the LCD module.
Output from the ADC is also coupled to UART so as to
convert the parallel digital data to serial data so can be
transmitted to the remote display panel with a pair of
wire.Figure.2 illustrates Block diagram of the receiver module.
PGA
ADC
UART
Serial data
Figure.1 Block diagram of transmitter.
ISSN: 2231-5381
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 given
to 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.
SYSTEM DESCRIPTION AND HARDWARE.
A. LM35
The LM-35 series are precision integrated circuit
temperature sensors whose output voltage is linearly
proportional 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 to
provide typical accuracies of ±1⁄4°Cat room temperature and
±3⁄4°C over a full −55 to +150°Ctemperature range. The
LM35’s low output impedance, linear output and precise
inherent calibration make interfacing to readout or control
circuitry especially easy. Figure.3 illustrates typical
application of the LM-35 IC.
http://www.ijettjournal.org
Page 2458
International Journal of Engineering Trends and Technology (IJETT) – Volume 4 Issue 6- June 2013
can be fixed value. But if the level of the signals defer by an
order of magnitude or more, it is essential to have a
programmable gain amplifier whose gain can be varied for
signal conditioning.
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 of
embedded systems which consists of many Digital as well as
Analog blocks which can be placed and programmed to
achieve various applications. The PSoC family consists of
many Mixed-Signal Array with On-Chip Controller devices.
These devices are designed to replace multiple traditional
MCU-based system components with one, low cost singlechip programmable component. A PSoC kit features an
evaluation board and MiniProg programming unit. The
evaluation 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 on
the other boards via a 5-pin header. The MiniProg is small and
compact and connected to the user’s PC via a provide USB
2.0 cable. The PSoC device includes configurable blocks of
analog 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 any
application. Figure.4 illustrates the global parameters window
and Figure.5 illustrates a PSoC EVal kit. This architecture
allows the user to create customized peripheral configurations,
to match the requirements of each individual application.
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 the
most important issue of an ADC as it decides amount of
change in input variable to be detected. It has a variable
resolution analog to digital converter named ADCINC.The
ADCINC is a differential or single input ADC that returns a 6
to 14 bit result.9 bit resolution of ADCINC and 5V reference
supply, and
Resolution
(1)
Hence the resolution is equal to 0.09765 V.As transducer LM35 gives a change 10mv per degree change in temperature; it
is the best suitable resolution selection.
E. LCD DISPLAY
Figure.4 Global parameters setting window
C. PGA
In a data acquisition system the signal inputs to various
channels may not normally be at same level. If all the signals
were to be of the same level, the gain required of the amplifier
ISSN: 2231-5381
The 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 data
bits, read/write (R/W), register select "RS," and an enable "E"
signal. The LCD Tool Box User Module is a set of library
routines that writes text strings and formatted numbers to a
common two- or four-line LCD module. This module was
developed specifically for the industry standard Hitachi
HD44780 two-line by 16 character LCD display driver chip,
http://www.ijettjournal.org
Page 2459
International Journal of Engineering Trends and Technology (IJETT) – Volume 4 Issue 6- June 2013
but will work for many other four-line displays. The figure.6
shows an interface of PSoC IO port to LCD display module.
selected must be eight times the frequency of the required data
bit rate. The clock is configured using the PSoC Designer
Device Editor. The data received and transmitted is a bit
stream that consists of a start bit, eight data bits, an optional
parity 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.
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 RS232-compliant, data format serial communications over two
wires. Received and transmitted data format includes a start
bit, optional parity, and a stop bit. Programmable clocking and
selectable 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 the
UART.
The receiver uses the RX Buffer, RX Shift, and RX
Control registers of a Digital Communications type PSoC
block. The RX Control register is initialized and configured
using 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 Full
condition, and then enabling the UART. When a start bit is
detected on the RX input, a divide-by-eight bit clock is started
and synchronized to sample the data in the centre of the
received bits. On the rising edge of the next eight-bit clock,
the input data is sampled and shifted into the RX Shift
register. If parity is enabled, the next bit clock samples the
parity bit. The sampling of the stop bit, on the next clock,
results in the received data byte transfer to the RX Buffer
register and the triggering of one or more of the following
events:
 Rx Register Full bit in the RX Control register is set,
and if the interrupt for the RX is enabled, then the
associated interrupt is triggered.
 If the stop bit is not detected at the expected bit
position in the data stream, then the Framing Error
bit in the RX Control register is set.
 If the Buffer register has not been read, before the
stop bit of the currently received data, then the
Overrun Error bit in the RX Control register is set.
 If a parity error was detected, then the Parity Error
bit is set in the RX Control register.
For polling detection of a completely received data byte, the
Rx Register Full bit in the RX Control register should be
monitored. Data must be read out of the RX Buffer register,
before the next byte is completely received, to prevent the
overrun error condition.
2. TX UART Transmitter.
Figure.7 Functional block diagram of the UART
The UART User Module implements a serial transmitter
and 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 the
RX PSoC block provides receiver functionality.RX and TX
operate 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 data
format. Enabling and disabling is performed using the API
provided functions. The UART User Module clock is shared
by both the RX and TX components. The clock frequency
ISSN: 2231-5381
The transmitter uses the TX Buffer, TX Shift, and TX
Control registers of a Digital Communications type PSoC
block. The TX Control register is initialized and configured
using the UART User Module firmware API routines. When
the Enable bit in the TX Control register is set, an internal
divide-by-eight bit clock is generated. A data byte to transmit
is written by an API routine into the TX Buffer register,
clearing the Tx Buffer Empty status bit in the TX Control
register. This status bit can be used to detect and prevent
transmit overrun errors. The rising edge of the next bit clock
transfers the data to the Shift register and sets the Tx Buffer
Empty bit in the TX Control register. If the interrupt enable
mask is enabled, an interrupt will be triggered. This interrupt
http://www.ijettjournal.org
Page 2460
International Journal of Engineering Trends and Technology (IJETT) – Volume 4 Issue 6- June 2013
enables the queuing of the next byte to transmit, so that upon
completion 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 byte
is transferred from the TX Buffer register to the TX Shift
register. 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 TX
Control register's Tx Complete status bit is set. This bit will
remain valid until read. If a new data byte has been written to
the TX Buffer register, the data byte will be transferred to the
TX Shift register and transmission of the data will begin on
the next rising edge of the bit clock.
Input = Laboratory Oven Temperature.
Measured by thermometer = 29ºC.
Measured output of LM-35 by DMM = 29.85mV.
Output displayed on LCD display of PSoC = 29ºC.
The figures below illustrate the setup of the work, results
displayed on both sides that is transmitter as well as receiver,
output at the UART etc.
3. Clock
UART is clocked by one of 16 possible sources. The clock
rate must be set to eight times the desired bit rate. One data bit
is received or transmitted every ten clocks cycles.
4. Baud Rate
Figure.8 Displaying temperature result on PSoC kit
Baud rate is an important parameter in serial
communication as it provides the synchronization between the
transmitter and the receiver. After making a tradeoff between
the clock required by ADC and UART in the global
parameters 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)
Figure.9 The setup including a handmade oven, transmitter
and receiver with connecting wire
Now keeping VC2 as the source for VC3 and VC3 divider as
41 then
Hence
(4)
VC3=36.585 KHz
The 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
Figure.10 Illustration of same result on both transmitter as
well as receiver
III. RESULTS
Following are the results obtained during carrying out the
work.
ISSN: 2231-5381
http://www.ijettjournal.org
Page 2461
International Journal of Engineering Trends and Technology (IJETT) – Volume 4 Issue 6- June 2013

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 open
resulting in switching OFF heater element (Bulb
here).
 Similarly when temperature goes bellow 47ºC at that
time output of PSoC IO pin goes low resulting in
switching transistor OFF.
 Because of this state of relay will change its state, it
will go normally close switching ON the heating
element.
This control circuit will keep the temperature value within the
reference range by switching the heating element ON and
OFF.
V. CONCLUSION AND FUTURE WORK.
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 is
accomplished by employing a simple ON-OFF controller
whose circuit is given in the figure.12.
Data acquisition, Controlling and Wired Remote
Display 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 the
study of new advancements in the embedded technology. This
wired work can further be developed to wireless system by
employing suitable modulators like FSK or QPSK with power
amplifier to increase the range of coverage area. Furthermore
multiplexer blocks are also available in the PSoC embedded
module so the data acquisition can be made multi channel data
acquisition system. Controllers like P, PD, PI, and PID can
also be designed on chip.
ACKNOWLEDGMENT
Figure.12 Schematic diagram of ON-OFF control circuit
The author is thankful to Prof Brijesh N. Shah, Head of the
Department of E.C of CHARUSAT for giving full support and
motivation during research work.
A. Circuit operation.




REFERENCES
Control circuit is a combination of electronic and
electro-mechanical switch. For electronics it is
transistor and for electro-mechanical it is the relay
Control voltage is generated at the PSoC IO pin
according to the reference temperature values set in
the program for the application. And here this
reference values are 50ºC (upper limit) and 47ºC
(lower limit). The temperature of the Lab Type Oven
has to be maintained in the range of this reference
values.
When temperature of oven goes above 50ºC at that
time PSoC IO pin goes high which is connected to
base terminal of the of transistor through a current
limiting base resistor R; which turns the transistor to
ON state.
When transistor is in ON state at that time its work as
short circuit between collector and emitter. Hence
current will start flowing through relay and coil of
relay is energized. A diode is used for the removal of
the back current or back emf produce in coil of relay.
ISSN: 2231-5381
[1]
[2]
[3]
[4]
[5]
[6]
Process Control Instrumentation Technology, Eight editions, by Curtis
D. Johnson.
N C Nair, V K Thakar, N M Patel “A Novel Scheme for Non-Contact
Level Measurement using Load Cell”, Journal of Engineering and
Technology ,SPU, VOL 13, March 2000.
Gayakwad, “Op-Amps & Linear Integrated Circuits”, Prentice Hall Inc.
Balagurusamy, E. “Programming in ANSI C.”, Tata McGraw-Hill Inc.
Bela G Laptac, “Process control- Instrument engineer’s Handbook”,
Asian books Pvt. Ltd.
Douglas M.Considine “Process/Industrial
Instruments & controls”,
McGraw-Hill Inc.
http://www.ijettjournal.org
Page 2462
Download