Microcontroller
project
By Yasir mohammed
1
Introduction: In this project we are using a
variable resistor to control the
angle of servo motors and set
them to 90 degrees
The idea of this project will be
executed using a PIC16F877A
microcontroller
2
Tools:
• The tools used for this project were:
1-PIC16F877A
2- two variable resistors (50 kΩ)
3- a 4MHz crystal
4-two 22PF capacitors
5-two 180 degrees pwm servo motors
6- 5V voltage source
7- pic k150 programmer
3
Tools (cont.):
4
We connect the crystal to pins 13 and 14 because
Procedure: these are the dedicated ports for the PIC16F877A's
internal oscillator circuit
we connect the capacitors to ground and pins 13 and
14 because The crystal cannot create a pulse on its
own; it needs these capacitors to help it vibrate at the
correct frequency.
We connect the variable resistors to pin 3 and 2
because they are the analog to digital converter and
we also connect them to the voltage source and the
ground
We connect the pwm pins of the motors to pins 16 and
17 because they are the only two pins on the
PIC16F877A equipped with the
Capture/Compare/PWM (CCP) hardware modules.
5
Procedure We connect pin to the positive because it acts
(cont.): as the Vcc
We write an assembly code and then turn it to
a hex file using Mplab program and then
upload it to the pic using a pic k150
programmer and it’s software microburn
We need to note that this whole operation
was first simulated in proteus 8 professional
6
Conclusion: the connection were right but difficulties were
faced because of the code ,
There are some real life applications to this
project like
1. Remote Medical Surgery (Telemedicine)
2. Fly-By-Wire Aircraft Controls
3. Industrial Flow Control (Valves)
7
Pic data sheet:
8
Proteus 8 simulation :