You are on page 1of 55

CHAPTER-1 Principle of working

1|Page

Working
The AC mains supply is stepped down to a 12 V alternating supply by the application of a step down transformer, then by using full wave 2 diode rectifier the AC voltage is translated into DC unregulated voltage. This unregulated supply is not suitable for any practical DC application as it contains ripple hence weve used a regulator ice 7805 which converts this unregulated DC voltage to a regulated steady and reliable 5 volt supply. ranging

The accelerometer is MMA7361L is a low voltage device and operates at low voltages

from 2.2V 3.6V, but the accelerometer module has an on-board 3 volt voltage regulator, so we need not to worry about that, also proper coupling capacitors are mounted on the module which smoothens the varying analog output of accelerometer. The accelerometer can operate in 1.5 and 6 g sensitivity weve used 1.5g sensitivity as it was sufficient and provided as greater even for small tilt. The accelerometer provide output which is analog voltage sensitivity which is

proportional to the acceleration sensed in that particular axis, Weve only used 2 axis as it was apt for our purpose.

Then to make sense of this analog varying voltage it is necessary to convert it to a format which our microcontroller can understand hence we need to convert it to digital format, for which it is required to use analog to digital convertor. Atmega8l has inbuilt ADC, weve made use of that to convert analog signals of x and y axis output of accelerometer to digital format, ADC Atmega8l can provide Analog to digital conversion to a precision of 10 bits under frequency of 50-250 KHz, Weve used a sampling rate of 125 KHz. Fo r the first conversion takes 25 ADC cycles and afterwards 13.5 ADC cycles for every conversion. Weve used the method of polling for sampling of X and Y output of accelerometer as in interrupt driven method the execution of previous conversion co uldnt complete due to frequent conversion result and some delay has to be provided to display the current status on LCD and to make the movement ostensible, hence the polling method which usually is not as efficient as interrupt of sampling it

driven method, turns to be provide almost the same results. Microcontroller is running at 16 MHz which is the maximum permissible frequency as per the data sheet, giving a throughput of MIPS, such high speed was required as a lot of cycles are consumed in the ADC and LCD delays. After getting the equivalent ranging from 0-1023 of accelerometer X and Y axis 16 and output Page | 2

they are subtracted by 338 as this much acceleration is sensed by the accelerometer under normal conditions due the acceleration due to gravity, now after doing this the tilt is decided by the

numerical valued which were calibrated, and based on this decision appropriate output if provided to motor driver IC which finally translated it to physical motion. Weve used differential drive mechanism to drive the motors, the motor driver IC l293D uses the concept of H bridge to drive these motors, it can drive 4 motors in one direction or 2 motors in both the directions. Also weve used a 16X2 Alpha Numeric lcd module which tells us about the input tilt sensed and the decision which microcontroller took and finally what robot would doing. Weve used LCD in 4 bit mode which is not as quick as compared to 8 bit mode, but requires fewer pins hence less PCB space and also helped to reduce the complexity of PCB. The motor driver IC can be provided a separate high current supply for driving motors, as it requires high current to drive the motors and such high current requirements are not there MCU and accelerometer also it high current can harm such low voltage low current devices. for be it

operated

Page | 3

CHAPTER-2 Construction and working of project

Page | 4

3 AXIS ACCELEROMETER

Pop POWER SUPPLY ATmega8L (MICROCONTROLLER) LCD

MOTOR RIGHT

L293D MOTOR DRIVER IC

MOTOR LEFT

Fig. 2.1 Basic Block Diagram

The basic block diagram of the gesture controlled robot controller is shown in the above figure. Mainly this block diagram consists of the following essential blocks. Power Supply 3 Axis Accelerometer MMA7361L ATmega8L micro-controller Motor Driver Circuit LCD

Page | 5

Power Supply:Here we used +12V and +5V regulated dc power supply. The main function of this block is to provide the required amount of voltage to essential circuits. +12voltage is given to motor driver circuit. To get the +5V dc power supply we have used here IC 7805, which provides the +5V dc regulated power supply. 3 Axis Accelerometer MMA7361L:This is one of the main parts of our project. The main purpose of this device is to provide us the acceleration sensed in 3 axis of which information about 2 axis X and Y is of our interest. It provide an analog equivalent voltage proportional to the acceleration in that axis. ATmega8L Microcontroller:The low-power Atmel 8-bit AVR RISC-based microcontroller combines 8KB of programmable flash memory, 1KB of SRAM, 512K EEPROM, and a 6 or 8 channel 10-bit A/D converter. The device supports throughput of 16 MIPS at 16 MHz and operates between 2.7-5.5 volts. Motor Driver Circuit:This circuit is mainly governed by the L293D ic which is also called as motor driver ic, this ic internally consists of 2 H-Bridge circuits which are very famous for controlling motors and are extensively used in the applications such as robotics. LCD :These LCD modules come in variety we choose 16X2 Alpha Numeric parallel LCD module as it was cheap easy to use and is readily available. It is used to display the input tilt sensed and the decision made by the controller regarding the input gesture.

Page | 6

Circuit Diagram

Fig. 2.2 Schematic Circuit Diagram

Page | 7

Component Description
List of Components:
Following is the list of components that are necessary to build the assembly of the Gesture Controlled Robot. 1. Microcontroller ATmega8L 2. Sensor MMA7361 3-Axis Accelerometer 3. 16X2 Alpha Numeric LCD 4. Motor Driver IC L293D 5. 7805 Voltage Regulator 6. Rectifier diode IN4148 7. DC B O 60 RPM Geared Motor 8. Crystal 16 MHz

ATmega8l Microcontroller:
The ATmega8 provides the following features: 8 Kbytes of In-System Programmable Flash with Read-While-Write capabilities, 512 bytes of EEPROM, 1 Kbyte of SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible Timer/Counters with compare modes, internal and external interrupts, a serial programmable USART, a byte oriented Twowire Serial Interface, a 6-channel ADC (eight channels in TQFP and QFN/MLF packages) with10-bit accuracy, a programmable Watchdog Timer with Internal Oscillator, an SPI serial port,and five software selectable power saving modes.

Page | 8

Fig. 2.3 ATmega8l Microcontroller

The Idle mode stops the CPU while allowing the SRAM, Timer/Counters, SPI port, and interrupt system to continue functioning. The Power down mode saves the register contents but freezes the Oscillator, disabling all other chip functions until the next Interrupt or Hardware Reset. In Powersave mode, the asynchronous timer continues to run, allowing the user to maintain a timer base while the rest of the device is sleeping. The ADC Noise Reduction mode stops the CPU and all I/O modules except asynchronous timer and ADC, to minimize switching noise during ADC conversions. In Standby mode, the crystal/resonator Oscillator is running while the rest of the device is sleeping. This allows very fast start-up combined with low-power consumption.The device is manufactured using Atmels high density non-volatile memory technology. The Flash Program memory can be reprogrammed In-System through an SPI serial interface, by a conventional non-volatile memory programmer, or by an On-chip boot program running on the AVR core. The boot program can use any interface to download the application program in the Application Flash memory. Software in the Boot Flash Section will continue to run while the Application Flash Section is updated, providing true Read-While-Write operation. By combining an 8-bit RISC CPU with In-System Self-Programmable Flash on a monolithic chip, the AtmelATmega8 is a powerful microcontroller that provides a highly-flexible and cost-effective solutionto many embedded control applications.The ATmega8 is supported with a full suite of program and system development tools, including Ccompilers, macro assemblers, program simulators, and evaluation kits.

