Circuit knowledge 
ADC 
ADC, Analog-to-Digital  Converter, is a device used to  convert analog to  digital.  The range of the  ADC on 
PCF8591  is 8  bits, that  means the  resolution is 2^8=256,  and it represents the  range (here is 3.3V)  will be 
divided equally to 256 parts. The analog of each range corresponds to one ADC values. So the more bits ADC 
has, the denser the partition of analog will be, also the higher precision of the conversion will be. 
 
Subsection 1: the analog in rang of 0V-3.3/256  V corresponds to digital 0; 
Subsection 2: the analog in rang of 3.3 /256  V-2*3.3 /256V corresponds to digital 1; 
… 
The following analog will be divided accordingly. 
DAC 
DAC, that is, Digital-to-Analog Converter, is the reverse process of ADC. The digital I/O port can output high 
level and low level, but cannot output an intermediate voltage value, which can be solved by DAC. PCF8591 
has a DAC output pin with 8-bit accuracy, which can divide VDD (here is 3.3V) into 2
8
=256 parts. For example, 
when the digital quantity is 1, the output voltage value is 3.3/256  *1 V, and when the digital quantity is 128, 
the output  voltage value is 3.3/256  *128=1.65V,  the  higher accuracy of DAC is, the higher the accuracy of 
output voltage value is.