Design and Construction of Digital Multi Meter Using Pic Microcontroller

March 27, 2018 | Author: IJSTR Research Publication | Category: Analog To Digital Converter, Electricity, Electromagnetism, Electrical Engineering, Electronics


Comments



Description

INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 4, ISSUE 07, JULY 2015ISSN 2277-8616 Design And Construction Of Digital Multi-Meter Using PIC Microcontroller Khawn Nue, Dr. KyawSoe Lwin, Hla Myo Tun Abstract: This thesis describes the design and construction of digital multi-meter using PIC microcontroller. In this system, a typical multi-meter may include features such as the ability to measure AC/DC voltage, DC current, resistance, temperature, diodes, frequency and connectivity. This design uses of the PIC microcontroller, voltage rectifiers, voltage divide, potentiometer, LCD and other instruments to complete the measure. When we used what we have learned of microprocessors and adjust the program to calculate and show the measures in the LCD, keypad selected the modes. The software programming has been incorporated using MPLAB and PROTEUS. In this system, the analogue input is taken directly to the analogue input pin of the microcontroller without any other processing. So the input range is from 0V to 5V the maximum source impedance is 2k5 (for testing use a 1k pot). To improve the circuit adds an op-amp in front to present greater impedance to the circuit under test. The output impedance of the op-amp will be low which a requirement of the PIC analogue input is. Keyword: PIC 16F887 Microcontroller, LCD display, MPLAB, PROTEUS. ———————————————————— I. INTRODUCTION Nowadays many measurement instruments have been used in all laboratories throughout the world. Unfortunately, their accuracies are mostly proportional to the time period. As time passes, they may function incorrectly and generate some errors. The mistaken results from such instruments can cause serious problems in economic system and life safety since they will be used for validating product standards in the importing and exporting industries. In order to ensure that they work perfectly, the calibration process is required. In the past, the calibration has to be performed manually and this process usually takes long time. Presently, fully automatic calibration systems have been used worldwide and they play an important role in the calibration of measurement instruments. They can improve measurement accuracy, repeatability and minimize routine jobs. This system is to measure AC/DC voltage, current, diodes, temperature, connectivity, frequency and resistance using PIC microcontroller. To carry out the design consideration and production of a useful consumer product of PIC microcontroller. The whole process of the digital multi-meter is controlled by PIC 16F887 microcontroller. solid state electronics, from a control circuit to small embedded computers, has provided a wealth of convenience features in modern digital meters. Voltage sensing AC to DC Converter _____________________  Khawn Nue, Dr. KyawSoe Lwin and Hla Myo Tun Department of Electronic Engineering, Mandalay Technological University [email protected] LCD Display Probe PIC16F887 Temperature sensing Mode Selector Resistance sensing Range Switches Diode sensing Frequency sensing II. DIGITAL MULTI-METER SYSTEM A multi-meter or a multi-tester, also known as a volt/ohm meter or VOM, is an electronic measuring instrument that combines several measurement functions in one unit. A typical multi-meter may include features such as the ability to measure voltage, current and resistance. Modern multimeters are often digital due to their accuracy, durability and extra features. In a Digital Multi-meter the signal under test is converted to a voltage and an amplifier with an electronically controlled gain preconditions the signal. A Digital Multi-meter displays the quantity measured as a number, which prevents parallax errors. The inclusion of Current sensing Connectivity sensing Fig. 1 Block Diagram of Digital Multi-meter V. Software Implementation Software Implementation can be divided into sixparts: measuring voltage, measuring current, measuring resistance, measuring frequency, measuring continuity and measuring diode. Program for this system is composed of main Processing (sensing/ assigning/ displaying).Microcontroller is main processing unit in remote control system. PIC16F887is chosen to perform the functions needed for digital multi-meter system. 109 IJSTR©2015 www.ijstr.org INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 4, ISSUE 07, JULY 2015 ISSN 2277-8616 START Star Assign I/O Port LCD-Init(); DC-1V mode Yes DC-1mA mode Yes Yes Yes adc > 1023 adc > 1023 No No No No Read – Adc (1) Ful l Range Read – Adc (0) Full Range Ful l Range Adc = adc*0.977 Adc = adc*0.049 Display on LCD (1,10) Display on LCD (1,1) DC-50V mode Yes DC-1A mode Yes adc > 1023 Yes Yes adc > 1023 No No No No Read – Adc (1) Read – Adc (0) Full Ful Range l Range Ful l Range Adc = adc*0.977 Adc = adc*0.049 Display on LCD (1,10) Display on LCD (1,1) DC-500V mode Yes DC-10A mode Yes adc > 1023 No No No Yes Yes adc > 1023 No Read – Adc (1) Read – Adc (0) l Range FullFulRange Full Range Adc = adc*0.977 Adc = adc*0.049 Display on LCD (1,10) Display on LCD (1,1) AC-500V mode No Yes Yes adc > 1023 Temperature adc > 1023 No Read – Adc (0) Adc = adc*0.977 Ful l Range Adc = adc*0.049 Adc = adc*0.977 Display on LCD (1,1) Display on LCD (1,10) Full Range No No St op ? St op ? Yes Yes End End Fig.2 Flow Chart of voltage measurement Fig.3 Flow Chart of current measurement The flow chart of the voltage measurement system is shown in figure 2. At the start of the program, PIC needed to be initialized the I/O pins assigned and clock frequency. After that, the PIC receives the corresponding code from the specified pin.Firstly selection dc mode for 0-1V, 0-50V, 0-500V.For 0-1V, it will read between 0 to 1V. For more than 1V, it will be display full range.For 0-50V, it will read between 0 to 50V. For more than 50V, it will be display full range.For 0-500V, it will read between 0 to 500V. For more than 500V, it will be display full range.Similarly for selection ac mode. Current is the electron flow that causes electrical equipment to operate. When the equipment is turned on, it is considered a “load” on the circuit. A load is any electrical component, such as a lamp, stereo, motor or heating element, that draws current. Current is measured in amperes, or amps. Each load has a rated current limit that should not be exceeded. If a load pulls too much current, excessive heat is produced that may cause insulation damage, component failure and possible fire hazards. If the load is under its rated current limit, it may perform poorly. 110 IJSTR©2015 www.ijstr.org INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 4, ISSUE 07, JULY 2015 The flow chart of the current and temperature measurement system is shown in figure 3. At the start of the program, PIC needed to be initialized the I/O pins assigned and clock frequency. After that, the PIC receives the corresponding code from the specified pin.To test for current, first determine testing DC current. Then set the switch to the appropriate function DC current. To test for temperature, it is related for full -55 C to 150 C range and then an output voltage linearly proportional to the temperature in degree centigrade. ISSN 2277-8616 St art Yes Frequency No Read – RC 0 Interrupt Read St art Resist ance 1k Ohm Yes Display on LCD (2,10) Yes adc > 1023 No No Read – Adc (2) Ful l Range No St op ? Adc = adc*9.76 Yes Display on LCD (2,1) End Resist ance 10k Ohm Yes Yes Fig.5 Flow Chart of frequency measurement adc > 1023 No No Read – Adc (2) These digital multi-meters is measured in Hertz (Hz) the number of times per second a wave form repeats.The flow chart of the resistance measurement system is shown in figure5. Ful l Range Adc = adc*9.76 Display on LCD (2,1) Start Resist ance 100k Ohm No Yes Yes adc > 1023 No Read – Adc (2) Ful l Range Yes Adc = adc*9.76 Continuity Display on LCD (2,1) No Read – RC 1 No St op ? Yes End Fig.4 Flow Chart of resistance measurement Display on LCD (2,10) Resistance opposes the flow of current. The higher the resistance, the lower the current flow. Insulation used for cables has a very high resistance, impeding current flow. Conversely, the cable’s copper conductor has low resistance, facilitating current flow. Proper resistance is critical. Too much resistance in electric wires and connections can result in overheating and possible fire hazards, while too little resistance may result in a short or performance problems. Components called resistors help maintain proper resistance in equipment.The flow chart of the resistance measurement system is shown in figure 4. At the start of the program, PIC needed to be initialized the I/O pins assigned and clock frequency. After that, the PIC receives the corresponding code from the specified pin. To test for resistance, first turn the power off in the circuit or component for testing. No Stop ? Yes End Fig.6 Flow Chart of connectivity measurement Testing for continuity is used to test to verify if a circuit, wire or fuse is complete with no open connect test probe across two points of the circuit under testing. If continuity exists 111 IJSTR©2015 www.ijstr.org INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 4, ISSUE 07, JULY 2015 ISSN 2277-8616 built-in buzzer will sound and display on LCD “connect”. If continuity does not exists display “opened” on LCD. Start Yes Diode No Read – Adc (2) Adc= adc*0.4882 Fig. 9 Prototype design of Digital Multi-meter Display on LCD (2,1) DC 1mA LCD1 U1 LM016L 1 2 3 4 5 6 7 14 13 AN0 AN1 AN2 D0 D1 D2 D3 D4 D5 D6 D7 VSS VDD VEE Stop ? RS RW E No VI. TEST AND RESULT PHOTOS OF THE SYSTEM R1 DC 1V D0 D1 D2 D3 D4 D5 D6 D7 RS RW E VSS VDD VEE R2 10k 10k R3 R4 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 8 9 10 PIC16F887 SW1 10k AN0 dc 500V 1N4733A D1 SW-ROT-4 R3(2) C5 SW2 SW3 C6 90k R5 R6 1k 99k R8 R7 6.8k 660k C7 B1 50 D4 DIODE SW-ROT-4 SW-ROT-4 V1 R12R11R10R9 10k 10k 10k 10k VSINE 22uF Fig.10 Simulation result of voltage sensing C4 10k D1 SW-ROT-4 ac 500V 7 8 9 10 11 12 13 14 4 5 6 RE0/AN5 RE1/AN6 RE2/AN7 19 20 21 22 27 28 29 30 C0 C1 10k R3 SW1 AN0 AN0 1 2 3 RD0 RD1 RD2 RD3 RD4 RD5/P1B RD6/P1C RD7/P1D RB0/AN12/INT RB1/AN10/C12IN3RB2/AN8 RB3/AN9/PGM/C12IN2RB4/AN11 RB5/AN13/T1G RB6/ICSPCLK RB7/ICSPDAT 15 16 17 18 23 24 25 26 R2 10k LM016L dc 500V 1N4733A R1 C1 In this system, the digital multi-meter can be measured voltage, current, temperature,resistance, diode, frequency and connectivity. The operation of the digital multi-meter condition and result will display on LCD screen as shown in Fig. 8. DC 50V RC0/T1OSO/T1CKI RC1/T1OSI/CCP2 RC2/P1A/CCP1 RC3/SCK/SCL RC4/SDI/SDA RC5/SDO RC6/TX/CK RC7/RX/DT C4 DC 50V ac 500V RA0/AN0/ULPWU/C12IN0RA1/AN1/C12IN1RA2/AN2/VREF-/CVREF/C2IN+ RA3/AN3/VREF+/C1IN+ RA4/T0CKI/C1OUT RA5/AN4/SS/C2OUT RA6/OSC2/CLKOUT RA7/OSC1/CLKIN LD4 LD5 LD6 LD7 RS DC 1V If the probe connection is forward the LCD will show the approximate forward voltage drop of the diode. If the probe connection is reversed, only LCD “open” will be displayed. LCD1 EN End Fig.7 Flowchart of diode measurement 33 34 35 36 37 38 39 40 RS EN LD4 LD5 LD6 LD7 B6 B7 7 8 9 10 11 12 13 14 4 5 6 1 2 3 Yes RE3/MCLR/VPP C5 R4 R3(2) SW2 SW3 C6 90k R5 R6 1k 99k R8 R7 6.8k 660k C7 B1 49 D4 SW-ROT-4 SW-ROT-4 R12R11R10R9 V1 DIODE 10k 10k 10k 10k VSINE C1 R13 LD4 LD5 LD6 LD7 D0 DC 1mA 5k U1 33 34 35 36 37 38 39 40 19 20 21 22 27 28 29 30 C0 C1 R37 SW5 R15 DC 1A D1 10 SW6 D3 B2 R17 AN1 100V C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 8 9 10 DC 10A 0.5 D2 SW-ROT-4 SW-ROT-4 SW-ROT-4 1N4733A Temp R24R23R22R21 10k 10k 10k 10k U2 1k Ohm R19 R25 900 9k R27 R26 9k 90k R29 R28 90k 900k LM35 D4 10k Ohm SW7 AN2 PIC16F887 100k Ohm D3 SW-ROT-4 D5 R32 D5 SW8 SW9 D6 D7 SW-ROT-4 SW-ROT-4 1N4733A Diode Test Frequency Connectivity D2 5 1 RC0/T1OSO/T1CKI RC1/T1OSI/CCP2 RA0/AN0/ULPWU/C12IN0RC2/P1A/CCP1 RA1/AN1/C12IN1RC3/SCK/SCL RA2/AN2/VREF-/CVREF/C2IN+ RC4/SDI/SDA RA3/AN3/VREF+/C1IN+ RC5/SDO RA4/T0CKI/C1OUT RC6/TX/CK RA5/AN4/SS/C2OUT RC7/RX/DT RA6/OSC2/CLKOUT RA7/OSC1/CLKIN RD0 RD1 RB0/AN12/INT RD2 RB1/AN10/C12IN3RD3 RB2/AN8 RD4 RB3/AN9/PGM/C12IN2RD5/P1B RB4/AN11 RD6/P1C RB5/AN13/T1G RD7/P1D RB6/ICSPCLK RB7/ICSPDAT RE0/AN5 RE1/AN6 RE2/AN7 41.0 RS EN LD4 LD5 LD6 LD7 B6 B7 RE3/MCLR/VPP 2 AN0 AN1 AN2 2 3 4 5 6 7 14 13 SW4 15 16 17 18 23 24 25 26 3 1 VOUT RS EN 22uF DIODE C0 R36R35R34R33 10k 10k 10k 10k 10k SW10 C0 SW-SPDT-MOM C1 BUZ1 R20R18 B6 B7 R43R42 BUZZER 10k 10k 10k 10k Fig.11 Test and result of voltage sensing Fig.8 Simulation diagram of digital multi-meter 112 IJSTR©2015 www.ijstr.org INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 4, ISSUE 07, JULY 2015 LCD1 1k Ohm LM016L ISSN 2277-8616 R19 R25 900 9k R27 R26 9k 90k R29 R28 90k 900k D4 10k Ohm SW7 AN2 100k Ohm D3 D5 SW-ROT-4 D5 SW8 SW9 D6 D7 SW-ROT-4 SW-ROT-4 R32 1N4733A R36R35R34R33 10k DIODE 10k 10k 10k 10k 7 8 9 10 11 12 13 14 D0 D1 D2 D3 D4 D5 D6 D7 RS RW E 4 5 6 1 2 3 VSS VDD VEE Diode Test LD4 LD5 LD6 LD7 RS EN Fig.14 Simulation result of resistance sensing DC 1mA U1 1 AN0 AN1 AN2 2 3 4 5 6 7 14 13 33 34 35 36 37 38 39 40 RS EN LD4 LD5 LD6 LD7 B6 B7 RE3/MCLR/VPP RA0/AN0/ULPWU/C12IN0RA1/AN1/C12IN1RA2/AN2/VREF-/CVREF/C2IN+ RA3/AN3/VREF+/C1IN+ RA4/T0CKI/C1OUT RA5/AN4/SS/C2OUT RA6/OSC2/CLKOUT RA7/OSC1/CLKIN RC0/T1OSO/T1CKI RC1/T1OSI/CCP2 RC2/P1A/CCP1 RC3/SCK/SCL RC4/SDI/SDA RC5/SDO RC6/TX/CK RC7/RX/DT RD0 RD1 RD2 RD3 RD4 RD5/P1B RD6/P1C RD7/P1D RB0/AN12/INT RB1/AN10/C12IN3RB2/AN8 RB3/AN9/PGM/C12IN2RB4/AN11 RB5/AN13/T1G RB6/ICSPCLK RB7/ICSPDAT RE0/AN5 RE1/AN6 RE2/AN7 15 16 17 18 23 24 25 26 C0 C1 C4 C5 C6 C7 19 20 21 22 27 28 29 30 D0 D1 D2 D3 D4 D5 D6 D7 8 9 10 PIC16F887 R13 D0 DC 1mA 5k SW4 DC 1A R37 SW5 R15 10 D1 SW6 D2 5 D3 B2 R17 AN1 100V DC 10A 0.5 2 SW-ROT-4 SW-ROT-4 SW-ROT-4 3 R24R23R22R21 1 1N4733A 41.0 VOUT D2 Temp Fig.15 Test and result of resistance sensing 10k 10k 10k 10k U2 LM35 DC 1mA U1 1 Fig.12 Simulation result of current sensing 2 3 4 5 6 7 14 13 AN0 AN1 AN2 33 34 35 36 37 38 39 40 RS EN LD4 LD5 LD6 LD7 B6 B7 RE3/MCLR/VPP RA0/AN0/ULPWU/C12IN0RA1/AN1/C12IN1RA2/AN2/VREF-/CVREF/C2IN+ RA3/AN3/VREF+/C1IN+ RA4/T0CKI/C1OUT RA5/AN4/SS/C2OUT RA6/OSC2/CLKOUT RA7/OSC1/CLKIN RC0/T1OSO/T1CKI RC1/T1OSI/CCP2 RC2/P1A/CCP1 RC3/SCK/SCL RC4/SDI/SDA RC5/SDO RC6/TX/CK RC7/RX/DT RB0/AN12/INT RB1/AN10/C12IN3RB2/AN8 RB3/AN9/PGM/C12IN2RB4/AN11 RB5/AN13/T1G RB6/ICSPCLK RB7/ICSPDAT RD0 RD1 RD2 RD3 RD4 RD5/P1B RD6/P1C RD7/P1D RE0/AN5 RE1/AN6 RE2/AN7 15 16 17 18 23 24 25 26 C0 C1 C4 C5 C6 C7 19 20 21 22 27 28 29 30 D0 D1 D2 D3 D4 D5 D6 D7 8 9 10 PIC16F887 LCD1 D0 D1 D2 D3 D4 D5 D6 D7 7 8 9 10 11 12 13 14 RS RW E 4 5 6 1 2 3 VSS VDD VEE LM016L LD4 LD5 LD6 LD7 RS EN Fig.13 Test and result of current sensing DC 1mA U1 LCD1 1 LM016L D0 D1 D2 D3 D4 D5 D6 D7 RS EN LD4 LD5 LD6 LD7 B6 B7 2 3 4 5 6 7 14 13 33 34 35 36 37 38 39 40 RE3/MCLR/VPP RA0/AN0/ULPWU/C12IN0RA1/AN1/C12IN1RA2/AN2/VREF-/CVREF/C2IN+ RA3/AN3/VREF+/C1IN+ RA4/T0CKI/C1OUT RA5/AN4/SS/C2OUT RA6/OSC2/CLKOUT RA7/OSC1/CLKIN RB0/AN12/INT RB1/AN10/C12IN3RB2/AN8 RB3/AN9/PGM/C12IN2RB4/AN11 RB5/AN13/T1G RB6/ICSPCLK RB7/ICSPDAT LD4 LD5 LD6 LD7 7 8 9 10 11 12 13 14 RS RW E 4 5 6 RS EN 1 2 3 VSS VDD VEE AN0 AN1 AN2 RC0/T1OSO/T1CKI RC1/T1OSI/CCP2 RC2/P1A/CCP1 RC3/SCK/SCL RC4/SDI/SDA RC5/SDO RC6/TX/CK RC7/RX/DT RD0 RD1 RD2 RD3 RD4 RD5/P1B RD6/P1C RD7/P1D RE0/AN5 RE1/AN6 RE2/AN7 15 16 17 18 23 24 25 26 19 20 21 22 27 28 29 30 C0 C0 C1 Frequency Connectivity C4 C5 C6 C7 C0 SW10 C1 SW-SPDT-MOM BUZ1 B6 freq D0 D1 D2 D3 D4 D5 D6 D7 R20R18 10k 10k BUZZER B7 connect R43R42 10k 10k 8 9 10 PIC16F887 Fig.16 Simulation result of frequency sensing 113 IJSTR©2015 www.ijstr.org INTERNATIONAL JOURNAL OF SCIENTIFIC & TECHNOLOGY RESEARCH VOLUME 4, ISSUE 07, JULY 2015 ISSN 2277-8616 C0 Frequency Connectivity C0 SW10 C1 SW-SPDT-MOM BUZ1 B6 freq R20R18 10k BUZZER 10k B7 connect R43R42 10k 10k Fig.18 Simulation result of frequency sensing Fig.17 Test and result of frequency sensing VII. CONCLUSION A microcontroller is essential if an automated system is to be achieved. A PIC microcontroller (PIC16F887), together with some auxiliary components were chosen and implemented in the design for the reasons that have been addressed in the previous chapter and sections. This design had to establish physically how the circuit to work and by other hand we were programming and programming until the measure was desired. Nowadays, many measurement instruments have been used in all laboratories through the world. Unfortunately, their accuracies are mostly proportional to the time period. At time passes, they may function incorrectly and generate some errors. In this digital multi-meter can be easily to use the user and safety. The system is flexible and safer to use. Smart feature can be added or withdrawn as per requirement and hence design is fully cost effective. By modifying this system, it is more useful and real apply the world. DC 1mA U1 PIC16F887 LCD1 LM016L 15 16 17 18 23 24 25 26 19 20 21 22 27 28 29 30 8 9 10 ACKNOWLEDGMENT The author would like to thank to Dr. HlaMyoTun, Associate Professor and Head of the Department of Electronic Engineering, Mandalay Technological University for his help. And thanks to the supervisor, Dr. KyawSoeLwin, Lecturers, Department of Electronic Engineering, Mandalay Technological University for his guidance, support and encouragement. REFERENCES [1] C0 C1 C4 C5 C6 C7 D0 D1 D2 D3 D4 D5 D6 D7 “LM 78XX/ LM 78XXA Positive Voltage Regulator Data Sheet”, Available from. http://www.fairchildsemi.com/ [2] John Iovine, “PIC Microcontroller Project Book”(2000). [3] Gothmann W. H., “Digital Electronics - An introduction to Theory and Practice.” Prentice-Hall, Englewood Cliffs, NJ, USA, 1977. [4] Hd44780U (LCD-II), http://www.chipdocs.com/pndecoder/ HIT/HD47780U.html 2006 D0 D1 D2 D3 D4 D5 D6 D7 [6] Anonymous: Microchip Co,Ltd. “PIC16F8X Datasheet”, August (2006). LD4 LD5 LD6 LD7 7 8 9 10 11 12 13 14 4 5 6 RS RW E [5] Sedra Adel, S. and Smitch Ken, C: Microelectronic Circuits, Oxford University Press, New York (1998). RS 33 34 35 36 37 38 39 40 EN RS EN LD4 LD5 LD6 LD7 B6 B7 2 3 4 5 6 7 14 13 RC0/T1OSO/T1CKI RC1/T1OSI/CCP2 RA0/AN0/ULPWU/C12IN0RC2/P1A/CCP1 RA1/AN1/C12IN1RC3/SCK/SCL RA2/AN2/VREF-/CVREF/C2IN+ RC4/SDI/SDA RA3/AN3/VREF+/C1IN+ RC5/SDO RA4/T0CKI/C1OUT RC6/TX/CK RA5/AN4/SS/C2OUT RC7/RX/DT RA6/OSC2/CLKOUT RA7/OSC1/CLKIN RD0 RD1 RB0/AN12/INT RD2 RB1/AN10/C12IN3RD3 RB2/AN8 RD4 RB3/AN9/PGM/C12IN2RD5/P1B RB4/AN11 RD6/P1C RB5/AN13/T1G RD7/P1D RB6/ICSPCLK RB7/ICSPDAT RE0/AN5 RE1/AN6 RE2/AN7 VSS VDD VEE AN0 AN1 AN2 RE3/MCLR/VPP 1 2 3 1 Fig.19 Test and result of connectivity sensing 114 IJSTR©2015 www.ijstr.org
Copyright © 2024 DOKUMEN.SITE Inc.