Page | 9

FEATURES:1. High-performance, Low-power Atmel AVR 8-bit Microcontroller 2. High Endurance Non-volatile Memory segments 3. 8Kbytes of In-System Self-programmable Flash program memory

4. 512Bytes EEPROM 5. 6. 1Kbyte Internal SRAM Write/Erase Cycles: 10,000 Flash/100,000 EEPROM

7. I/O and Packages 8. 23 Programmable I/O Lines

9. 28-lead PDIP, 32-lead TQFP, and 32-pad QFN/MLF 10. Special Microcontroller Features 11. Power-on Reset and Programmable Brown-out Detection 12. Internal Calibrated RC Oscillator 13. External and Internal Interrupt Sources 14. Five Sleep Modes: Idle, ADC Noise Reduction, power save, power down and stand by.

MMA7361 L 3-Axis Accelerometer


Description:
By measuring the amount of acceleration due to gravity, an accelerometer

can figure out the angle it is tilted at with respect to the earth. By sensing the amount of dynamic acceleration, the accelerometer can find out how fast and in what direction the device is moving. Using these two properties, you can make all sorts of cool projects, from musical instruments (imagine playing and having the tilt connected to the distortion level or the pitch-bend) to a velocity monitor on your car (or your children's car). This 3-Axis Accelerometer is reborn with a sweet new chip and great new price. The 3-axis accelerometer module carries an MMA7361 chip Page | 10

from Freescale. The MMA7361 operates in 2 selectable sensitivity modes, +/- 1.5g, and 6g. The sensor board defaults to 1.5g. Add the shunt or use the GS pin for software selection of 6g sensitivity. The 3-Axis Accelerometer sensor will operate between 2.2 and 6 volts. Because the MMA7361 chip only will deal with 3.6 volts maximum , the sensor is equipped with a low-dropout regulator so the sensor will work, out of the box with an adruino or other 5 volt microcontroller. At 5 volts the sensor draws around 50 uA with the shunt off and 100 uA with the shunt on. The current draw at 3.3 V is 150 / 200 uA respectively. The 3-axis accelerometer module comes as a kit with a 5-pin male headers, a two pin header, and a shunt for G selection. The sensor defaults to 1.5G so you don't have to install the two pin header if you are only using the more sensitive setting.

Fig. 2.4 MMA7361 L 3-Axis Accelerometer

Applications
1. Laptop PC: Freefall Detection 2. Cell Phone: Image Stability, Text Scrolling, Motion Dialing, E-Compass 3. Pedometer: Motion Sensing 4. Portable Handheld: Text Scrolling 5. Navigation and Dead Reckoning: E-Compass Tilt Compensation

Page | 11

6. Gaming: Tilt and Motion Sensing, Event Recorder 7. Robotics: Motion Sensing

Block Diagram:

Fig. 2.5 Block Diagram of 3 Axis Accelerometer

16x2 Alpha Numeric LCD:


Description:
A range of intelligent alphanumeric dot matrix display modules employing

Supertwist Nematic (STN) technology which provides a superior viewing angle and higher contrast over conventional designs. Each module uses a 5 x 8 dot matrix format, has a cursor and is capable of displaying 224 different characters and symbols. An on-board RAM facility also enables the user to produce any character pattern required. The 16 x 2, 16 x 4, 20 x 2 and 20 x 4 modules are available with low power LED backlight to provide excellent contrast characteristics. Intensity of backlighting is also continuously variable over a wide range.

Page | 12

Fig. 2.6 16x2 Alpha Numeric LCD

Fig. 2.7 Block Diagram of LCD

Features: 1. 16 characters wide, 2 rows. 2. White text on blue background. 3. Connection port is 0.1" pitch, single row for easy breadboarding and wiring. 4. Pins are documented on the back of the LCD to assist in wiring it up. 5. Single LED backlight included can be dimmed easily with a resistor or PWM and uses much less power than LCD with EL (electroluminescent) backlights. 6. Can be fully controlled with only 6 digital lines. Page | 13

7. Built in character set supports most English/European/Japanese text, see the HD44780 datasheet for the full character set. 8. Up to 8 extra characters can be created for custom glyphs or 'foreign' language support. 9. Comes with strip of header pins. 10. Can adjust contrast with the addition of a potentiometer (not included).

L293D Motor Driver ICDescription: L293D is a dual H-bridge motor driver integrated circuit (IC). Motor drivers act
as current amplifiers since they take a low-current control signal and provide a higher-current signal. This higher current signal is used to drive the motors.L293D contains two inbuilt H-bridge driver circuits. In its common mode of operation, two DC motors can be driven simultaneously, both in forward and reverse direction. The motor operations of two motors can be controlled by input logic at pins 2 & 7 and 10 & 15. Input logic 00 or 11 will stop the corresponding motor. Logic 01 and 10 will rotate it in clockwise and anticlockwise directions,respectively.Enable pins 1 and 9 (corresponding to the two motors) must be high for motors to start operating. When an enable input is high, the associated driver gets enabled. As a result, the outputs become active and work in phase with their inputs. Similarly, when the enable input is low, that driver is disabled, and their outputs are off and in the high-impedance state.

Fig. 2.8 L293 motor driver IC

Page | 14

The L293 and L293D are quadruple high-current half-H drivers. The L293 is designed to provide bidirectional drive currents of up to 1 A at voltagesfrom 4.5 V to 36 V. The L293D is designed to provide bidirectional drive currents of up to600-mA at voltages from 4.5 V to 36 V. Both devices are designed to drive inductive loads such as relays, solenoids, dc and bipolar stepping motors, as well as other high-current/high-voltage loads in positive-supply applications. All inputs are TTL compatible. Each output is a complete totem-pole drive circuit, with a Darlington transistor sink and a pseudo-Darlington source. Drivers are enabled in pairs, with drivers 1 and 2 enabled by 1,2EN and drivers 3 and 4 enabled by 3,4EN. When an enable input is high, the associated drivers are enabled and their outputs are active and in phase with their inputs. When the enable input is low, those drivers are disabled and their outputs are off and in the high-impedance state. With the proper data inputs, each pair of drivers forms full-H (or bridge) reversible drive suitable for solenoid or motor applications.

Fig. 2.9 H-bridge

7805 Voltage Regulator


Description:
The KA7805/KA7805A series of three-terminal positive regulator are

available in the TO-220/D-PAK package and with several fixed output voltages, making them useful in a wide range of applications. Each type employs internal current limiting, thermal shut down and safe operating area protection, making it essentially indestructible. If adequate heat sinking is provided, they can deliver over 1A output current. Although designed primarily as fixed

Page | 15

voltage regulators, these devices can be used with external components to obtain adjustable voltages and currents.

The 7805 (sometimes L7805, LM7805, MC7805...) is a family of self-contained fixed linear voltage regulator integrated circuits. The 7805 family is commonly used in electronic circuits requiring a regulated power supply due to their ease-of-use and low cost. For ICs within the family, the xx is replaced with two digits, indicating the output voltage (for example, the 7805 has a 5 volt output, while the 7812 produces 12 volts). The 7805 line are positive voltage regulators: they produce a voltage that is positive relative to a common ground. There is a related line of 79xx devices which are complementary negative voltage regulators. 7805 and 79xx ICs can be used in combination to provide positive and negative supply voltages in the same circuit.

7805 ICs have three terminals and are commonly found in the TO220 form factor, although smaller surface-mount and larger TO3 packages are available. These devices support an input voltage anywhere from a couple of volts over the intended output voltage, up to a maximum of 35 to 40 volts depending on the make, and typically provide 1 or 1.5 amperes of current (though smaller or larger packages may have a lower or higher current rating).

Fig. 2.10 (7805 Voltage Regulator)

Page | 16

Features: 1. Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V 2. 3. 4. 5. Thermal Overload Protection Short Circuit Protection Output Current up to 1A Output Output Transistor Safe Operating Area Protection

Advantages:

1. 7805 series ICs do not require additional components to provide a constant, regulated source of power, making them easy to use, as well as economical and efficient uses of space. Other voltage regulators may require additional components to set the output voltage level, or to assist in the regulation process. Some other designs (such as aswitchedmode power supply) may need substantial engineering expertise to implement. 2. 7805 series ICs have built-in protection against a circuit drawing too much power. They have protection against overheating and short-circuits, making them quite robust in most applications. In some cases, the current-limiting features of the 7805 devices can provide protection not only for the 7805 itself, but also for other parts of the circuit.

Disadvantages:

1.

The input voltage must always be higher than the output voltage by some minimum

amount (typically 2 volts). This can make these devices unsuitable for powering some devices from certain types of power sources (for example, powering a circuit that requires 5 volts using 6volt batteries will not work using a 7805). 2. As they are based on a linear regulator design, the input current required is always the

same as the output current. As the input voltage must always be higher than the output voltage, this means that the total power (voltage multiplied by current) going into the 7805 will be more than the output power provided. The extra input power is dissipated as heat. This means both that

Page | 17

for some applications an adequate heatsink must be provided, and also that a (often substantial) portion of the input power is wasted during the process, rendering them less efficient than some other types of power supplies. When the input voltage is significantly higher than the regulated output voltage (for example, powering a 7805 using a 24 volt power source), this inefficiency can be a significant issue. 3. Even in larger packages, 7805 integrated circuits cannot supply as much power as many

designs which use discrete components, and are generally inappropriate for applications requiring more than a few amperes of current. 4. Each specific model of 7805 is designed to produce only one fixed voltage output, so they

may not be suitable for applications requiring a configurable or varying output (For such applications, the LM317 series of ICs are available, which are similar to 7805 ICs but can produce a configurable voltage).

Rectifier Diode IN4148 :


The 1N4148 is a standard silicon switching diode. It is one of the most popular and long-lived switching diodes because of its dependable specifications and low cost. Its name follows the JEDEC nomenclature. The 1N4148 is useful in switching applications up to about 100 MHz with a reverse-recovery time of no more than 4 ns. The 1N4148 replaced the 1N914, which had a much higher leakage current (5 microamps vs. 25 nanoamps). Since leakage is almost never a desirable property, today manufacturers produce the 1N4148 and sell it as either part number. It was second sourced by many manufacturers; Texas Instruments listed their version of the device in an October 1966 data sheet.These device types have an enduring popularity in low-current applications.

Fig. 2.11 Rectifier Diode IN4148 Page | 18

DC B O 60 rpm Geared Motor :


60 rpm Single/Dual Shaft Plastic Gear Motor - Bo Motor gives good torque and rpm at lower operating voltages, which is the biggest advantage of these motors. Small shaft with matching wheels give optimized design for your application or robot. Mounting holes on the body & light weight makes it suitable for in-circuit placement . It is a 60 rpm cost-effective Single/dual shaft DC geared motor which is best suitable for application requiring less weight & low power consumption. The gearbox for this motor is horizontally mounted to the shaft of base motor which is 6000 rpm. The gears are plastic which explain the light weight of the motor. The drive shaft is perpendicular to the shaft of the base motor & it has a protection for gears from the sudden overload . Motor runs well from 3V to 9V and gives a good range of speed (rpm) and torque. This motor can be used with 70mm Diameter Wheel and 90mm Diameter Wheel with specific mount at axis to suit these types of motors.

Fig. 2.12 DC B O 60 rpm Geared Motor

Page | 19

Features : 1. Series: Bo Motor DC Geared 2. Operating voltage : 3V to 9V 3. Motor Speed: 60 rpm at 9V 4. Motor Shaft: 280:1 5. Motor weight: 35 gms. 6. Motor torque: 1.5 Kgf.cm. 7. Base Motor Speed: 6000 rpm 8. Same size motor available in various rpm 9. Light weight, small shaft, low cost. 10. Connector type: 2 pin PTR Female

16 MHz Crystal :
Crystals are commonly used to provide a stable clock source for micro-controllers. This has a stability of +-50ppm, and is slightly more than 1/8" tall.22pF ceramic disc capacitors commonly used with this crystal to provide a clock source to micro-controllers. When installing, be sure that the case does not make contact with any other conductors; ie, don't push it all the way flush with the board. +-5ppm (parts per million) per year aging drift. The marking on the top of the crystal shown to the right is in 1000Hz

Fig. 2.13 16 MHz Crystal Page | 20

CHAPTER-3
PROGRAMMING/COMPONENT DESCRIPTION

Page | 21

3.1 Printed Circuit Board ABOUT PCB DESIGN 1. Printed circuit board (PCB) is a component made of one or more layers of insulating

material with electrical conductors.

2.

The insulator is typically made on the base of fiber reinforced resins, ceramics, plastic, or

some other dielectric materials. During manufacturing, the portions of conductors that are not needed are etched off, leaving printed circuits that connect electronic components.

3.

The width of the circuit conductors should be chosen based on maximum temperature rise

at the rated current and an acceptable impedance. The spacing between the PC traces is determined by peak working voltage, the coating, location of the circuit, and the product application.

4.

Depending on the application and product end use, other standards may also apply. For

example, for mains-powered or battery-powered information technology equipment, the creepage and clearance requirements of IEC/UL 60950-1 shall take precedence over IPC.

Fig. 3.1 Printed Circuit Board

Page | 22

3.2 Layout Design


The connections on the PCB should be identical to the circuit diagram, but while the circuit diagram is arranged to be readable, the PCB layout is arranged to be functional, so there is rarely any visible correlation between the circuit diagram and the layout. PCB layout can be performed manually (using CAD) or in combination with an Autorouter. The best results are usually still achieved using atleast some manual routing - simply because the design engineer has a far better judgement of how to arrange circuitry. Different methods of PCB constructionConventional A rigid PCB (usually of thickness 1.6mm), with wire-leaded components mounted on only one side of the PCB, with all the leads through holes, soldered and clipped. Conventional circuitry is generally easier to debug and repair than Surface mount.

Surface Mount Technology (SMT) or devices (SMD) A PCB with tag-leaded components soldered flush to PCB pads. Holes are still needed on the PCB, but not where the component leads are attached. Surface mount circuitry is generally smaller than conventional. Surface mount is generally more suited to automated assembly than conventional.

Surface mount & conventional mix In practice, most boards are a mix of surface mount and conventional components. This can have its disadvantages as the two technologies require different methods of insertion and soldering.

Double sided Laminate A bare PCB laminate having tracks on both sides, normally with PTH holes connecting circuitry on the two sides together.

Double sided Component Assembly Mounting components on both sides of the PCB. Normally only surface mount circuitry would be mounted on both sides of a PCB, but some conventional components (such as LEDs) may be mounted on the reverse of a PCB to suit the enclosure design.

Page | 23

Multi-layer A PCB Laminate may be manufactured with more than two layers of copper tracks by using a sandwich construction. The cost of the laminate reflects the number of layers. The extra layers may be used to route more complicated circuitry, and/or distribute the power supply more effectively.

Gold plated Certain areas on a PCB may be gold plated for use as contact pads or as a ROHS-compliant board finish. If a thicker gold plating is required (for instance a quality 50um contact) an electrolytic process is needed. Normally this is limited to pads on the edge of a PCB, as an electrolytic plating bar must be attached to the pads, and then removed part way through the PCB manufacturing process. Gold plating normally needs a nickel underplate or the Gold quickly disappears through migration effects into the underlying copper.

Immersion Silver plating A ROHS-compliant board finish that is a cost effective alternative to Gold.

ROHS Compliance Simple definition: Getting rid of the Lead in PCBs and components which poisons groundwater when it leaches out of discarded boards put in landfill waste dumps. Actually, lead is not the only substance covered, but it is the main one. Frankly it would also help if people stopped throwing away so much electronics, and that would be helped if boards were made to last.

Flexible PCB A technique used extensively with membrane keyboards, combination connector/circuit boards, and circuit boards to fit in awkward shapes - e.g. cameras.

Chip On Board (COB) Where the IC die is attached direct to a PCB, and bond out wires from the IC connect directly to PCB lands. The chip is then covered with a black blob of epoxy. A technique used mostly with very high volume, cost sensitive applications, e.g. musical greeting cards. The creative applicability of the technique provides a wide range of application of the PCB, this is cost effective than the other techniques so that, this can be used easily and anywhere.

Page | 24

Phenolic PCB As distinct from fiberglass, Phenolic is a cheaper PCB laminate material. Even its cost effective this technique is not that much used, as the reliability is very much questionable. That is why the technique is not applicable to a very wide range of applications.

Daughterboard A daughterboard, daughtercard, mezzanine board or piggyback board is a circuit board meant to be an extension or "daughter" of a motherboard (or 'mainboard'), or occasionally of another card. In particular, daughterboards often have plugs, sockets, pins, connectors, or other attachments for other boards, which is what differentiates them from standard expansion boards such as for PCI or ISA, which are usually called expansion cards. In addition, daughterboards usually have only internal connections within a computer or other electronic device rather than any external ones, and usually access the motherboard directly rather than through a computer bus.

Daughterboards are sometimes used in computers in order to allow for expansion cards to fit on their side (or upright), parallel to the motherboard, usually to maintain a small or slim form factor. In this case they can also be called riser cards, or risers. Daughterboards are also sometimes used to expand the basic functionality of an electronic device, such as when a certain model has features added to it and are released as a new or separate model. Rather than redesign the first model completely, a daughterboard may be added to a special port or connector on the motherboard or mainboard. These usually fit on top of and parallel to the board, separated by spacers or standoffs, and are therefore sometimes called mezzanine cards due to being stacked like the mezzanine of a theatre. Wavetable cards are often mounted on sound cards in this manner.

Fig. 3.2 PCB Layout Design Page | 25

3.3 Etching Process


ETCHING PROCESS Etching is the process of using strong acid or mordant to cut into the unprotected parts of a metal surface to create a design in intaglioin the metal (the original processin modern manufacturing other chemicals may be used on other types of material). As an intagliomethod of printmaking, it is, along with engraving, the most important technique for old master prints, and remains in wide use today Chemical etching is done with ferric chloride, ammonium persulfate, or sometimes hydrochloric acid. For PTH (plated-through holes), additional steps of electroless deposition are done after the holes are drilled, then copper is electroplated to build up the thickness, the boards are screened, and plated with tin/lead. The tin/lead becomes the resist leaving the bare copper to be etched away. The simplest method, used for small-scale production and often by hobbyists, is immersion etching, in which the board is submerged in etching solution such as ferric chloride. Compared with methods used for mass production, the etching time is long. Heat and agitation can be applied to the bath to speed the etching rate. In bubble etching, air is passed through the etchant bath to agitate the solution and speed up etching. Splash etching uses a motor-driven paddle to splash boards with etchant; the process has become commercially obsolete since it is not as fast as spray etching. In spray etching, the etchant solution is distributed over the boards by nozzles, and recirculated by pumps. Adjustment of the nozzle pattern, flow rate, temperature, and etchant composition gives predictable control of etching rates and high production rates. As more copper is consumed from the boards, the etchant becomes saturated and less effective; different etchants have different capacities for copper, with some as high as 150 grams of copper per litre of solution. In commercial use, etchants can be regenerated to restore their activity, and the dissolved copper recovered and sold. Small-scale etching requires attention to disposal of used etchant, which is corrosive and toxic due to its metal content. The etchant removes copper on all surfaces exposed by the resist. "Undercut" occurs when etchant attacks the thin edge of copper under the resist; this can reduce conductor widths and cause opencircuits. Careful control of etch time is required to prevent undercut. Where metallic plating is

Page | 26

used as a resist, it can "overhang" which can cause short-circuits between adjacent traces when closely spaced. Overhang can be removed by wire-brushing the board after etching. Aquatint etching Aquatint uses acid-resistant resin to achieve tonal effects. Soft-ground etching Soft-ground etching uses a special softer ground. The artist places a piece of paper (or cloth etc. in modern uses) over the ground and draws on it. The print resembles a drawing. Relief etching Relief etching was invented by William Blake in about 1788, and he has been almost the only artist to use it in its original form. However from 18801950 a photo-mechanical ("line-block") variant was the dominant form of commercial printing for images. A similar process to etching, but printed as a relief print, so it is the "white" background areas which are exposed to the acid, and the areas to print "black" which are covered with ground. Blake's exact technique remains controversial. He used the technique to print texts and images together, writing the text and drawing lines with an acid-resistant medium.

Fig. 3.3 Etching Process

Page | 27

3.4 Component Assembly


The components where mounted on the etched PCB according to the circuit diagram. Various changes and modifications were made, so as to accommodate the components and make the circuit as light as possible for fast processing and lesser time consumption. The circuit was assembled by hand, with each component mounted by the group members itself, refraining from any of the mechanical mounting so as to assure the placement of the components effectively. This provides a leverage over the mechanical mounting to the manual or hand mounting, which is effective if there is any problem regarding the size of the drill holes and the component size so that suitable adjustments can be made on requirement of the situation there itself. The manual mounting helps in the adjustment of the components on requirement which is not possible in mechanical or automatic mounting on the PCB.

Fig. 3.4 Assembling the components

Page | 28

3.5 Soldering
SOLDERING TECHNIQUE Soldering is the only permanent way to fix components to a circuit. However, soldering requires a lot of practice as it is easy to destroy many hours preparation and design work by poor soldering. If you follow the guidelines below you have a good chance of success. 1. Use a soldering iron in good condition. Inspect the tip to make sure that it is not past good operation. If it looks in bad condition it will not help you solder a good joint. The shape of the tip may vary from one soldering iron to the next but generally they should look clean and not burnt.

2. A PCB eraser is used to remove any film from the tracks. This must be done carefully because the film will prevent good soldering of the components to the PCB. The tracks can be checked using a magnifying glass. If there are gaps in the tracks, sometimes they can be repaired using wire but usually a new PCB has to be etched.

3. Place the PCB, with its components in position, in the bull clip. This will steady the PCB when you try to use the soldering iron. Page | 29

4. The heated soldering iron should then be placed in contact with the track and the component and allowed to heat them up. Once they are heated the solder can be applied. The solder should flow through and around the component and the track

5. Having completed soldering the circuit the extended legs on the components need to be trimmed using wire clippers. The circuit is now ready for testing.

Fig. 3.5 Soldering Process

Page | 30

3.6 PCB Layout PCB layout was designed on EAGLE CAD version 6.3, as it is a really easy to use and provide us a lot of unique features which ease the process.

Fig. 3.6 PCB Designing in Eagle

Fig. 3.7 PCB After Etching Page | 31

3.7 Software Design:


The programming was done on Atmel Studio 6 which is the latest version of free program development tool provided by Atmel for their microcontrollers. Coding for microcontroller can be done as well as hex file can be generated by this software. After the generation of hex file it was required to burn the hex file into the Atmega8l along with the burning of proper fuse bytes to enable the working of external crystal oscillator for this we used USBASP programmer which can be used with laptops as it makes use of USB port and Extreme Burner software developed by Avinash Gupta of Extreme Electronics. Fuse bytes used were 0xFF for low fuse byte and 0xc9 for high fuse byte.

Fig. 3.8 Screenshot of Atmel studio 6

Page | 32

3.8 Coding:
The coding of the microcontroller Atmega8L was done in C language on the software Atmel Studio 6. The code is as follows: /* * xlrbotbeta.c * * Author: Ankit */ #ifndef F_CPU #define F_CPU 16000000UL // or whatever may be your frequency #endif // remember to put it before delay.h // now include the header files #include <avr/io.h> #include <util/delay.h> #include <avr/interrupt.h> #include <avr/pgmspace.h> #include "motor.h" #include "lcd.h" const uint8_t LCDwelcomeln1[] PROGMEM="Welcome AnKit\0"; const uint8_t LCDwelcomeln2[] PROGMEM="Greetings HUMANS\0"; const uint8_t LCDwelcomeln3[] PROGMEM="ImXclroBot beta\0"; voidADC_init() { ADMUX|=(1<<REFS0); ADCSRA=(1<<ADEN)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0); //Rrescalar div factor =128 } /* Function To Read ADC Channel Argument: Channel Number between 0-7 Return Value : Between 0-1023 */ Page | 33

uint16_t ADC_read(uint8_t ch) { //Select ADC Channel ch must be 0-7 ch=ch&0b00000111; ADMUX&=0b11100000; ADMUX|=ch; //Start Single conversion ADCSRA|=(1<<ADSC); //Wait for conversion to complete while(!(ADCSRA & (1<<ADIF))); //Clear ADIF by writing one to it //Note you may be wondering why we have write one to clear it //This is standard way of clearing bits in io as said in datasheets. //The code writes '1' but it result in setting bit to '0' !!! ADCSRA|=(1<<ADIF); return(ADC); } int main(void) { ADC_init(); Motor_init(); LCDinit(); LCDclr(); CopyStringtoLCD(LCDwelcomeln2, 0,0); _delay_ms(1000); CopyStringtoLCD(LCDwelcomeln3, 0,0); _delay_ms(1000); LCDclr(); MotorA(MOTOR_CW,255); //Motor A (right motor) moves Clockwise MotorB(MOTOR_ACW,255); //Motor B (left motor) moves Anti Clockwise while(1) { int x, y, z; x = ADC_read(3); // Read analog input from accelerometer x axis output pin y = ADC_read(4); Page | 34

// Read analog input from accelerometer y axis output pin x = x - 338; y = y - 338; if ((x>=0)&&(y>=0)) { if((x<100)&&(y<100)) { // it means no movement in either x or y direction bot stands still LCDclr(); LCDGotoXY(0,0); LCDstring("BREAK STAND BY",14); LCDGotoXY(4,1); LCDstring("STAY PUT",8); MotorA(MOTOR_BRK,0); MotorB(MOTOR_BRK,0); _delay_ms(100); } if((x<100)&&(y>100)) { // it means no motion in x direction left tilt in y direction // hence bot moves left LCDclr(); LCDGotoXY(0,0); LCDstring("TILT IN LEFT",12); LCDGotoXY(0,1); LCDstring("I'm TURNIN LEFT",15); MotorA(MOTOR_CW,255); //Motor A (right motor) moves Clockwise MotorB(MOTOR_CW,255); //Motor B (left motor) moves Clockwise _delay_ms(100); } if((x>100)&&(y<100)) { // it means backward motion with no tilt in y direction // hence bot moves back LCDclr(); LCDGotoXY(0,0); LCDstring("TILT IN BACK",12); LCDGotoXY(0,1); Page | 35

LCDstring("I'm MOVIN BACK",14); MotorA(MOTOR_ACW,255); //Motor A (right motor) moves Anti Clockwise MotorB(MOTOR_CW,255); //Motor B (left motor) moves Clockwise _delay_ms(100); } if((x>100)&&(y>100)) { // it means backward motion with left tilt in y direction // hence bot moves back in left direction LCDclr(); LCDGotoXY(0,0); LCDstring("TILT LEFT-BACK",14); LCDGotoXY(0,1); LCDstring("M MOVIN LEFTBCK",15); MotorA(MOTOR_ACW,255); // Motor A (right motor) moves Anticlockwise with full speed MotorB(MOTOR_CW,127); // Motor B (left motor) moves Clockwise with half speed _delay_ms(100); } } if((x<0)&&(y>=0)) { if((x<0)&&(y<100)) { // it means forward motion with no tilt // hence the bot moves forward LCDclr(); LCDGotoXY(0,0); LCDstring("TILT IN FORWARD",15); LCDGotoXY(0,1); LCDstring("I'm MOVIN FRWRD",15); MotorA(MOTOR_CW,255); //Motor A (right motor) moves Clockwise MotorB(MOTOR_ACW,255); //Motor B (left motor) moves Anti Clockwise _delay_ms(100); } if((x<0)&&(y>100)) { Page | 36

// it means forward motion with left tilt in y direction // hence the bot moves forward in left direction LCDclr(); LCDGotoXY(0,0); LCDstring("TILT FRWRD-LFT",14); LCDGotoXY(0,1); LCDstring("MOVIN FRWRD-LFT",15); MotorA(MOTOR_CW,255); //Motor A (right motor) moves Clockwise with full speed MotorB(MOTOR_ACW,127); //Motor B (left motor) moves Anti Clockwise with half speed _delay_ms(100); } } if((x<0)&&(y<0)) { // it means forward motion in right tilt in y direction // hence the bot moves forward in right direction LCDclr(); LCDGotoXY(0,0); LCDstring("TILT FRWRD-RGHT",15); LCDGotoXY(0,1); LCDstring("MOVIN FRWRD-RGHT",16); MotorA(MOTOR_CW,127); //Motor A (right motor) moves clockwise with half speed MotorB(MOTOR_ACW,255); //Motor B (left motor) moves Anti Clockwise with full speed _delay_ms(100); } if((x>=0)&&(y<0)) { if((x<100)&&(y<0)) { // it means no motion in x direction with right tilt // hence the bot moves in right direction LCDclr(); LCDGotoXY(0,0); LCDstring("TILT IN RIGHT",13); LCDGotoXY(0,1); LCDstring("I'm Turnin RIGHT",16); MotorA(MOTOR_ACW,255); //Motor A (right motor) moves Anti Clockwise MotorB(MOTOR_ACW,255); //Motor B (left motor) moves Clockwise Page | 37

_delay_ms(100); } if((x>100)&&(y<0)) { // it means backward motion with right tilt in y direction // hence bot moves back in right direction LCDclr(); LCDGotoXY(0,0); LCDstring("TILT BCKWRD-RGHT",16); LCDGotoXY(0,1); LCDstring("MOVIN BCKWRDRGHT",16) ; MotorA(MOTOR_ACW,127); // Motor A (right motor) moves Anticlockwise with half speed MotorB(MOTOR_CW,255); // Motor B (left motor) moves Clockwise with full speed _delay_ms(100); } } } } /********************************************************************* ********* Header file for Atmega8/Atmega8l running at 16MHz for runnning motor File name :motor.c Author :Ankit ********************************************************************* **********/ #include <avr/io.h> #include <avr/interrupt.h> #include "motor.h" voidMotor_init() { //set up pwm for speed control TCCR1A=(1<<COM1A1)|(1<<COM1B1)|(1<<WGM10); //clk=fcpu/64 TCCR1B=(1<<CS11)|(1<<CS10); Page | 38

//Set the corresponding port pin to output DDR(OC1A_PORT)|=(1<<OC1A_PIN); DDR(OC1B_PORT)|=(1<<OC1B_PIN); //Set the direction control PINs to OUT DDRB|=(1<<0)|(1<<3)|(1<<4)|(1<<5); //PB0, PB3, PB4 and PB5 as output } /********************************************************** Description: Set the rotation of motor A in given direction and speed dir = 0 for stop dir = 1 for CW rotation dir = 2 for ACW rotation dir = 3 for brake speed is any value between 0 and 255 Example: MotorA(MOTOR_CW,120); Note: Other Constants for direction are MOTOR_ACW and MOTOR_STOP ***********************************************************/ voidMotorA(uint8_t dir,uint8_t speed) { //Direction if(dir == MOTOR_STOP) { PORTB&=(~(1<<PB0)); PORTB&=(~(1<<PB3)); } else if(dir == MOTOR_ACW) { PORTB&=(~(1<<PB0)); PORTB|=(1<<PB3); } else if(dir == MOTOR_CW) { Page | 39

PORTB&=(~(1<<PB3)); PORTB|=(1<<PB0); } else if(dir == MOTOR_BRK) { PORTB|=(1<<PB0)|(1<<PB3); } //Speed uint8_tsreg=SREG; cli(); OCR1A=speed; SREG=sreg; } /********************************************************** Descriptipn: Set the rotation of motor B in given direction and speed dir = 0 for stop dir = 1 for CW rotation dir = 2 for CCW rotation dir = 3 for brake speed is any value between 0 and 255 Example: MotorB(MOTOR_CW,120); Note: Other Constants for direction are MOTOR_CCW and MOTOR_STOP ***********************************************************/ voidMotorB(uint8_t dir,uint8_t speed) { //Direction if(dir == MOTOR_STOP) { PORTB&=(~(1<<PB4)); PORTB&=(~(1<<PB5)); }

Page | 40

else if(dir == MOTOR_ACW) { PORTB&=(~(1<<PB4)); PORTB|=(1<<PB5); } else if(dir == MOTOR_CW) { PORTB&=(~(1<<PB5)); PORTB|=(1<<PB4); } else if (dir == MOTOR_BRK) { PORTB|=(1<<PB4)|(1<<PB5); } //Speed uint8_tsreg=SREG; cli(); OCR1B=speed; SREG=sreg; } //******************************************************************** ******** // // File Name : 'lcd.c' // Title : 8 and 4 bit LCd interface // Author : Ankit - Copyright (C) 2011 // Version : 1.0 // Target MCU : Atmel AVR series // // //******************************************************************** ********* #include "lcd.h" #include <inttypes.h> #include <avr/io.h> #include <avr/pgmspace.h> #include <util/delay.h> const uint8_t LcdCustomChar[] PROGMEM=//define 8 custom LCD chars { Page | 41

0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, // 0. 0/5 full progress block 0x00, 0x1F, 0x10, 0x10, 0x10, 0x10, 0x1F, 0x00, // 1. 1/5 full progress block 0x00, 0x1F, 0x18, 0x18, 0x18, 0x18, 0x1F, 0x00, // 2. 2/5 full progress block 0x00, 0x1F, 0x1C, 0x1C, 0x1C, 0x1C, 0x1F, 0x00, // 3. 3/5 full progress block 0x00, 0x1F, 0x1E, 0x1E, 0x1E, 0x1E, 0x1F, 0x00, // 4. 4/5 full progress block 0x00, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x00, // 5. 5/5 full progress block 0x03, 0x07, 0x0F, 0x1F, 0x0F, 0x07, 0x03, 0x00, // 6. rewind arrow 0x18, 0x1C, 0x1E, 0x1F, 0x1E, 0x1C, 0x18, 0x00 // 7. fast-forward arrow }; voidLCDsendChar(uint8_t ch) { #ifdef LCD_4bit //4 bit part LDP=(ch&0b11110000); LCP|=1<<LCD_RS; LCP|=1<<LCD_E; _delay_ms(15); LCP&=~(1<<LCD_E); LCP&=~(1<<LCD_RS); _delay_ms(15); LDP=((ch&0b00001111)<<4); LCP|=1<<LCD_RS; LCP|=1<<LCD_E; _delay_ms(15); LCP&=~(1<<LCD_E); LCP&=~(1<<LCD_RS); _delay_ms(15); #else //8 bit part LDP=ch; LCP|=1<<LCD_RS; LCP|=1<<LCD_E; _delay_ms(10); LCP&=~(1<<LCD_E); LCP&=~(1<<LCD_RS); _delay_ms(10); #endif } voidLCDsendCommand(uint8_t cmd) { #ifdef LCD_4bit //4 bit part //Sends Char to LCD

//Sends Command to LCD

Page | 42

LDP=(cmd&0b11110000); LCP|=1<<LCD_E; _delay_ms(15); LCP&=~(1<<LCD_E); _delay_ms(15); LDP=((cmd&0b00001111)<<4); LCP|=1<<LCD_E; _delay_ms(15); LCP&=~(1<<LCD_E); _delay_ms(15); #else //8 bit part LDP=cmd; LCP|=1<<LCD_E; _delay_ms(15); LCP&=~(1<<LCD_E); _delay_ms(15); #endif } voidLCDinit(void)//Initializes LCD { #ifdef LCD_4bit //4 bit part _delay_ms(15); LDP=0x00; LCP=0x00; LDDR|=1<<LCD_D7|1<<LCD_D6|1<<LCD_D5|1<<LCD_D4; LCDR|=1<<LCD_E|1<<LCD_RW|1<<LCD_RS; //---------one-----LDP=0<<LCD_D7|0<<LCD_D6|1<<LCD_D5|1<<LCD_D4; //4 bit mode LCP|=1<<LCD_E|0<<LCD_RW|0<<LCD_RS; _delay_ms(15); LCP&=~(1<<LCD_E); _delay_ms(15); //-----------two----------LDP=0<<LCD_D7|0<<LCD_D6|1<<LCD_D5|1<<LCD_D4; //4 bit mode LCP|=1<<LCD_E|0<<LCD_RW|0<<LCD_RS; _delay_ms(15); LCP&=~(1<<LCD_E); _delay_ms(15); //-------three------------LDP=0<<LCD_D7|0<<LCD_D6|1<<LCD_D5|0<<LCD_D4; //4 bit mode LCP|=1<<LCD_E|0<<LCD_RW|0<<LCD_RS; _delay_ms(15); Page | 43

LCP&=~(1<<LCD_E); _delay_ms(15); //--------4 bit--dual line--------------LCDsendCommand(0b00101000); //-----increment address, invisible cursor shift-----LCDsendCommand(0b00001100); //init 8 custom chars uint8_tch=0, chn=0; while(ch<64) { LCDdefinechar((LcdCustomChar+ch),chn++); ch=ch+8; } #else //8 bit part _delay_ms(15); LDP=0x00; LCP=0x00; LDDR|=1<<LCD_D7|1<<LCD_D6|1<<LCD_D5|1<<LCD_D4|1<<LCD_D3 |1<<LCD_D2|1<<LCD_D1|1<<LCD_D0; LCDR|=1<<LCD_E|1<<LCD_RW|1<<LCD_RS; //---------one-----LDP=0<<LCD_D7|0<<LCD_D6|1<<LCD_D5|1<<LCD_D4|0<<LCD_D3 |0<<LCD_D2|0<<LCD_D1|0<<LCD_D0; //8 it mode LCP|=1<<LCD_E|0<<LCD_RW|0<<LCD_RS; _delay_ms(1); LCP&=~(1<<LCD_E); _delay_ms(1); //-----------two----------LDP=0<<LCD_D7|0<<LCD_D6|1<<LCD_D5|1<<LCD_D4|0<<LCD_D3 |0<<LCD_D2|0<<LCD_D1|0<<LCD_D0; //8 it mode LCP|=1<<LCD_E|0<<LCD_RW|0<<LCD_RS; _delay_ms(1); LCP&=~(1<<LCD_E); _delay_ms(1); //-------three------------LDP=0<<LCD_D7|0<<LCD_D6|1<<LCD_D5|1<<LCD_D4|0<<LCD_D3 |0<<LCD_D2|0<<LCD_D1|0<<LCD_D0; //8 it mode LCP|=1<<LCD_E|0<<LCD_RW|0<<LCD_RS; _delay_ms(1); LCP&=~(1<<LCD_E); _delay_ms(1); //--------8 bit dual line---------LDP=0<<LCD_D7|0<<LCD_D6|1<<LCD_D5|1<<LCD_D4|1<<LCD_D3 Page | 44

|0<<LCD_D2|0<<LCD_D1|0<<LCD_D0; //8 it mode LCP|=1<<LCD_E|0<<LCD_RW|0<<LCD_RS; _delay_ms(1); LCP&=~(1<<LCD_E); _delay_ms(1); //-----increment address, invisible cursor shift-----LDP=0<<LCD_D7|0<<LCD_D6|0<<LCD_D5|0<<LCD_D4|1<<LCD_D3 |1<<LCD_D2|0<<LCD_D1|0<<LCD_D0; //8 it mode LCP|=1<<LCD_E|0<<LCD_RW|0<<LCD_RS; _delay_ms(1); LCP&=~(1<<LCD_E); _delay_ms(5); //init custom chars uint8_tch=0, chn=0; while(ch<64) { LCDdefinechar((LcdCustomChar+ch),chn++); ch=ch+8; } #endif } voidLCDclr(void) //Clears LCD { LCDsendCommand(1<<LCD_CLR); } voidLCDhome(void) //LCD cursor home { LCDsendCommand(1<<LCD_HOME); } voidLCDstring(uint8_t* data, uint8_t nBytes) //Outputs string to LCD { register uint8_t i; // check to make sure we have a good pointer if (!data) return; // print data for(i=0; i<nBytes; i++) { LCDsendChar(data[i]); } } voidLCDGotoXY(uint8_t x, uint8_t y) //Cursor to X Y position Page | 45

{ register uint8_t DDRAMAddr; // remap lines into proper order switch(y) { case 0: DDRAMAddr = LCD_LINE0_DDRAMADDR+x; break; case 1: DDRAMAddr = LCD_LINE1_DDRAMADDR+x; break; case 2: DDRAMAddr = LCD_LINE2_DDRAMADDR+x; break; case 3: DDRAMAddr = LCD_LINE3_DDRAMADDR+x; break; default: DDRAMAddr = LCD_LINE0_DDRAMADDR+x; } // set data address LCDsendCommand(1<<LCD_DDRAM | DDRAMAddr); } //Copies string from flash memory to LCD at x y position //const uint8_t welcomeln1[] PROGMEM="AVR LCD DEMO\0"; //CopyStringtoLCD(welcomeln1, 3, 1); voidCopyStringtoLCD(const uint8_t *FlashLoc, uint8_t x, uint8_t y) { uint8_t i; LCDGotoXY(x,y); for(i=0;(uint8_t)pgm_read_byte(&FlashLoc[i]);i++) { LCDsendChar((uint8_t)pgm_read_byte(&FlashLoc[i])); } } //defines char symbol in CGRAM /* const uint8_t backslash[] PROGMEM= { 0b00000000,//back slash 0b00010000, 0b00001000, 0b00000100, 0b00000010, 0b00000001, 0b00000000, 0b00000000 }; LCDdefinechar(backslash,0); */ voidLCDdefinechar(const uint8_t *pc,uint8_t char_code){ uint8_t a, pcc; uint16_t i; Page | 46

a=(char_code<<3)|0x40; for (i=0; i<8; i++){ pcc=pgm_read_byte(&pc[i]); LCDsendCommand(a++); LCDsendChar(pcc); } } voidLCDshiftLeft(uint8_t n) //Scrol n of characters Right { for (uint8_t i=0;i<n;i++) { LCDsendCommand(0x1E); } } voidLCDshiftRight(uint8_t n) //Scrol n of characters Left { for (uint8_t i=0;i<n;i++) { LCDsendCommand(0x18); } } voidLCDcursorOn(void) //displays LCD cursor { LCDsendCommand(0x0E); } voidLCDcursorOnBlink(void) //displays LCD blinking cursor { LCDsendCommand(0x0F); } voidLCDcursorOFF(void) //turns OFF cursor { LCDsendCommand(0x0C); } voidLCDblank(void) //blanks LCD { LCDsendCommand(0x08); } voidLCDvisible(void) //Shows LCD { LCDsendCommand(0x0C); } voidLCDcursorLeft(uint8_t n) //Moves cursor by n poisitions left { for (uint8_t i=0;i<n;i++) Page | 47

{ LCDsendCommand(0x10); } } voidLCDcursorRight(uint8_t n) //Moves cursor by n poisitions left { for (uint8_t i=0;i<n;i++) { LCDsendCommand(0x14); } } //adapted fromAVRLIB voidLCDprogressBar(uint8_t progress, uint8_t maxprogress, uint8_t length) { uint8_t i; uint16_tpixelprogress; uint8_t c; // draw a progress bar displaying (progress / maxprogress) // starting from the current cursor position // with a total length of "length" characters // ***note, LCD chars 0-5 must be programmed as the bar characters // char 0 = empty ... char 5 = full // total pixel length of bargraph length*PROGRESSPIXELS_PER_CHAR; // pixel length of bar itself is pixelprogress ((progress*(length*PROGRESSPIXELS_PER_CHAR))/maxprogress); equals

