This is a simple voltmeter which measures 0-5V at a precision of 4.8 mV. This is a simple design using inbuilt ADC of PIC 16F877A. PIC 16F877A have 8 channel 10bit ADC. This is a computer interfaced project. Measured voltage is output in serial interface software in computer. There is a serial interface circuit (MAX232) is necessary for interfacing with computer, which is not included in the circuit. Please check Β Β Β PIC Serial Communication Tutorial (UART) for the circuit and more details.
Using one of the most popular 8 bit PIC 16f877A, for instance, reading the datasheet, weβll find that the ADC modules (10 bit) are controlled by four different registers. The first two, ADCON0 and ADCON1, are used to set and start the ADC module. When high level language is used, the programmer doesnβt need to care a lot of the register connected to the results because they are normally stored in a variable by a routine of the language itself (adc_read, for instance, using mikroc).
The ADCON0
As we can see this registers are 8 bit registers where.
β bit6 and bit 7 are used to set the frequency of the conversions.
β bits 3, 4 and 5 are used to select the pins of the microcontroller enabled to the adc conversions.
β bit 2 represents the status of the conversion procedure.
β bit 0 starts the conversion.
Regarding the second register, ADCON1, it must be set for two reasons: to select the format of the result value (bit 7), to select (bit0β¦bit3) the reference voltage and to set the port configuration control bits according to the following table
This circuit uses AN0 channel of ADC. The voltage conversion is employed in a logic, 16F877A have 10 bit ADC. That is, it can have 1024 levels. Reference voltage is fixed at
0 β 5 V Analog I/P is mapped to one of the 1024 levels (0-1023 Digital Count)
Resolution = 5/(1024) Β (as it is 10 bit ADC)
= 5/1024
=Β 4.8828 mVΒ Β It means that for a change in 4.8828mV, the binary output changes by 1.
For more detail: PC Based Digital Voltmeter Using PIC 16F877AΒ