Introduction to Mechatronics

DATA ACQUISITION AND INTERFACING
Prof.Dr. Fatih M. Botsalı

DATA ACQUISITION
DATA Interface

Computing Unit

Control Software
Control Signal

Interface Interface System

1

DATA ACQUISITION
A data acquisition system is a device designed to measure and log some parameters. The purpose of the data acquisition system is generally the analysis of the logged data and the improvement of the object of measurements. The data acquisition system is normally electronics based, and it is made of hardware and software. The hardware part is made of sensors, cables and electronics components (among which memory is where imformation are stored). The software part is made of the data acquisition logic and the analysis software (and some other utilities that can be used to configure the logic or to move data from data acquisition memory to a laptop or to a mainframe computer).

DATA ACQUISITION
An example: Data logging, carried out by a data acquisition system (DAS), can be used to measure parameters such as temperature and humidity in storage facilities with perishable products; the measurement data is then stored for analysis to improve quality assurance. Another example: a data acquisition system can be placed on a race car to measure RPM and vehicle speed to analyze car's behaviour once it's back to pits and improve the car setup.

2

COMPUTING UNIT
Microprocessor Programmable Interface Controller (PIC) Programmable Logic Controller (PLC) Industrial PC(IPC) Single Board Computer

INTERFACING

3

INTERFACE An interface defines the communication boundary between two entities. Interfaces between hardware components are physical interfaces. It may also provide a means of translation between entities which do not speak the same language. such as a piece of software. a hardware device. INTERFACES RSRS-232 RSRS-485 USB BUS ADC DAC MULTIPLEXOR SAMPLESAMPLE -HOLD 4 . or a user.

INTERFACING STANDARTS DATA TRANSFER 5 .

Series/Parallel communication Synchronous/Asenchronous communication Simplex/ HalfHalf-Dublex / FullFull-Dublex communication DATA COMMUNICATION 6 .DATA COMMUNICATION Data transmission is the conveyance of any kind of information from one space to another.

This method is used internally within the computer. for example the internal buses. PARALLEL DATA TRANSFER 7 .DATA TRANSFER PARALEL DATA TRANSFER: Multiple wires are used and transmit multiple bits simultaneously and is much faster than Serial transmission as one byte can be sent rather than one bit. however this method of transmission is only available over short distances as the signal will degrade and become unreadable. as there is more interference between many wires than between one. and sometimes externally for such things as printers.

Whilst only one bit is sent at a time. SERIES DATA TRANSFER 8 .SERIES DATA TRANSFER Bits are sent over a single wire individually. high transfer rates are possible. This can be used over longer distances as a check digit or parity bit can be sent along it easily.

CHANNEL TYPES In Simplex systems. This is an obvious solution to a balanced system employing only one set of wires -.if signals were coming in both directions at once. they would conflict with each other. 9 . transmission can occur only in one direction at all the times. communication can take place in only one direction at a time. CHANNEL TYPES In Half Half-Duplex operation. in even systems in which different pairs of wire are used for transmission and reception can still operate in HalfHalf-Duplex mode. However.

Point A can send data to Point B while receiving data from Point C. With a FullFull -Duplex configuration. CHANNEL TYPES 10 . FullFull -Duplex operation becomes especially important in systems where a single master is communicating with multiple receivers. transmission and reception can occur at the same time. Thus Point A can send information to Point B while at the same time receiving data from Point B.CHANNEL TYPES In Full Full-Duplex systems.

: A "0100 0001" would become "1 0100 0001 0". Due to there being no start and stop bits the data transfer rate is quicker although more errors will occur. Ways to get around this problem include reresynchronization of the clocks and use of check digits to ensure the byte is correctly interpreted and received. The extra one (or zero depending on parity bit) at the start and end of the transmission tells the receiver first that a character is coming and secondly that the character has ended. The start and stop bits must be of opposite polarity. ASYNCHRONOUS TRANSMISSION uses start and stop bits to signify the beginning bit ASCII character would actually be transmitted using 10 bits e. as the clocks will eventually get out of sync.SYNCHRONOUS TRANSMISSION uses no start and stop bits but instead synchronizes transmission speeds at both the receiving and sending end of the transmission using clock signals built into each component. and the receiving device would have the wrong time that had been agreed in protocol (computing) for sending/receiving data.g. This method of transmission is used when data is sent intermittently as opposed to in a solid stream. In the previous example the start and stop bits are in bold. 11 . so some bytes could become corrupted (by losing bits). A continual stream of data is then sent between the two nodes. This allows the receiver to recognize when the second packet of information is being sent.

