60
EUROPEAN UNIVERSITY OF LEFKE FACULTY OF ENGINEERING DC VOLTAGE MEASUREMENT USING THE PIC MICROCONTROLLER AND PWM by Dursun Emre KALPAK A DISSERTATION SUBMITTED IN PARTIAL FULFILMENT OF THE REQUIREMENTS FOR THE DEGREE OF BACHELOR OF SCIENCE IN ELECTRICAL AND ELECTRONIC ENGINEERING August 2015 Supervisor: Assist. Prof. Dr Samet BİRİCİK

DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

Embed Size (px)

Citation preview

Page 1: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

EUROPEAN UNIVERSITY OF LEFKE

FACULTY OF ENGINEERING

DC VOLTAGE MEASUREMENT USING THE PIC

MICROCONTROLLER AND PWM

by

Dursun Emre KALPAK

A DISSERTATION SUBMITTED IN PARTIAL

FULFILMENT OF THE REQUIREMENTS FOR THE

DEGREE OF BACHELOR OF SCIENCE

IN

ELECTRICAL AND ELECTRONIC ENGINEERING

August 2015

Supervisor:

Assist. Prof. Dr Samet BİRİCİK

Page 2: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 2 -

To my parents,

Hayati and Aysel KALPAK

Page 3: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 3 -

Abstract

In this thesis, the microprocessor with dc voltmeter checking the voltage applied to

the two separate entrance with based on the principle of. I plan to use the IC as a pic16f877a

microcontroller. In summary, if I open the circuit when the voltage applied to the principle of

two separate working voltage depending on the status of the pulse width modulation from

the ayriyet that is a square wave. Square wave in the range of 1-20 KHz frequency range of

frequency, it is now possible to integrate pic16f877a. We can see these two sepa-

rate voltage on the LCD.

This project today, so dc PWM motor with control or servo motor control led

brightness can be controlled electronic elements such as. In the future, more advanced stages

can be controlled with the PIC. Also taking advantage of the hardware and software integrat-

ed PWM module pic16f877a PWM. This voltmeter from 0 to 100 Volts measurement. Can

be adjusted with two separate potentiometer.

Page 4: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 4 -

Declaration

I understand the nature of plagiarism, and I am aware of the University’s policy on this.I cer-

tify that this dissertation reports original work by me during my University project except for

the following (adjust accordingly):

The PIC-C code taken help Mr. Ahmet GÜÇLÜOĞLU

The details about devices and parameters are taken from datasheets

The using micro C PRO taken help Mr. Hakan NOYAN

The Circuit Design taken Help Mr. Hakan NOYAN

Signature Date:

Page 5: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 5 -

Acknowledgement

First of all, I would like to thank my supervisor Assist. Prof. Dr. Samet BİRİCİK

who has given me plenty encouragement, support and guidance. My cousin is high Electron-

ic Engineer Mr Hakan NOYAN deserves special thanks for help and his constant motivation

throughout this thesis. I am also thankful for the contributions and comments the teaching

staff of the Department of Electric and Electronic Engineering, especially Assist. Prof. Dr.

Soydan REDİF, Assist. Prof. Dr. Hüseyin ADEMGİL and Assist. Prof. Dr. Yönal KIRSAL for

their and Assist. Prof. Dr. Ahmet ARCA and Assist. Prof. Dr. Server KASAP for their great

advice.

Page 6: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 6 -

Table of Contents

Abstract.................................................................................................................... 3

Declaration .............................................................................................................. 4

Acknowledgement ................................................................................................... 5

Table of Contents ............................................. .................................................... 6-7

List Of Figures ...................................................................................................... 8-9

1.1 Chapter-1 introduction .................................................................................... 10

1.2 Scope and Objectives ...................................................................................... 11

1.3 Achievements .................................................................................................. 11

CHAPTER 2 ELECTRONIC CIRCUİT DESİGN...........................................................12

2.1 Transformer ..................................................................................................... 13

2.2 Voltage Regulator-(LM7805) .......................................................................... 14

2.3 LCD-(Liquid Crystal Display) ........................................................................ 15

2.4 Zener diode ...................................................................................................... 16

2.5 Led - (Light Emitting Diode) .......................................................................... 17

2.6 Diode ............................................................................................................... 18

2.7 Potentiometer ................................................................................................... 19

2.8 Trimmer-(10K) ................................................................................................ 20

2.9 Capacitors ........................................................................................................ 21

2.9.1 Ceramic Capacitor ................................................................................... 21

2.9.2 Electrolyte capacitor ................................................................................ 21

2.10 Bridge Diode ................................................................................................. 22

2.11 Crystal Oscillator ........................................................................................... 23

2.12 Resistor .................................................................................................................... 24

CHAPTER 3 MICROCONTROLLER AND PWM ............................................. 25

3.1 MICROCONTROLLER.................................................................................. 25

3.1.1 What is the Microcontroller ....................................................................... 26

3.1.2CPU-(Central Processing Unit) .................................................................. 27

3.1.3 Memory ..................................................................................................... 28

3.1.4 BUS-(Connection Paths) .......................................................................... 29

3.1.5 Address Bus .............................................................................................. 29

3.1.6 Data Bus ................................................................................................... 29

3.1.7 Register .................................................................................................... 30

Page 7: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 7 -

3.2 PIC-(PROGRAMMABLE INTERFACE CONTROLLER) .......................... 31

3.2.1What is the PIC Microcontroller .............................................................. 31

3.2.2 PIC Microcontrollers Memory Types ..................................................... 31

3.2.3 Why PIC Microcontroller is preferred .................................................... 32

3.2.4 PIC16F877A PROPERTIES...................................................................32

3.2.5 Programming PIC 16F877A .................................................................... 32

3.2.6 PIC16F877A Block Diagram .................................................................. 33

3.2.7 PIC16F876/877A REGISTER FILE MAP ............................................ 34

3.3 PULSE WIDTH MODULATION-(PWM) ............................................... 35-37

3.4 MicroC Pwm Functions .................................................................................. 38

3.4.1 CCP(CAPTURE/COMPARE/PWM) .................................................... 39

3.4.2 Capture Mode ........................................................................................ 39

3.4.3 Compare Mode ..................................................................................... 40

CHAPTER 4 ELECTRONIC CIRCUIT DESIGN ............................................... 41

4 PCB (Printed Circuit Board) .............................................................................. 42

4.1 What is the PCB ......................................................................................... 42

4.2 PCB 3D Circuit Design ............................................................................. 43

4.2.1 Isis Circuit Diagram............................................................................44

4.2.2The materials required to make the printed circuit board ..................... 45

4.2.3 Ares Circuit Diagram. ........................................................................... 45

4.2.4 General Appearance Of The Circuit ..................................................... 46

CHAPTER 5 ELECTRONIC CIRCUIT MATERIALS ...................................... 47

5.1 REQUIRED MATERIALS ............................................................................. 48

5.2 REQUIRED SOFTWARE ......................................................................... 48

5.3 I use pictures of electronic material ..................................................... 49-50

CHAPTER 6-RESULT .......................................................................................... 51

6.1 Conclusion ....................................................................................................... 51

6.1.1 Summary ...................................................................................................... 51

