Stand-Alone Microprocessor-Based Optical Data Acquisition System
Stand-Alone Microprocessor-Based Optical Data Acquisition System
, Department of Electrical Engineering King Fahd University of Petroleum and Minerals P.O.B. 323, Dhahran, 31261, Saudi Arabia E-MAIL: FACC109@SAUPMMOO.BINTNET
In this paper, the design of stand-alone optical data acquisition system is presented. The system hardware consists of an optical analog inputs, optical digital inputs, analog and digital inputs/outputs and Motorla MC68HCll microcontroller. The system software consists of several subroutines that enables the user through the input-driven-menu to read, store, analyze, process and display the incoming data. In addition to that, the user can select direction of the data, the number of analog or digital channels to be monitored, sampling rate per channel and the throughput rate. The user has the option of programming the unit itself for special application. The system is programmable, cheap, compact and versatile.
ing [l-51. A recent US patent 131 has been granted to the design of an optical analog to digital converter using optical and table look-up [l]. This presents paper integrated the optical and table loop-up approach with the microcontroller MC68HCll plus optical digital-to-analog converter and standard digital-to-analog and analog-to-digital converters which make complete stand-alone microprocessor-based optical data acquisition system. The system architecture shown in figure
1, is divided into five subsystems: An Optical
Optical sensing is one of the leading techniques in today's sensing technology. It has been used in signal processing, underwater acoustics, aerospace guidance and color sort-
analog and digital inputs, analog and digital inputs/outputs, microcontroller, input/output timers and communication ports. The first part of the inputs consists of sixteen channels Optical Analog-to-Digital Converters (OADCs) Each channel consists of optical emitter as tn"itter and detector as receiver. These sensors are interfaced via analog multiplexers to the analog inputs of the built-in eight channels analog-to-digital converter that is imbedded in the microcontroller [ 2 ] . The second part of the inputs consists of two eight-bit Optical Digital-to-Analog-Converters (ODACS). Each bit designed with emitter and
.) = - . )
3 Input
Timers 5 Output Timers
VoH
+
VoB VoA
0-7803-0582-5/92$3.0001992 IEEE
detector. In addition to that an eight channel eight-bit standard analog-to-digital converters is interfaced to the microcontroller [1,2]. The microcontroller (MC68HCll) consists of eight channels standard,Analog-to-DigitalConverters (ADCs), 16Kbyte RAM, 2Kbyte EPROM, 512 byte EEPROM, seven input/output interrupt driven internal timers, Asynchronouns Communications Interface Adapter (ACIA) and RS232 to communicate with a host or terminal (Personal computer) with six different baud rate [2]. The output stage consists of eight channel Digital-to-Analog Converters (DACs) and eightbit bi-directional input/output ports. The software algorithm is written in a way that enables the user, through input driven-menu, to select, any analog, digital channel or channels to be monitored and recorded. With simple programi -7 ski.lls the user ia able to write his own subroutines to processes the input signals and make a desired decisions. The decision can be sent in analog or digital form. The system can be used as a real-time measurement unit in underwater acoustics, aerospace aviation, speech recognition and color sorting [1,8,9]. It can be used in neural network application where the sensors will act as input layer, the microcontroller and software as hidden layers and the DAC as an output layer [12]. The special feature of this system is its relatively low cost, a stand-alone system that does not require a host Computer to operate with once it is programmed, it can operate with different optical wavelengths where the user replaces the transmitter and receiver elements only, additionally it is in-house programmable for many tines as the user wants.
1 vcc
As mentioned in the introduction there are sixteen optical pairs. These pairs are multiplexed via sixteen analog switches to the built-in eight channels analog-to-digital converter of the microcontroller MC68HCll. The range of the analog input should be between 0 to 5 Volts. The distance between the emitter and the detector is a very important matter in optical sensing. Table 1 shows the optimum distance between emitters and detectors [l]. Though this distance can be increased by pulsing the emitter rather than fixing the biasing [7].
Table 1. Transmission and reflective range of optical sensors [7] hnitter-Detector Pairs LED56&L14Ql Transmission Range
012"
Reflective Range
03."
1 1
m t i c a l a a l w-to-Diaital-Convert ers : The system has eight channels optical analog-to-digital converters. The basic building block of each channel is an optical light emitter as transmitter and optical light detector as a receiver (Figure 2). The emitter is a Light Emitting Diode (LED) and the receiver is phototransistor [7]. The operating wavelengths of both devices can be varied between 450-1000 Nanmeters. The gain and the offset of each cell can be adjusted with the three variable resistor that are shown in figure 2. RE will adjust the light intensity of the emitter, RD will adjust the analog voltage level at the output of the phototransistor. RO will adjust the DC offset that may result from the dark current or from interference from other adjacent optical channel. In addition to that, RE, RO and RD are used to adjust the current density of the emitter, the analog output level when the operation wavelength is changed by the user.
I I 1
018"
032" 048"
080" 200"
I I I
04.5"
I 1 1
F5Dl&L14P2
m i c a 1 Diaital gn_Duts/Ot&put
and -ertere
The system has 16-bit optical digital switches which can be used separately to read or write 8-bit transfers. Each bit consists of emitter and detector, three variable resistor and Schimtt trigger buffer (Figure 3). The output has two digital logic level, one is a high level (2.4-5.0 Volts) and the other is a low levei (3.0-0.SV). The functrGi1 G f &IC three variable resistor is the same as their function in the analog input. The optical digital switches are used as b a s ' c bcilding block of two eight-bit optical digital-toanalog converters. The output of these sixteen switches is directed to one or more of the eight digital-to-analog converters that will be described in the next section.
1626
1 vcc
as well as in single or continues scan mode. Single channel mode converts one channel only. Multiple-channel mode converts four channels simultaneously as a group. The single scan means one converting only and the ADC will not start conversion unless a software command is executed. On the other hand the scan mode means once the conversion is started, it will convert continuously one channel every 16 micro-sec.
mDUtS/oUtDl&
PrWr-1
e T
S+andard-to-moa
Converters
A general purpose, single chip (DAC8800), eight channels eight-bit digital-analog converter is interfaced with one the microcontroller output port [a]. Both unipolar and bipolar output voltage are available. A threewire serial digital interface loads the contents of the eight internal DAC registers which establish the output voltage level. Figure 4 shows the basic building block of the DAC-8800 [ll].
The system has on-board eight programmable timers [2]. These timers are based on a free-running 16-bit counter with a four-stage programmable prescaler. The timer starts from a count of $0000 as the MCU is coming out of reset and then counts up continuously. When a maximum count is reached (SFFFF), the counter rolls over to a count of $0000. The eight timers are divided into three input capture timers and five output-capture timers. Each input and output timer has its own 16-bit register. These timers can be programmed to generate a hardware or a fix software interrupt at a fixed periodic rate for sequential conversion. The user can program each inputcapture function to detect edge polarity, measure a pulse width or a period of incoming signal. Such information can help t o start or stop conversion, to output an analog or digital single. Also the user can program the output-capture timers to generate a pulse or square wave upon receiving a sequence of optical signals via the OADCs or ODACs. More information on the timers operation can be found in reference 2.
P
Software package has been written in assembly language. It was divided into two section: User interface input driven-menu and real-time data acquisition. The interface subroutines enable the user to select the number of analog or digital channels to be monitored, sampling rate per channel, direction of the data, programming the input output timers and some. The data acquisition subroutines enable the user to read, store, and process the data. The main function of this data acquisition system is that it can be programmed in-house for special purposes.
SYSTEn FINAL FEATURES Ei SPECIFICA TIC??S
DAC5
v5
- -..
The system features and specifications can be summarized as follows: * 16 channels Optical Analog-to-Digital Converters. Resolution 8-bits (2omV/bit) * 8 channels standard Analog-to-DigitalConverter. Resolution 8-bits (20mV/bit) * 2 Optical-Digital-to-Analog Converters Resolution 8-bits (2OmV/bit) * 8 channels standard Digital-to-AnalogConverter.
* * * * *
8 TTL digital inputs/ outputs 8 programmable timers 16Kbyte RAM on-board memory
11. PMI, "Data Book of Analog Integrated Circuits," Vol. i o , pp 1 1 . 2 5 0 - 1 1 - 2 6 2 , 1 9 9 0 . 12. A1-Ali , Alakdhar & Al-Baiyat, "Neural Network Implementation Using MicroprocessorBased System," Second International Conf. on Automation. Robotics and C w uter Vision. Singapore, 1 9 9 2 .
8Kbyte EPROM on-board memory 512 byts EEPROM on-board memory Six programmable baud rate (Max: 9 6 0 0 , Min: 3 0 0 ) Sampling rate: 1 6 micro Sec. Software programmable
An optical stand-alone data acquisition system has been designed using an existing microcontroller [ 2 ] . The system was used in color sorting and proved to be accurate, reliable, cheap and compact. One disadvantage of the system the slow sampling rate and low voltage resolution. A new unit design is underway using MC68030 to overcome the sampling rate and resolution.
The author wishes to acknowledge the support of King Fahd University of Petroleum and Minerals.
1 . A. D. McAulay, Wptical Analog to Digital Converter Using Optical Logic and Table LoopUP I ODtical enoiDeering, Vol. No. 2 , pp 1141 2 9 , 29 Feb., 1 9 9 0 ,
2 . Motorola, 1988. WC68HCll
reference manual**,
Trends in Microcom6 . B. K. Bose. llTechnology puter Control of Electrical Machines,I1 LggE 3 Vol. , 35, 1601 7 7 , Feb. 1 9 8 8 .
7. Harris semiconductors, I1Optical electronics data bookt1,1 9 9 1 .
S. Barua, llHigh-Speed, Multiplier for 8. Digital Signal processing,11 Enaineer U ,Val 30 No. 1 2 , pp 1997-2002, Dec. 1 9 9 1 .
9. B. Javidi, nIndustrial Application of optical signal Processing I , 1 a QDtical Xngk neering, Vol. 27 No. 4, pp 2 5 7 . April 1 9 8 8 .
1 0 . P. R. Norton, "Infrared Image Sensors , ODtical w e e r i n g , Vol. 30 No. 1 1 , pp 16491 6 6 3 , Nov. 1 9 9 1 .
1628