for serial (USB) transfer start and stop digits may be used.g. e. The set of rules defining a format is called a protocol.: computer and printer.: Check digit (and what type/ what formula to be used) data compression method.: Zipped files if the file is large.g. PROTOCOL how the sending device will indicate that it has finished sending a message. protocols can include sophisticated techniques for detecting and recovering from transmission errors and for encoding and decoding data. LANs and WANs. like transfer across the Internet. All communications between devices require that the devices agree on the format of the data.g. how the receiving device will indicate that it has received a message rate of transmission (in baud or bit rate) whether transmission is to be synchronous or asynchronous In addition. The protocol determines the following: the type of error checking to be used if any e. if any e.PROTOCOL A protocol is an agreedagreed-upon format for transmitting data between two devices e.: in a Communications port a spare wire would be used.g. 12 .

24. Handshaking must occur before data transmission as it allows the protocol to be agreed. A similar ITUITU-T standard is V. Handshaking begins when one device sends a message to another device indicating that it wants to establish a communications channel.HANDSHAKING The process by which two devices initiate communications e.g. 13 . RS RS-232 RS RS-232 (Recommended Standard 232) is a standard for serial binary data signals connecting between a DTE (Data terminal equipment) and a DCE (Data CircuitCircuit -terminating Equipment). It is commonly used in computer serial ports.: a certain ASCII character or an interrupt signal/ request bus signal to the processor along the Control Bus. The two devices then send several messages back and forth that enable them to agree on a communications protocol.

