{"id":59176,"date":"2020-06-11T08:26:29","date_gmt":"2020-06-11T08:26:29","guid":{"rendered":"https:\/\/electronicsmaker.com\/?p=59176"},"modified":"2020-06-11T08:26:29","modified_gmt":"2020-06-11T08:26:29","slug":"digital-voltmeter-using-8051-microcontroller","status":"publish","type":"post","link":"https:\/\/electronicsmaker.com\/digital-voltmeter-using-8051-microcontroller","title":{"rendered":"Digital Voltmeter using 8051 Microcontroller"},"content":{"rendered":"\n<p>A voltmeter is a voltage measuring instrument. We can measure the potential difference between any two points in an electrical network using a voltmeter.\u00a0Let us design and make a simple voltmeter using 8051 microcontrollers. There are two types of voltmeter as\u00a0analog voltmeter and digital voltmeter. Analog voltmeter moves the pointer on a scale but it has some limitations like the accuracy of few percent of full scale.<\/p>\n\n\n\n<p>A simple 0-5V voltmeter using 8051.This digital voltmeter has a sensitivity of &nbsp;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.<\/p>\n\n\n\n<p>A digital voltmeter can display the numerical value of the voltage on a display by use of analog to digital converter (ADC). All the data processing and manipulating are in digital form, so it is essential to use ADC. We have used ADC0804 analog-to-digital converter IC. The range of input voltage is 0-15V. Here the input voltage should be DC voltage so as to get the steady output on the LCD display. If you give the AC voltage as an input, it will display continuously running numbers as the nature of AC voltage.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/electronicsmaker.com\/wp-content\/uploads\/2020\/06\/Untitled-4.png\" alt=\"Digital-Voltmeter-using-ICL7071-block-diagram.jpg\" class=\"wp-image-59178\"\/><\/figure><\/div>\n\n\n\n<p><strong>About the circuit<\/strong><\/p>\n\n\n\n<p>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 &nbsp;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.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/electronicsmaker.com\/wp-content\/uploads\/2020\/06\/Untitled1.png\" alt=\"0-5-voltmeter.png\" class=\"wp-image-59179\"\/><\/figure>\n\n\n\n<p><strong>Circuit Components<\/strong><\/p>\n\n\n\n<p>AT89C51 micro controller<\/p>\n\n\n\n<p>ADC0804 IC<\/p>\n\n\n\n<p>25V Voltage Sensor<\/p>\n\n\n\n<p>AT89C51 programming board<\/p>\n\n\n\n<p>Variable resistor (to demonstrate the program)<\/p>\n\n\n\n<p>DC Adapter or Battery<\/p>\n\n\n\n<p><strong>Digital Voltmeter Circuit Design using 8051 Microcontroller<\/strong><\/p>\n\n\n\n<p>In the above circuit, analog to digital converter IC data bits are connected to the PORT2. LCD data pins are connected to the POTR3 of controller and control pins RS and EN are connected to the P1.6 and P1.7 respectively.<\/p>\n\n\n\n<p><strong>ADC0804 &nbsp;<\/strong><\/p>\n\n\n\n<p>This is an 8 bit analog to digital converter. This IC uses successive approximation method to convert analog values to digital. It can take only one analog data as input. The step size of this IC is varied by varying the reference voltage at pin9. If this pin is not connected, VCC will be the reference voltage.<\/p>\n\n\n\n<p>For every 19.53mV, rise in input voltage the output is incremented by 1 value when the step size is at 5V. The conversion time of this IC depends on clock source.<\/p>\n\n\n\n<p><strong>ADC Features<\/strong><\/p>\n\n\n\n<ul><li>0 to 5V analog input voltage<\/li><li>Built in clock generator<\/li><li>Differential analog inputs<\/li><li>Adjustable reference voltage<\/li><\/ul>\n\n\n\n<p>Below table shows the different step sizes for different reference voltages.<\/p>\n\n\n\n<p>In the above circuit diagram, pin9 (Vref\/2) is left open so that input voltage span can be 0 to 5V.<\/p>\n\n\n\n<p><strong>Voltage Sensor<\/strong><\/p>\n\n\n\n<p>The voltage sensor module is a simple voltage divider network that increases the analog input range of the ADC to about 25V.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/electronicsmaker.com\/wp-content\/uploads\/2020\/06\/Digital-Voltmeter-using-ICL.jpg\" alt=\"Digital-Voltmeter-using-ICL.jpg\" class=\"wp-image-59180\"\/><\/figure>\n\n\n\n<p><strong>Working of 8051 Microcontroller<\/strong><\/p>\n\n\n\n<p>Initially burn the program to the at89c51 microcontroller. Now give the connections as per the circuit diagram. Connect a battery or any voltage source at the input of the voltage sensor. Make sure that maximum analog input voltage should be less than 25V DC, Connect a digital multi meter at the Input terminals of the voltage sensor. Now switch on the board supply. Now observe both LCD and digital multi meter, both displays the same voltage (or very similar voltages). If possible, try to slowly vary the analog input voltage. Now you can observe that both multimeter and LCD displays the same voltages so that we can say that voltmeter is working properly. Switch off the board supply.<\/p>\n\n\n\n<p><strong>Digital Voltmeter Circuit&nbsp;Applications<\/strong><\/p>\n\n\n\n<ul><li>This system is used to measure the voltage in low voltage applications.<\/li><li>Used to measure the toy batteries.<\/li><li>We can measure the physical quantities like temperature, humidity, gas etc. using this system with a little modification.<\/li><\/ul>\n\n\n\n<p><strong>Digital Voltmeter Circuit Limitations<\/strong><\/p>\n\n\n\n<ul><li>The input analog voltage range should be 0 to 5V.<\/li><li>Using this system we can measure only one analog input value at a time.<\/li><\/ul>\n\n\n\n<p><strong>Coding<\/strong><\/p>\n\n\n\n<p>#include &lt;REGX51.H&gt;<\/p>\n\n\n\n<p>#include &#8220;lcd.h&#8221;<\/p>\n\n\n\n<p>#define adc_port P1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/ADC Port<\/p>\n\n\n\n<p>#define rd P3_7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/Read signal P3.7<\/p>\n\n\n\n<p>#define wr P3_6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/Write signal P3.6<\/p>\n\n\n\n<p>#define cs P3_5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/Chip Select P3.5<\/p>\n\n\n\n<p>#define intr P3_4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/INTR signal P3.4<\/p>\n\n\n\n<p>void conv();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;\/\/Start of conversion function<\/p>\n\n\n\n<p>void read();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/Read ADC function<\/p>\n\n\n\n<p>unsigned int adc_avg,adc;<\/p>\n\n\n\n<p>void main(){<\/p>\n\n\n\n<p>char i;<\/p>\n\n\n\n<p>LCD_INI();<\/p>\n\n\n\n<p>while(1){&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/Forever loop<\/p>\n\n\n\n<p>adc_avg = 0;<\/p>\n\n\n\n<p>for(i=0;i&lt;10;i++){<\/p>\n\n\n\n<p>conv();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/Start conversion<\/p>\n\n\n\n<p>read();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/\/Read ADC<\/p>\n\n\n\n<p>adc_avg += adc;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>adc_avg = adc_avg\/10;<\/p>\n\n\n\n<p>wrt_cmd(0x80);<\/p>\n\n\n\n<p>wrt_string(&#8220;V(DC): &#8220;);<\/p>\n\n\n\n<p>adc = adc_avg * 59;<\/p>\n\n\n\n<p>hex2lcd((unsigned char)(adc\/1000));<\/p>\n\n\n\n<p>wrt_data(&#8216;.&#8217;);<\/p>\n\n\n\n<p>adc = adc%1000;<\/p>\n\n\n\n<p>hex2lcd((unsigned char)(adc\/10));<\/p>\n\n\n\n<p>wrt_data(&#8216;V&#8217;);<\/p>\n\n\n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sp;&nbsp;&nbsp; \/\/Make CS high<\/p>\n\n\n\n<p>}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A voltmeter is a voltage measuring instrument. We can measure the potential difference between any two points in an electrical network using a voltmeter.\u00a0Let us design and make a simple voltmeter using 8051 microcontrollers. There are two types of voltmeter as\u00a0analog voltmeter and digital voltmeter. Analog voltmeter moves the pointer on a scale but it [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":59180,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[5985,5986],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v15.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Digital Voltmeter using 8051 Microcontroller - Electronics Maker<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/electronicsmaker.com\/digital-voltmeter-using-8051-microcontroller\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Digital Voltmeter using 8051 Microcontroller - Electronics Maker\" \/>\n<meta property=\"og:description\" content=\"A voltmeter is a voltage measuring instrument. We can measure the potential difference between any two points in an electrical network using a voltmeter.\u00a0Let us design and make a simple voltmeter using 8051 microcontrollers. There are two types of voltmeter as\u00a0analog voltmeter and digital voltmeter. Analog voltmeter moves the pointer on a scale but it [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/electronicsmaker.com\/digital-voltmeter-using-8051-microcontroller\" \/>\n<meta property=\"og:site_name\" content=\"Electronics Maker\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-11T08:26:29+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\">\n\t<meta name=\"twitter:data1\" content=\"Electronics Maker\">\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data2\" content=\"6 minutes\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/electronicsmaker.com\/#website\",\"url\":\"https:\/\/electronicsmaker.com\/\",\"name\":\"Electronics Maker\",\"description\":\"Electronics Magazine\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/electronicsmaker.com\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/electronicsmaker.com\/digital-voltmeter-using-8051-microcontroller#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/electronicsmaker.com\/digital-voltmeter-using-8051-microcontroller#webpage\",\"url\":\"https:\/\/electronicsmaker.com\/digital-voltmeter-using-8051-microcontroller\",\"name\":\"Digital Voltmeter using 8051 Microcontroller - Electronics Maker\",\"isPartOf\":{\"@id\":\"https:\/\/electronicsmaker.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/electronicsmaker.com\/digital-voltmeter-using-8051-microcontroller#primaryimage\"},\"datePublished\":\"2020-06-11T08:26:29+00:00\",\"dateModified\":\"2020-06-11T08:26:29+00:00\",\"author\":{\"@id\":\"https:\/\/electronicsmaker.com\/#\/schema\/person\/df9e9cfbf590f29e49716824dd7d81f9\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/electronicsmaker.com\/digital-voltmeter-using-8051-microcontroller\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/electronicsmaker.com\/#\/schema\/person\/df9e9cfbf590f29e49716824dd7d81f9\",\"name\":\"Electronics Maker\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/electronicsmaker.com\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a4af77a4fcb00c5dfc7c1ca124a492b4?s=96&d=mm&r=g\",\"caption\":\"Electronics Maker\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/electronicsmaker.com\/wp-json\/wp\/v2\/posts\/59176"}],"collection":[{"href":"https:\/\/electronicsmaker.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/electronicsmaker.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/electronicsmaker.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/electronicsmaker.com\/wp-json\/wp\/v2\/comments?post=59176"}],"version-history":[{"count":0,"href":"https:\/\/electronicsmaker.com\/wp-json\/wp\/v2\/posts\/59176\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/electronicsmaker.com\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/electronicsmaker.com\/wp-json\/wp\/v2\/media?parent=59176"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/electronicsmaker.com\/wp-json\/wp\/v2\/categories?post=59176"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/electronicsmaker.com\/wp-json\/wp\/v2\/tags?post=59176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}