Sunteți pe pagina 1din 62

Virtual remote Main Project 2013-14

Chapter 1 INTRODUCTION
Man has always been consistent in his struggle to achieve perfection. He has always been persevering to make his life easier and simpler. It is through this perseverance, that he has been able to convert the factory sized computers of the first era to the handheld computers we are using now. Our lives have become much simpler and easier due to the perseverance and determination of some hardworking individuals. We must admit that even the kings and royalty of old times did not en oy the comforts that an ordinary middle class person en oys today. !very discovery or innovation irrespective of their proportion had its own significance in shaping this world. "he first ever television remote control was called #$azy bones% and was made in &'().It was connected to the "* through a wire. "he first wireless remote control #+lashmatic #was made in &'((.It worked by shining a beam of light on a photoelectric cell. "he main disadvantage was that the light had to be pointed very precisely. "he first infrared remote control was to be developed only , decades later in &'-)."he concept of virtual remote using gestures has been a topic of discussion for ./, years. "he prototype of the low cost gesture recognition remote featured here could be a stepping stone onto the further developments in that field. 0esides television, the applications of this concept can be e1tended to other devices also. "he primary component of the *irtual remote being featured here is a gesture detection device called 2inect, which was developed by Microsoft e1clusively for their gaming platform ,the 3bo1 ,4).Here our approach has been particularly directed towards making the *irtual remote universal and budget friendly as possible. "he 2inect can be considered as the key component in our model of *irtual 5emote. "he 2inect sends out I5 beams across the entire field or area by means of its infrared laser pro ector. "he beams are deflected off ob ects or obstacles in its path and these deflected beams are picked up by the 6MO7 sensor. "he kinect forms a skeletal like framework of the body, much like the ones used in animatronics and motion capture mechanism used in movie studios. "he 2inect already comes preloaded with the data to

Dept. of ECE AWH En

1 . Colle e

Virtual remote Main Project 2013-14 recognize over .)) common poses. "he data from the 2inect is fed to a 86 which contains the control instructions. "he 86 is loaded with the .9!" program commands. "he 86 is connected to the microcontroller I6 :8I6&4+-;;< via an 57.,. cable.57.,. is preferred over =70 as it gives a pure serial output and eliminates the hassles associated with data commands. "he Microcontroller with its -2 memory can be programmed to respond to gestures of our choice. "he microcontroller sends the appropriate commands for the corresponding gestures and because of its internal program memory a large number of program commands can be stored on the microcontroller for every function of a normal remote control.

Dept. of ECE AWH En

2 . Colle e

Virtual remote Main Project 2013-14

Chapter 2 PERIPHERAL INTERFACE CONTROLLERS (PIC)


8eripheral Interface 6ontrollers :8I6< is one of the advanced microcontrollers developed by microchip technologies. "hese microcontrollers are widely used in modern electronics applications. > 8I6 controller integrates all type of advanced interfacing ports and memory modules. "hese controllers are more advanced than normal microcontroller like I9"!$ -)(&. "he first 8I6 chip was announced in &';( :8I6&4()<. >s like normal microcontroller, the 8I6 chip also combines a microprocessor unit called 68= and is integrated with various types of memory modules :5>M, 5OM, !!85OM, etc<, I?O ports, timers?counters, communication ports, etc. >ll 8I6 microcontroller family uses Harvard architecture. "his architecture has the program and data accessed from separate memories so the device has a program memory bus and a data memory bus :more than - lines in a normal bus<. "his improves the bandwidth :data throughput< over traditional von 9eumann architecture where program and data are fetched from the same memory :accesses over the same bus<. 7eparating program and data memory further allows instructions to be sized differently than the -/bit wide data word. General Features High performance 5I76 68= Only,( simple word instructions. >ll single cycle instructions e1cept for program branches which are two cycles. Operating speed@ clock input :.))MHz<, instruction cycle :.))n7<.

Dept. of ECE AWH En

3 . Colle e

Virtual remote Main Project 2013-14 =p to ,4-A-bit of 5>M :data memory<, .(4A- of !!85OM :data memory<, and -kA&B of flash memory. 8in out compatible to 8I6 &46;B0, 8I6 &46;4, 8I6 &46;;. !ight level deep hardware stack. Interrupt capability :up to &B sources<. Cifferent types of addressing modes :direct, Indirect, relative addressing modes<. 8ower on 5eset :8O5<.

8ower/=p "imer :8W5"< and oscillator start/up timer. $ow power/ high speed 6MO7 flash?!!85OM. +ully static design. Wide operating voltage range :..) D (.(4< volts. High sink?source current :.(m><. 6ommercial, industrial and e1tended temperature ranges.

2 1 Intr!"u#t$!n t! PIC1%F&''A ($#r!#!ntr!ller Microcontroller 8I6&4+-;;> is one of the 8I6 Microcontroller +amily microcontroller which is popular at this moment, start from beginner until all professionals, because easy using 8I6&4+-;;> and use +$>7H memory technology so that can be write/erase until thousand times. "he superiority this 5isc Microcontroller compared to with other microcontroller -/bit especially at a speed of and his code compression. 8I6&4+-;;> have B) pin by ,, path of I?O.

+ig ..&.& Dept. of ECE AWH En 4 . Colle e

Virtual remote Main Project 2013-14 8I6&4+-;;> perfectly fits many uses, from automotive industries and controlling home appliances to industrial instruments, remote sensors, electrical door locks and safety devices. It is also ideal for smart cards as well as for battery supplied devices because of its low consumption. !!85OM memory makes it easier to apply microcontrollers to devices where permanent storage of various parameters is needed :codes for transmitters, motor speed, receiver freEuencies, etc.<. $ow cost, low consumption, easy handling and fle1ibility make 8I6&4+-;;> applicable even in areas where microcontrollers had not previously been considered :e1ample@ timer functions, interface replacement in larger systems, coprocessor applications, etc.<.In 7ystem 8rogrammability of this chip :along with using only two pins in data transfer< makes possible the fle1ibility of a product, after assembling and testing have been completed. "his capability can be used to create assembly/line production, to store calibration data available only after final testing, or it can be used to improve programs on finished products.

Dept. of ECE AWH En

! . Colle e

Virtual remote Main Project 2013-14

+ig ..&.. Internal/>rchitecture/of/8I6&4+-;;>/6hip H$)h*Per+!r,an#e RISC CPU

Only ,( single/word instructions to learn >ll single/cycle instructions e1cept for program branches, which are two/cycle Operating speed@ C6 D .) MHz clock input C6 D .)) ns instruction cycle =p to -2 1 &B words of +lash 8rogram Memory, =p to ,4- 1 - bytes of Cata Memory :5>M<, =p to .(4 1 - bytes of !!85OM Cata Memory 8inout compatible to other .-/pin or B)?BB/pin 8I6&46333 and 8I6&4+333 microcontrollers

Dept. of ECE AWH En

" . Colle e

Virtual remote Main Project 2013-14 Per$pheral Features

"imer)@ -/bit timer?counter with -/bit prescaler "imer&@ &4/bit timer?counter with prescaler, can be incremented during 7leep via e1ternal crystal?clock "imer.@ -/bit timer?counter with -/bit period register, prescaler and postscaler "wo 6apture, 6ompare, 8WM modules 7ynchronous 7erial 8ort :778< with 78IF :Master mode< and I.6F :Master?7lave< =niversal 7ynchronous >synchronous 5eceiver "ransmitter :=7>5"?76I< with '/bit address detection 8arallel 7lave 8ort :878< D - bits wide with e1ternal 5C, W5 and 67 controls :B)?BB/pin only< 0rown/out detection circuitry for 0rown/out 5eset :0O5< &)/bit, up to -/channel >nalog/to/Cigital 6onverter :>?C< 0rown/out 5eset :0O5< >nalog 6omparator module :"wo analog comparators , 8rogrammable on/chip voltage reference :*5!+< module , 8rogrammable input multiple1ing from device inputs and internal voltage reference , 6omparator outputs are e1ternally accessible<