timing and slewslew-rate of signals. parity) protocols for error detection or algorithms for data compression. Interface mechanical characteristics. 14 . Standard subsets of interface circuits for selected telecom applications. Baudot or EBCDIC) the framing of characters in the data stream (bits per character. shortshort-circuit behavior.RS RS-232 The Electronic Industries Alliance (EIA) standard RSRS-232232-C[1] as of 1969 defines: Electrical signal characteristics such as voltage levels. ASCII. pluggable connectors and pin identification. Functions of each circuit in the interface connector. start/stop bits. start/stop bits. signaling rate. voltage withstand level. maximum stray capacitance and cable length. parity) the framing of characters in the data stream (bits per character. RS RS-232 The standard does not define such elements as character encoding (for example.

Many modern devices can exceed this speed (38.600 bit/s being common. Details of character format and transmission bit rate are controlled by the serial port hardware. often a single integrated circuit called a UART that converts data from parallel to serial form.RS RS-232 bit rates for transmission.000 bits per second.200 and 230. and 115. although the standard says it is intended for bit rates lower than 20. A typical serial port includes specialized driver and receiver integrated circuits to convert between internal logic levels and RSRS-232 compatible signal levels RS RS-232 15 .400 and 57.400 bit/s making occasional appearances) while still using RSRS-232 compatible signal levels.

If the DCE is a modem. Received Data (RxD) – Data sent from DCE to DTE. RS RS-232 Data Terminal Ready (DTR) – Asserted by DTE to indicate that it is ready to be connected. When this signal is dede-asserted. This behaviour is seen quite often in modern PSTN and GSM modems. this may "wake up" the modem.g. e. bringing it out of a power saving mode. a null modem cable or other equipment). possibly by a jumper to another signal.RS RS-232 Commonly-used signals are: CommonlyTransmitted Data (TxD) – Data sent from DTE to DCE. Data Set Ready (DSR) – Asserted by DCE to indicate an active connection. this signal should be permanently asserted (set to 0). immediately hanging up any calls in progress. If DCE is not a modem (e.g. transmitting a carrier or reversing the direction Clear To Send (CTS) – Asserted by DCE to acknowledge RTS and allow DTE to transmit. Request To Send (RTS) – Asserted (set to 0) by DTE to prepare DCE to receive data. This may require action on the part of the DCE. the modem may return to its standby mode. 16 .

RS RS-232
Data Carrier Detect (DCD) – Asserted by DCE when a connection has been established with remote equipment. Ring Indicator (RI) – Asserted by DCE when it detects a ring signal from the telephone line. NOTE: The standard defines RTS/CTS as the signaling protocol for flow control for data transmitted from DTE to DCE. The standard has no provision for flow control in the other direction. In practice, most hardware seems to have repurposed the RTS signal for this function.

RS RS-232

RTS : (Request to send) Bu sinyal DCE'yi DTE'den bir veri transferi için uyarır. CTS: (Clear to send) Bu sinyal DCE'nin veri almak için hazır sinyali ile diğer DCE'den cevap bekler. TD : tranmitted data RD : received data

17

RS RS-232

RS RS-232

18

RS RS-232 SIGNAL

RS RS-485

19

RS RS-485 OTHER SERIAL INTERFACES RS RS-422 (a high high-speed system similar to RSRS-232 but with differential signaling) RS RS-485 (a descendant of RS RS-422 that can be used as a bus in multidrop configurations) RS RS-423 (a high high-speed system similar to RSRS-422 but with unbalanced signaling) RS RS-449 (a functional and mechanical interface that used RSRS422 and RSRS-423 signals . supersedes RSRS-449) TIATIA -574 (standardizes the 99-pin DD-subminiature connector pinout for use with EIAEIA-232 electrical signalling. thus combining the best of both.it never caught on like RSRS-232 and was withdrawn by the EIA) MILMIL -STDSTD-188 (a system like RSRS-232 but with better impedance and rise time control) EIAEIA -530 (a high high-speed system using RSRS-422 or RSRS-423 electrical properties in an EIAEIA-232 pinout configuration. as originated on the IBM PC/AT) 20 .

21 . USB was designed to allow peripherals to be connected using a single standardized interface socket and to improve plugplug -and and-play capabilities by allowing devices to be connected and disconnected without rebooting the computer (hot swapping). A major component in the legacylegacy-free PC. individual device drivers to be installed.USB USB Universal Serial Bus (USB) is a serial bus standard to interface devices. Other convenient features include providing power to lowlow-consumption devices without the need for an external power supply and allowing many devices to be used without requiring manufacturer specific.

scanners.USB USB is intended to help retire all legacy varieties of serial and parallel ports. gamepads and joysticks. printers. digital cameras. and flash drives. there were about 1 billion USB devices in the world. USB simplifies connecting several printers to one computer. personal media players. For many of those devices USB has become the standard connection method. keyboards. 22 . USB was originally designed for personal computers. PDAs. USB USB is also used extensively to connect nonnonnetworked printers. In 2004. USB can connect computer peripherals such as mouse devices. but it has become commonplace on other devices such as PDAs and video game consoles.

Microsoft. Notable members have included Apple Inc. USB USB connection has three components: O O O Host Hub USB device 23 .. an industry standards body incorporating leading companies from the computer and electronics industries. HewlettHewlett-Packard.USB The design of USB is standardized by the USB Implementers Forum (USB(USB-IF). Intel. and Agere. NEC.

3 volts for low and 2.0–0. mice. In FS mode the cable wires are not terminated. Transmitted signal levels are 0. These collectively use halfhalf-duplex differential signaling to combat the effects of electromagnetic noise on longer lines.0) rate of 1.8– 2.usually operate together.6 volts for high in Full Speed and Low Speed modes.0) rate of 480 Mbit/s (60 MB/s). A Full Speed (1. All USB Hubs support Full Speed. D+ and DD. A HiHi-Speed (2. Full Speed devices divide the USB bandwidth between them in a firstfirst-come firstfirst-served basis and it is not uncommon to run out of bandwidth with several isochronous devices. labeled D+ and DD. or 90Ω differential to match the data cable impedance.8 –3.1.USB DATA RATES USB supports three data rates: A Low Speed (1. 24 . USB SIGNAL USB signals are transmitted on a twisted pair data cable with 90Ω ±15% impedance.0– 0. and ++-400mV in High Speed (HS) mode. they are not separate simplex connections. 2.5 MB/s). 2. and joysticks.0 specification and many devices fall back to Full Speed. but the HS mode has termination of 45Ω to ground. Full Speed was the fastest rate before the USB 2.1.5 Mbit/s (187 kB/s) that is mostly used for Human Interface Devices (HID) such as keyboards..0) rate of 12 Mbit/s (1.

are driven LOW by host) it tries to pull the D. USB device setup information is read from the device by the host and the device is assigned a unique hosthostcontroller specific 77-bit address. the enumeration process is repeated for all connected devices.line high. If the USB host is restarted. a device that is HS capable always connects as a FS device first. After reset. The enumeration process first sends a reset signal to the USB device. USB When a new USB device is connected to a USB host.USB PROTOCOL USB uses a special protocol to negotiate the High Speed mode called "chirping". In simplified terms. but after receiving a USB RESET (both D+ and D. If the device is supported by the host. it returns alternating signals on DDand D+ lines letting the device know that the tier will operate at High Speed. The speed of the USB device is determined during the reset signaling. the USB device enumeration process is started. the device drivers needed for communicating with the device are loaded and the device is set to configured state. If the host (or hub) is also HS capable. 25 .

a bus (bidirectional universal switch) is a subsystem that transfers data or power between computer components inside a computer or between computers. 26 . PC game port. Each bus defines its set of connectors to physically plug devices. Unlike a pointpoint-to to-point connection. tablets and other humaninterface devices are also progressively migrating from MIDI. keypads. and automatically detect which type of port they are plugged in to.USB AND HID Mice and keyboards are frequently fitted with USB connectors. they are often supplied with a small USB-to-PS/2 adaptor. but because most PC motherboards still retain PS/2 connectors for the keyboard and mouse as of 2007. cards or cables together. A bus can logically connect several peripherals over the same set of wires. A bus typically is controlled by device driver software. Joysticks. DATA BUS In computer architecture. and PS/2 connectors to USB. There is no logic inside these adaptors: they make use of the fact that such HID interfaces are equipped with controllers that are capable of serving both the USB and the PS/2 protocol. allowing usage with either USB or PS/2 interface.

Modern trends in personal computers. Modern computer buses can use both parallel and bitbit-serial connections. headphone jack. and optional VGA or FireWire. as in the case of USB. although the difference is largely conceptual rather than practical. Cat5. DATA BUS Most computers have both internal and external buses. An external bus connects external peripherals to the motherboard. These types of buses are also referred to as a local bus. have been moving towards eliminating all external connections except for modem jack. An internal bus connects all the internal components of a computer to the motherboard (and thus. USB. the CPU and internal memory).DATA BUS Early computer buses were literally parallel electrical buses with multiple connections. Network connections such as Ethernet are not generally regarded as buses. and can be wired in either a multidrop (electrical parallel) or daisy chain topology. especially laptops. because they are intended to connect to local devices. or connected by switched hubs. but the term is now used for any physical arrangement that provides the same logical functionality as a parallel electrical bus. 27 . not to those in other machines or external to the computer.

1 Mb/s throughput at 16 bits Optic Fiber Mil Std 1773 Widely used in space craft systems 1 Mb/s throughput. 1982) Proprietary bus.1 Local Bus Specification Widely used in commercial PC market Component Interconnect) Futurebus+ IEEE 896. expected to be produced by many of current VME manufacturers Commercial aircraft data bus 80 Mb/s sustained at 64 bits (proposed upgrade to 160 Mb/s stalled by development problems) Advertised potential throughput 500 Mb/s. 264 Mb/s peak throughput at 64 bits 100 Mb/s at 32 bits PCI bus (Peripheral PCI-SIG 2. Originally based on x86/DOS processor technology VME64 ANSI/VITA 1-1994 Developed from VME standard. some military applications De facto industry standard for commercial PC until 5 Mb/s throughput at 32 bits 3 Mb/s throughput at 16 bits Widely used in commercial PC applications GPIBGPIB . board size 300mmx300mm – twice the size of VME.GENERAL PURPOSE INTERFACE BUS IEEIEE-488 GPIB System 28 . commercial computing. with 320 Mb/s throughput is in development Mark 33 Digital Information Transfer System SIB (Systems Interface Bus) ISA ARINC 429 100Kb/s or 12. Current trend is use of mezzanine buses with VME backplane to increase capability. LeCroy P1123 (1990) IEEE P-1882. Growth potential with VME320. Few manufacturers. wide 40 Mb/s sustained throughput at 32 application in industrial and bits. In production.5a Proposed for military applications Used for on-board command and telemetry transfer between spacecraft components and subsystems Extension of the 68xxx microprocessor technology. 32 bits (Dual rate AS 1773 in development to provide 1 Mb/s or 20 Mb/s) VME bus IEEE P1014-1987 (developed from Motorola VersaBus) -1981 Over 200 manufacturers. (25 Mb/s sustained).1 (1996) (From IBM PISA. 32 bit architecture.5Kb/s at 25 or 32 bits Wide use in the commercial aircraft avionics industry. also significant military application 132 Mb/s peak throughput at 32 bits.Description Controlling Standard and Date Market Acceptance Performance Notes 1553 Data Bus Mil Std 1553B Most US military aircraft systems now 1553 based. High cost.

bit parallel interface system which incorporates: – 5 control lines – 3 handshake lines – 8 bibi-directional data lines. Talker 3. The maximum data transfer rate is determined by a number of factors. Devices exist on the bus in any one of 3 general forms: 1. GPIB.GENERAL PURPOSE GPIBINTERFACE BUS IEEIEE-488 The entire bus consists of 24 lines. Listener 29 . Controller 2.GENERAL PURPOSE GPIBINTERFACE BUS IEEIEE-488 The IEEEIEEE-488 interface bus. also known as the General Purpose Interface Bus "GPIB" is an 8 bit wide byte serial. and no minimum operational transfer limit. with the remaining lines occupied by ground wires. Additional features include: TTL logic levels (negative true logic). but is assumed to be 1Mb/s.GPIB. the ability to communicate in a number of different language formats.

A controller can only select a particular function of a device. GPIB. Each individual device is associated with a 5 bit BCD code which is unique to that device. 30 . unun-listen) as determined by the controller. By using this code. although only one option may be active at a time. for example a ‘listen’ only device can not be made to talk to the controller.GENERAL PURPOSE GPIBINTERFACE BUS IEEIEE-488 A single device may incorporate all three options.GPIB. listen (un(un-talk. the controller can coordinate the activities on the bus and the individual devices can be made to talk. The GPIB can handle only 1 ‘active’ controller on the bus. although it may pass operation to another controller. if that function is incorporated within the device.GENERAL PURPOSE GPIBINTERFACE BUS IEEIEE-488 The controller determines which devices become active by sending interface messages over the bus to a particular instrument. Any number of active listeners can exist on the bus with an active talker as long as no more then 15 devices are connected to the bus. The Controller makes the determination as to which device becomes active on the bus.

A Talker transmits data over the interface when addressed to talk by the Controller. Talkers and Listeners are typically instruments such as oscilloscopes. and by an optional secondary address. multimeters. but only the System Controller can make itself the CIC. only one Controller can be active at a given time. the CIC is a Listener while another device is enabled as a Talker. Each Talker/Listener is identified by a unique primary address ranging from 0 to 30. GPIB DEVICES The Controller specifies which devices are Talkers or Listeners. When the Controller is not sending messages. However. Typically. function generators. A Listener receives data over the interface when addressed to listen by the Controller. The CIC can pass control to an idle Controller. then a Talker can send messages. A GPIB system can contain multiple Controllers one of which is designated the System Controller.GPIB DEVICES A Controller is typically a board that you install in your computer. Typically. Each Controller is identified by a unique board index number. The current active controller is the ControllerController-In In-Charge (CIC). which can be 0 or can range from 96 to 126. Most modern instruments are both Talkers and Listeners. There can be only one Talker at a given time. There can be up to 14 Listeners at a given time. the Controller is a Talker while one or more instruments on the GPIB are Listeners. and so on. 31 .

and so on. and is limited by the slowest device on the bus. Data transfer consists of one byte (8 bits) sent in parallel. refer to its documentation.Instrument data consists of vendorvendorspecific commands that configure your instrument. However.Interface messages are defined by the GPIB standard and consist of commands that clear the GPIB bus. return selfself-test results. and so on. return measurement results. this data rate is usually not achieved in practice. For a complete list of commands supported by your instrument. Interface messages -. address devices.GPIB DATA There are two types of data that can be transferred over the GPIB: Instrument data -.The data transfer rate across the interface is limited to 1 megabyte per second. GPIB CONNECTOR IEEEIEEE -488 / ANSI Connector 32 .

INTERBUS A/D D/A CONVERSION 33 .

A/D . Gray code or two's complement binary. so the resolution is usually expressed in bits. for example. depending on the application. unsigned integer) or -128 to 127 (i.D/A CONVERSION An analoganalog-to to-digital converter (abbreviated ADC. can also be considered ADCs. some nonnonelectronic or only partially electronic devices. However. In consequence.e. The values can represent the ranges 0 to 255 (i. RESOLUTION The resolution of the converter indicates the number of discrete values it can produce over the range of analog values. 34 . such as binary. an ADC with a resolution of 8 bits can encode an analog input to one in 256 different levels.e. signed integer). such as rotary encoders. The reverse operation is performed by a digitaldigital-totoanalog converter (DAC). The digital output may be using different coding schemes. The values are usually stored electronically in binary form. an ADC is an electronic device that converts an input analog voltage (or current) to a digital number. Typically. For example. A/D or A to D) is an electronic integrated circuit. since 28 = 256. the number of discrete values available. which converts continuous signals to discrete digital numbers. or "levels". is usually a power of two.

and expressed in volts. i.5 it is referred to as mid mid-tread.RESOLUTION Resolution can also be defined electrically.e. The term linear as used here means that the range of the input values that map to each output value has a linear relationship with the output value.5. although analoganalog-to to-digital conversion is an inherently nonnon-linear process (since the mapping of a continuous space to a discrete space is a nonnon-invertible and therefore nonnonlinear operation). Here b is typically 0 or −0. the ADC is referred to as mid mid-rise.. 35 . that the output value k is used for the range of input values from m(k + b) to m(k + 1 + b). and when b = −0. The voltage resolution of an ADC is equal to its overall voltage measurement range divided by the number of discrete intervals as in the formula: LINEAR ADC’s Most ADCs are of a type known as linear. When b = 0. where m and b are constants.

36 . which is an abbreviation for least significant bit.22 mV/code Example 3 Full scale measurement range = 0 to 8 volts ADC resolution is 3 bits: 23 = 8 quantization levels (codes) ADC voltage resolution is: (8V .00244 volts/code 2.0V)/8 codes = 8V / 8 codes = 1 volts/code = 1000 mV/code RESOLUTION ACCURACY An ADC has several sources of errors. In the above example of an eighteight -bit ADC.00122 volts/code 1.Example 1 Full scale measurement range = 0 to 10 volts ADC resolution is 12 bits: 212 = 4096 quantization levels (codes) ADC voltage resolution is: (10V . These errors are measured in a unit called the LSB.0V) / 4096 codes = 10V / 4096 codes 0.4%. It is known as dither. There is also a soso-called aperture error which is due to a clock jitter and is revealed when digitizing a signal (not a single value). an error of one LSB is 1/256 of the full signal range. eliminates the distortion. or about 0.(-10V)) / 16384 codes = 20V / 16384 codes 0.44 mV/code Example 2 Full scale measurement range = -10 to +10 volts ADC resolution is 14 bits: 214 = 16384 quantization levels (codes) ADC voltage resolution is: (10V . Quantization error and (assuming the ADC is intended to be linear) nonnon-linearity is intrinsic to any analoganalog-to to-digital conversion.

In the general case. and is an unavoidable imperfection in all types of ADC.QUANTI QUANT IZATI ZATION ERROR Quantization error is due to the finite resolution of the ADC. These errors can sometimes be mitigated by calibration. this represents 0. The magnitude of the quantization error at the sampling instant is between zero and half of one LSB. the quantization error is not correlated with the signal. given by . and has a uniform distribution. NONNON -LINEARITY All ADCs suffer from nonnon-linearity errors caused by their physical imperfections. When this happens. Its RMS value is the standard deviation of this distribution. In the eighteight-bit ADC example.113% of the full signal range. 37 . the original signal is much larger than one LSB. causing their output to deviate from a linear function (or some other function. in the case of a deliberately nonnon-linear ADC) of their input. or prevented by testing.

ADC HOLDING AND SAMPLING 38 .

39 . If the input is known to be changing slowly compared to the sampling rate. If. at some later stage in the system. Their output is therefore an incomplete picture of the behaviour of the input.QUANTIZATION ANALOG DATA QUANTIZING DIGITIZING DIGITAL DATA ALIASING All ADCs work by sampling their input at discrete intervals of time. it is desirable that the output of the DAC be a faithful representation of the original signal. the input signal is changing fast compared to the sample rate. what the input was doing between one sampling instant and the next. If the digital values produced by the ADC are. There is no way of knowing. by looking at the output. then this assumption is not valid. then it can be assumed that the value of the signal between two sample instants was somewhere between the two sampled values. however. converted back to analog values by a digital to analog converter or DAC.

the input to an ADC must be lowlow-pass filtered to remove frequencies above half the sampling rate. and spurious signals called aliases will be produced at the output of the DAC.ALIASING If the input signal is changing much faster than the sample rate. To avoid aliasing. The frequency of the aliased signal is the difference between the signal frequency and the sampling rate. This problem is called aliasing. This filter is called an anti anti-aliasing filter. then this will not be the case. ALIASING 40 . For example. a 2 kHz sinewave being sampled at 1. and is essential for a practical ADC system that is applied to analog signals with higher frequency content.5 kHz would be reconstructed as a 500 Hz sinewave.

ALIASING ALIASING 41 .

signal. fs= 2 f maks ∆t=1/ fs NYQUIST THEOREM 42 .NYQUIST’S SAMPLING THEOREM Aliasing occurs if a signal is not sampled with a frequency greater than twice of the maximum frequency of the signal.

Signal Conditioning Electrical signals are conditioned so they can be used by an analog input board. Types of signal conditioner: – Amplification – Isolation – Filtering – Linearization 43 .

Most transducers produce analog signals • Digital – Signal is either ON or OFF – Example: light switch. 44 .Analog to Digital (A/D) Converter A/D Converter: Input Signal • Analog – Signal is continuous – Example: strain gage.

A/D Converter: Sampling Rate • Determines how often conversions take place. Analog Input 4 Samples/cycle 16 Samples/cycle 8 Samples/cycle 45 . • The higher the sampling rate.A/D Converter: Sampling • The data is acquired by an ADC using a process called sampling. the better.taking a sample of the signal at discrete times. • Sampling a analog signal .

• Higher sampling frequency achieves better conversion of the analog signals • A signal of lower frequency is generated from such a process (this is called aliasing).• This rate at which the signal is sampled sampling frequency.determines the quality of the analog signal that is converted. Sample and hold • Take the snapshot of the sensor signal and hold the value • Switch connect the capacitor and the capacitor hold the value until the new sample is acquired 46 . • Sampling frequency .

Direct conversion is very fast. Successive approximation works by constantly comparing the input voltage to the output of an internal digital to analog converter (DAC. each firing for their decoded voltage range. a binary value of the approximation is stored in a successive approximation register (SAR).DIRECT CONVERSION ADC A direct conversion ADC or flash ADC has a bank of comparators. fed by the current value of the approximation) until the best approximation is achieved. but usually has only 8 bits of resolution (256 comparators) or fewer. 47 . eventually settling on a final voltage range. The comparator bank feeds a logic circuit that generates a code for each voltage range. as it needs a large. At each step in this process. expensive circuit SUCCESSIVESUCCESSIVEAPPROXIMATION ADC A successivesuccessive-approximation ADC uses a comparator to reject ranges of voltages.

When the ramp voltage matches the input. then quickly falls to zero. 48 . and the timer's value is recorded.SUCCESSIVESUCCESSIVEAPPROXIMATION ADC RAMPRAMP -COMPARE ADC A rampramp-compare ADC (also called integrating. When the ramp starts. a comparator fires. Timed ramp converters require the least number of transistors. a timer starts counting. dualdual -slope or multi multi-slope ADC) produces a sawsaw -tooth signal that ramps up.

Delta converters have very wide ranges. The circuit uses negative feedback from the comparator to adjust the counter until the DAC's output is close enough to the input signal. The comparator controls the counter. The input signal and the DAC both go to a comparator. though it will always have a guaranteed worstworst-case. but the conversion time is dependent on the input signal level. The number is read from the counter. 49 .RAMP-COMPARE A/D RAMPCONVERSION DELTADELTA -ENCODED ADC A deltadelta-encoded ADC has an upup-down counter that feeds a digital to analog converter (DAC). and high resolution.

the difference to the input signal is determined with a digital to analog converter (DAC). By combining the merits of the successive approximation and flash ADCs this type is fast. 50 . In a second step. This difference is then converted finer. SIGMASIGMA -DELTA ADC A SigmaSigma-Delta ADC (also known as a DeltaDeltaSigma ADC) oversamples the desired signal by a large factor and filters the desired signal band.PIPELINE ADC A pipeline ADC (also called subranging quantizer) uses two or more steps of subranging. four bits) rather than just the nextnext-mostmost-significant bit. The resulting signal. is fed back and subtracted from the input to the filter. a coarse conversion is done. has a high resolution. First. This can be considered a refinement of the successive approximation ADC wherein the feedback reference signal consists of the interim conversion of a whole range of bits (for example. and the results are combined in a last step. Generally a smaller number of bits than required are converted using a Flash ADC after the Filter. along with the error generated by the discrete levels of the Flash. and only requires a small die size.

The effect of this is that the output voltage is held in time at the current value until the next input number is latched resulting in a piecewise constant output. voltage or electric charge). 51 . The job of converting various compressed forms of signals into PCM is left to codecs.DIGITAL-TODIGITALTO-ANALOG CONVERTER DAC A digitaldigital-to to-analog converter (DAC or D D-to to-A) is a device for converting a digital (usually binary) code to an analog signal (current. Usually these numbers are updated at uniform sampling intervals and can be thought of as numbers obtained from a sampling process. at which time the DAC output voltage changes rapidly from the previous value to the value represented by the currently latched number. A DAC usually only deals with pulsepulse-code modulation (PCM)(PCM)-encoded signals. These numbers are written to the DAC. DIGITAL-TODIGITALTO-ANALOG CONVERTER DAC The DAC fundamentally converts finitefinite-precision numbers into a physical quantity. Normally the output voltage is a linear function of the input number. usually an electrical voltage. An analoganalog-to to-digital converter (ADC) performs the reverse operation. sometimes along with a clock signal that causes each number to be latched in sequence.

Maximum sampling frequency: This is a measurement of the maximum speed at which the DACs circuitry can operate and still produce the correct output. which is the base two logarithm of the number of levels. This is usually stated as the number of bits it uses. result in the original signal before sampling) but instead output a sequence of piecewise constant values or rectangular pulses. if ideally lowlow-pass filtered.9224 dB loss at the Nyquist frequency). For instance. For instance a 1 bit DAC is designed to reproduce 2 (21) levels while an 8 bit DAC is designed for 256 (28) levels. means that there is an inherent effect of the zerozeroorder hold on the effective frequency response of the DAC resulting in a mild rollroll-off of gain at the higher frequencies (a 3. which includes frequencies of up to 20 kHz. to reproduce signals in all the audible spectrum. The fact that practical DACs do not output a sequence of dirac impulses (that.DIGITAL-TODIGITALTO-ANALOG CONVERTER DAC This is equivalently a zerozero-order hold operation and has an effect on the frequency response of the reconstructed signal. DAC’s Resolution: is the number of possible output levels the DAC is designed to reproduce. it is necessary to use DACs that operate at over 40 kHz. This zerozero-order hold effect is a consequence of the hold action of the DAC and is not due to the sample and hold that might precede a conventional analog to digital converter as is often misunderstood. a signal must be sampled at over twice the freqency of the desired signal. 52 . As stated in the ShannonShannon-Nyquist sampling theorem.

4 BIT LADDER DAC MULTIPLEXER A multiplexer or mux (occasionally the term muldex is also found. Frequently a multiplexor and demultiplexor are combined into a single device capable of processing both outgoing and incoming signals. A multiplexor is sometimes called a mux and also spelled as multiplexer. 53 . for a combination multiplexermultiplexer -demultiplexer) is a device that performs multiplexing: it selects one of many analog or digital data sources and outputs that source into a single channel. A multiplexer is often used with a complementary demultiplexer on the receiving end. A demultiplexer (or demux) is a device taking a single input that selects one of many datadata-outputoutputlines and connects the single input to the selected output line.

MULTIPLEXER A real world example is the creation of telemetry for transmission from the computer/instrumentation system of a satellite. space craft or other remote vehicle to a ground system. a multiplexer is a special type of analog switch that connects one signal selected from several inputs to a single output. MULTIPLEXERMULTIPLEXER -DEMULTIPLEXER Multiplexer Demultiplexer 54 . In analog circuit design.

and display the acquired data with the help of software 55 . store.MULTIPLEXERMULTIPLEXERDEMULTIPLEXER Data Acquisition A data acquisition system consists of many components that are integrated to: Sense physical variables (use of transducers) Condition the electrical signal to make it readable by an A/D board Convert the signal into a digital format acceptable by a computer Process. analyze.

Data Acquisition System Block Diagram Flow of information in DAQ 1. 6. conversion Conditioned analog signal – digitized using ADC Digital information – acquired. 4. 5. digital output converted to analog by DAC Analog signals are conditioned Output transducer interact with physical variables 56 . amplify. 3.e. process and record by computer Modify physical signal. 7. filter. 2. Input transducer – measure physical quantity Output from transducer – conditioned i.

Examples: • • • • Temperature Pressure Light Force • • • • Displacement Level Electric signals ON/OFF switch Example of Computer DAQ System DAQ Board Trigger Timer Digital Control Interrupt Circuit Instrumentation Amplifier + Bridge Filter S/H A/D Input Strobe Parallel/Series Computer Input Port Sensor Display Control D/A Parallel/Series Output Port Output Strobe 57 .Transducers Sense physical phenomena and translate it into electric signals.

Visual Basic + Add-on tools (such as VisuaLab with VTX) – Fortran – C# • Advantage: flexibility • Disadvantages: complexity and steep learning curve 58 . – Data acquisition software packages.Data Acquisition Software • It can be the most critical factor in obtaining reliable. • Different alternatives: – Programmable software. Programmable Software • Involves the use of a programming language. and display system. analysis. such as: – C++. • Transforms the PC and DAQ hardware into a complete DAQ. high performance operation. Visual C++ – BASIC.

DADISP. These programs can be configured to take data from transducers at the times requested. Using selections from various menus. • Enables developers to design the custom instrument best suited to their application. and use the data to perform required control functions. display the data on the screen.Data Acquisition Software • Does not require programming. the operator can configure the program for the particular application. sophisticated computer programs have been availavail-able for some time. • Examples: TestPoint. SnapMaster. it is possible to include instructions programmed in a higherhigherlevel language such as C. so it is important that the software setup be straightforward. LabView. SOFTWARE FOR DAS SYSTEMS In the processprocess-control industry. 59 . For complicated processing or control functions. etc. DASYLAB. These systems are often concon-figured by technicians rather than engineers or programmers.

These The se programs are configured for a particular application using menus or icons. display it in real time. modules. and perform some control functions. These packages are very capable— capable —they can take data. write the data to files for subsequent processing by another program. These software packages are the best choice for the majority of experimental situations. 60 .SOFTWARE FOR DAS SYSTEMS There are a number of very sophisticated software packages now available for personal computer— computer—based datadata -acquisition systems. Some of them may allow for the incorporation of C program modules.