Professional Documents
Culture Documents
1. INTRODUCTION
Space probes are important part of growing space technology. they are used to study
extra terrestrial bodies like moon, planets etc.
a solar probe posses different sections, depending on its aim. but the vital part is the
power source for the entire probe. mainly all solar probes uses solar light as energy by
solar panels. but at the surface of extra terrestrial bodies the presence of light will not
be same, which means shadows, as there are lot of obstacles like huge rocks, pits etc.
• light tracking
we can also control the probe manually by visual basic based interface program from
the base station via zigbee.
2. PRODUCT DESIGN
The design of a product is a laborious task which takes much of immense creative
skills bringing out artist and designer within an engineer. He is directed by axioms of
industrial design which are:
AESTHETICS FUNCTION
PRODUCT
ERGONOMICS
AESTHETICS: It is the study of theories that apply to the arts in a broad and
fundamental way. It means having to do with beautiful, as distinguished for the useful,
scientific or moral based on or determined by the beauty rather than by practical or
moral consideration. While considering the designing of a product, it should a good
appearance. Beauty is one of the peak thing determines the market of a product.
3. Ease of handling
2. Enclosure design ,
3. BLOCK DIAGRAM
Microchip PIC was chosen because of its easy availability. The other option was
Atmel , but is not available as easily as PIC. 8051 variants have less peripheral and
are less efficient when it comes to a project like this. we use the PIC 16F73 as it
posses smaller number of instructions. the pic receives the output of temperature
sensor , LDRs and it communicates with the base station, computer, via zigbee. It also
controls the servomotors of solar panel and dc motors of the probe.
4.2. MOTOR:
Types of motors available for the required application in the project are:
– Stepper
– Servo
– DC motors
Servo motors were selected over steppers because of its light weight, and ability to
point at any angle. Stepper motors cannot position to angles in between its step angle.
Servo motors consume far less current than steppers. Servo motors have driver build
into it so additional drivers need not be provided. Drivers work at 4.8 to 6v.
DC motors are used to drive the probe and control the steeringof the probe.
In lux measurement system, we use LDRs (light dependent resistors) to track the solar
light. LDR is a device which has a resistance which varies according to the amount of
light falling on its surface. When light falls on an LDR its resistance falls rapidly.
Three LDRs are connected to pic so that to compare light intensity at various point on
our probe.
5. CIRCUIT DIAGRAM
6. FLOWCHART
N
Is texture
Move camera
seen?
Find error
7. HARDWARE
From the available controllers we chose microchip PIC due to its good performance,
good peripheral and easily available programming tools. PIC16F73 is chosen. It is a
28pin 8 bit CMOS flash microcontroller. It has three i/o ports-port A, B and port C, 11
interrupts. Five A/D input channels.
There are two memory blocks in each of these PICmicro MCUs. The Program
Memory and Data Memory have separate buses so that concurrent access can occur.
The Program Memory can be read internally by user code.
The Data Memory is partitioned into multiple banks, which contain the General
Purpose Registers and the Special Function Registers. Bits RP1 (STATUS<6>) and
RP0 (STATUS<5>) are the bank select bits: Each bank extends up to 7Fh (128 bytes).
The lower locations of each bank are reserved for the Special Function Registers.
Above the Special Function Registers are General Purpose Registers, implemented as
static RAM. All implemented banks contain Special Function Registers.
RP1:RP0 Banks
00 0
01 1
10 2
11 3
Each bank extends up to 7Fh (1238 bytes). The lower locations of each bank are
reserved for the Special Function Registers. Above the Special Function Registers are
General Purpose Registers, implemented as static RAM. All implemented banks
contain special function registers. Some frequently used special function registers
from one bank may be mirrored in another bank for code reduction and quicker
access.
The data EEPROM and flash program memory are readable and writable during
normal operation over the entire VDD range. A bulk erase operation may not be
DEPT. OF ELECTRONICS AND COMMUNICATION ENGINEERING
12
COLLEGE OF ENGINEERING, ADOOR
AUTONOMOUS LIGHT TRACKING.SOLAR CELL CHARGING SYSTEM
issued from user code (which includes removing code protection. The data memory is
not directly mapped in the register file space. Instead it is indirectly addressed through
the special function registers (SFR).
There are six SFRS used to read and write the program and data EEPROM memory.
EECON1
EECON2
EEDATA
EEDATH
EEADR
EEADRH
EEDATA holds the 8-bit data for read/write and EEADRR holds the address of the
EEPROM location being accessed. The 8-bit EEADR register can access up to 256
locations of data EEPROM. The EEADR register can be thought of as the indirect
addressing register of the data EEPROM. EEcon1 contains the control bits, while
eecon2 is the register used to initiate the read/write. The EEPROM data memory
allows bytes read and write. A byte write automatically erases the location and writes
the new data. The write time is controlled by timer in-built.
6.1.2. PORTS
Some pins for these I/O ports are multiplexed with an alternate function for the
peripheral features on the device. In general, when a peripheral is enabled, that pin
may not be used as a general purpose I/O pin.
PORTA is a 6-bit wide bi-directional port. The corresponding data direction register
is TRISA. Setting a TRISA bit (=1) will make the corresponding PORTA pin an
input, i.e., put the corresponding output driver in a Hi-impedance mode. Clearing a
TRISA bit (=0) will make the corresponding PORTA pin an output, i.e., put the
contents of the output latch on the selected pin.
PORTB is an 8-bit wide bi-directional port. The corresponding data direction register
is TRISB. Setting a TRISB bit (=1) will make the corresponding PORTB pin an
input, i.e., put the corresponding output driver in a hi-impedance mode. Clearing a
TRISB bit (=0) will make the corresponding PORTB pin an output, i.e., put the
contents of the output latch on the selected pin. Three pins of PORTB are multiplexed
with the Low Voltage Programming function; RB3/PGM, RB6/PGC and RB7/PGD.
The alternate functions of these pins are described in the Special Features Section.
Each of the PORTB pins has a weak internal pull-up. A single control bit can turn on
all the pull-ups.
PORTC is an 8-bit wide bi-directional port. The corresponding data direction register
is TRISC. Setting a TRISC bit (=1) will make the corresponding PORTC pin an
input, i.e., put the corresponding output driver in a hi-impedance mode. Clearing a
TRISC bit (=0) will make the corresponding PORTC pin an output, i.e., put the
contents of the output latch on the selected pin. PORTC is multiplexed with several
peripheral functions. PORTC pins have Schmitt Trigger input buffers.
6.1.3. TIMERS
There are three timers used Timer 0, Timer1 and Timer2
Timer 0:
8-bit timer/counter
Software programmable prescaler
Internal or external clock select
Readable writable
Interrupt on overflow
Edge selects for external clock
Timer 1:
Timer 1 can be used as timer or counter
It is 16-bit register
Software programmable prescaler
Interrupt on overflow
Readable and writable
The timer-1 module is a 16-bit timer/counter consisting two 8-bit register (TMR1H)
and TMR1L), which are readable and writable. The TMR1 register pair
DEPT. OF ELECTRONICS AND COMMUNICATION ENGINEERING
14
COLLEGE OF ENGINEERING, ADOOR
AUTONOMOUS LIGHT TRACKING.SOLAR CELL CHARGING SYSTEM
(TMR1H:TMR1L) Increments from 0000h to FFFFH and rolls over to 0000h. The
tmr1 interrupt, if enabled, is generated on overflow, which is latched in interrupt flag
bit tmr1IF. This interrupt can be enabled/disabled by setting/clearing tmr1 interrupt
enable bit tmr1IE.
Timer-2:
Timer2 is an 8-bit timer with a prescaler and a postscaler. IT can be used as the PWM
time-base for the PWM mode of the CCP module(s). The TMR2 register is readable
and writable, and is cleared on any device reset. The input clock (Fosc/4) has a
prescale option of 1:1, 1:4 OR 1:16, selected by control bits. The timer2 module has
an 8-bit period register PR2. Timer2 increments from 00h until it match PR2 and then
resets to 00h on the next increment cycle. PR2 is a readable and writable register. The
PR2 register is initialized to FFh upon reset.The match output of TMR2 goes through
a 4-bit postscaler (which gives a 1:1 to 1:16 scaling inclusive) to generate a tmr2
interrupt . Timer 2 can be shut off by clearing control bit tmr2on to minimize power
The timer-1 module is a 16-bit timer/counter consisting two 8-bit register (TMR1H)
and TMR1L), which are readable and writable. The TMR1 register pair
(TMR1H:TMR1L) Increments from 0000h to FFFFH and rolls over to 0000h. The
tmr1 interrupt, if enabled, is generated on overflow, which is latched in interrupt flag
bit tmr1IF. This interrupt can be enabled/disabled by setting/clearing tmr1 interrupt
enable bit tmr1IE.
6.1.4 INTERRUPTS
INTCON: Additionally if the device has peripheral interrupts, then it will have
registers to enable the peripheral interrupts and registers to hold the interrupt flag bits
PIE1
PIE2
PIR1
PIR2
Another type of indexed addressing is used in the“ case jump ” instructions. In this
case the destination address of a jump instruction is computed as the sum of the base
pointer and the Accumulator data.
address byte is needed to point OT ir. In these cases, the opcode itself points to the
correct register. Instruction that register to Accumulator as A assemble as Accumulator
- specific Opcodes.
XTAL1 and XTAL2 are the input and output respectively of an inverting amplifier
which is intended for use as a crystal oscillator in the pioerce configuration, in the
frequency range of 1.2 Mhz to 12 Mhz. XTAL2 also the input to the internal clock
generator.
To drive the chip with an internal oscillator, one would ground XTAL1 and XTAL2.
Since the input to the clock generator is divide by two filip flop there are no
requirements on the duty cycle of the external oscillator signal. However, minimum
high and low times must be observed.The clock generator divides the oscillator
frequency by 2 and provides a tow phase clock signal to the chip. The phase 1 signal
is active during the first half to each clock period and the phase 2 signals are active
during the second half of each clock period.
The manner in which the use of micro controllers is shaping our lives is breathtaking.
Today, this versatile device can be found in a variety of control applications. CVTs,
VCRs, CD players, microwave ovens, and automotive engine systems are some of
these.
A micro controller unit (MCU) uses the microprocessor as its central processing unit
(CPU) and incorporates memory, timing reference, I/O peripherals, etc on the same
chip. Limited computational capabilities and enhanced I/O are special features.
The micro controller is the most essential IC for continuous process- based
applications in industries like chemical, refinery, pharmaceutical automobile, steel,
and electrical, employing programmable logic systems (DCS). PLC and DCS thrive
on the programmability of an MCU.
DEPT. OF ELECTRONICS AND COMMUNICATION ENGINEERING
17
COLLEGE OF ENGINEERING, ADOOR
AUTONOMOUS LIGHT TRACKING.SOLAR CELL CHARGING SYSTEM
There are many MCU manufacturers. To understand and apply general concepts, it is
necessary to study one type in detail. This specific knowledge can be used to
understand similar features of other MCUs.
Micro controller devices have many similarities. When you look at the differences,
they are not so great either. Most common and popular MCUs are considered to be
mature and well-established products, which have their individual adherents and
devotees. There are a number of variants within each family to satisfy most memory,
I/O, data conversion, and timing needs of end user applications.
Microcontrollers are designed for use in sophisticated real time applications such as
o Industrial Control
o Instrumentation and
o Motor
o Robotics
o In medical instrumentation
o Oscilloscopes
o Telecommunication
o Automobiles
o Driving an LCD
6.3. SERVOMOTOR
A Servo is a small device that has an output shaft. This shaft can be positioned to
specific angular positions by sending the servo a coded signal. As long as the coded
signal exists on the input line, the servo will maintain the angular position of the shaft.
As the coded signal changes, the angular position of the shaft changes. In practice,
servos are used in radio controlled airplanes to position control surfaces like the
elevators and rudders. They are also used in radio controlled cars, puppets, and of
course, robots.
So, how does a servo work? The servo motor has some control circuits and a
potentiometer (a variable resistor, aka pot) that is connected to the output shaft. In the
picture above, the pot can be seen on the right side of the circuit board. This pot
allows the control circuitry to monitor the current angle of the servo motor. If the shaft
is at the correct angle, then the motor shuts off. If the circuit finds that the angle is not
correct, it will turn the motor the correct direction until the angle is correct. The
output shaft of the servo is capable of travelling somewhere around 180 degrees.
Usually, its somewhere in the 210 degree range, but it varies by manufacturer. A
normal servo is used to control an angular motion of between 0 and 180 degrees. A
DEPT. OF ELECTRONICS AND COMMUNICATION ENGINEERING
20
COLLEGE OF ENGINEERING, ADOOR
AUTONOMOUS LIGHT TRACKING.SOLAR CELL CHARGING SYSTEM
normal servo is mechanically not capable of turning any farther due to a mechanical
stop built on to the main output gear.
The amount of power applied to the motor is proportional to the distance it needs to
travel. So, if the shaft needs to turn a large distance, the motor will run at full speed. If
it needs to turn only a small amount, the motor will run at a slower speed. This is
called proportional control.
How do you communicate the angle at which the servo should turn? The control wire
is used to communicate the angle. The angle is determined by the duration of a pulse
that is applied to the control wire. This is called Pulse Coded Modulation. The servo
expects to see a pulse every 20 milliseconds (.02 seconds). The length of the pulse
will determine how far the motor turns. A 1.5 millisecond pulse, for example, will
make the motor turn to the 90 degree position (often called the neutral position). If the
pulse is shorter than 1.5 ms, then the motor will turn the shaft to closer to 0 degrees. If
the pulse is longer than 1.5ms, the shaft turns closer to 180 degress.
Servos are controlled by sending them a pulse of variable width. The control wire is
used to send this pulse. The parameters for this pulse are that it has a minimum pulse,
a maximum pulse, and a repetition rate. Given the rotation constraints of the servo,
neutral is defined to be the position where the servo has exactly the same amount of
potential rotation in the clockwise direction as it does in the counter clockwise
direction. It is important to note that different servos will have different constraints on
their rotation but they all have a neutral position, and that position is always around
1.5 milliseconds (ms).
The angle is determined by the duration of a pulse that is applied to the control wire.
This is called Pulse width Modulation. The servo expects to see a pulse every 20 ms.
The length of the pulse will determine how far the motor turns. For example, a 1.5 ms
pulse will make the motor turn to the 90 degree position (neutral position).
When these servos are commanded to move they will move to the position and hold
that position. If an external force pushes against the servo while the servo is holding a
position, the servo will resist from moving out of that position. The maximum amount
of force the servo can exert is the torque rating of the servo. Servos will not hold their
position forever though; the position pulse must be repeated to instruct the servo to
stay in position.
When a pulse is sent to a servo that is less than 1.5 ms the servo rotates to a position
and holds its output shaft some number of degree counter clockwise from the neutral
point. When the pulse is wider than 1.5ms the opposite occurs. The minimal width
and the maximum width of pulse that will command the servo to turn to a valid
position are functions of each servo. Different brands, and even different servos of the
same brand, will have different maximum and minimums. Generally the minimum
pulse will be about 1 ms wide and the maximum pulse will be 2 ms wide.
7. PCB FABRICATION
(vi) Caution
FABRICATION PROCEDURE: Copper clad board was taken. The layout was screen
printed on the board which i then etched. Then the board was dipped in ferric chloride
solution and the part exposed to copper was dissolved in the solution. After this, the
board was cleaned using thinner and the board is now ready for drilling. The normal
size of the hole is 0.8mm which slightly varies according to the components. The
components are then mounted into the holes and then soldered.
The PC based artwork consists of drawing the conductor pattern. For putting artwork
on the component side of the board, flip the whole image before or while taking print.
When the pattern has been drawn, take the print out in 600-1200 dpi on a translucent
or butter paper. Keep the paper side on which the toner is deposited facing down over
the copper laminated boards copper side and then when the board is turned
component side up, the pattern on the conductor will be found properly aligned with
the components. Finally the printout of the PCB is taken. Conducting layers are
typically made of thin copper foil. Insulating materials has wider scale, phenol paper,
glass fibre and different plastics are commonly used. Usually PCB factories use
prepregs (short for preimpregnated) that is a combination of glass fibre mat, non
woven material and resin. Copper foil and prepreg are typically laminated together
with epoxy resin. Well known prepreg materials used in PCB industry are FR-2
(Phenolic cotton paper), FR-3 (Cotton paper and epoxy), FR-4 (Woven glass and
epoxy), FR-5 (Woven glass and epoxy), FR-6 (Matte glass and polyester), G-10
(Woven glass and epoxy), CEM-1 (Cotton paper and epoxy), CEM-2 (Cotton paper
and epoxy), CEM-3 (Woven glass and epoxy), CEM-4 (Woven glass and epoxy),
CEM-5 (Woven glass and polyester). Other widely used materials are polyimide,
Take the printout of the circuit layout from a laser printer. The idea is to use a coated
paper so that the toner comes loose when heated which would transfer a sharp black
print on to copper laminate. Print for each of the required layers should be taken on a
separate paper.
Scrub the copper side of the copper clad laminated used for the PCB board with a
sponge. The scrubbing involves removes oxidation, stains, etc. And it also makes the
copper surface some-what a rough which helps the toner to adhere to the copper
surface. The next step is to degrease the board thoroughly using a paper towel soaked
with acetone solvent. Keep doing it until no more discoloration is seen on the paper
towel. Rub hard and keep switching to clean parts of towel. Place and align the paper
on the copper side, using an iron box to maximum setting on the back of the paper for
atleast half a minute. If you don’t apply enough heat, the film or toner may not stick
or be dark enough. The removal of paper from PCB is done by putting it into hot
water for 10 or more minutes. Check whether it has transferred properly onto copper
plate.
Dig the bristles on the tip of a smooth tooth-brush into the holes, remove the paper
part from the tight areas like drill-holes. Now cut the PCB to required size by using a
hacksaw.
7.4. ETCHING
Etch the unwanted copper from the board using the ferric chloride solution for more
than 20 or more minutes. One pint can etch at least 3.6 sq meters of the 28gm board.
Heating the etchant will speed up the etching process. The PCB is attached to a
wooden piece and dip in to the solution. Lift the PCB up and check whether all the
unwanted copper is removed. Then it is immersed in to cold water to clean. When
etching is complete, board is removed from the solution and rinse it under running tap
water. Acetone or lacquer thinner is used to remove the toner. Lacquer thinner is used
as a solvent in painting industry. Wash the board in lacquer thinner solvent, rubbing
with a paper towel, to remove the toner instantly. The vast majority of printed circuit
boards are made by bonding a layer of copper over the entire substrate, sometimes on
both sides, (creating a “blank PCB”) then removing unwanted copper after applying a
temporary mask (eg. By etching), leaving only the desired copper traces. A few PCBs
are made by adding traces to the bare substrate (or a substrate with a very thin layer of
copper) usually by a complex process of multiple electroplating steps. There are three
common “subtractive” methods (methods that remove copper) used for the production
of printed circuit boards:
Silk screen printing uses etch-resistant inks to protect the copper foil. Subsequent
etching removes the unwanted copper. Alternatively, the ink may be conductive,
printed on a blank (non-conductive) board. The latter technique is also used in the
manufacture of hybrid circuits.
Photoengraving uses a photomask and chemical etching to remove the copper foil
from the substrate. The photomask is usually prepared with a photoplotter from data
produced by a technician using CAM, or computer-aided manufacturing produced by
a technician using CAM, or computer-aided manufacturing software. Laser-printed
transparencies are typically employed for photo tools; however, direct laser imaging
techniques are being employed to replace phototools for high-resolution requirements
PCB milling uses a two or three-axis mechanical milling system to mill away the
copper foil from the substrate. A PCB milling machine (referred to as a ‘PCB
Prototyper’) operates in a similar way to a plotter, receiving commands from the host
software that control the position of the milling head in the x, y, and (if relevant) z
axis. Additive” processes also exist. The most common is the “semi-additive” process.
In this version, the unpatterned board has a thin layer of copper already on it. A
reverse mask is then applied. (Unlike a subtractive process mask, this mask exposes
those parts of the substrate that will eventually become the traces.) Additional copper
is then plated onto the board in the unmasked areas; copper may be plated to any
desired weight. Tin-lead or other surface platings are then applied. The mask is
stripped away and a brief etching step removes the now-exposed original copper
laminate from the board, isolating the individual traces. The additive process is
commonly used for multi-layer boards as it facilitates the plating-through of the holes
(vias) in the circuit board.
In this a PCB hand drill is used. Use 0.8mm PCB drill bit to drill out all of the
component holes. After drilling the holes, scrub sponge is used to clean before
soldering. After drilling and cleaning, wash the board in cold water and then dry it.
Holes, or vias, through a PCB are typically drilled with tiny drill bits made of solid
tungsten carbide. The drilling is performed by automated drilling machines with
placement controlled by a drill tape or drill file. These computer-generated files area
also called numerically controlled drill (NCD) files or “Excellon files”. The drill file
describes the location and size of each drilled hole.When very small vias are
required, drilling with mechanical bits is costly because of high rates of wear and
breakage. In this case, the vias may be evaporated by lasers. Laser-drilled vias
typically have an inferior surface finish inside the hole. These holes are called micro
vias.It is also possible with controlled-depth drilling, laser drilling, or by pre-drilling
the individual sheets of the PCB before lamination, to produce holes that connect
only some of the copper layers, rather than passing through the entire board. These
holes are called blind vias when they connect an internal copper layer to an outer
layer, or buried vias when they connect two or more internal copper layers and no
outer layers.
The walls of the holes, for boards with 2 or more layers, are plated with copper to
form plated-\through holes that electrically connect the conducting layers of the
PCB. For multilayer boards, those with 4 layers or more, drilling typically produces
a smear comprised of the bonding agent in the laminate system. Before the holes
can be plated through, this smear must be removed by a chemical de-smear process,
or by plasma-etch.
because of high rates of wear and breakage. In this case, the vias may be evaporated
by lasers. Laser-drilled vias typically have an inferior surface finish inside the hole.
These holes are called micro vias. It is also possible with controlled-depth drilling,
laser drilling, or by pre-drilling the individual sheets of the PCB before lamination,
to produce holes that connect only some of the copper layers, rather than passing
through the entire board. These holes are called blind vias when they connect an
internal copper layer to an outer layer, or buried vias when they connect two or
more internal copper layers and no outer layers. The walls of the holes, for boards
with 2 or more layers, are plated with copper to form plated-\through holes that
electrically connect the conducting layers of the PCB. For multilayer boards, those
with 4 layers or more, drilling typically produces a smear comprised of the bonding
agent in the laminate system. Before the holes can be plated through, this smear
must be removed by a chemical de-smear process, or by plasma-etched with solder.
7.6. CAUTION
8. SOLDERING
Soldering is the process of joining metals by using lower melting point metal to wet
or alloy with joined surfaces. Solder is the joining material. It melts below 427C.
Soldered joints in electronic circuits will establish strong electrical connections
between component leads. The popularly used solders are alloys of tin and lead that
melt below the melting point of tin.
In order to make the surfaces accept the solder readily, the component terminals
should be cleaned chemically or by abrasion using blades or knives. Small amount of
lead coating can be done on the cleaned portion of the leads using soldering iron. This
process is called tinning. Zinc chloride or ammonium chloride separately or in
combination are the most commonly used fluxes. These are available in petroleum
jelly as paste flux.
A solder joint can at first glance to be okay, but under close examination it could be a
‘Dry Joint’. A dry joint is when either the circuit board or the leg of the component
has not been properly heated to allow the solder to flow between the surfaces freely.
This creates an intermittent or no electrical connection. This can also be caused by
lack of flux or on reusing an old solder.
Quite often, reheating a bad joint will cure the problem but in a lot of cases, the old
solder will need to be removed and some new solder applied. The residues, which
remain after the soldering, may be washed out with more water, accompanied by
brushing.
Soldering iron is the tool used to melt the solder and apply at the joints in the circuit.
It operates in 230 V mains supply. The iron bit at the tip gets heated up within a few
minutes. 50W and 25W soldering irons are commonly used for soldering purposes.
The procedure is
5. Apply flux on the joints and solder the joints. Soldering must
be done in minimum time to avoid dry soldering and heating up of
components. Wash the residue using water and brush.
10. SOFTWARE
circuit emulators and in-circuit debuggers are also available to test code as it runs in
the applications hardware.
MPLAB IDE is a “wrapper” that coordinates all the tools from a single
graphical user interface, usually automatically. For instance, once code is written, it
can be converted to executable instructions and downloaded into a microcontroller to
see how it works. In this process multiple tools are needed: an editor to write the code,
a project manager to organize files and settings, a compiler or assembler to convert
the source code to machine code and some sort of hardware or software that either
connects to a target microcontroller or simulates the operation of a microcontroller
#INCLUDE P16F73.INC
LIST P=16F73
ORG 0X04
MOVWF W_TEMP ;Copy W to TEMP
register
SWAPF STATUS,W ;Swap status to be saved
into W
CLRF STATUS ;bank 0, regardless of
current bank, Clears IRP,RP1,RP0
MOVWF STATUS_TEMP ;Save status to bank zero
STATUS_TEMP register
MOVF PCLATH, W ;Only required if using pages 1, 2
and/or 3
MOVWF PCLATH_TEMP ;Save PCLATH into W
CLRF PCLATH ;Page zero, regardless of
current page
BCF INTCON,GIE
BANKSEL PIR1
BTFSSPIR1,0
GOTO ISR_OVER
BANKSEL PORTB
MOVFW VAL0
BZ XX1
BSF PORTB,0
CALL SER0_DELAY
XX1 BCF PORTB,0
MOVFW VAL1
BZ XX2
BSF PORTB,1
CALL SER1_DELAY
XX2 BCF PORTB,1
RETFIE
;;
;;================================================
;; PORT INIT
;;================================================
;;
MAIN:
CALL PORT_INIT
CALL TIMER_INIT
CALL USART_INIT
CALL INTERRUPT_INIT
CALL DEFAULTPOSITION
BEG:
CALL RECEIVE_DATA
MOVFW RX_DATA
MOVWF ID
CALL RECEIVE_DATA
MOVFW RX_DATA
MOVWF SERVOVAL
MOVFW ID
SUBLW 0X30
DEPT. OF ELECTRONICS AND COMMUNICATION ENGINEERING
37
COLLEGE OF ENGINEERING, ADOOR
AUTONOMOUS LIGHT TRACKING.SOLAR CELL CHARGING SYSTEM
BNZ NEXT_1
MOVFW SERVOVAL
MOVWF VAL0
GOTO BEG
NEXT_1
MOVFW ID
SUBLW 0X31
BNZ NEXT_2
MOVFW SERVOVAL
MOVWF VAL1
GOTO BEG
NEXT_2
GOTO BEG
;;================================================
;; PORT INIT
;;================================================
;;
PORT_INIT:
BANKSEL TRISB
CLRF TRISB
CLRF TRISA
MOVLW 0XC0
MOVWF TRISC
BANKSEL ADCON1
MOVLW 0X06
MOVWF ADCON1
BANKSEL PORTB
CLRF PORTB
CLRF PORTC
CLRF PORTA
RETURN
;;
;;================================================
;; INTERRUPT_INIT
;;================================================
;;
INTERRUPT_INIT
BANKSEL PIE1
BSF PIE1,0
BSF INTCON,PEIE
BSF INTCON,GIE
RETURN
;;
;;================================================
;; TIMER INIT
;;================================================
;;
TIMER_INIT
BANKSEL T1CON
BCF T1CON,TMR1CS ;USE INTERNAL
CLOCK
BSF T1CON,TMR1ON
BANKSEL T2CON
BSF T2CON,2
RETURN
;;
;;================================================
;; SERVO_DELAY
;;================================================
;;
SER0_DELAY
banksel TEMP
MOVLW 0X8f
MOVWF TEMP
SS00
DECFSZ TEMP,1
GOTO SS00
BANKSEL VAL0
MOVFW VAL0
MOVWF TEMP
SS0 NOP
NOP
NOP
NOP
DECFSZ TEMP,1
GOTO SS0
RETURN
;;
;;================================================
;; SERV1_DELAY
;;================================================
;;
SER1_DELAY
banksel TEMP
MOVLW 0X8f
MOVWF TEMP
SS10
DECFSZ TEMP,1
GOTO SS10
BANKSEL VAL1
MOVFW VAL1
MOVWF TEMP
SS1 NOP
NOP
NOP
NOP
DECFSZ TEMP,1
GOTO SS1
RETURN
;;
;;================================================
;;
;;================================================
;;
DELAY2S
MOVLW .15
MOVWF COUNT2
MOVLW .5
MOVWF COUNT3
RETURN
SERVO_DELAY
RETURN
DEFAULTPOSITION
BANKSEL VAL0
MOVLW 0X7F
MOVWF VAL0
MOVLW 0X6F
MOVWF VAL1
RETURN
;;
;;===================================================
;; USART INITIALIZATION BAUD RATE = 9.6K
;;===================================================
;;
USART_INIT:
BANKSEL SPBRG
MOVLW .25
MOVWF SPBRG
BANKSEL TXSTA
BCF TXSTA,SYNC
BSF TXSTA,BRGH
BANKSEL RCSTA
BSF RCSTA,CREN
BSF RCSTA,SPEN
RETURN
;;
;;===================================================
;; SERIAL RECEPTION
;;===================================================
;;
RECEIVE_DATA:
BANKSEL PIR1
BTFSS PIR1,RCIF
GOTO $-1
BANKSEL RCREG
MOVFW RCREG
MOVWF RX_DATA
RETURN
END
We were able to design a system which aims at detecting and tracking texture. This
project can be used in wildlife research and intruder detection applications. This
project has helped us to study about microcontroller, MPLAB IDE, image processing
basics using MATLAB and helped to widen our horizons. As a future improvement to
this device, we can use cameras with higher resolution and we may also modify this
into a mobile robot, which detects the desired texture and moves along with it.
12. REFERENCES
BIBLIOGRAPHY
[1]. St.Clair. R. & Seiffert. A. E. [2009] Tracking objects with moving textures
[Abstract]. Journal of Vision
[2]. Shariat H & Price K. E. [2008]. Real-time Hybrid Tracking using Edge and
Texture Information, International Journal of Robotic Research, Volume 26, Issue 7.
[3].Rafael C.Gonzalez & Richard E.Woods [2006].Digital Image Processing, 2nd ed.,
Prentice-Hall of India, New Delhi
[4]. Rafael C.Gonzalez, Richard E.Woods & Steven L.Eddins[2008], Digital Image
Processing Using MATLAB,4th ed., Dorling Kindersley, New Delhi
WEBLIOGRAPHY
[1]. http://journalofvision.org/9/8/245/
[2].http:// index.ieeexplore.ieee.org/iel5/83/4358840/101109TIP2007914150.pdf
[3].http:// ieeexplore.ieee.org/iel5/4269955/4269956/04270504.pdf.
13. APPENDIX