6.1.2 Future Work .................................................................................................. 51

6.1.3 References ............................................................................................... 52-53

6.1.4APPENDIX ................................................................................................... 54

PIC C CODE ................................................................................................... 54-57

Page 8: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 8 -

List of Figures

Figure-2.1: Transformation Schematic ................................................................ 13

Figure-2.2.This Project is LM7805 ...................................................................... 14

Figure-1.3. LM7805 pin out diagram and connectors ......................................... 14

Figure 1.4-Lcd Schematic Circuit ....................................................................... 15

Figure-1.5-Zener Diode Symbol ......................................................................... 16

Figure-1.6 Zener diode characteristics ................................................................ 16

Figure-1.7 Led Diode Symbol ............................................................................. 17

Figure-1.8 Led Diode Characteristics ................................................................. 17

Figure-1.9 Diode Symbol .................................................................................... 18

Figure-1.10-Diode characteristic ......................................................................... 18

Figure-1.11 Potentiometer Symbols .................................................................... 19

Figure-1.12 Tripod Symbol and Schematic ........................................................ 20

Figure-1.13 Capacitor Symbols .......................................................................... 21

Figure-1.14 Ceramic Capacitor Circuit ............................................................... 21

Figure-1.15 Bridge Diode Symbol ...................................................................... 22

Figure-1.16 Bridge Diode Symbol-2 .................................................................... 22

Figure-1.17 Crystal Oscillator Symbol .............................................................. 23

Figure-1.18Crystal OscillatorSymbol 2...............................................................23

Figure-1.19 Resistor Circuit ................................................................................ 24

Figure-1.20 Resistor circuit-2 .............................................................................. 24

Figure-2.1 Microcontroller Block Diagram ........................................................ 26