Anal!) Features

Spe#$al ($#r!#!ntr!ller Features

&)),))) erase?write cycle !nhanced +lash program memory typical &,))),))) erase?write cycle Cata !!85OM memory typical Cata !!85OM 5etention G B) years 7elf/reprogrammable under software control In/6ircuit 7erial 8rogrammingF :I678F< via two pins 7ingle/supply (* In/6ircuit 7erial 8rogramming Watchdog "imer :WC"< with its own on/chip 56 oscillator for reliable operation 8rogrammable code protection 8ower saving 7leep mode # . Colle e

Dept. of ECE AWH En

Virtual remote Main Project 2013-14


7electable oscillator options In/6ircuit Cebug :I6C< via two pins

C(OS Te#hn!l!).

$ow/power, high/speed +lash?!!85OM technology +ully static design Wide operating voltage range :..)* to (.(*< 6ommercial and Industrial temperature ranges $ow/power consumption

2 2 (e,!r. Or)an$/at$!n !+ PIC1%F&'' "he memory of a 8I6 &4+-;; chip is divided into , sections. "hey are &. 8rogram memory .. Cata memory and ,. Cata !!85OM 1 Pr!)ra, ,e,!r. 8rogram memory contains the programs that are written by the user. "he program counter :86< e1ecutes these stored commands one by one. =sually 8I6&4+-;; devices have a &, bit wide program counter that is capable of addressing -2A&B bit program memory space. "his memory is primarily used for storing the programs that are written :burned< to be used by the 8I6. "hese devices also have -2H&B bits of flash memory that can be electrically erasable ?reprogrammed. !ach time we write a new program to the controller, we must delete the old one at that time. "he figure below shows the program memory map and stack.

Dept. of ECE AWH En

$ . Colle e

Virtual remote Main Project 2013-14

+ig ....& 8I6&4f-;; 8rogram Memory 8rogram counters :86< is used to keep the track of the program e1ecution by holding the address of the current instruction. "he counter is automatically incremented to the ne1t instruction during the current instruction e1ecution. "he 8I6&4+-;3> family has an -/level deep 1 &,/bit wide hardware stack. "he stack space is not a part of either program or data space and the stack pointers are not readable or writable. In the 8I6 microcontrollers, this is a special block of 5>M memory used only for this purpose. !ach time the main program e1ecution starts at address )))) D 5eset *ector. "he address )))B is #reserved% for the #interrupt service routine% :I75<. 2 PIC1%F&'0A Data (e,!r. Or)an$/at$!n "he data memory of 8I6&4+-;; is separated into multiple banks which contain the general purpose registers :I85< and special function registers :785<. >ccording to the type of the microcontroller, these banks may vary. "he 8I6&4+-;; chip only has

Dept. of ECE AWH En

% . Colle e

Virtual remote Main Project 2013-14 four banks :0>92 ), 0>92 &, 0>92 ., and 0>92B<. !ach bank holds &.- bytes of addressable memory.

+ig ..... Cata Memory Organization "he banked arrangement is necessary because there are only ; bits are available in the instruction word for the addressing of a register, which gives only &.- addresses. "he selection of the banks are determined by control bits 58&, 58) in the 7">"=7 registers "ogether the 58&, 58) and the specified ; bits effectively form a ' bit address. "he first ,. locations of 0anks & and ., and the first &4 locations of 0anks. and , are reserved for the mapping of the 7pecial +unction 5egisters :7+5Js<. > bit of 58& K 58) of the 7">"=7 register selects the bank access.

Dept. of ECE AWH En

10 . Colle e

Virtual remote Main Project 2013-14 0>92 ) & . , 58) ) & ) & 58& ) ) & &

"able ...., 7">"=7 register selects 1 Data EEPRO( an" FLASH "he data !!85OM and +lash program memory is readable and writable during normal operation :over the full *CC range<. "his memory is not directly mapped in the register file space. Instead, it is indirectly addressed through the 7pecial +unction 5egisters. "here are si1 7+5s used to read and write this memory@ L !!6O9& L !!6O9. L !!C>"> L !!C>"H L !!>C5 L !!>C5H "he !!85OM data memory allows single/byte read and writes. "he +lash program memory allows single/word reads and four/word block writes. 8rogram memory write operations automatically perform an erase/before write on blocks of four words. > byte write in data !!85OM memory automatically erases the location and writes the new data :erase/before/write<. "he write time is controlled by an on/chip timer. "he write?erase voltages are generated by an on/chip charge pump, rated to operate over the voltage range of the device for byte or word operations.

2 1 P$n Des#r$pt$!n
8I6&4+-;; chip is available in different types of packages. >ccording to the type of applications and usage, these packages are differentiated. "he pin diagrams of a 8I6&4+-;; chip in different packages are shown in the figure below. Dept. of ECE AWH En 11 . Colle e

Virtual remote Main Project 2013-14

+ig &.,.& 8I6&4+-;;> pin details

Input2!utput p!rts 8I6&4+-;; has ( basic input?output ports. "hey are usually denoted by 8O5" > :5 ><, 8O5" 0 :50<, 8O5" 6 :56<, 8O5" C :5C<, and 8O5" ! :5!<. "hese ports are used for input? output interfacing. In this controller, #8O5" >% is only 4 bits wide :5>/ ) to 5>/;<, %8O5" 0% , #8O5" 6%,%8O5" C% are only - bits wide :50/) to 50/;,56/ ) to 56/;,5C/) to 5C/;<, %8O5" !% has only , bit wide :5!/) to 5!/;<. 8O5"/> 8O5"/0 8O5"/6 8O5"/C 8O5"/! 5>/) to 5>/( 50/) to 50/; 56/) to 56/; 5C/) to 5C/; 5!/) to 5!/. "able ... Input?output ports 4 bit wide - bit wide - bit wide - bit wide , bit wide

Dept. of ECE AWH En

12 . Colle e

Virtual remote Main Project 2013-14 >ll these ports are bi/directional. "he direction of the port is controlled by using "5I7:3< registers :"5I7 > used to set the direction of 8O5"/>, "5I7 0 used to set the direction for 8O5"/0, etc.<. 7etting a "5I7:3< bit M&J will set the corresponding 8O5":3< bit as input. 6learing a "5I7:3< bit M)J will set the corresponding 8O5":3< bit as output. :If we want to set 8O5" > as an input, ust set "5I7:>< bit to logical M&J and want to set 8O5" 0 as an output, ust set the 8O5" 0 bits to logical M)J.< >nalog input port :>9) "O >9;<@ these ports are used for interfacing analog inputs. "3 and 53@ "hese are the =7>5" transmission and reception ports. 762@ these pins are used for giving synchronous serial clock input. 76$@ these pins act as an output for both 78I and I.6 modes. C"@ these are synchronous data terminals. 62@ synchronous clock input. 7C)@ 78I data output :78I Mode<. 7C&@ 78I Cata input :78I mode<. 7C>@ data input?output in I.6 Mode. 668& and 668.@ these are capture?compare?8WM modules. O76&@ oscillator input?e1ternal clock. O76.@ oscillator output?clock out. M6$5@ master clear pin :>ctive low reset<.

