# Digital voltmeter using 8051 microcontroller

Custom Student Mr. Teacher ENG 1001-04 17 April 2016

## Digital voltmeter using 8051 microcontroller

Voltmeter using 8051 microcontroller. Automatic railway gate control 8051 microcontroller use  adminOctober – 4 – 20127 CommentsVoltmeter using 8051. A simple 0-5V voltmeter using 8051 is shown in this article. This digital voltmeter has a sensitivity of 200mV which is a bit low but this project is meant for demonstrating how an ADC and seven segment display can be interfaced to 8051 to obtain a digital readout of the input voltage.

A 31/2 digit high end voltmeter will be added soon. ADC0804 is the ADC and AT89S51 is the controller used in this project. Before attempting this project, go through these projects Interfacing ADC to 8051 and Interfacing seven segment display to 8051 which will give you a good idea on the basics.

Circuit diagram.

0-5 digital voltmeter using 8051
About the circuit. In the circuit Vref/2 (pin9) of the ADC is left open and it means that the input voltage span can be o to 5V and the step size will be 5/255 = 19.6mV. The equation for the digital output of ADC0804 is Dout = Vin/Step size. In this circuit, for an input voltage of 1V the digital output will be 1/19.6mV = 51 and so the binary equivalent of 51 ie 00110011.

Digital output of the ADC is interfaced to P1.0 of the microcontroller. Control signals for the ADC ie CS, RD, WR and INTR are available from the P3.7, P3.6, P3.5 and P3.4 pins of the microcontroller respectively. 2 digit multiplexed seven segment display is interfaced to Port0 of the microcontroller. Control signals for the display driver transistors Q1 and Q2 are obtained from P3.2 and P3.1 of the microcontroller. Push button switch S1, capacitor C2 and resistor R10 forms a debouncing reset circuitry.

Program.
ORG 00H
MOV P1,#11111111B
MOV P0,#00000000B
MOV P3,#00000000B
MOV DPTR,#LABEL
MAIN: CLR P3.7
SETB P3.6
CLR P3.5
SETB P3.5
WAIT: JB P3.4,WAIT
CLR P3.7
CLR P3.6
MOV A,P1
MOV B,#10D
DIV AB
MOV B,#2D
MUL AB
MOV B,#10D
DIV AB
SETB P3.2
ACALL DISPLAY
MOV P0,A
ACALL DELAY
MOV P0,#10000000B
ACALL DELAY
MOV A,B
CLR P3.2
SETB P3.1
ACALL DISPLAY
MOV P0,A
ACALL DELAY
CLR P3.1
SJMP MAIN
DELAY: MOV R3,#02H
DEL1: MOV R2,#0FAH
DEL2: DJNZ R2,DEL2
DJNZ R3,DEL1
RET
DISPLAY: MOVC A,@A+DPTR
RET
LABEL: DB 3FH
DB 06H
DB 5BH
DB 4FH
DB 66H
DB 6DH
DB 7DH
DB 07H
DB 7FH
DB 6FH
END

At first the program controls the ADC to produce a digital output corresponding to the input voltage.This digital output is scanned through P1.0 and is loaded to accumulator. Then the value in the accumulator is divided by 10 to omit the last digit. For example, let the input voltage be 4V. Then the corresponding digital output of the ADC will be 204D (D stands for decimal) .After the the division by 10, the value left in the accumulator will be 20D. This 20D is then multiplied by 2D which results in 40D.

The next target of the program is to manipulate this 40D and make a 4.0 readout on the display. For this the 40D is again divided by 10D . This results in 4 inside accumulator and 0 inside B register. Then the program gets the digit drive pattern for 4 using the lookup table , puts this pattern on Port 0 and activates Q1. After 1 ms delay 10000000B is loaded to P0 and this accounts for the dot.

After a further 1ms delay Q1 is deactivated, content in B (ie 0) is moved to A, gets the correct digit drive pattern for 0 using the lookup table, puts this pattern on Port 0 and activates Q2. After a further 1ms delay Q2 is deactivated and the entire cycle is repeated.

8051 Microcontroller Projects & Circuits adminFebruary – 1 – 20138 CommentsIn this article we are listing all the projects and circuits we have developed using the 8051 micro controller. We have tested all of these projects in our lab and verified the working . All these projects are made to solve a real world requirement or problem. Engineering students & other diploma students will find these projects useful for their mini project and main project requirements.

All the 8051 projects listed below are made using the 8051 compliant microcontroller from Atmel – AT89S51. We have given the correct circuit diagram, working and software code (in assembly language) for each and every project. You can use all of them freely for your project & learning requirements. In case you are using a controller other than AT89S51 – please be sure to check the hardware of your controller and compare it with that of AT89S51.

This is necessary because we have developed all the software in assembly language. If you are not that good at assembly language, you can convert the software into C language & use it with any compliant 8051 controller.

Image Source