Figure 2.2 CPU-(Central Processing Unit Diagram)[ .......................................... 27

Figure-2.3 Typical Memory is Schematic .......................................................... 28

Figure 2.4.BUS-Connection Paths ...................................................................... 29

Figure 2.5 Register Block Diagram .................................................................... 30

Figure 2.6 Pic16f877a pin connection ................................................................ 33

Figure 2.7 PIC16876A/877A register file map ................................................... 34

Figure 2.8 PIC16F877A Chip ............................................................................. 34

Figure 2.9 A variety of Signals Obtained with the Arduino PWM Technique ..... 36

Figure-2.10 Pwm is isis % 50 Duty Cycle-(128) ................................................. 37

Figure-2.11 Pwm is isis % 75 Duty Cycle-(192) ................................................. 37

Figure 2.12 Pwm is isis % 25 Duty Cycle-(64) ................................................... 37

Page 9: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 9 -

Figure 2.1Using Internal PWM Module PIC Microcontroller Circuit Diagram .. 38

Figure 2.14 Ccp Recorders ................................................................................... 39

Figure 2.15 CCP X CON Register ....................................................................... 39

Figure 2.16 Capture Section ................................................................................. 40

Figure 2.17 Compare Section ............................................................................... 41

Figure 3.1 PCB Two Channel Voltmeter Circuit Design ..................................... 43

Figure 3.2-Pcb Circuit Voltmeter Ares ................................................................. 43

Figure 3.3 Two Channel Voltmeter Isis Schematic .............................................. 44

Figure 3.4 Pcb Two Channel Voltmeter Circuit Design ....................................... 45

Figure 3.5 General view Of Project ..................................................................... 46

Page 10: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 10 -

CHAPTER 1 INTRODUCTION

This graduation project has two separate channels using microcontroller is based on the principle

of controlling the applied voltage. In this thesis I used pic16f877a chip.a voltage of 9 volts to 5 volts

from the voltage regulator by the first transformer is lowered, and we'll give you 5 volts VDD at the

end of a bitch. Then this comes to the end of 9 volt VSS LCD, and the LCD works. Then two separate

two separate voltage is applied from the terminal, the microprocessor makes this comparison.

When this comparison is made using the voltage from the PWM module 16 the bastard's leg as

a percentage of a square wave consists of between 1 per cent and 100 per cent. Minimum PWM fre-

quency is 1kHz and 20 kHz is applied to between the ranges. Integrated crystal oscillator frequency 10

MHz microprocessor.

The measured ranges between 0 and 100 volts minimum voltage of this circuit. Also a refer-

ence voltage and a voltage on both at the time when the voltage pulse width modulation, i.e., we can

make the square wave is zero. We can also directly apply 100 volts from a separate entrance.

When we apply two separate voltage from both terminals, this voltage can be set with the po-

tentiometer. Also we can adjust the calibration by using two other wise. As a result, this thesis also a

pic by using two separate voltage we can achieve by making a comparison of the status of the PWM

according to the situation.

Page 11: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 11 -

1.2 Scope and Objectives

The scope of this project and purpose by programming the microprocessor may be any device

or comparator circuits providing control of the device, such as a motor or systematically runs. But the

project by providing a measurement of the voltage of the comparison voltage at the lower and upper

limits and can give us the proper information through any two PIC.

Also with this project by generating a square wave a square wave is produced at different rates

according to the condition of the two voltages can we be that the "duty cycle". A square of 50 percent

if we want to Micro-128 proportionally 50 percent to us like when we write the C Program will give

you a square wave.

1.3 Achievements

In this project, we briefly compared our data on two separate channels in PWM hardware the

applied voltage can be achieved at different rates and the bastard that we have seen. Also in this circuit

the PWM frequency ranges we can see

Page 12: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 12 -

CHAPTER-2 ELECTRONIC CIRCUIT ELEMENTS

DEFINITION

Page 13: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 13 -

2.1 Transformer

Transformers the windings of the voltage that is applied to one of the other alternative via

electromagnetic induction windings at the same frequency and the same power at different

voltage and current values allows us to obtain, stationary electric machines. Usually used

in power transmission and distribution transformers, as well as there are places where it is

used in electronics. After the production of electricity in power plants where it will be used

must be delivered to residential areas.[31]

Figure-2.1: Transformation Schematic [1]

This power loss occurs during transmission in the form of heat and voltage drop in the line.

Or at least to bring them up to the level of conductive wires or the voltage increase of the

cross section must be increased. The cost to increase the conductor size will be very large

with very high levels by the introduction of voltage transformers, because this problem is

solved. Is raised when current decreases when the voltage is constant power, thus heat be-

cause of the resistance to movement of the conductor and, consequently, the energy loss is

reduced.

In Turkey, 220 V and 380 V low voltage networks medium voltage networks 10 kV, 15 kV

and 33 kV, 66 kV and 154 kV high voltage networks, high voltage 380 kV networks are

used. The energy produced in power plants low voltage transformers are used for convert-

ing the desired level of transmission and distribution lines. Transformers for electrical

energy is converted to another voltage level voltage level, considering that the power is

constant, the voltage rises when voltage drops when current drops or rises. Therefore, when

a very high voltage is used in energy transmission lines can be reduced to quite small val-

ues of current.

Page 14: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 14 -

2.2 Voltage Regulator-(LM7805)

A voltage regulator circuit that can be used in almost every circuit element. Typically, the

microprocessor is an electronic circuit which provides 5 volts to the pic chip in. The voltage

regulator lm7805 integrated between 9-12 volts when the voltage is applied to the input of

the output steady 5 volts can be obtained. Voltage regulator consists of three legs. Input,

output, and ground.1 leg of pic16f877a in this thesis is applied to integrated, and takes it to

the pic chip. Finishing below shows the voltage regulator on the project.

Figure-2.2.This Project is LM7805

Leg of the voltage regulator 1 Input 2 input land a leg, with the legs 3 is output. This elec-

tronic circuit to the input of 9-12, 5 V is obtained at the output of the voltage applied to 24-

36 in different ways. Lowered the voltage from the transformer is reduced to 9 volts in this

project there is obtained 5 volts is applied to the output of the lm7805 No. 1 in the leg. This

voltage is applied to the input at the bastard.[32]

Figure-2.2.3. LM7805 pin out diagram and connectors[2]

Page 15: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 15 -

2.3 LCD-(Liquid Crystal Display)

LCD liquid crystal display a liquid crystal display which is electrically polarized and the po-

larization of the light pass filter single-phase liquid is added to the front that can be seen

with the eye based on the principle of display technology. Thermotropic liquid crystals in

the LCD according to the structure of matter temperature and liyotropik and more can be

found. Nomadic phase liquid crystals, thermo tropic liquid crystals, which is a sub group,

what matic curling (twisted pneumatics - TN) is called a variant of the voltage of the current

applied, depending on what will become the flat position matik not so curly. What MATIC

liquid crystals, LCDs, liquid crystal phase is possible. LCDs should be polarized light, po-

larized light should be able to pass liquid crystals, the molecular alignment of the liquid

crystal must be replaced with an electric current and an electrically conductive structure.

Below shows the shape of the LCD screen.

Figure 2.3-Lcd Schematic Circuit[3]

Robot LCD panels for use in projects or automation projects using a pic microcontroller,

you can control your computer's serial or parallel port or. According to the number of rows

and columns in the LCD panel market, 1x8, 2x8, 1x16, 2x16, 1x20, 2x20, 1x40, 2x40, such

as are available in different sizes. Among these robot projects widely 2x16-sized LCD pan-

els are used. Produced today in the majority of the LCD panel in a single row 16 pin

location. The first 14 of the last two if this pin to control the backlight is used. Some LCD 's

that is used to control pin 14 2 7 ranks can be found. This graduation Project 2*16 LCD us-

ing the LCD the purpose of better programming. Also the LCD seven-segment display is

more useful. So I used the LCD.[33]

Table.1 Lcd Pin Definitions[4]

Page 16: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 16 -

2. 4 Zener diode

Zener diode, in general, composed of P and N semiconductor material, silicon diode struc-

tured a special variety. The main aim is to keep constant the voltage applied to the ends. Do

not flow in this direction until the voltage exceeds a certain value. This zener voltage (re-

fraction) is called the voltage and is expressed in the VZ. Zener diode symbol shows below

Figure-2.4-Zener Diode Symbol[5]

The circuit operates like a normal diode when it is bound to be the correct polarmal. How-

ever, in the case of reverse bias, Zener voltage and is connected electrically to the element

that works on the principle of protection. So often connects to reverse Zener diodes for pro-

tection purposes. Zener diode symbol below shows.In this project, the use of Zener diodes

voltage 100 volts 100 volts to 0 so we can apply also to stabilize the voltage was used.

shows the operating characteristics of the Zener diode. he Zener voltages of Zener diodes

typically have been defined by also. When Zener diode Zener 30V corresponds to the volt-

age of said 30V. For example, my project has a Zener voltage of 100 volts when I mean it.

[34]

Figure-2.4.1 Zener diode characteristics[6]

Page 17: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 17 -

2.5 Led-(Light Emitting Diode)

LED (light emitting diode) P-N-semiconductor to emit light in the direction of transmission

and kutuplandig if a function is designed. This light red, green, yellow, or infra-red may be

of various colors such as. As in a normal diode, the LED has a threshold voltage of little

value. When this threshold is exceeded the function to transmit the voltage resistance de-

creases and the current begins. Use of LEDs with a resistor in the circuit the current should

be limited. Depends on the amount of current passing through the light emitted by the

LEDs. This current may be a direct current or pulsed current. Nowadays LEDs are usually

operated in a pulsed regime. The reason for this is desired in the pulse regime, the light in-

tensity is obtained. The LED gives light when current is applied in the direction of

transmission. Below is seen a symbol of a LED diode.

Figure-2.6 Led Diode Symbol[7]

Typical rise and fall times of LEDs lies in the order of nanoseconds. This is a fast answer

for optoelectronic systems, high-speed switching is used as the transmitter beam. The oper-

ating life of the LEDs is very long. Working hours to 100,000 hours.

Figure-2.6.1 Led Diode Characteristics[8]

Making light of the LEDs and Electrical Characteristics p-n and plugging in the direction of the gate

with a voltage applied in the forward direction in the case of the recombination of the electrons is

based on real events. The operation of the LEDs is based on the principle of converting electrical en-

ergy into the optical light. The spectrum of the light emitted from the LEDs is located in the visible

and infrared regions of the electromagnetic spectrum. LEDs are Semiconductors that makes

kutuplandig in the direction of transmission of electromagnetic radiation. The wavelength of this ra-

diation depends on the material used and the additives. Microprocessor are typically used for projects

led.

Page 18: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 18 -

2.6 Diode

The basic building block of electronic circuit elements of the semiconductor diodes. All

transistors, logic gates, integrated circuits are manufactured from a combination of diodes.

In general, diode, current pass in one direction, the other direction to flow in electronic cir-

cuits. In short, that allows current to pass through in only one direction through the

element.Below is seen a symbol diode. I used two 1n4007 diodes in the graduation pro-

ject.We aimed to apply 100 volts to the purpose of use.

Figure-2.6 Diode Symbol[9]

If the diode is polarized correctly, i.e., the anode is positive (+) and a negative voltage is

applied to the cathode over becomes conductive if the voltage applied, and the heat in direct

proportion to the amount of current starts to flow.The maximum that can be applied depend-

ing on the structure of each diode is manufactured correct bias voltage, operating

temperature, tape and the amount of current that can pass through when it is manufactured,

prepared stated in the catalog. These values should not be exceeded.Below shows the oper-

ating characteristics of the diode.

Figure-2.6.1-Diode characteristic[10]

Page 19: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 19 -

2.7 Potentiometer

Potentiometer, the resistance value is changed on the outside of physical interventions.

One with a higher current rating of the potentiometer rheostat is called stronger. A resistive

element made of carbon or a carbon content of more potentiometers. Rheostat with chrome-

nickel resistance wire is made from. It is used to divide the voltage or the current limit po-

tentiometer in the circuit. Two separate voltage with a potentiometer in my project my

graduation in two separate two 220 K from 0 to 100% increase. Below shows the symbol of

the potentiometer.

Figure-2.7 Potentiometer Symbols[11]

The adjustment process adjustment potentiometer on the arm (shaft) is done through. Thus,

the level of electricity electronic devices through the user the desired setting in each case,

the potentiometer is used. Potentiometer (adjustable resistance) a (rheostat) is a variety of.

The sliding resistance of the potentiometer is the simplest meaning of a kind. The other is

that the resistance value of the resistance value can be changed. The resistance value of the

sliding potentiometer is very high.[35]

Page 20: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 20 -

2.8 Trimmer-(10K)

Electronic circuits and the setting of potentiometer or trimmer won't change for a long time

with a screwdriver adjustable potentiometer is called wise. A wise has three legs. When

used as a voltage divider typically, the supply voltage to a trimmer leg and the movable leg,

the other leg is used to retrieve the output are connected to ground. If such a variable is to

be used as the variable resistance is connected to the ends of the earth if three. In my project

I used two 10K two wise. The purpose of these two trimmer two separate channels, I'll

measure the voltage for calibration purposes for are used. Such a symbol is seen below

Figure-2.8 Tripod Symbol and Schematic[12]

It is not recommended to leave idle for any leg of the trimmer in this case because as a wise

connected load changes, the voltage varies a lot. Ultimately, even the slightest deviation

from the full set of such resistance, the voltage divider can do as good a job.[36]

Page 21: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 21 -

2.9 Capacitors

Structurally it consists of a capacitor insulator placed between two conductive plates. Con-

ductive dielectric between the plates is called the power of proof in the sense that poured to

the substance. A capacitor as a dielectric substance; mica, paper, polyester, metal, paper, ce-

ramic, tantalum, etc. materials can be used. Electrolytic and tantalum capacitors thing we

could do, and therefore only DC-powered circuits, they can be used. Non-polar capacitors in

circuits with DC or AC can be used. In my project, I used two ceramic capacitor electrolyte

capacitor of the capacitor and the other someone.

Figure-2.9 Capacitor Symbols[13]

2.9.1 Ceramic Capacitor

This ceramic is used as a dielectric material in a capacitor. The same amount of ca-

pacity ceramic capacitors, paper capacitors in much smaller sizes than can be

obtained. Ceramic capacitors are physically manufactured in tube or disk format. A

disc-shaped ceramic capacitors “capacitor is referred to as lentils.

Figure-2.9.1 Ceramic Capacitor Circuit[14]

2.9.2 Electrolyte capacitor

Boraksli electrolytes in electrolytic capacitors as a dielectric material boric acid solu-

tion or services. Aluminum or tantalum plates are conductive plates. Electrolytic capacitors

polar or non-polar as are produced. When connecting to the terminals of the capacitors to

the plus and minus pole of the DC circuits should be considered.

Page 22: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 22 -

2.10 Bridge Diode

o The bridge rectifier is to convert alternating current to direct current my fastest and

economical way.The correct voltage is applied to the input diode bridge that converts

the voltage of the alternative.The same structure of the diode Bridge connected in suit-

able manner with a normal PN diode, which have four combinations is obtained.Two or

four diodes Bridge says there are varieties.The input and output legs for ease of connec-

tion a socket connection can be made in the way that is ejected to the outside.

Figure-2.10 Bridge Diode Symbol[15]

o One diode, two diodes of the diode Bridge full-wave rectifier circuits used in the pro-

duction of transformer triple middle. Three-legged open her legs on the edge of whether

these diodes, the DC output from the legs in the middle. Today, these diodes has been

used very little. Diode Bridge seen in the picture below. In my project, it says 100 volts

DC AC voltage from the transformer and Zener to fix it is to turn through.[37]

Figure-2.10.1 Bridge Diode Symbol-2[16]

Page 23: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 23 -

2.11 Crystal Oscillator

The Frequency Stability of the oscillator is very important. The ability to remain at a fixed

frequency from an oscillator "Frequency Stability" is called. RC and LC oscillators and Fre-

quency Stability is not good. The transmitter circuit Frequency Stability frequency crystal

controlled oscillators are used for which is best allocated. An oscillator in RC or LC, L, C and

R values, the variations in transistor amplifiers, the static operating point, changes in the sta-

bility of the frequency due to environmental changes such as temperature and humidity

varies.10 MHz crystal oscillator 1 of my graduation in my project.

Figure-2.11 Crystal Oscillator Symbol[17]

Crystal, the piezoelectric effect is a component that works with. The property exhibits natural

crystal piezoelectric elements; quartz (quartz), Rochelle salt, tourmaline. Usually when Ro-

chelle salt crystal microphone is used in the oscillator due to the Frequency Stability of quartz

is used. Mechanical pressure between the opposing faces of the quartz crystal when a voltage

is applied on one side occurs.

Figure-2.11.1-Crystal Oscillator Symbol-2[18]

Page 24: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 24 -

2.12 Resistor

Resistance to electronic current limiting and voltage dividing circuits, a two-pronged element.

Briefly resistance; the difficulty of showing the flow of electrical current, we can say. Their

intended use; the current limit, the voltage lowering circuit of the load and the current set of

substances such as can give examples. Resistors used in electronic circuits, various film mate-

rials and alloys (e.g. nickel-chromium alloys, such as high resistant) and are made from

materials such as wire. Virtually all electronic circuits Analog integrated circuits from the dig-

ital circuits. Below shows the symbol of the resistance.

Figure-2.12 Resistor Circuit[19]

There are two important parameter of the resistance. These are, it should be recalled that the

value of the resistor and the power of resistance. The market value of a few ohms of resistance

MΩs are produced to order. It should be recalled that in the market, the values and the various

power resistors. It should be recalled that with the value of the resistor, there is no relationship

between the physical size. with a value of 100 Ω resistor 1 MΩ resistor can be a value of the

same size. Determines the size of the resistor elements is the power of resistance. High power

resistor sizes too big. My graduation project 11th one resistor.

Figure-2.12.1 Resistor circuit-2[20]

Page 25: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 25 -

CHAPTER 3 MICROCONTROLLER AND PWM

Page 26: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 26 -

3.1 MICROCONTROLLER

3.1.1 What is the Microcontroller

Microprocessor, memory and input and output units throughout the structure that holds the

microcomputer; an integrated circuit chip that contains the CPU, the microprocessor is called.

In fact, the simplest computers with microprocessors, and are reviewed in Section 3 The basic.

[38]

CPU-(Central Processing Unit)

Memory

Hardware-(input and output units)

Figure-3.1 Microcontroller Block Diagram [21]

Page 27: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 27 -

3.1.2CPU-(Central Processing Unit)

CPUS, microprocessors, and is known as the brain of the computer and data processing part of

the data flow between the various units of fulfilling tasks. The lower unit of the CPU of the

control part performs the data flow. Read from the memory and decodes the commands by the

command performs the specified operation. Most of the data processing in the CPU Alu

(arithmetic logic unit) is performed. Numeric arithmetic functions, logical operations, and

control are among the basic functions of the CPU. The information temporarily stored in the

CPU register. Registers within the CPU 8,16,32 or 64-bit. The blog below shows a diagram

CPU.

Figure 3.1.2 CPU-(Central Processing Unit Diagram)[22]

The requested command to read the content of the program counter on ways to address this, is

to call and find. Within the CPU, the command decoder(instruction decoder unit is also avail-

able. By interpreting the meaning of the incoming command to the CPU, this unit acts as a

kind of dictionary. Generates control signals according to the meaning of the command.

Page 28: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 28 -

3.1.3 Memory

The instructions and data of the memory where the program is first loaded. The program is

based on commands and data hiding here. Directly access the CPU memory units are called.

For this reason, often known as a memory element, the memory element so that the hardware

isn't actually an element of Environmental Science harddisk.

Figure-3.1.3 Typical Memory is Schematic[23]

RAM (random access memory) temporary memory means and the random access memory by

the computer while programs are running. Shut down the computer in case of data is lost.

ROM (read only memory) read-only memory means. ROM information in the event of any

power interruption is continuous and the information will not be lost. We can give you the

BIOS as the Roman example. The first working of the pcs program.

Page 29: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 29 -

3.1.4 BUS-(Connection Paths)

CPU, memory and input/output devices to the information on the computer connections and

allows it to be transported from one place to another. The address of each computer,a data bus

and a Control Bus including 3 kinds of.

Figure 3.1.4.BUS-Connection Paths[24]

3.1.5 Address Bus

The source and destination of the data addresses. Address BUS width determines the maxi-

mum memory capacity of the system. For example, in a 16-bit microprocessor BUS adress

max memory 64 kilobytes. Address of the path width is a combination of more than one pro-

cess at the same time deliberate. For example, if the path width 8-bit 256 pieces address

address. Intel's 8086 processor, this width 20 bit, PENTİUM II 36 bits. Address uses more

RAM and processor expands the path Buddha will cause an increase in performance. Address

Bus, one-way.

3.1.6 Data Bus

Microprocessor by memory or output units send data or from memory or input are used once

the unit of memory data. Carry data and this data could be a command or data. The data path

width affect the computer's performance. The ability to read data at the same time increases

your speed. For example Intel 8085 microprocessor data path width models of 8 bit,

PENTIUM is at 64 bits. The parallel wire can be defined as channels of communication. Data

paths is two-fold.

Page 30: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 30 -

3.1.7 Register

The register is in the CPU memory units. The more the merrier. Widths vary according to the

CPU. Requires a certain time to reach the in-memory data. But when asked to register are pro-

cessor kernel and waste a lot of time before content can be used. The following register block

diagram. Expressed by a limited number of General according to the intended use and or can

be used as special-purpose. Expressed by 32 bit (EAX, EBX, ECX), 16-bit (AH, BH, CH,

etc.).

Figure 3.1.7 Register Block Diagram[25]

Page 31: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 31 -

3.2 PIC-(PROGRAMMABLE INTERFACE CONTROLLER)

3.2.1 What is the PIC Microcontroller

Microchip produces, the name of the Peripheral Interface Controller (environmental control

unit interface) statement from the PIC, input-output (input-output i/o) operations that are de-

signed to perform a very fast chip. For the purposes of the work of the PIC microcontrollers

fast RISC (Reduced Instruction Set Computing) processors have been designed as well. I

mean this quite a few number of commands in the microcontroller. Commands are processed

in a single cycle, increasing the speed from the microcontroller. PIC16 microcontrollers "go

to" and "call", as well as routing commands are processed in a single cycle, all commands oth-

er than

Harvard architecture is used in the architecture of the PIC Microcontroller. Harvard in the ar-

chitecture of the program and data storage memory are separate from each other. In this case,

the program uses the same structure to store data and Von Neumann architecture according to

the microcontroller is a little more expensive over time, even if it means they are advances in

technology that eliminates the price difference. Program memory data memory static RAM

used in, rather than the flash memory used in hızlıdr. For this reason, the Harvard architecture

microcontrollers is much faster.[39]

3.2.2 PIC Microcontrollers Memory Types

EPROM ( Erasable Programmable Memory )

Sign up with EPROM memory electrical signal. If you installed the program to

change the EPROM eraser to wipe out devices with ultraviolet light exposure.

EEPROG ( Electrically Erasable Programmable Memory )

Microchip's FLASH memory, also termed this memory is different than the type of

EPROM memory quickly with the side of the electrical signal is the opportunity to do the de-

letion.

Page 32: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 32 -

3.2.3 Why PIC Microcontroller is preferred

A wide range of mass produced about programming with the PIC used by software

and hardware is too much, and easy to find. Simple electronic circuit elements can be

prepared using the equipment (programming cards) can be programmed. In the case

that the reset and clock signal and power circuits is very simple.

3.2.4 PIC 16F877A PROPERTIES

8 Kbytes of FLASH Program Memory

368 bytes of Data Memory (RAM)

256 bytes of EEPROM Data Memory

33 input or outputs pins

20 MHz operating speed(200 ns instruction cycle)

Max 25 mA Current from an output pin

3.2.5 Programming PIC 16F877A

C code (mikroC PRO for PIC)

mikroC PRO for PIC convert to Hexadecimal

parallel port

series port

2 PWM 10-bit

CCP(Capture/Compare/PWM)

Page 33: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 33 -

3.2.6 PIC16F877A Block Diagram

Figure 3.2.6 Pic16f877a pin connection[26]

Page 34: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 34 -

3.2.7 PIC16F876/877A REGISTER FILE MAP

Figure 3.2.7 PIC16876A/877A register file map[27]

Figure 3.2.8 PIC16F877A Chip[28]

Page 35: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 35 -

3.3 PULSE WIDTH MODULATION-(PWM)

Stands for Pulse Width Modulation, so that the signal width modulation techniques, signal pro-

cessing or signal transmission more electronic circuits as well as Arduino or electrical machines

located on the custom application areas such as technique. Also PIC is integrated, so you can be manu-

factured in Hpwm pwm module. In its simplest form can be defined as a signal modulation technique.

Suitable for the transport of the signal information in addition to the purpose of power control and

won't fade, electric machines, solar battery charging units as our aim is to support private circuits. Also

dc motor control, servo motor control in PWM motor control technique is like.

Two-channel dc voltmeter project located within the integrated pwm module used in the Pıc .Pwm

is technique used to generate output signal using digital signals. It is commonly used to control aver-

age power delivered to a load, motor speed control generating analog collage levels and for generating

analog waveforms.CCP Modules area available with a number of PIC Microcontrollers.CCP stands for

Capture/Compare/PWM. Using PWM module is far more easier and cost effective than using extra

chips for PWM which makes our task every simple.

The Foundation produces square wave PWM technique. This square wave is usually in reference to

the average of the wave took up in size. In addition, the size of the waves in the system is directly pro-

portional to the size of the task cycle.[40]

Page 36: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 36 -

Figure 3.3 A variety of Signals Obtained with the Arduino PWM Technique[29]

Page 37: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 37 -

Figure-3.3.1.10 Pwm is Isis % 50 Duty Cycle-(128)

Figure-3.3.2 Pwm is Isis % 75 Duty Cycle-(192)

Figure 3.3.3 Pwm is Isis % 25 Duty Cycle-(64)

Page 38: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 38 -

3.4 MicroC Pwm Functions

PWM1_Init(constant long frequency) : This function initializes the PWM module

with duty ratio 0. Frequency parameter is the desired frequency in Hz. It should be a

numeric constant, should not be a variable.

PWM1_Set_Duty(unsigned short duty ratio): This function is used to set the duty

cycle of the PWM. The parameter duty ratio takes values from 0 to 255, ie 0 means

0% , 127 means 50% and 255 means 100% duty cycle. The PWM1_Init() routine

must be called before using this.

PWM1_Start() : This function starts the PWM output. PWM1_Init() must be called

before calling this routine.

PWM1_Stop() : This function stops the PWM output. PWM1_Init() must be called

before calling this routine[40]

Figure 3.4 Using Internal PWM Module PIC Microcontroller Circuit Diagram[30]

Page 39: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 39 -

3.4.1 CCP(CAPTURE/COMPARE/PWM)

The Foundation produces square wave PWM technique. This square wave is usually

in reference to the average of the wave took up in size. In addition, the size of the

waves in the system is directly proportional to the size of the task cycle. General of

CCP operations CCP is controlled with the X CON register.[41]

Figure 3.4.1 Ccp Recorders

Figure 3.4.1.1 CCP X CON Register

3.4.2 Capture Mode

PIC can be seen within the capture volume way works in partnership with the Timer to

1. Capture unit of task capture. Modes each fall, each rising 4. or 16. How long's it

been doing to capture rising edge, the elapsed time Timer 1 timer install the special

unit of recorder by taking from the CCP. Then they read the saved time necessary to

CCP transactions.

Figure 3.4.2 Capture Section

Page 40: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 40 -

3.4.3 Compare Mode

The compare part of the PIC is used in comparison operations within. as can be seen

in the shape to work jointly with Timer1. Here is the general rationale for the study.

First Timer 1 and the compare mode, adjustments are made. Then, CCPRxH and

CCPRxL are installed in the desired number get caught into the record-

er. Then, typically is used to feed an external source timer 1.Timer 1 with recorder

CCPRx recorder is equal to each other with cutting flag is set.

Figure 3.4.3 Compare Section

Page 41: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 41 -

CHAPTER 5 ELECTRONIC CIRCUIT DESIGN

Page 42: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 42 -

4 PCB (Printed Circuit Board)

4.1 What is the PCB

PCB printed circuit board plaque. Electrical and electronic components are provided

with the help of the solder connections with each other of the elements is fixed on a

perforated pertinaks which ensures that the plaque. It is found in a variety of siz-

es. The perforated plate is called. Thanks to the soldered onto the copper structure

behind. The circuit below the pressure circuit drawing.[42]

Figure 4.1 PCB Two Channel Voltmeter Circuit Design

Page 43: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 43 -

4.2 PCB 3D Circuit Design

As with single-sided double-sided PCB, 3 floors, 4 decks or more storeys. This

varies depending on the project and facilities. We are usually single-layered and

double-layered printed circuit as we are we going to do, and in this tutorial I'm go-

ing to work on a single-layer PCB production. So let's move on to the point of a

printed circuit board is necessary for us to do our tools and equipment. The follow-

ing circuit is three dimensional pcb version.

Figure 4.2-Pcb Circuit Voltmeter Ares

Page 44: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 44 -

4.2.1 Isis Circuit Diagram

The following circuit diagram of the two channels voltmeter with Isis pic16f877a.

There is no any problem in circuit simulation. It's nice when a simulating circuit

works.

Figure 4.2.1Two Channel Voltmeter Isis Schematic

Page 45: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 45 -

4.2.2 The materials required to make the printed circuit board

To the extent that conforms to the schema printed circuit copper or epoxy plaque

PNP or oily (coated) paper

Iron and ironing board

Kitchen cloth for washing utensils

Asitat Pen

Tuz ruhu

Perhidrol Acid

Plastic container that can fit horizontally on plaque

4.2.3 Ares Circuit Diagram

Figure 4.2.3 Pcb Two Channel Voltmeter Circuit Design

Page 46: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 46 -

4.2.4 General Appearance Of The Circuit

General form of the two channels below voltmeter.

Figure 4.2.4 General view Of Project

Page 47: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 47 -

CHAPTER 5

ELECTRONIC CIRCUIT MATERIALS

Page 48: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 48 -

5.1 REQUIRED MATERIALS

Terminal Block.................................................................... 3 piece

Transformers 220 V/150 V.................................................. 1 piece

Transformers 220 V / 9 V ...................................................1 piece

Zener Diode 110 V.............................................................. 1 piece

Zener Diode 5,6 V .............................................................. 2 piece

LCD-(Liquid Crystal Display)..............................................1 piece

Crystal Oscillator-10 MHz.....................................................1 piece

LED-(Light Emitting Diode).................................................2 piece

Voltage Regulator-(LM7805)................................................1 piece

Potantiometer-220Kohm........................................................2 piece

Trimpot-10K...........................................................................2 piece

Diode-1N4007........................................................................2 piece

PIC16F877A Microchip........................................................1 piece

Bridge Diode...........................................................................2 piece

Capacitors-..............................................................................8 piece

Resistor...................................................................................11 piece

18 Pin Connector....................................................................1 piece

5.2 REQUIRED SOFTWARE

mikroC PRO for PIC Writing the PIC C-code

Programador picket k150 Upload to PIC16F877A

Proteus 8 Professional (including Ares and İsis Toolkit) the system

designed on Isis and then created PSB board by using Ares toolkit

Microsoft Visual Studio we used Microsoft Visual studio to write in

C language

mikroC PRO for PIC is C kode Converted to Hex Code

Page 49: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 49 -

5.3 I use pictures of electronic material

Terminal Block Transformers Zener Diode

LCD-(Liquid Crystal Display)

Crystal Oscillator-10 MHz Led-(Light Emitting Diode)

Voltage Regulator-(lM7805) Potantiometer-(220K)

Page 50: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 50 -

Trimpot-(10k) Diode-( 1N4007) PIC16F877A Chip

Bridge Diode Capacıtors

Resistor

Page 51: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 51 -

CHAPTER 6-RESULT

6.1 Conclusion

6.1.1 Summary

The purpose of this circuit as a result two-channel microprocessor voltage applied from by

comparing through PIC and programmable interface controller that is under control through the inte-

grated circuit pic16f877a pic c connected to port two separate led diode voltage is equal to it's going to

be tension in the absence of other equal an led on led will be on. In addition, according to the State of

the output voltage of the chip by controlling c port 1 bit in hardware pwm is a square wave in different

percentage possible to take.

Integrated circuit microprocessors so pic integrated circuit c port 1 in the second bit and bit two

separate hardware pwm. This by making changes in the code or the pwm feature with a reference volt-

age is determined, we can see this square wave output between 0 and 100. DC motor control even

when a square wave from the property. If we want we want we want hardware PWM event with the

code we wrote with the oscillator.

When designing this system I thought something really hard. But pic16f877a integrated circuit in

hpwm so hardware pulse width modulation for pwm feature short, hardware and software that is based

on this incident that I've designed two channels never even looked at me. This circuit design,

while micro-c proprogram has helped me a lot in this regard.

6.1.2Future Work

When designing this system, The mean square wave PWM microprocessor chip that supported

the event I didn't know. Later in the program C as a result of my research on the first and second pic of

the pot I realized that I had bit hardware PWM pulse width modulation of the characteristic. Then, mi-

cro-C Program, with help from my cousin, I put the C code with help from a friend.

Nowadays with a PWM DC motor control, servo motor control, and I did my thesis is con-

trolled as a DC voltmeter. In the future, even more progress with the modulation technique of

communication is developing an advanced degree. With the development of an advanced degree of

modulation pulse width modulation technique also can be used in the future in a better way. Nowadays

motherboard PWM fan speed control, smps power supplies, telecommunications, power circuits are

used.

Page 52: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 52 -

References

r-supply-design-5v-7805-voltage-regulator/ [Accessed 2 July

2015].

-By-Step-LCD-wiring-4-Bit-Mode-and-

Programmi/step1/Pin-Configurations-May-Vary/ [Accessed 3 Jul. 2015].

[4] An

[5] Oskay, W. and →, V. (2012). Basics: Introduction to Zener Diodes | Evil Mad Scientist Laboratories. [online]

Evilmadscientist.com. Available at: http://www.evilmadscientist.com/2012/basics-introduction-to-zener-diodes/ [Accessed 3 Jul. 2015].

[6] Storr, W. (2013). Zener Diode as Voltage Regulator Tutorial. [online] Basic Electronics Tutorials. Available at:

http://www.electronics-tutorials.ws/diode/diode_7.html [Accessed 4 Jul. 2015].

[7] Cagataykaynak.com, (2015). Diyot ve Çeşitleri | Elektrik - Elektronik - Bilgisayar - Teknoloji. [online] Available at:

http://www.cagataykaynak.com/devre-elemanlari/diyot-ve-cesitleri/ [Accessed 5 Jul. 2015].

[8] Electronics.dit.ie, (2015). Index of /staff/tscarff/DT089_Physical_Computing_1/LEDS. [online] Available at:

http://www.electronics.dit.ie/staff/tscarff/DT089_Physical_Computing_1/LEDS/ [Accessed 5 Jul. 2015].

[9] Learn.sparkfun.com, (2015). Diodes - learn.sparkfun.com. [online] Available at: https://learn.sparkfun.com/tutorials/diodes [Ac-

cessed 6 Jul. 2015].

[10] Ustudy.in, (2015). VI Characteristics of Diode | The Web's Where You Study In!. [online] Available at:

http://www.ustudy.in/node/4945 [Accessed 6 Jul. 2015].

[11] Globalspec.com, (2015). Potentiometers, Rheostats, and Trimmers Information | IHS Engineering360. [online] Available at:

http://www.globalspec.com/learnmore/electrical_electronic_components/electronic_components_passives/potentiometers_rheostats [Ac-

cessed 6 Jul. 2015].