*pp@ programming voltage input. Dept. of ECE AWH En

13 . Colle e

Virtual remote 8IM@ $ow *oltage 8rogramming input. I9"@ e1ternal interrupt. 5C@ 5ead control for parallel slave port. 67@ 7elect control for parallel slave. 878) to 878;@ 8arallel slave port. *CC@ positive supply for logic and input pins. *77@ Iround reference for logic and input?output pins Main Project 2013-14 "H*@ High voltage test mode controlling. *ref :N?/<@ reference voltage. 77@ 7lave select for the synchronous serial port. ")62&@ clock input to "IM!5 ). "&O7O@ "imer & oscillator output. "&O7&@ "imer & oscillator input. "&62&@ clock input to "imer &. 8IC@ 7erial programming data. 8I6@ serial programming clock.

Os#$llat!r #hara#ter$st$#s

Dept. of ECE AWH En

14 . Colle e

Virtual remote Main Project 2013-14 3">$& and 3">$. are the input and output, respectively, of an inverting amplifier that can be configured for use as an on/chip oscillator, as shown in +igure &&. !ither a Euartz crystal or ceramic resonator may be used. "o drive the device from an e1ternal clock source, 3">$. should be left unconnected while 3">$& is driven, as shown in +igure &.. "here are no reEuirements on the duty cycle of the e1ternal clock signal, since the input to the internal clocking circuitry is through a divide/by/two flip/ flop, but minimum and ma1imum voltage high and lower time specifications must be observed.

+ig &.,.. Oscillator 6onnection and e1ternal clock drive configuration

Chapter 1 CD34%% S5ITCHING IC


"he 6CB)440 is a Euad bilateral switch intended for the transmission or multiple1ing of analog or digital signals. It is pin/for/pin compatible with the 6CB)&40, but e1hibits a much lower on/state resistance. In addition, the on/state resistance is relatively constant over the full signal/input range.

Dept. of ECE AWH En

1! . Colle e

Virtual remote Main Project 2013-14 6CB)440 consists of four bilateral switches, each with independent controls. 0oth the p and the n devices in a given switch are biased on or off simultaneously by the control signal.

+ig ,.& 8in description of 6CB)44 Features

Wide supply voltage range ,* to &(* .High noise immunity ).B( *CC High O9?O++OO 4( d0 output voltage ratio High degree linearity ).&P distortion !1tremely low O++ ).& n> switch leakage *CC $ow crosstalk () d0 between switches

Appl$#at$!ns >nalog signal switching?multiple1ing 7ignal gating 7Euelch control 6hopper AWH En 1" . Colle e

Dept. of ECE

Virtual remote Main Project 2013-14 Modulator?Cemodulator 6ommutating switch Cigital signal switching?multiple1ing 6MO7 logic implementation >nalog/to/digital?digital/to/analog conversion

Chapter 3 RS*212 SERIAL INTERFACE


57/.,. working is based on the =>5" module. >nd our microcontroller is also contained the =>5" module. "he asynchronous serial interface was designed as a Dept. of ECE AWH En 1# . Colle e

Virtual remote Main Project 2013-14 system/to/system communications port. >synchronous means that no synchronization or clocking signal is present, so characters can be sent with any arbitrary time spacing. !ach data signal that is sent over a serial connection is framed by a standard start/and/stop signal. > single ) bit, called the start bit, precedes each character to tell the receiving system that the ne1t eight bits constitute a byte of data. One or two stop bits follow the character to signal that the character has been sent. >t the receiving end of the communication, characters are recognized by the start/and/stop signals instead of by the timing of their arrival. "he asynchronous interface is character oriented and has an appro1imate .)P overhead for the e1tra information that is needed to identify each data signal.

+ig B.&@ '/8in C/"ype 57/.,. 7erial port 8in Cescription 7erial refers to data that is sent over a single wire, with each bit lining up in a series as the bits are sent. "his type of communication is used over the phone system because it provides one wire for data in each direction.

"he heart of any serial port is the =niversal >synchronous 5eceiver?"ransmitter :=>5"< chip. "his chip completely controls the process of breaking the native parallel

Dept. of ECE AWH En

1$ . Colle e

Virtual remote Main Project 2013-14 data within the 86 into serial format and later converting serial data back into the parallel format. In the serial port we are only using the pins ., , and ( :5eceive, "ransmit and 7ignal Iround< because without other control signals the serial port can work properly. >nd for microcontroller to computer communication we are using the =>5" module in the microcontroller, it only needs 53C and Iround pins because here the microcontroller is only receiving the dataJs from the computer.

+ig B.. M>3 .,. pinout and diagram +igure showing the I6 M>3.,. that converts the 57.,. logic level into ""$ compatible logic level and vice/versa.

Chapter 6 7INECT
Dept. of ECE AWH En 1% . Colle e

Virtual remote Main Project 2013-14 2inect is a motion sensing input device by Microsoft for the 3bo1 ,4) video game console and Windows 86s. 0ased around a webcam/style add/on peripheral for the 3bo1 ,4) console, it enables users to control and interact with the 3bo1 ,4) without the need to touch a game controller, through a natural user interface using gestures and spoken commands. "he pro ect is aimed at broadening the 3bo1 ,4)Os audience beyond its typical gamer base. 2inect competes with the Wii 5emote 8lus and 8lay7tation Move with 8lay7tation !ye motion controllers for the Wii and 8lay7tation , home consoles, respectively. > version for Windows was released on +ebruary &, .)&.. 2inect was launched in 9orth >merica on 9ovember B, .)&), in !urope on 9ovember &), .)&), in >ustralia, 9ew Qealand and 7ingapore on 9ovember &-, .)&), and in Rapan on 9ovember .), .)&). 8urchase options for the sensor peripheral include a bundle with the game 2inect >dventures and console bundles with either a B I0 or .() I0 3bo1 ,4) console and 2inect >dventures. >fter selling a total of - million units in its first 4) days, the 2inect holds the Iuinness World 5ecord of being the Sfastest selling consumer electronics deviceS. &- million units of the 2inect sensor had been shipped as of Ranuary .)&..Microsoft released 2inect software development kit for Windows ; on Rune &4, .)&&. "his 7C2 will allow developers to write 2inecting apps in 6NN?6$I, 6T, or *isual 0asic .9!".

Dept. of ECE AWH En

20 . Colle e

Virtual remote Main Project 2013-14

+ig (.& kinect 1D Depth Sens!rs D "his is a combination of a depth pro ector :left reticule< and sensor :right reticule< to calculate distance RG8 Ca,era D > regular video camera that has a resolution of 4B)1B-) at ,) frames per second (!t!r$/e" T$lt D "he motorized tilt enables you to ad ust the camera up or down .; degrees to ensure that the camera has the best possible view (ult$*Arra. ($#r!ph!ne D > four/microphone array that is mounted as a single microphone 6 1 Te#hn!l!). 2inect builds on software technology developed internally by 5are, a subsidiary of Microsoft Iame 7tudios owned by Microsoft, and on range camera technology by Israeli developer 8rime 7ense, which developed a system that can interpret specific gestures, making completely hands/free control of electronic devices possible by using an infrared pro ector and camera and a special microchip to track the movement of ob ects and individuals in three dimension. "his ,C scanner system called $ight 6oding employs a variant of image/based ,C reconstruction. "he 2inect sensor is a horizontal bar connected to a small base with a motorized pivot and is designed to be positioned lengthwise above or below the video display. "he device features an S5I0 camera, depth sensor and multi/array microphone running proprietary softwareS, which provide full/body ,C motion capture, facial recognition and voice recognition capabilities. >t launch, voice recognition was only made available in Rapan, the =nited 2ingdom, 6anada and the =nited 7tates. Mainland !urope received the feature later in spring .)&&. 6urrently voice recognition is supported in >ustralia, 6anada, +rance, Iermany, Ireland, Italy, Rapan, Me1ico, 9ew Qealand, =nited 2ingdom and =nited 7tates. "he 2inect sensorOs microphone array enables the 3bo1 ,4) to conduct acoustic source localization and ambient noise suppression, allowing for things such as headset/free party chat over 3bo1 $ive. Dept. of ECE AWH En 21 . Colle e

