Digital to Analog and Analog to Digital Converters:
In order to interface two peripherals one of them is digital and the other one is analog we need to add analog to digital converter (ADC) and digital to analog converter (DAC). Let us learn DAC and ADC in brief. Connecting digital circuitry to sensor devices is simple if the sensor devices are inherently digital themselves. Switches, encoders and relays are interfaced easily with gate circuits because of the on/off nature of their signals. However, while analog devices are involved, interfacing becomes much more complicated. What is needed is a way to translate analog signals electronically to digital (binary) quantities, and vice-versa. An analog-to-digital converter, or ADC, carry out the former task while a digital-to-analog converter, or DAC, carry out the latter. An ADC inputs an analog electrical signal such as voltage or current and outputs a binary number. In block diagram form, it can be depicted as in Figure. It is much easier to convert a digital signal into an analog signal than it is to do the reverse. Therefore, we will start with DAC circuitry and then move to ADC circuitry.
Figure: ADC/DAC