[13] Stitchingworlds.net, (2014). Measuring Textile Capacitors | stitching worlds. [online] Available at:

http://www.stitchingworlds.net/experimentation/measuring-textile-capacitors/ [Accessed 8 Jul. 2015].

[14] Anon, (2015). [online] Available at: html http://www.azlabs.net/store/index.php/ceramic-capacitor-dc-1kv-680pf [Accessed 8 Jul.

2015].

[15] Ixysic.com, (2015). Diode Bridges. [online] Available at: http://www.ixysic.com/Products/DiodeBridges.htm [Accessed 9 Jul.

2015].

[16] Electronics, L. (2015). Diodes Inc. W04M. [online] Octopart. Available at: https://octopart.com/w04m-diodes+inc.-7420997 [Ac-

cessed 9 Jul. 2015].

[17] Anon, (2015). [online] Available at: Electronics, L. (2015). Diodes Inc. W04M. [online] Octopart. Available at:

https://octopart.com/w04m-diodes+inc.-7420997 [Accessed 9 Jul. 2015]. [Accessed 10 Jul. 2015].

[18] Bilgiustam.com, (2015). 16F84 ile Basit Devre Kurmak » Bilgiustam. [online] Available at: http://www.bilgiustam.com/16f84-ile-

basit-devre-kurmak/ [Accessed 10 Jul. 2015].