Virtual remote Main Project 2013-14 "he depth sensor consists of an infrared laser pro ector combined with a monochrome 6MO7 sensor, which captures video data in ,C under any ambient light conditions. "he sensing range of the depth sensor is ad ustable, and the 2inect software is capable of automatically calibrating the sensor based on game play and the playerOs physical environment, accommodating for the presence of furniture or other obstacles. Cescribed by Microsoft personnel as the primary innovation of 2inect, the software technology enables advanced gesture recognition, facial recognition and voice recognition. >ccording to information supplied to retailers, 2inect is capable of simultaneously tracking up to si1 people, including two active players for motion analysis with a feature e1traction of .) oints per player. However, 8rime 7ense has stated that the number of people the device can SseeS :but not process as players< is only limited by how many will fit in the field/of/view of the camera.

+ig.(.&.& image shows the laser grid 2inect uses to calculate depth this infrared 5everse engineering has determined that the 2inect sensor outputs video at a frame rate of ,) Hz. "he 5I0 video stream uses -/bit *I> resolution :4B) A B-) pi1els< with a 0ayer color filter, while the Monochrome depth sensing video stream is in *I> resolution :4B) A B-) pi1els< with &&/bit depth, which provides .,)B- levels of sensitivity. "he 2inect sensor Dept. of ECE AWH En 22 . Colle e

Virtual remote Main Project 2013-14 has a practical ranging limit of &..D,.( m :,.'D&& ft< distance when used with the 3bo1 software. "he area reEuired to play 2inect is roughly 4 m., although the sensor can maintain tracking through an e1tended range of appro1imately ).;D4 m :..,D.) ft<. "he sensor has an angular field of view of (;U horizontally and B,U vertically, while the motorized pivot is capable of tilting the sensor up to .;U either up or down. "he horizontal field of the 2inect sensor at the minimum viewing distance of V).- m :..4 ft< is therefore V-; cm :,B in<, and the vertical field is V4, cm :.( in<, resulting in a resolution of ust over &., mm :).)(& in< per pi1el. "he microphone array features four microphone capsules and operates with each channel processing &4/bit audio at a sampling rate of &4 kHz. 0ecause the 2inect sensorOs motorized tilt mechanism reEuires more power than the 3bo1 ,4)Os =70 ports can supply, the device makes use of a proprietary connector combining =70 communication with additional power. 5edesigned 3bo1 ,4) 7 models include a special >=3 port for accommodating the connector, while older models reEuire a special power supply cable :included with the sensor that splits the connection into separate =70 and power connectionsW power is supplied from the mains by way of an >6 adapter. 6 2 H!9 (!t$!n Dete#t$!n 5!r:s $n 0;!< 7$ne#t

Dept. of ECE AWH En

23 . Colle e

Virtual remote Main Project 2013-14

(...& Motion Cetection working "he prototype for MicrosoftJs 2inect camera and microphone famously cost X,),))). >t midnight "hursday morning, youJll be able to buy it for X&() as an 3bo1 ,4) peripheral. Microsoft is pro ecting that it will sell ( million units between now and 6hristmas. WeJll have more details and a review of the system soon, but for now itJs worth taking some time to think about how it all works. Ca,era 2inectJs camera is powered by both hardware and software. >nd it does two things@ generate a three/dimensional :moving< image of the ob ects in its field of view, and recognize :moving< human beings among those ob ects.

Dept. of ECE AWH En

24 . Colle e

Virtual remote Main Project 2013-14

+ig.(.... >n intensity image and gray scale coded depth image of a person. 7ince the background is similar color to the personJs shirt, it is difficult for the computer to segment the person from the background using the intensity image. "he segmentation is trivial using the depth image Older software programs used differences in color and te1ture to distinguish ob ects from their backgrounds. 8rime 7ense, the company whose tech powers 2inect, and recent Microsoft acEuisition 6anesta use a different model. "he camera transmits invisible near/infrared light and measures its #time of flight% after it reflect off the ob ects. "ime/of/flight works like sonar@ If you know how long the light takes to return, you know how far away an ob ect is. 6ast a big field, with lots of pings going back and forth at the speed of light, and you can know how far away a lot of ob ects are. =sing an infrared generator also partially solves the problem of ambient light. 7ince the sensor isnJt designed to register visible light, it doesnJt get Euite as many false positives.

Dept. of ECE AWH En

2! . Colle e

Virtual remote Main Project 2013-14 8rime 7ense and 2inect go one step further and encode information in the near/ I5 light. >s that information is returned, some of it is deformed Y which in turn can help generate a finer image of those ob ectsJ ,/C te1ture, not ust their depth. With this tech, 2inect can distinguish ob ectsJ depth within & centimeter and their height and width within , mm.

+igure (..., 8rime 7enses !1plaining the 8rime 7ensor 5eference Cesign.

Chapter %
PO5ER SUPPL=

> stable C6 power is necessary for the proper working of most of the electronic system. "he reEuired C6 power is derived from the ac mains using a transformer, Dept. of ECE AWH En 2" . Colle e

Virtual remote Main Project 2013-14 rectifier, filter and voltage regulators. "he .,)*?() hertz >6 voltage is at first step down using a step down transformer. "hen the voltage is rectified using the bridge rectifier. "he output may contain dc components called ripples. It is removed by capacitive filtering. 0ut the produced C6 voltage will vary with changes in the mains voltage. 7o to provide a stable voltage, voltage regulators are used. > voltage stabilizer is an electronic circuit that supplies a constant voltage regardless of changes in load current, temperature, and >6 line voltage. >lthough voltage regulators can be designed using op/amps, it is Euicker and easier to use I6 *oltage regulators. +urthermore, I6 voltage regulators are versatile and relatively ine1pensive and are available with features such as programmable output, current ? voltage boosting, internal short Dcircuit current limiting, thermal shut down, and floating operation for high voltage applications. I6 voltage stabilizers are of the following types@ +i1ed output voltage regulators :8ositive and?or 9egative<, >d ustable output voltage regulators :8ositive or 9egative output voltage< 7witching regulators and 7pecial regulators. !1cept for the switching regulators, all other type of regulators is called linear regulators 7eries regulators use a power transistor connected in series between the unregulated C6 input and the load. "he output voltage is controlled by continuous voltage drop taking place across the series pass transistor. 7ince the transistor conducts in the active or linear region, these regulators are also called linear regulators. "he impedance of a linear regulatorJs active element may be continuously varied to supply a desired current to load. On the other hand, in a switching 5egulator power transistor is turned on and off at a rate such that the regulator delivers the desired average current in periodic pulses to the load. 0ecause the switching element dissipates negligible power in either on or off state, the switching regulators are more efficient than the linear regulators. 9evertheless, in the switching regulators the power dissipation is substantial during the switching intervals :on to off or off to on<. In addition, most loads cannot accept the average current in periodic pulses. "herefore most practical regulators are of linear type.

*oltage regulators are commonly used for on/card regulation and laboratory type power supplies. *oltage regulators, especially of the switching type are Dept. of ECE AWH En 2# . Colle e

Virtual remote Main Project 2013-14 used as control circuits in 8ulse Width Modulation :8WM<, push/pull bridges, and series type switch mode supplies. >lmost all power supplies use some kind of voltage regulator I6 because they are simple to use, reliable, low in cost and above all available in a variety of voltage and current ratings. > vast number of *oltage regulators are available, data sheets and application notes provided by the manufacturer contain information on the design and use of these devices.

With the advent of microelectronics it is possible to incorporate the complete circuit of voltage regulators on monolithic silicon chip :I6<. "his gives low cost, high reliability, reduction in size and e1cellent performance. !1amples of monolithic regulators are ;-33?;'33 series, ;., general/purpose regulators etc.;-33 are three terminal, positive, fi1ed voltage regulators. "he first pin is input, second ground and the third pin is output. Here we used this series. "he output voltage options available are (, (.., 4, -, -.(,',&.,&(,&- and .B.in ;-33 the last no@ 33 stands for the output voltage and it gives a ma1imum output current of & >mpere. ).& microfarad capacitors are connected at the input and output of the voltage regulator I6 ."he input capacitor is for reducing lead inductance and the output capacitance for smoothing the transient response. "hese regulators are available in two types of packages@ &. .. Metal 8ackage :"O/,< 8lastic 8ackage :"O/..)<

7ome of the important performance parameters of I6 ;-33 are@ $ine regulation $oad regulation 5ipple re ection Over current protection "hermal overload protection

Dept. of ECE AWH En

2$ . Colle e

Virtual remote Main Project 2013-14 +or >6 power conversion we need two power transformers one in transmitter and another in the receiver. 5eEuired specification for the transformer is given below, *oltage@ >6 .,)*?4* +reEuency@ () Hz 6urrent@ ())ma

+or our pro ect we reEuire one ( * supply. +or this at first a step down transformer with rating .,)?4/), & >mpere is used. "he stepped down voltage is rectified using a bridge rectifier making use of four &9B)); diodes. "he output of the rectifier is filtered to remove ripples using a capacitive filter of B;)) microfarad. "hen the output is given to a voltage regulator with I6 ;-)( that produces (* output.