// print exactly "length" characters for(i=0; i<length; i++) { // check if this is a full block, or partial or empty // (u16) cast is needed to avoid sign comparison warning if( ((i*(uint16_t)PROGRESSPIXELS_PER_CHAR)+5) >pixelprogress ) { // this is a partial or empty block if( ((i*(uint16_t)PROGRESSPIXELS_PER_CHAR)) >pixelprogress ) { // this is an empty block // use space character? Page | 48

c = 0; } else { // this is a partial block c = pixelprogress % PROGRESSPIXELS_PER_CHAR; } } else { // this is a full block c = 5; } // write character to display LCDsendChar(c); } }

Page | 49

3.9 Testing And Verification


We started our project by making power supply. After which we did the programming part and burned the code onto the microcontroller and designed the pcb and schematic. Then we tested our whole circuit on breadboard and after having a successful trial run we made the PCB. While designing the main circuit, there were many problems and issues related to it, which we faced, like component selection, which components is better than other and its feature and cost wise also, then refer the data books and other materials related to its.

Fig. 3.9 Testing and Verification We had issues with better or correct result, which we desiredand also the software problem. We also had some soldering issues which were resolved using continuity checks performed on the hardware. We started testing the circuit from the power supply, which worked perfectly after which we moved to the main circuit and no glitch was encountered.

Page | 50

CHAPTER-4
Result and Conclusion

Page | 51

4.1 Result The project ran successfully and operated at full functionality, the robot module would move in accordance to the tilting of the controlling unit. Also variable speed functionality was achieved by software programming. The tilt sensed by the controller board is updated on the LCD and then the controlling unit provides appropriate command signals to the motor driver circuit which translates the electrical analog and digital signals to physical movement. This system can be applied to almost any device which requires input like mouse or any pointing device, also to situations where the diligence of a human anatomy is required like for diffusing a bomb or in outer space or for performing a medical operation in such scenarios it is not practically possible to control such a device with buttons as the number of buttons required are a lot as well the precision of a human touch cannot be achieved by buttons, hence application of an input device like this becomes very important as is simplifies the controlling process of these complex devices and makes it as simple movement of our hands. 4.2 Application 1. For remote surveillance 2. For doing medical operations 3. For remote maintenance 4. In Space exploration 5. As an input device 6. For military training purpose 7. Animation movies and training purposes 4.3 Advantages: 1. Futuristic Technology 2. Easy to use 3. High precision 4. Low cost 5. Wide scope and area for expansion 6. Highly secure 4.4 Future Development Scope 1. Wireless 2. Speed proportional to tilt angle Page | 52

3. Camera can be added 4. Multi gesture 5. Obstacle avoidance 6. Connectivity to mobile phones and GPS

Page | 53

CHAPTER-5
Bibliography

Page | 54

Reference Books (1) Programming in ANSI C: E BALAGURUSAMY (2) The 8051microcontroller and embedded systems: MUHAMMAD ALI MAZIDI, JANICE GILLISPIE MAZIDI (3) The 8051 microcontroller: KENNETH J. AYALA

Website

(1) www.datasheets4u.com (2) www.engineersgarage.com (3) www.extremeelectronics.co.in (4) www.newbiehack.com

Page | 55

You might also like