[19] Reumayr, R. (2015). Resistor SET Carbon Film : Develissimo Electronics - Online Shop. [online] Develissimo.com. Available at:

http://develissimo.com/es/online-shop/product/resistor-set-carbon-film/ [Accessed 11 Jul. 2015].

[20] Keith, J. (2015). Power Resistors - All About it. [online] Electroschematics.com. Available at:

http://www.electroschematics.com/8763/about-power-resistors/ [Accessed 12 Jul. 2015].

[21] Edsim51.com, (2015). EdSim51 - Notes on the 8051. [online] Available at: http://www.edsim51.com/8051Notes/introduction.html

[Accessed 14 Jul. 2015].

Page 53: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 53 -

[22] Fda.gov, (2015). Computerized Systems in Drug Establishments (2/83). [online] Available at:

http://www.fda.gov/ICECI/Inspections/InspectionGuides/ucm074869.htm [Accessed 14 Jul. 2015].

[23] Desktopreality.com, (2015). Why ROM is a RAM ? | Desktop Reality. [online] Available at: http://desktopreality.com/why-rom-is-

a-ram/ [Accessed 15 Jul. 2015].

[24] Desktopreality.com, (2015). Why ROM is a RAM ? | Desktop Reality. [online] Available at: http://desktopreality.com/why-rom-is-