1. Ultrasonic Range Finder using 8051 – This project as the name says, is an application to measure distance of an object. It uses an ultrasonic transducer module HC-SR04 to measure the distance and the controller AT89S51 to make the necessary processing. This project can be used to make applications like Automotive parking sensor, Obstacle warning systems, Terrain monitoring robots etc. This ultrasonic range finder can measure distances upto 2.5 meters with an accuracy of 1 cm.

2. Digital Tachometer using 8051 – This project is a digital tachometer which can be used to measure the revolutions per second of any object like a rotating wheel or a disc or a shaft. This application built using 8051 micro controller can measure upto 255 revolutions/second with an accuracy of 1 rev/sec. This application has 3 important sections – 1) is the optical pickup designed to pick the revolutions of the object using a photo transistor and LED. 2) is the processing stage designed using 8051 and the associated software 3) is the display section using 7 segment displays.

3. Water Level Controller using 8051 – This is one of the most popular project we have published using 8051 controller. This water level controller monitors the level of the over head tank and automatically switches on the water pump when ever the level goes below a preset limit. The level of the over head tank is indicated using 5 leds and the pump is switched of when the over head tank is filled. We have given an illustrated circuit diagram with working explained in detail. You will also find the software codes written in assemble language.

4. Voltmeter using 8051 – We all must have used a multimeter from our young days. Have you ever bothered to create one ? So here is one such an interesting project. A Voltmeter using 8051 micro controller. Even though its quiet simple and an easy to make one, you shall find it really interesting. This can be used as an application at the mini project level for engineering and diploma students.

This digital voltmeter can measure 0 to 5 volts and has a sensitivity of 200mV which is a bit low but this project is meant for demonstrating how an ADC and seven segment display can be interfaced to 8051 to obtain a digital readout of the input voltage. ADC0804 is the ADC and AT89S51 is the controller used in this project.

5. Thermometer using 8051 – This is an interesting project designed to measure temperature using 8051. Its a simple 0-100°C digital thermometer with 1°C resolution using 8051. The circuit is based on LM35 analog temperature sensor, ADC0804 and AT89S51 microcontroller. LM35 is an analogue temperature sensor IC which can measure a temperature range of -55 to 150°C. Its output voltage varies 10mV per °C change in temperature.

Knowledge Resources:- The articles below given are basics on how to work with 8051 micro controller. You can refer them if you come across a road block anywhere!

1. Interfacing 7 segment display to 8051 – A good tutorial on interfacing 7 segment display to 8051 micro controller.

2. Interfacing LCD display to 8051 – Explains how to interface a 16×2 LCD display with 8051 micro controller.

3. Interfacing DC motor to 8051 – Explains how to interface a DC motor with 8051 micro controller.

4. Interfacing push button switch to 8051 – Interfacing LED & Push button switch to 8051 micro controller.

5. Interfacing ADC to 8051 – This articles gives you a good detail on how to interface ADC to 8051 micro controller. ADC 0804 is used to explain the interfacing procedure with an example software routine.

8 channel light chaser using 8051
adminMay – 10 – 201210 Comments6 function 8 channel light chaser using 8051. A 6 function 8 channel light chaser using 8051 is shown here. The hardware and software of this circuit are very simple and the light functions gets repeated one after another automatically. P1.0 to P1.7 of the microcontroller (AT89S51) are assigned as the output pins.

Corresponding LEDs are connected to the output pins through 1K current limiting resistors (R1 to R8). The sequence by which the output pins (P1.0 to P1.7) goes high and low is determined by the program and the LEDs follow this sequence. Circuit diagram of the 6 function chaser using 8051 is shown below.

6 function light chaser using 8051

Program.
START: MOV A,#80H
MOV R7,#07H
MOV P1,A
LCALL DELAY
LABEL1: RR A
MOV P1,A
LCALL DELAY
DJNZ R7,LABEL1
MOV R7,#07H
LABEL2: RL A
MOV P1,A
LCALL DELAY
DJNZ R7,LABEL2
MOV P1,#81H
LCALL DELAY
MOV P1,#42H
LCALL DELAY
MOV P1,#24H
LCALL DELAY
MOV P1,#18H
LCALL DELAY
MOV P1,#0FFH
LCALL DELAY
MOV P1,#00H
LCALL DELAY
MOV A,#80H
MOV P1,A
LCALL DELAY
MOV R7,#07H
LABEL3: SETB C
RRC A
MOV P1,A
LCALL DELAY
DJNZ R7,LABEL3
MOv P1,#00H
LCALL DELAY
MOV A,#0AAH
MOV P1,A
LCALL DELAY
CPL A
MOV P1,A
LCALL DELAY
LJMP START

DELAY: MOV R4,#03H
WAIT1: MOV R3,#00H
WAIT2: MOV R2,#00H
WAIT3: DJNZ R2,WAIT3
DJNZ R3,WAIT2
DJNZ R4,WAIT1
RET
END

A

• Subject:

• University/College: University of California

• Type of paper: Thesis/Dissertation Chapter

• Date: 17 April 2016

• Words:

• Pages:

We will write a custom essay sample on Digital voltmeter using 8051 microcontroller

for only \$16.38 \$12.9/page