Dept. of ECE AWH En

2% . Colle e

Virtual remote Main Project 2013-14

Chapter ' 5OR7ING

+ig ;.& 0lock diagram "he 2inect can be considered as the key component in our model of *irtual 5emote. "he 2inect sends out I5 beams across the entire field or area by means of its infrared laser pro ector. "he beams are deflected off ob ects or obstacles in its path and these deflected beams are picked up by the 6MO7 sensor. "he kinect forms a skeletal like framework of the body, much like the ones used in animatronics and motion capture mechanism used in movie studios. "he 2inect already comes preloaded with the data to recognize over .)) common poses. "he 2inect cannot be connected to the microprocessor directly as the microprocessor will not be able to process images directly from kinect, "he data from the 2inect is 6O99!6"!C to a 86 via =70 ."he 86 contains the control instructions. "he 86 is loaded with the .net program commands. "he 86 is connected to the microcontroller I6 :8I6&4+-;;< via an 57.,. cable.57.,. is preferred over =70 as it gives a pure serial output and eliminates the hassles associated with data commands.M>3 .,. level converter is being used here so as to step down the output voltage to the optimum value to be used with a microcontroller. "he microcontroller is fed with a (* power supply. "he M>3.,. is an integrated circuit, first created by Ma1im Integrated 8roducts, that converts signals from an 57/.,. serial port to signals suitable for use in Dept. of ECE AWH En 30 . Colle e

Virtual remote Main Project 2013-14 ""$ compatible digital logic circuits. "he M>3.,. is a dual driver?receiver and typically converts the 53, "3, 6"7 and 5"7 signals.

"he drivers provide 57/.,. voltage level outputs :appro1. Z ;.( *< from a single N ( * supply via on/chip charge pumps and e1ternal capacitors. "his makes it useful for implementing 57/.,. in devices that otherwise do not need any voltages outside the ) * to N ( * range, as power supply design does not need to be made more complicated ust for driving the 57/.,. in this case. "he receivers reduce 57/.,. inputs :which may be as high as Z .( *<, to standard ( * ""$ levels. "hese receivers have a typical threshold of &., *, and a typical hysteresis of ).( *. "he later M>3.,.> is backwards compatible with the original M>3.,. but may operate at higher baud rates and can use smaller e1ternal capacitors D ).& [+ in place of the &.) [+ capacitors used with the original device. "he Microcontroller with its -2 memory can be programmed to respond to gestures of our choice. "he microcontroller sends the appropriate commands for the corresponding gestures and because of its internal program memory a large number of program commands can be stored on the microcontroller for every function of a normal remote control. > B MHz crystal oscillator is used to set clock pulse to the microcontroller. "he $6C display is used to view the commands. It displays appropriate commands for each gesture. If we show the gesture for ne1t channel, it displays 9!3", and likewise they display commands in accordance with the data they are fed. >ny I.5 transmitter fully compatible with the device we are operating on can be used. 7o in general , when a person waves his hand or shows a particular gesture, the image of his gesture is captured by 2inect camera and the gesture is compared with a seEuence of preloaded gesture stored inside the kinect. If a match is found, then the data is send to the 86 which contains the control instructions. "he 86 sends the instructions to the microcontroller which processes and analyzes the data and sends the accurate data to the I5 "ransmitter which is compatible with the device which is being operated.

Dept. of ECE AWH En

31 . Colle e

Virtual remote Main Project 2013-14 "he newer M>3,.,. is also backwards compatible, but operates at a broader voltage range, from , to (.( *. "he Microcontroller with its -2 memory can be programmed to respond to gestures of our choice. "he microcontroller sends the appropriate commands for the corresponding gestures and because of its internal program memory a large number of program commands can be stored on the microcontroller for every function of a normal remote control.

' 1 P!9er Suppl.

+ig ;.&.& 8ower 7upply 6ircuit Ciagram

+igures showing "5 power supply circuit diagram for 8I6 microcontroller. In the power supply the transformer converting the .,)* >6 mains in to ).(> 4* >6. "his is then rectifying using four &9B)); diodes arranged in bridge configuration, filtered by &)))uf electrolytic capacitor. "his voltage may be about -* to regulate this voltage to (* we are using ;-)( (* regulator and the ).)&uf capacitor is using for eliminating the 5+ noises.

' 2 Inter+a#$n) LCD (!"ules 9$th PIC


> large number of embedded pro ect reEuire some type of user interface. "his includes displaying numerical, te1tual and graphical data to user. +or very simple numerical display we can use ; segment displays. If the reEuirement is little more than that, like displaying some alphanumeric te1t, we can use $6C Modules. "hey are cheap enough to be used in low cost pro ects. "hey come in various sizes for different Dept. of ECE AWH En 32 . Colle e

Virtual remote Main Project 2013-14 reEuirement. > very popular one is &41. models. It can display . lines of &4 characters. Other models are &41B, .)1B, -1&, -1 . etc +irst create a M8$>0 pro ect. 9ame the pro ect $6C. >lso add a main file called >l#"?test #> "o use my $6C library you need to add it to your pro ect. Rust copy?paste the following files to your pro ect folder. Hea"er F$les

lcd.h myutils.h

S!ur#e F$le

lcd.c

Hardware Connections

+ig.;...& 7imple Interfacing $6C Modules with 8I6

Dept. of ECE AWH En

33 . Colle e