a-ram/ [Accessed 16 Jul. 2015].

[25] Cs.uwm.edu, (2015). Chapter 5. Basic Computer Organization and Design. [online] Available at:

http://www.cs.uwm.edu/classes/cs458/Lecture/HTML/ch05.html [Accessed 17 Jul. 2015].

[26] Futurlec.com, (2015). PIC16F877A-I/P Technical Data. [online] Available at:

http://www.futurlec.com/Microchip/PIC16F877A.shtml [Accessed 19 Jul. 2015].

[27] Microcontrollerboard.com, (2015). PIC microcontroller memory organization tutorial. [online] Available at:

http://www.microcontrollerboard.com/pic_memory_organization.html [Accessed 20 Jul. 2015].

[28] Anon, (2015). [online] Available at: Microcontrollerboard.com, (2015). PIC microcontroller memory organization tutorial. [online]

Available at: http://www.microcontrollerboard.com/pic_memory_organization.html [Accessed 20 Jul. 2015]. [Accessed 21 Jul. 2015].

[29] Arduino.cc, (2015). Arduino - PWM. [online] Available at: https://www.arduino.cc/en/Tutorial/PWM [Accessed 24 Jul. 2015].

[30] George, L. (2013). Generating PWM with PIC Microcontroller - MikroC Pro. [online] electroSome. Available at:

https://electrosome.com/pwm-pic-microcontroller/ [Accessed 27 Jul. 2015].

http://www.elektrikport.com/teknik-kutuphane/transformatorlerin-uretimi-ve-cesitleri-1-bolum [Accessed 25 Jul. 2015].

-voltaj-regulatoru/ [Accessed 27 Jul. 2015].

[33] Anon, (2015). [online] Availa

-roportaj/zener-diyot-nedir-elektrikport-akademi/11658

[Accessed 1 Aug. 2015].

[35] Elektrikrehberiniz.com, (2015). Potansiyometre Nedir? | ELEKTRİK REHBERİNİZ. [online] Available at:

http://www.elektrikrehberiniz.com/elektronik/potansiyometre-nedir-10639/ [Accessed 2 Aug. 2015].

[36] Trimpotcesitleri.com, (2015). Trimpot nedir? - Entegre Dünyası | Trimpot Çeşitleri - Entegre Dünyası. [online] Available at:

http://www.trimpotcesitleri.com/2015/07/trimpot-nedir-entegre-dunyas.html [Accessed 2 Aug. 2015].

[37] Elektrikrehberiniz.com, (2015). Köprü Diyot Nedir? Köprü Diyot | ELEKTRİK REHBERİNİZ. [online] Available at:

http://www.elektrikrehberiniz.com/elektronik/kopru-diyot-nedir-11984/ [Accessed 3 Aug. 2015].

[38] Elektrikport.com, (2015). Mikroişlemci Nedir ve Nasıl Çalışır ?. [online] Available at: http://www.elektrikport.com/teknik-

kutuphane/mikroislemci-nedir-ve-nasil-calisir--mikroislemciler-1-bolum/15140#ad-image-0 [Accessed 3 Aug. 2015].

[39] Robotiksistem.com, (2015). Pic Mikrodenetleyiciler. [online] Available at:

http://www.robotiksistem.com/pic_mikrodenetleyiciler.html [Accessed 4 Aug. 2015].

[40] George, L. (2013). Generating PWM with PIC Microcontroller - MikroC Pro. [online] electroSome. Available at:

https://electrosome.com/pwm-pic-microcontroller/ [Accessed 5 Aug. 2015].

[41] Seadle, M. (2009). PDF in 2109?. Library Hi Tech, 27(4), pp.639-644.

[42] Elektrikport.com, (2013). Baskılı Devre Kartı Yapımı. [online] Available at: http://www.elektrikport.com/teknik-kutuphane/baskili-

devre-karti-yapimi-elektrikport-akademi/8940#ad-image-0 [Accessed 8 Aug. 2015].

Page 54: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 54 -

APPENDIX

PIC C CODE

// Dc Voltage Measurements Using The Pic Microcontroller //

// 10 MHz Oscillator Frequency //

// Using The PIC16F877A//

//The output are connected to RB0-RB1-RB2-RB3-RB4-RB5-RB6-RB7//

//The counter for pulse unit is connected TO RA1//

//The Pwm Connected to RC1-RC2 Output//

//The led's connected to RC0-RC1//

// Lcd pinout settings//

sbit LCD_RW at RB6_bit; /* RB6 connected to RW */

sbit LCD_RS at RB4_bit; /* RB4 connected to RS */

sbit LCD_EN at RB5_bit; /* RB5 connected to E */

sbit LCD_D7 at RB3_bit; /* RB3 connected to D7 */

sbit LCD_D6 at RB2_bit; /* RB2 connected to D6 */

sbit LCD_D5 at RB1_bit; /* RB1 connected to D5 */

sbit LCD_D4 at RB0_bit; /* RB0 connected to D4 */

// Pin direction

sbit LCD_RS_Direction at TRISB4_bit; /* RB4 connected to R5 */

sbit LCD_EN_Direction at TRISB5_bit; /* RB5 connected to E */

sbit LCD_D7_Direction at TRISB3_bit; /* RB3 connected to D7 */

sbit LCD_D6_Direction at TRISB2_bit; /* RB2 connected to D6 */

sbit LCD_D5_Direction at TRISB1_bit; /* RB1 connected to D5 */

sbit LCD_D4_Direction at TRISB0_bit; /* RB0 connected to D4 */

sbit LCD_RW_Direction at TRISB6_bit; /* RB6 connected to RW */

Page 55: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 55 -

char conv[7];

char txt[4];

char txt1[2];

void main()

int i; /* Tamsayımızı i olarak integerda tanımladık */

cmcon = 0x07; /* PORT A dijital giris olarak ayarlandı */

trisa = 0xff; /* porta giriş olarak ayarlandı */

trisb = 0; /* portb giriş veya çıkış olarak ayarlandı */

trisc = 0; /* portc giriş veya çıkış olarak ayarlandı */

portc = 0; /* portc çıkış olarak ayarlandı */

adc_init(); /* ADC Modülü varsayılan degerlerle baslatıldır */

lcd_init(); /* LCD Modülü baslat */

lcd_cmd(_lcd_cursor_off); /* Lcd imlec kapalı */

lcd_cmd(_lcd_clear); /* lcd'yi temizle */

lcd_out(1,1,"V1="); /* v1 metni yazıldı */

lcd_out(2,1,"V2="); /* v2 metni yazıldı */

lcd_out(2,9," VOLT"); /* Volt metni yazıldı */

lcd_out(1,9," VOLT"); /* volt metni yazıldı */

PWM1_Init(18000); /* Buraya 1-20 khz arası istediğin frekansı yaz */

PWM1_start(); /* pwm modülü başlatıldı bu komutu istedğimiz yere yazabiliriz

kullandıgımız portc1 pini */

Page 56: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 56 -

do

PWM1_set_duty(128); /* eger yuzde 50 lik bir kare dalga istiyorsak (50*255/100) cıkan

sonuc degerini yazarsak yüzde 50 pwm alırız This Formula (Percent*255)/100 */

i = adc_read(2); /* i değerine atanan degeri analog degeri oku */

inttostr(i,conv); /* i değerini atadığımız yeri karaktere çevir */

txt[0]=conv[2];

txt[1]=conv[3];

txt[2]=conv[4];

txt1[0]=conv[5];

txt1[1]='\0';

txt[3]='\0';

lcd_out(2,4,txt); /*lcd ye yazıldı */

lcd_out(2,7,"."); /* lcd ye yazıldı */

lcd_out(2,8,txt1); /* lcd'ye yazıldı */

i = adc_read(1); /* analog i degerini oku */

inttostr(i,conv); /* i degerini atafıgımız yeri karaktere cevir */

txt[0]=conv[2];

txt[1]=conv[3];

txt[2]=conv[4];

txt1[0]=conv[5];

txt1[1]='\0';

Page 57: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 57 -

txt[3]='\0';

lcd_out(1,4,txt);

lcd_out(1,7,".");

lcd_out(1,8,txt1);

if(adc_read(2)==adc_read(1)) */ adc 1 de okunan deger ile adc 2 de okunan deger birbirlerine

esit ise */

portc.b0=1; /* portc nin 0 bitini 1 yap led yak */

portc.B1=0; /* portc nin 1 bitini 0 yap led sönsün */

else */ bu sartlar olmassa yani iki okunan deger birbirlerine esit değilse */

portc.b0=0; /* İkinci ledin yani port c'nin o bitindeki ikinci ledi söndür */

portc.b1=1; /* ikinci ledin yani port c'nin 1 bitindeki ikinci ledi yak */

delay_ms(100); */gecikmemiz 100 ms */

while(1); */ Sartın sonucu dogru ise görev ıcındeki döngüyü tekrarla */

Page 58: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 58 -

Page 59: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 59 -

Page 60: DC VOLTAGE MEASUREMENT USİNG THE WITH PIC MICROCONTROLLER

- 60 -