Code, flowchart and Proteus simulation is given in the 'Downloads' section at the bottom of this page. It is assumed that you know how to interface LCD and ADC with 8051 micro-controller.
The result of the Proteus simulation is shown below.
In the above figure, we can see that a read of voltmeter and ohmmeter is shown on the screen. The processor keep scanning for change of analog signals of voltmeter and ohmmeter circuits sequentially and frequently. If some change happens equal to one step size (5/255=19.61mV) or more, the processor calculate the new reads and print it.
Flowchart
The flowchart describes the main routine and each one of the three subroutines included at the assembly code.
The program acts as follows:
- Initialize the memory and LCD for display after powering up.
- Convert analog voltage signal on IN0 of ADC to 8-bit digital signal.
- Calculate and print voltage value (Vin = Digital signal * Step size)
- Convert analog voltage signal on IN1 of ADC to 8-bit digital signal.
- Calculate and print resistance value by voltage divider method.
- Forever repeat steps from 2 to 5
Features
- Good sensitivity for voltmeter.
- Ohmmeter resistivity ranges up to 9.7 KΩ.
- No need of external clocking source for ADC.
- No need of switches for voltmeter and ohmmeter mode multiplexing.
Downloads
The code was compiled in Kiel uVision 4 and simulation was made in Proteus v7.8 SP2.
To download code, flowchart and simulation click here