Virtual remote Main Project 2013-14 8I6 development board then you donOt need to care for crystal or power supply :they are already on board<. \ou ust need to connect the $6C to 8I6 micro by using ; I?O lines. (v supply for $6C and *ariable 5esistor :&)2< can be easily drawn from the board.

' 1 C$r#u$t "$a)ra,

+ig ;.,.&.6ircuit diagram *irtual remote is a remote control technology based on the hand movement with the help of a sensor. "his sensor detects the human action and provide corresponding signal for transmission. "he range of sensor is up to &) meter. "he sensor can detect multiple peopleJs action, but on this pro ect we make only one persons action detection.

Dept. of ECE AWH En

34 . Colle e

Virtual remote Main Project 2013-14

"he circuit consist of 8I6&4f-;;>, M>3.,. and two B)44 switching I6Js. 8I6 is B) pin I6 used as the controller. When the power is turned on controller will be ready for working. "he input of controller is connected to system and the output is connected to switching I6. "he system is connected to serial port and output of system is connected to M>3.,.. "he ma1 .,. convert the signal in to microcontroller working format. "he port 50 is used as output control pin. !ach pin is connected to each switch of switching I6 B)44. 7uppose *O$=M! N is connected to switch/& and this control pin is connected to 50), i.e. the first pin of port 0. when we make a corresponding movement of volumeN. 2inect detect the movement and system process the signal and provide a high signal to 50), so the switch & will be turned on and volume will be controlled change in volume.

Dept. of ECE AWH En

3! . Colle e

Virtual remote Main Project 2013-14

Chapter & PIC PROGRA((ING IN C 5ITH (PLA8 IDE

M8$>0 Integrated Cevelopment !nvironment :IC!< is a free, integrated toolset for the development of embedded applications employing MicrochipOs 8I6] and ds8I6] micro controllers. > rich set of compilers and assemblers are also available with it. "his post teaches you to how to start programming your 8I6 microcontroller in 6 using M8$>0 IC!. "o begin with download and install M8$>0 IC! from the website. ConJt forget to install HI"!6H 6 compiler when it asks you during the installation process. +or the demonstration purpose I am using M8$>0 version -.4). 9ow start the M8$>0. "he following screen appears.

"his is the environment where you do your further work. 9e1t select the pro ect wizard from the 8ro ect menu. 9e1t select the 8ic which you are using. Here 8I6 &4+-;;> is used.

Dept. of ECE AWH En

3" . Colle e

Virtual remote Main Project 2013-14

9e1t select the compiler tool suite. Here HI"!6H 6 compiler is used and it is selected.

9e1t give the name of the pro ect and select a pro ect directory where the necessary files needed for your pro ect are kept. Here #test S is the pro ect name.

Dept. of ECE AWH En

3# . Colle e

Virtual remote Main Project 2013-14

Here we can add the files reEuired for our pro ect. +or the time being you can leave it. 6lick ne1t to continue.

Here we can add the files reEuired for our pro ect. +or the time being you can leave it. 6lick ne1t to continue.

Dept. of ECE AWH En

3$ . Colle e

Virtual remote Main Project 2013-14

9ow everything is over. Once you click finish you can see a window as shown below.

Here you can add various files for your pro ect. Open a new file from the file menu and enter the following program and save it as Sled.cS. Dept. of ECE AWH En 3% . Colle e

Virtual remote Main Project 2013-14

9ow you have to add this file to the source file as shown below.

In the program we have used a delay function which is included in the header file Sdelay.hS. 7o we have to add Sdelay.hS to the header files and Sdelay.cS files to the header files as shown below.

Dept. of ECE AWH En

40 . Colle e

Virtual remote Main Project 2013-14

Once this is complete you can build your pro ect by selecting O0uildO option from the 8ro ect menu or by pressing +&). If there are no errors then you will get a message O0uild 7uccessful.

+or the proper working of the 8I6 you will have to set the configuration bits. \ou can set it in M8$>0 itself. +rom the OconfigureO menu select 6onfiguration bits and you can set the various bits as shown below. > typical value is ,+;> for a &)MHz crystal. Dept. of ECE AWH En 41 . Colle e

Virtual remote Main Project 2013-14

>fter building the he1 file will be formed. >lso you can e1port your he1 file :+ile menu /G !1port +ile<. "he advantage is that the together with the program code, !!85OM, configuration bits, Cevice IC etc will be automatically programmed into the 8I6. 9ow you can use any of the programmers to program the 8I6.

Dept. of ECE AWH En

42 . Colle e

Virtual remote Main Project 2013-14

Chapter @ PC8 PREPARATION


9owadays, artwork is drawn using either a dedicated 860 6>C program or a suitable drawing?graphics package. It is absolutely essential that our 860 software prints holes in the middle of pads, which will act as center marks when drilling. It is virtually impossible to accurately hand/drill boards without these holes. If weJre using a general/purpose 6>C or graphics package, define pads as either a grouped ob ect containing a black/filled circle with a smaller concentric white/filled circle on top of it, or as an unfilled circle with a thick black line :i.e. a black ring<. When defining pad and line shapes, the minimum size recommended for vias :through/linking holes< for reliable results is () mil, assuming ).-mm drill sizeW & mil ^ :&?&)))<th of an inch. 4(mil round or sEuare pads for normal components and CI$ I6s, with ).-mm hole, will allow a &..( mil down to &)mil if we really need to. 6entre/to/centre spacing of &..(mil tracks should be .(milYslightly less may be possible if our printer can manage it. "ake care to preserve the correct diagonal track/track spacing on mitered cornersW grid is .( mil and track width &..(mil. "he artwork must be printed such that the printed side is in contact with the 860 surface when e1posing, to avoid blurred edges. In practice, this means that if we design the board as seen from the component side, the bottom :solder side< layer should be printed the McorrectJ way round, and the top side of a double/sided board must be printed mirrored. @ 1 OUTPUT DEAICES $aser printers offer the best all/round solution. "hese are affordable, fast, and good/Euality. "he printer used must have at least 4))dpi resolution for all but the simplest 860s, as we will usually be working in multiples of ).)4cm :B) tracks per inch<. 4)) dpi divides into B), so we can get consistent spacing and line width. It is very important that the printer produces a good solid black with no toner pinholes. If the printer has a density control, set it to the blackest. !ven the best laser printers donJt Dept. of ECE AWH En 43 . Colle e

Virtual remote Main Project 2013-14 generally cover large areas well, but usually this isnJt a problem as long as fine tracks are solid.

We may need to specify a vertical offset in our 860 software to make it print on the right part of the page. 7ome laser printers have poor dimensional accuracy, which can cause problems for large 860s. 0ut as long as any error is linear, it can be compensated by scaling the printout in software. @ 2 ETCHING +erric chloride etch/ant is a messy stuff, but easily available and cheaper than most alternatives. It attacks any metal including stainless steel. 7o when setting up a 860 etching area, use a plastic or ceramic sink, with plastic fittings and screws wherever possible, and seal any metal screws with silicone. 6opper water pipes may get splashed or dripped/on, so sleeve or cover them in plasticW heat/shrink sleeving is great if weJre installing new pipes. +ume e1traction is not normally reEuired, although a cover over the tank or tray when not in use is a good idea. We would always use the he1 hydrate type of ferric chloride, which should be dissolved in warm water until saturation. >dding a teaspoon of table salt helps to make the etch/ant clearer for easier inspection. >void anhydrous ferric chloride. It creates a lot of heat when dissolved. 7o always add the powder very slowly to waterW do not add water to the powder, and use gloves and safety glasses. "he solution made from anhydrous ferric chloride doesnJt etch at all, so we need to add a small amount of hydrochloric acid and leave it for a day or two. >lways take e1treme care to avoid splashing when dissolving either type of ferric chloride, as it tends to clump together and we often get big chunks coming out of the container and splashing into the solution. It can damage eyes and permanently stain clothing. If weJre making 860s in a professional environment, where time is money, we would get a heated bubble/etch tank. With fresh hot ferric chloride, a 860 will etch in well under five minutes. +ast etching produces better edge/Euality and consistent line widths. If we arenJt using a bubble tank, we need to agitate freEuently to ensure even etching. Warm the etch/ant by putting the etching tray inside a larger tray filled with boiling water. Dept. of ECE AWH En 44 . Colle e

