{"id":15281,"date":"2019-05-28T10:50:34","date_gmt":"2019-05-28T14:50:34","guid":{"rendered":"http:\/\/engineersgarag-main\/vat-meter-using-atmega8\/"},"modified":"2023-07-13T12:45:08","modified_gmt":"2023-07-13T16:45:08","slug":"vat-meter-using-atmega8","status":"publish","type":"post","link":"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/","title":{"rendered":"VAT meter using ATMega8"},"content":{"rendered":"<div>While measuring voltage and current with multi-meter, the probes have to be changed its position carefully. There is a probability of damaging the multi-meter, if voltage is measured in high current mode by mistake.\u00a0 In case, both voltage and current to be measured at a time, we have to use two multi-meters and care should be taken while wiring both the multi-meters.\u00a0<span style=\"font-size: 12.8px;\">VAT meter is combination of Voltmeter, Ammeter and Thermometer. It can measure voltage and current simultaneously along with the temperature.<\/span><\/div>\n<div><\/div>\n<div>The project is built on ATMega8 So Reader should have knowledge of how to start with AVR and interface LCD with AVR. It used ACS-712 current sensor to measure the current and voltage is measured by ACD terminal. There is two temperature sensor is used in the circuit which can measure temperature of two different places like Transformer, Voltage regulator or any heating components. All data can observable on 16&#215;2 LCD display.<\/div>\n<div><\/div>\n<div>This project can measure and display maximum voltage up to 50Volts DC and maximum current up to 20Amps DC. When Voltage is exceeds 45VDC or current exceed 15A or temperature exceed 70 degree then the display blinks parameter near particular value and beep sound is generated.<\/div>\n<div><\/div>\n<div><u><strong>Components Required \u2013<\/strong><\/u><\/div>\n<div><\/div>\n<div><img decoding=\"async\" style=\"width: 518px; height: 696px; margin-left: auto; margin-right: auto;\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Components_project_0.jpg\" alt=\"\" \/><\/div>\n<div><u><strong><em><span style=\"font-size: 12.8px;\">Block diagram \u2013<\/span><\/em><\/strong><\/u><\/div>\n<div><\/div>\n<div><img decoding=\"async\" style=\"width: 550px; height: 329px; margin-left: auto; margin-right: auto;\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/block_diagram.jpg\" alt=\"\" \/><\/div>\n<div style=\"text-align: center;\"><\/div>\n<div style=\"text-align: center;\"><span style=\"font-family: verdana,geneva,sans-serif;\"><em><span style=\"font-size: 12.8px;\">Fig. 1: Block Diagram Of\u00a0<\/span><span style=\"font-size: 12.8px;\">VAT METER using ATMega8<\/span><\/em><\/span><\/div>\n<div><\/div>\n<div><strong><u><em>Circuit Connections \u2013<\/em><\/u><\/strong><\/div>\n<div><\/div>\n<div>This device is based on AVR ATMega8. ATMega8 is an 8 bit microcontroller that can operate up to 16 MIPS Throughput at 16 MHz clock. Here we are using internal RC oscillator of ATMega8 which provides fixed 1.0 2.0 4.0 or 8.0 MHz clock so set your ATMega8 to 1MHz internal RC oscillator.<\/div>\n<div><\/div>\n<div>ATMega8 is interfaced with 16&#215;2 LCD, L M35 and ACS712 to make the device. There is a Trimpot (Shown as VR1 in the circuit diagram) which is used to adjust the contrast of LCD. There is a Yellow LED that is interfaced parallel to the whole circuit which is used to indicate that the power supply for circuit is working properly. There is a blinker connected at bit 0 of port D of ATMega8 which indicates, the MCU is working.<\/div>\n<div><\/div>\n<div>Two LM35 temperature sensors are used to get state of temperature at two different places. Both LM35 is connected at the bit 1, 2 of port C of ATMega8 which is ADC pin 1 and 2.\u00a0<span style=\"font-size: 12.8px;\">ACS712 Current sensor is used to measure the current via connected in series with DC power supply. The OUT pin of ACS712 is connected to bit 0 of port C of ATMega8 which is ADC pin 0. The voltage is measured by bit 3 of port C of ATMega8 which is ADC pin 3. There is a Trimpot (Shown as VR2 in the circuit diagram) which is used to calibrate the voltage.<\/span><\/div>\n<div><\/div>\n<div>BC548 transistor is used to drive buzzer. The base of transistor is connected with bit 1 of port D of ATMega8. Collector of transistor is connected with buzzer and emitter is connected to ground.\u00a0<span style=\"font-size: 12.8px;\">AREF or 21th pin of ATMega8 is connected to the 5v via 10mH inductor and also there is 0.1uf capacitor connected in between ground and AREF.\u00a0<\/span><span style=\"font-size: 12.8px;\">The entire circuit operates on 5V DC which may obtain from 5V power bank or 9V battery with 5V regulated power supply using 7805 IC. The internal RC oscillator (1 MHz) used with ATMega8 so no need to add external oscillator.<\/span><\/div>\n<div><\/div>\n<div><strong><u><em>How circuit Works \u2013<\/em><\/u><\/strong><\/div>\n<div><\/div>\n<div>After assembling the circuit, the ISP port of ATmega8 must be connected to any AVR programmer and VATmeter.hex file should be flashed in the microcontroller. Then, disconnect the circuit from the AVR programmer. Now the device is ready for operation.\u00a0<span style=\"font-size: 12.8px;\">When the Device is powered ON, the blinker LED start blinking and LED displays \u201cWelcome to VAT METER\u201d. After few second LCD comes in stable state that displays Voltage, ampere and temperature of both sensor and it update data as update in sensor input.<\/span><\/div>\n<div><\/div>\n<div><span style=\"font-size: 12.8px;\">While we connect the DC power source in series with ACS712 current sensor as shown in circuit diagram. The LCD shows the voltage and current of battery. Make sure the Load is connected in series with battery and ACS712 current sensor so current can be measured across the Load. Temperature sensor can be placed near heating component so it will measure temperature.<\/span><\/div>\n<div><\/div>\n<div>If the temperature exceeds 70 degree Centigrade or Voltage exceeds 45VDC or Current exceeds 15ADC then, the display blinks the parameter near the particular value and a beep sound is generated via buzzer.<\/div>\n<div><\/div>\n<div><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/VAT.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" style=\"width: 550px; height: 318px; margin-left: auto; margin-right: auto;\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/VAT.jpg\" alt=\"\" width=\"550\" height=\"318\" \/><\/a><\/div>\n<div style=\"text-align: center;\"><\/div>\n<div style=\"text-align: center;\"><span style=\"font-family: verdana,geneva,sans-serif;\"><em>Fig.1: Image showing Working of\u00a0VAT METER<\/em><\/span><\/div>\n<div><\/div>\n<div><u><em><strong>Programming Guide \u2013<\/strong><\/em><\/u><\/div>\n<div><\/div>\n<div>This device is based on AVR ATMega8 and it is programmed with embedded C using AVR Studio 4. Other programming tools like Atmel Studio or Notepad++ can also be used to write and compile the code. The ATMega8 is programmed to measure Voltage, Current and temperature at same time in single display. This project can measure voltage up to 50Volts DC and maximum current up to 20Amps DC.<\/div>\n<div><\/div>\n<div>\u00a0Constants used in the code \u2013<\/div>\n<div><\/div>\n<div>#define F_CPU 1000000L\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 :- Constant used to define clock frequency of the MCU<\/div>\n<div><\/div>\n<div>#define BLINKER 0b00000001\u00a0 \u00a0 \u00a0:- define blinker LED to bit 0 of port D<\/div>\n<div><\/div>\n<div>#define ALARM 0b00000010\u00a0 \u00a0 \u00a0 \u00a0:- define buzzer connected at bit 1 of port D<\/div>\n<div><\/div>\n<div>#define LCD_DP\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 PORTB\u00a0 :- Port B defined as LCD data control port<\/div>\n<div><\/div>\n<div>#define LCD_CP PORTD\u00a0 :- Port D is defined as control port of LCD<\/div>\n<div><\/div>\n<div>#define LCD_EN\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0b10000000\u00a0 \u00a0 \u00a0 \u00a0:- EN pin of LCD is connected at 7 bit of port D<\/div>\n<div><\/div>\n<div>#define LCD_RS 0b01000000\u00a0 \u00a0 \u00a0 \u00a0:- RS pin of LCD is connected at 6 bit of port D<\/div>\n<div><\/div>\n<div><u><em><strong>Variable used in code \u2013<\/strong><\/em><\/u><\/div>\n<div><\/div>\n<div>long AMPFACTOR = 488;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 :- To calculate ampere value to ADC value<\/div>\n<div><\/div>\n<div>int\u00a0 VOLTS=0;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 :- To store voltage value<\/div>\n<div><\/div>\n<div>long AMPS=0L;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 :- To store current value<\/div>\n<div><\/div>\n<div>int\u00a0 TEMP1=0;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 :- To store temperature from first sensor<\/div>\n<div><\/div>\n<div>int\u00a0 TEMP2 = 0;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 :- To store temperature from second sensor<\/div>\n<div><\/div>\n<div>char DST[8];\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0:- To display value on LCD<\/div>\n<div><\/div>\n<div>long A=0;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 :- To initially store ADC vale<\/div>\n<div><\/div>\n<div>int loop = 0;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 :- To control the blink of parameter on LED<\/div>\n<div><\/div>\n<div>int alarm = 0;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 :- To control the buzzer<\/div>\n<div><\/div>\n<div>int temparray1[5]={25,25,25,25,25};\u00a0 \u00a0 \u00a0 \u00a0:- To Store 5 value of temperature for average temperature<\/div>\n<div><\/div>\n<div>int temparray1pos=0;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0:- To Select the temperature array value<\/div>\n<div><\/div>\n<div>int temparray2[5]={25,25,25,25,25};\u00a0 \u00a0 \u00a0 \u00a0:- To Store 5 value of temperature for average temperature<\/div>\n<div><\/div>\n<div>int temparray2pos=0;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0:- To Select the temperature array value<\/div>\n<div><\/div>\n<div><u><em><strong>Header file and libraries used in the code \u2013<\/strong><\/em><\/u><\/div>\n<div><\/div>\n<div>#include &lt;avr\/io.h&gt;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0:- Standard AVR header for input\/output<\/div>\n<div><\/div>\n<div>#include &lt;util\/delay.h&gt;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 :- Standard AVR header to provide time delays<\/div>\n<div><\/div>\n<div><u><em><strong><span style=\"font-size: 12.8px;\">Function used in the code \u2013<\/span><\/strong><\/em><\/u><\/div>\n<div><\/div>\n<div>initPorts\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0:- To initialize port as input or putput<\/div>\n<div><\/div>\n<div>LCD_enable\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0:- To control the EN pin of LCD<\/div>\n<div><\/div>\n<div>LCD_WriteCmd\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 :- write command for LCD<\/div>\n<div><\/div>\n<div>LCD_init\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 :- To initialize LCD at beginning<\/div>\n<div><\/div>\n<div>LCD_RowCol\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 :- To Set the cursor position<\/div>\n<div><\/div>\n<div>LCD_ClrScr\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 :- To clear the LCD display<\/div>\n<div><\/div>\n<div>LCD_writeCh\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0:- Write character on LCD display<\/div>\n<div><\/div>\n<div>LCD_writeStr\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0:- Write String on LCD display<\/div>\n<div><\/div>\n<div>ADC_init\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 :- To initialize ADC<\/div>\n<div><\/div>\n<div>ADC_read\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 :- Read ADC value<\/div>\n<div><\/div>\n<div>showValue\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0:- Show value in specific format<\/div>\n<div><\/div>\n<div>_delay_ms\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0:- For time Delay<\/div>\n<div><\/div>\n<div><u><em><strong>Algorithm \u2013<\/strong><\/em><\/u><\/div>\n<div><\/div>\n<div>The code for this VAT METER using ATMega8 works as follow.<\/div>\n<div><\/div>\n<div>When the VAT Meter circuit is powered on, first of all , the port is initialized that set the port B and port D as output . the port C as set as input.<\/div>\n<div><\/div>\n<div>void initPorts ( )<\/div>\n<div><\/div>\n<div>{<\/div>\n<div><span style=\"font-size: 12.8px;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0DDRB = 0xFF;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0<\/span><\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0DDRD = 0xFF;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0DDRC = 0x00;<\/div>\n<div>}<\/div>\n<div><\/div>\n<div>After initialization of port, the blinker LED set to High for some delay and then it inverted (set to LOW). Also LCD is initialized.<\/div>\n<div><\/div>\n<div>PORTD |= BLINKER;<\/div>\n<div><\/div>\n<div><span style=\"font-size: 12.8px;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 _delay_ms ( 2000 );<\/span><\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LCD_init ( );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 _delay_ms ( 100 );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 PORTD &amp;= (~BLINKER);<\/div>\n<div><\/div>\n<div><span style=\"font-size: 12.8px;\">Firstly LCD is Cleared to remove any type of garbage value. Then set cursor to print massage \u201cWelcome to\u201d in first row and \u201cVAT METER\u201d in second row.<\/span><\/div>\n<div><\/div>\n<div>LCD_ClrScr();<\/div>\n<div><\/div>\n<div>LCD_RowCol ( 1, 1 );<\/div>\n<div><\/div>\n<div>LCD_writeStr ( &#8220;Welcome to&#8221; );<\/div>\n<div><\/div>\n<div>LCD_RowCol ( 2, 7 );<\/div>\n<div><\/div>\n<div>LCD_writeStr ( &#8220;VAT METER&#8221; );<\/div>\n<div><\/div>\n<div><span style=\"font-size: 12.8px;\">Now ADC is initialized and reading all ADC channel values. Then LCD cleared that remove welcome massage.<\/span><\/div>\n<div><\/div>\n<div>ADC_init ( );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 _delay_ms ( 2000 );<\/div>\n<div><\/div>\n<div><span style=\"font-size: 12.8px;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 for ( int i=0; i&lt;10; i++ )<\/span><\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 {<\/div>\n<div><span style=\"font-size: 12.8px;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ADC_read ( i\/2 );<\/span><\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }<\/div>\n<div><\/div>\n<div><span style=\"font-size: 12.8px;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LCD_ClrScr();<\/span><\/div>\n<div><\/div>\n<div><span style=\"font-size: 12.8px;\">We entered in while loop, here loop variable used that blink the parameter on LCD with every cycle while any value exceeded it\u2019d defined value. alarm set to LOW. Blinker LED set to blink for every cycle which indicates MCU is working.<\/span><\/div>\n<div><\/div>\n<div>if (loop==0)<\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 loop = 1;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 else<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 loop = 0;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 alarm = 0;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 PORTD ^= BLINKER;<\/div>\n<div><\/div>\n<div>Read ACD value from channel 3 and store it in A variable. Divided ADC value by 2 in order to maintain max range approximate 50 volt. Cursor of LCD set to it\u2019s position to print the value in specific format. If voltage vale is exceeded the 45 Volt range the \u201cV\u201d parameter on LCD will blink and buzzer makes beep sound.<\/div>\n<div><\/div>\n<div>A = ADC_read(3);<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 _delay_ms ( 5 );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LCD_RowCol ( 1, 1 );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 VOLTS = A \/ 2;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 showValue ( VOLTS );<\/div>\n<div><\/div>\n<div>if (VOLTS&gt;450 &amp;&amp; loop==0)<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 {<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LCD_writeStr ( &#8221;\u00a0 &#8221; );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 alarm = 1;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 else<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LCD_writeStr ( &#8220;V &#8221; );<\/div>\n<div><\/div>\n<div>Now set A to zero for reading another ADC value from channel 0. Some calculation require to convert ADC value into Ampere value. once we got the ampere value just print on LCD . When Current exceed the defined range of 15 amp then it blink parameter on LCD and buzzer makes beep sound.<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 A = 0;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0ADC_read ( 0 );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0_delay_ms ( 5 );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0for ( int i=0; i&lt;10; i++ )<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0{<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0A = A + ADC_read ( 0 );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0_delay_ms ( 5 );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0}<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0A = 5110-A;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0AMPS = (A * AMPFACTOR) \/10000L;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0LCD_RowCol ( 2, 1 );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0showValue ( AMPS );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0if ( (AMPS&gt;150 || AMPS&lt;-150) &amp;&amp; loop==0)<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0{<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0LCD_writeStr ( &#8221;\u00a0 &#8221; );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0alarm = 1;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0}<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0else<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0LCD_writeStr ( &#8220;A &#8221; );<\/div>\n<div><\/div>\n<div><span style=\"font-size: 12.8px;\">Set A to zero and read value From ADC channel 1. Here 5 temperature values is taken for every cycle in order to take average temperature value. When temperature value exceeds 70 degree it blinks parameter on LCD and buzzer will makes beep sound.<\/span><\/div>\n<div>A = 0;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ADC_read(1);<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 _delay_ms ( 5 );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 for ( int i=0; i&lt;10; i++ )<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 {<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 A = A + ADC_read ( 1 );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 _delay_ms ( 5 );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 TEMP1 = A\/2;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 temparray1[temparray1pos++] = TEMP1;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 TEMP1 = (temparray1[0] + temparray1[1] + temparray1[2] + temparray1[3] + temparray1[4] )\/5;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 if (temparray1pos&gt;4)<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 temparray1pos = 0;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LCD_RowCol ( 1, 9 );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 showValue ( TEMP1 );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 if (TEMP1&gt;700 &amp;&amp; loop==0)<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 {<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LCD_writeStr ( &#8221;\u00a0 &#8221; );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 alarm = 1;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 else<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 {<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LCD_writeCh ( 223 );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LCD_writeCh ( &#8216;C&#8217; );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }<\/div>\n<div><\/div>\n<div><span style=\"font-size: 12.8px;\">Set A to zero and read value From ADC channel 2. Here 5 temperature values is taken for every cycle in order to take average temperature value. When temperature value exceeds 70 degree it blinks parameter on LCD and buzzer will makes beep sound.<\/span><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0A = 0;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ADC_read(2);<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 _delay_ms ( 5 );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 for ( int i=0; i&lt;10; i++ )<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 {<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 A = A + ADC_read ( 2 );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 _delay_ms ( 5 );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 TEMP2 = A\/2;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 temparray2[temparray2pos++] = TEMP2;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 TEMP2 = (temparray2[0] + temparray2[1] + temparray2[2] + temparray2[3] + temparray2[4] )\/5;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 if (temparray2pos&gt;4)<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 temparray2pos = 0;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LCD_RowCol ( 2, 9 );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 showValue ( TEMP2 );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 if (TEMP2&gt;700 &amp;&amp; loop==0)<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 {<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LCD_writeStr ( &#8221;\u00a0 &#8221; );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 alarm = 1;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 else<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 {<\/div>\n<div><span style=\"font-size: 12.8px;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LCD_writeCh ( 223 );<\/span><\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 LCD_writeCh ( &#8216;C&#8217; );<\/div>\n<div><span style=\"font-size: 12.8px;\">\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 }<\/span><\/div>\n<div><\/div>\n<div>If alarm variable IS high Then produce beep sound via port D\u2019s pin 1.<\/div>\n<div><\/div>\n<div>if (alarm)<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0PORTD |= ALARM;<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0_delay_ms ( 150 );<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0PORTD &amp;= (~ALARM);<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0_delay_ms ( 60 );<\/div>\n<div><\/div>\n<div>Check out the complete code and quickly start building this exciting project.<\/div>\n<div><\/div>\n<div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>While measuring voltage and current with multi-meter, the probes have to be changed its position carefully. There is a probability of damaging the multi-meter, if voltage is measured in high current mode by mistake.&nbsp; In case, both voltage and current to be measured at a time, we have to use two multi-meters and care should be taken while wiring both the multi-meters. VAT meter is combination of Voltmeter, Ammeter and Thermometer. It can measure voltage and current simultaneously along with the temperature.&nbsp;<\/p>\n","protected":false},"author":306,"featured_media":40499,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[4043,13],"tags":[],"class_list":{"2":"type-post","9":"entry","10":"has-post-thumbnail"},"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.2 (Yoast SEO v25.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>VAT meter using ATMega8<\/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:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"VAT meter using ATMega8\" \/>\n<meta property=\"og:description\" content=\"While measuring voltage and current with multi-meter, the probes have to be changed its position carefully. There is a probability of damaging the multi-meter, if voltage is measured in high current mode by mistake.&nbsp; In case, both voltage and current to be measured at a time, we have to use two multi-meters and care should be taken while wiring both the multi-meters. VAT meter is combination of Voltmeter, Ammeter and Thermometer. It can measure voltage and current simultaneously along with the temperature.&nbsp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/\" \/>\n<meta property=\"og:site_name\" content=\"Engineers Garage\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/engineersgarage\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Components_project_0.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"518\" \/>\n\t<meta property=\"og:image:height\" content=\"696\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Fayaz Hassan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@EngineersGarage\" \/>\n<meta name=\"twitter:site\" content=\"@EngineersGarage\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fayaz Hassan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/\"},\"author\":{\"name\":\"Fayaz Hassan\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/4b8146cdf9931d9b2372ee72a505df3d\"},\"headline\":\"VAT meter using ATMega8\",\"datePublished\":\"2019-05-28T14:50:34+00:00\",\"dateModified\":\"2023-07-13T16:45:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/\"},\"wordCount\":1769,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Components_project_0.jpg\",\"articleSection\":[\"AVR\",\"Electronic Projects\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/\",\"url\":\"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/\",\"name\":\"VAT meter using ATMega8\",\"isPartOf\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Components_project_0.jpg\",\"datePublished\":\"2019-05-28T14:50:34+00:00\",\"dateModified\":\"2023-07-13T16:45:08+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/#primaryimage\",\"url\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Components_project_0.jpg\",\"contentUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Components_project_0.jpg\",\"width\":518,\"height\":696,\"caption\":\"\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.engineersgarage.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"VAT meter using ATMega8\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.engineersgarage.com\/#website\",\"url\":\"https:\/\/www.engineersgarage.com\/\",\"name\":\"Engineers Garage\",\"description\":\"Electronic Projects, Electrical Engineering Resources, Makers Articles and Product News\",\"publisher\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.engineersgarage.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\",\"name\":\"Engineer's Garage - WTWH Media\",\"url\":\"https:\/\/www.engineersgarage.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png\",\"contentUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png\",\"width\":372,\"height\":52,\"caption\":\"Engineer's Garage - WTWH Media\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/engineersgarage\",\"https:\/\/x.com\/EngineersGarage\",\"https:\/\/www.youtube.com\/channel\/UC0VITh11JSYk-UW7toLebUw\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/4b8146cdf9931d9b2372ee72a505df3d\",\"name\":\"Fayaz Hassan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/25d2c325056c6d6011c1cfbf8fb9b940551a24bf9ecfe32d7f1ef27af9fc0d70?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/25d2c325056c6d6011c1cfbf8fb9b940551a24bf9ecfe32d7f1ef27af9fc0d70?s=96&r=g\",\"caption\":\"Fayaz Hassan\"},\"url\":\"https:\/\/www.engineersgarage.com\/author\/fhassan\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"VAT meter using ATMega8","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/","og_locale":"en_US","og_type":"article","og_title":"VAT meter using ATMega8","og_description":"While measuring voltage and current with multi-meter, the probes have to be changed its position carefully. There is a probability of damaging the multi-meter, if voltage is measured in high current mode by mistake.&nbsp; In case, both voltage and current to be measured at a time, we have to use two multi-meters and care should be taken while wiring both the multi-meters. VAT meter is combination of Voltmeter, Ammeter and Thermometer. It can measure voltage and current simultaneously along with the temperature.&nbsp;","og_url":"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/","og_site_name":"Engineers Garage","article_publisher":"https:\/\/www.facebook.com\/engineersgarage","og_image":[{"width":518,"height":696,"url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Components_project_0.jpg","type":"image\/jpeg"}],"author":"Fayaz Hassan","twitter_card":"summary_large_image","twitter_creator":"@EngineersGarage","twitter_site":"@EngineersGarage","twitter_misc":{"Written by":"Fayaz Hassan","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/#article","isPartOf":{"@id":"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/"},"author":{"name":"Fayaz Hassan","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/4b8146cdf9931d9b2372ee72a505df3d"},"headline":"VAT meter using ATMega8","datePublished":"2019-05-28T14:50:34+00:00","dateModified":"2023-07-13T16:45:08+00:00","mainEntityOfPage":{"@id":"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/"},"wordCount":1769,"commentCount":0,"publisher":{"@id":"https:\/\/www.engineersgarage.com\/#organization"},"image":{"@id":"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/#primaryimage"},"thumbnailUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Components_project_0.jpg","articleSection":["AVR","Electronic Projects"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/","url":"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/","name":"VAT meter using ATMega8","isPartOf":{"@id":"https:\/\/www.engineersgarage.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/#primaryimage"},"image":{"@id":"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/#primaryimage"},"thumbnailUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Components_project_0.jpg","datePublished":"2019-05-28T14:50:34+00:00","dateModified":"2023-07-13T16:45:08+00:00","breadcrumb":{"@id":"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/#primaryimage","url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Components_project_0.jpg","contentUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Components_project_0.jpg","width":518,"height":696,"caption":""},{"@type":"BreadcrumbList","@id":"https:\/\/www.engineersgarage.com\/vat-meter-using-atmega8\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.engineersgarage.com\/"},{"@type":"ListItem","position":2,"name":"VAT meter using ATMega8"}]},{"@type":"WebSite","@id":"https:\/\/www.engineersgarage.com\/#website","url":"https:\/\/www.engineersgarage.com\/","name":"Engineers Garage","description":"Electronic Projects, Electrical Engineering Resources, Makers Articles and Product News","publisher":{"@id":"https:\/\/www.engineersgarage.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.engineersgarage.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.engineersgarage.com\/#organization","name":"Engineer's Garage - WTWH Media","url":"https:\/\/www.engineersgarage.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png","contentUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png","width":372,"height":52,"caption":"Engineer's Garage - WTWH Media"},"image":{"@id":"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/engineersgarage","https:\/\/x.com\/EngineersGarage","https:\/\/www.youtube.com\/channel\/UC0VITh11JSYk-UW7toLebUw"]},{"@type":"Person","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/4b8146cdf9931d9b2372ee72a505df3d","name":"Fayaz Hassan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/25d2c325056c6d6011c1cfbf8fb9b940551a24bf9ecfe32d7f1ef27af9fc0d70?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/25d2c325056c6d6011c1cfbf8fb9b940551a24bf9ecfe32d7f1ef27af9fc0d70?s=96&r=g","caption":"Fayaz Hassan"},"url":"https:\/\/www.engineersgarage.com\/author\/fhassan\/"}]}},"featured_image_src":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Components_project_0.jpg","featured_image_src_square":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Components_project_0.jpg","author_info":{"display_name":"Fayaz Hassan","author_link":"https:\/\/www.engineersgarage.com\/author\/fhassan\/"},"_links":{"self":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts\/15281","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/users\/306"}],"replies":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/comments?post=15281"}],"version-history":[{"count":0,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts\/15281\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/media\/40499"}],"wp:attachment":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/media?parent=15281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/categories?post=15281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/tags?post=15281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}