Virtual remote Main Project 2013-14 @ 1 TIN PLATING "in/plating a 860 makes it a lot easier to solder, and is pretty much essential for surface mount boards. =nless we have access to a roller tinning machine, chemical tinning is the only option. =nfortunately, tin/plating chemicals are e1pensive but the results are usually worth it. If we donJt tin/plate the board, either leave the photo resist coating on :most resists are intended to act as soldering flu1es< or spray the board with rework flu1 to prevent the copper from o1idizing. 5oom/temperature tin/plating crystals produce a good finish in a few minutes. "here are other tinning chemicals available, some of which reEuire mi1ing with acid or high/temperature use. !nsure that the temperature of the tinning solution is at least .( o6, but not more than B)o6. If reEuired, either put the bottle in a hot water bath or put the tinning tray in a bigger tray filled with hot water to warm it up. @ 3 DRILLING If we have fiberglass board, we must use tungsten carbide drill bits. +iberglass eats normal high/speed steel :H77< bits very rapidly, although H77 drills are all right for odd larger sizes :G. mm<. 6arbide drill bits are e1pensive and the thin ones snap very easily. When using carbide drill bits below & mm, we must use a good vertical drill stand. we will break drill very Euickly without one. 6arbide drill bits are available as straight/shank or thick :sometimes called MturboJ< shank. In straight shank, the whole bit is the diameter of the hole, and in thick shank, a standard/size :typically about ,.( mm< shank tapers down to the hole size. "he straight/shank drills are usually preferred because they break less easily and are usually cheaper. "he longer thin section provides more fle1ibility. 7mall drills for 860 use usually come with either a set of collets of various sizes or a ,/ aw chuck. 7ometimes the ,/ aw chuck is an optional e1tra and is worth getting for the time it saves on changing collets. +or accuracy, however, ,/ aw chucks arenJt brilliant, and small drill sizes below & mm Euickly form grooves in the aws, preventing good grip. 0elow & mm, we would use collets, and buy a few e1tra of the smallest onesW keeping one collect per drill size, as using a larger drill in a collect will open it out and it no longer grips smaller drills well. We need a good strong light on the board when drilling, to ensure accuracy. > dichroic halogen lamp, under/run at '* to reduce brightness, can be mounted on a microphone gooseneck for easy positioning.

Dept. of ECE AWH En

4! . Colle e

Virtual remote Main Project 2013-14 It can be useful to raise the working surface about &( cm above the normal desk height for more comfortable viewing. Cust e1traction is nice, but not essentialYan occasional blow does the trick_ > foot/pedal control to switch the drill MoffJ and MonJ is very convenient, especially when freEuently changing bits.

@ 6 CUTTING > small guillotine is the easiest way to cut fiberglass laminate. Ordinary saws :band saws, igsaws, and hacksaws< will be blunted Euickly unless these are carbide/ tipped, and the dust can cause sink irritation. > carbide tile/saw blade in a igsaw might be worth a try. ItJs also easy to accidentally scratch through the protective film when sawing, causing photo resist scratches and broken tracks on the finished board. > sheet/ metal guillotine is also e1cellent for cutting boards, provided the blade is fairly sharp. "o make cut/outs, drill a series of small holes, punch out the blank, and file to size. >lternatively, use a fretsaw or small hacksaw, but be prepared to replace blades often. With practice itJs possible to do corner cutouts with a guillotine but we have to be very careful that we donJt over/cut_ @ % SOLDERING "here are many soldering techniEues like wave soldering, hand soldering, hot air soldering.etc here we are using hand soldering method for this pro ect. "here is one 860 in which >ll I6s are fi1ed using I6 bases. "he transformer is fi1ed outside the 860.

Dept. of ECE AWH En

4" . Colle e

Virtual remote Main Project 2013-14

+ig '.4.& 860 layout

Dept. of ECE AWH En

4# . Colle e

Virtual remote Main Project 2013-14

Chapter 14
PROGRA( (a$n pr!)ra, Tinclude `htc.hG Tinclude Susart.hS Tinclude Sdelay.hS aa6O9+II:+O76aH7 K WC"!aO++ K $*8aO++ <W Tdefine led 50; void init:<W unsigned char fW void mdelay:< b CelayMs:&))<W c static void interrupt isr:void< b unsigned char k, inW if :56I+< b in ^ getch:<W putchr:O7O<W putchr:in<W lcdaclear:<W if :in ^^ OEO< b Dept. of ECE AWH En 4$ . Colle e

Virtual remote Main Project 2013-14 50)^&W lcdaputs:Schannel NS<W c else if :in ^^ OwO< b 50&^&W lcdaputs:Schannel /S<W c else if :in ^^ OeO< b 50.^&W lcdaputs:Svolum NS<W c else if :in ^^ OrO< b 50,^&W lcdaputs:Svolum /S<W c else if :in ^^ OtO< b 50B^&W lcdaputs:SO9?O++S<W c CelayMs:&))<W 8O5"0^)W c c main:void< b "5I76 ^ )1ffW "5I7C^)W >C6O9&^4W 8O5"0^)W 8O5"C^)W Dept. of ECE AWH En 4% . Colle e

Virtual remote Main Project 2013-14 initacomms:<W II! ^ &W 8!I! ^ &W 56I! ^ &W ldcainit:<W ldcaputs:SwelcomeS<W putchr:O7O<W putchr:O7O<W "5I70^)W while :&< b led^)W CelayMs:&))<W led^&W CelayMs:&))<W c c void init:< b c L#" h ?H H H H? ?H write a byte to the $6C in B bit mode H? e1tern void lcdawrite:unsigned char<W ?H 6lear and home the $6C H? Dept. of ECE AWH En !0 . Colle e $6C interface header file 7ee lcd.c for more info

Virtual remote Main Project 2013-14 e1tern void lcdaclear:void<W ?H write a string of characters to the $6C H? e1tern void lcdaputs:const char H s<W ?H Io to the specified position H? e1tern void lcdagoto:unsigned char pos<W ?H intialize the $6C / call before anything else H? e1tern void lcdainit:void<W e1tern void lcdaputch:char<W ?H Tdefine L#" # 7et the cursor position H? lcdacursor:1< lcdawrite:::1<K)1;+<d)1-)<

Tifndef a3">$a+5!e ?? =nless specified elsewhere, BMHz system freEuency is assumed Tdefine a3">$a+5!e B)))))) Tendif

Tinclude Tinclude Tdefine Tdefine Dept. of ECE

`htc.hG Slcd.hS $6Ca57 5>) $6Ca5W 5>. AWH En !1 . Colle e

Virtual remote Main Project 2013-14 Tdefine $6Ca!9 5>& Tdefine $6CaC>"> 8O5"C Tdefine $6Ca7"5O0!:< ::$6Ca!9 ^ &<,:$6Ca!9^)<<

?H write a byte to the $6C in B bit mode H? void lcdawrite:unsigned char c< b aadelayaus:B)<W $6CaC>"> ^ : : c GG B < K )1)+ <W $6Ca7"5O0!:<W $6CaC>"> ^ : c K )1)+ <W $6Ca7"5O0!:<W c ?H H H? void lcdaclear:void< b $6Ca57 ^ )W lcdawrite:)1&<W aadelayams:.<W c ?H write a string of chars to the $6C H? void Dept. of ECE AWH En !2 . Colle e 6lear and home the $6C

Virtual remote Main Project 2013-14 lcdaputs:const char H s< b $6Ca57 ^ &W ?? write characters while:Hs< lcdawrite:HsNN<W c ?H write one character to the $6C H? void lcdaputch:char c< b $6Ca57 ^ &W ?? write characters lcdawrite: c <W c

?H H Io to the specified position H? void lcdagoto:unsigned char pos< b $6Ca57 ^ )W lcdawrite:)1-)Npos<W c ?H initialise the $6C / put into B bit mode H? void lcdainit:< b char initavalueW Dept. of ECE AWH En !3 . Colle e

Virtual remote Main Project 2013-14 >C6O9& ^ )1)4W initavalue ^ )1,W "5I7>^)W "5I7C^)W $6Ca57 ^ )W $6Ca!9 ^ )W $6Ca5W ^ )W aadelayams:&(<W $6Ca7"5O0!:<W aadelayams:(<W $6Ca7"5O0!:<W aadelayaus:.))<W $6Ca7"5O0!:<W aadelayaus:.))<W $6CaC>"> ^ .W $6Ca7"5O0!:<W lcdawrite:)1.-<W ?? 7et interface length lcdawrite:)1+<W ?? Cisplay On, 6ursor On, 6ursor 0link lcdaclear:<W c Usart h Tifndef a7!5I>$aHa Tdefine a7!5I>$aHa Tdefine 0>=C '4)) Dept. of ECE AWH En !4 . Colle e ?? 6lear screen lcdawrite:)14<W ?? 7et entry Mode ?? +our bit mode ?? wait &(m7ec after power applied, ?? Cisable analog pins on 8O5">

$6CaC>"> ^ initavalueW

Virtual remote Main Project 2013-14 Tdefine +O76 B))))))$ Tdefine 9I9! ) ?H =se 'bit communicationf +>$7!^-bit H?

Tdefine CI*IC!5 ::int<:+O76?:&4=$ H 0>=C< /&<< Tdefine HIIHa78!!C & Tif 9I9! ^^ & Tdefine 9I9!a0I"7 )1B) Telse Tdefine 9I9!a0I"7 ) Tendif Tif HIIHa78!!C ^^ & Tdefine 78!!C )1B Telse Tdefine 78!!C ) Tendif Tif defined:a&4+-;< dd defined:a&4+--< Tdefine 53a8I9 "5I70. Tdefine "3a8I9 "5I70( Telse Tdefine 53a8I9 "5I76; Tdefine "3a8I9 "5I764 Tendif ?H 7erial initialization H? Tdefine initacomms:<g 53a8I9 ^ &W g "3a8I9 ^ &W 7805I ^ CI*IC!5W g g g !! . Colle e

567"> ^ :9I9!a0I"7d)1')<W Dept. of ECE

"37"> ^ :78!!Cd9I9!a0I"7d)1.)< AWH En

Virtual remote Main Project 2013-14 void putch:unsigned char<W unsigned char getch:void<W unsigned char getche:void<W void putchr:char<W Tendif Usart # Tinclude `htc.hG Tinclude `stdio.hG Tinclude Susart.hS void putch:unsigned char byte< b ?H output one byte H? while:_"3I+< ?H set when register is empty H? continueW "35!I ^ byteW c unsigned char getch:< b ?H retrieve one byte H? while:_56I+< ?H set when register is not empty H? continueW return 565!IW c unsigned char getche:void< b unsigned char cW putch:c ^ getch:<<W Dept. of ECE AWH En !" . Colle e

Virtual remote Main Project 2013-14 return cW c void putchr:char byte&< b while:_"3I+<W "35!I ^ :unsigned char<byte&W c Dela. h ?H H H H H H H H H H H H H? ?H 7et the crystal freEuency in the 688 predefined symbols list in H8C8I6, or on the 8I66 commmand line, e.g. picc /C3">$a+5!e^BMHQ or picc /C3">$a+5!e^&))2HQ 9ote that this is the crystal freEuency, the 68= clock is divided by B. Dept. of ECE AWH En !# . Colle e 9ote that there are range limits@ 1 must not e1ceed .(( / for 1tal freEuencies G &.MHz the range for Celay=s is even smaller. "o use Celay=s it is only necessary to include this fileW to use CelayMs you must include delay.c in your pro ect. +unctions available@ Celay=s:1< CelayMs:1< Celay specified number of microseconds Celay specified number of milliseconds Celay functions for HI/"!6H 6 on the 8I6

Virtual remote H H? Tifndef 3">$a+5!e Tdefine Tendif Tdefine Tdefine Tif Tdefine MHQ H&)))$ 2HQ H& 3">$a+5!e G^ &.MHQ Celay=s:1< b unsigned char adcntW g ?H number of kHz in a MHz H? ?H number of kHz in a kHz H? 3">$a+5!e BMHQ ?H 6rystal freEuency in MHz H? Main Project 2013-14 M>2! 7=5! this code is compiled with full optimization___

adcnt ^ :1<H::3">$a+5!e<?:&.MHQ<<W g while://adcnt _^ )< g continueW c Telse Tdefine Celay=s:1< b unsigned char adcntW g

adcnt ^ :1<?::&.MHQ<?:3">$a+5!e<<d&W g while://adcnt _^ )< g continueW c Tendif e1tern void CelayMs:unsigned char<W Dela. # ?H H H H H Make sure this code is compiled with full optimization___ AWH En !$ . Colle e Dept. of ECE Celay functions 7ee delay.h for details

Virtual remote Main Project 2013-14 H? Tinclude void CelayMs:unsigned char cnt< b Tif 3">$a+5!e `^ .MHQ do b Celay=s:''4<W c while://cnt<W Tendif Tif 3">$a+5!e G .MHQ unsigned char iW do b i ^ BW do b Celay=s:.()<W c while://i<W c while://cnt<W Tendif c Sdelay.hS

Dept. of ECE AWH En

!% . Colle e

Virtual remote Main Project 2013-14

Chapter 11 CONCLUSION

"he kinect is state of the art eEuipment that can track both simple and complicated gestures. "he virtual remote can be made compatible with a large number of eEuipments. 0y successfully combining a virtual remote with a universal remote, control of every eEuipment in our house will be at our fingertips. >lthough there are some minor flaws, altogether it can be considered that, *irtual 5emote is a fascinating bunch of low cost components that can be very helpful and handy as well as providing an insight into the things we can accomplish without burning a hole in our pocket.

Dept. of ECE AWH En

"0 . Colle e

Virtual remote Main Project 2013-14

REFERANCE
&. 8I6 microcontroller pro ect book@ Rohn Iovine .. 8ic Microcontroller and !mbedded 7ystems@ Mazidi ,. http@??www.1bo1.com?en/6>?2inect
4. en.wikipedia.org?wiki

(. www.circuitstoday.com 4. www.electro/tech/online.com? ;. http@www.1bo1.com?en/I0?news/features?news?8ro ect


8. www.microchip.com?pic&

Dept. of ECE AWH En

"1 . Colle e

Virtual remote Main Project 2013-14

Dept. of ECE AWH En

"2 . Colle e

S-ar putea să vă placă și