Employablity presentation and Future Career Plan.pptx
final year major project
1. A
PROJECT REPORT
ON
“AUTONOMOUS ROBOT WITH ARM”
Submitted in Fulfillment for the Award of
Bachelor of Technology Degree
Of
Rajasthan Technical University, KOTA
2008-12
Submitted to: Submitted by:
MD. ASIF IQBAL PREM RANJAN (EE/08/19)
Assistant Professor RAJ SINGH REPASWAL (EE/08/20)
Department of Electrical Engineering SAUMYA GARG (EE/08/27)
PCE, Jaipur 4th Year, EE, PCE
DEPARTMENT OF ELECTRICAL ENGINEERING
POORNIMA COLLEGE OF ENGINEERING
ISI-6, RIICO INSTITUTIONAL AREA
SITAPURA, JAIPUR-302022
(RAJASTHAN)
2. DEPARTMENT OF ELECTRICAL ENGINEERING
POORNIMA COLLEGE OF ENGINEERING
JAIPUR - 302022
CERTIFICATE
This is to certify that the seminar report entitled “AUTONOMOUS ROBOT WITH ARM” is submitted
by PREM RANJAN (EE/08/19), RAJ SINGH REPASWAL (EE/08/20) & SAUMYA GARG (EE/08/27),
Students of IV Year, VIII semester in fulfillment of the degree of Bachelor of Technology in
Electrical Engineering of Rajasthan Technical University, Kota during the academic year 2011-12.
The report has been found satisfactory and is approved for submission.
MD. ASIF IQBAL MR. HARBEER SINGH MR. SHIVRAJ SHARMA DR. R. P. RAJORIYA
Project Guide Project Coordinator HOD, EE department Campus Director (PCE)
3. PREFACE
Today the world swiftly changing, there are multiple challenges faced by us. Surly it is
the knowledge through technology, which makes us to overcome them.
The project report, which is an integral part of four years engineering program provides a
platform to all the student to augment their technical study revelation. It is the time, which is
effectively used by students to enhance their interaction with technical atmosphere.
The project is obligatory as per university course outline. This project is based on work
done and theory gained during analysis of the topic. The report basically introduces working of
project in detail.
In this project we worked in the development of an Autonomous Robot with Arm which
can move in any direction and pick up and put down things. It is capable of many capabilities
like it is fully remote controlled and can pick objects of 50 grams approximately. It can take the
object, hold it and put it anywhere of its reach, even to some height. It only works on 220V A.C.
supply.
We have been fortunate to get a chance for making the seminar under guidance of Md.
Asif Iqbal, Assistant Professor, Department of Electrical Engineering.
We hope, this report will make the learning of the facts are warding experience and will
have away for future study.
This report is true to best of my knowledge.
PREM RANJAN
RAJ SINGH REPASWAL
SAUMYA GARG
PCE/EE/iii
4. ACKNOWLEDGEMENT
We take this opportunity to express our deep sense of gratitude and respect towards our project
guide Md. Asif Iqbal, Assistant Professor, Department of Electrical Engineering. We are
very much indebted to him for his generosity, expertise and guidance; we have received from
him while working on this project and throughout our studies. Without his support and timely
guidance, the completion of our project would have seemed a farfetched dream. In this respect
we find ourselves lucky to have him as our guide. He has guided us not only with the subject
matter, but also taught us the proper style and techniques of working.
We are grateful to our respected Dr. R. P. Rajoria (Campus Director), Dr. Om
Prakash Sharma (Principal), Mr. Shivraj Sharma (HOD, EE Dept.) and Mr. Harbeer Singh
(Project Coordinators) and all the staff members of Department of Electrical Engineering for
their constant encouragement and all those who helped us directly or indirectly in our endeavor.
PREM RANJAN
RAJ SINGH REPASWAL
SAUMYA GARG
PCE/EE/iv
5. CONTENTS
CERITFICATE ……ii
PREFACE ……iii
ACKNOWLEDGEMENT ……iv
CONTENTS ……v
FIGURE INDEX ……viii
ABSTRACT ……ix
CHAPTERS
1. Introduction 1
1.1 Embedded System 1
1.2 Variety of Embedded Systems 2
1.3 Microcontrollers 4
1.4 Embedded Design of Microcontroller 5
1.4.1 Interrupts 6
1.4.2 Programs 6
1.4.3 Other Microcontroller Features 7
2. Autonomous Robot with Arm 9
2.1 Aims 9
2.2 Objectives 9
2.3 Project Restrictions 9
2.4 Individual Task 10
2.4.1 IR Transmitter 10
2.4.2 IR Receiver 12
2.4.3 Signal Processing 13
2.4.4 Robot Movement 14
PCE/EE/v
6. 2.4.4.1 Straight – Forward 14
2.4.4.2 Straight – Backwards 15
2.4.4.3 Point Turn – Right 15
2.4.4.4 Point Turn – Left 16
2.4.4.5 Swing Turn - Forward Right 16
2.4.4.6 Swing Turn - Backward Right 16
2.4.4.7 Swing Turn - Forward Left 17
2.4.4.8 Swing Turn - Backward Left 17
2.4.5 Arm Movement 18
2.4.6 Power Supply 18
2.4.7 Body/Chassis 19
2.4.8 Motor Control 20
3. Circuit Diagram 21
3.1 Microcontroller ATmega8 22
3.1.1 Pin Configuration 22
3.1.2 Features 24
3.2 Motor Driver IC L293D 26
3.3 Crystal Oscillator 27
3.4 7805 Voltage Regulator IC 28
3.5 Stepper Motor 29
3.6 Infra-red Remote 31
3.7 Power Supply 32
3.7.1 Transformer 33
3.7.2 Bridge rectifier 34
3.7.3 Smoothing 35
PCE/EE/vi
8. FIGURE INDEX
Figure 2.1: IR Transmitter 11
Figure 2.2: IR Receiver 12
Figure 2.3: Straight – Forward 15
Figure 2.4: Straight – Backwards 15
Figure 2.5: Point Turn – Right 15
Figure 2.6: Point Turn – Left 16
Figure 2.7: Swing Turn - Forward Right 16
Figure 2.8: Swing Turn - Backward Right 17
Figure 2.9: Swing Turn - Forward Left 17
Figure 2.10: Swing Turn - Backward Left 17
Figure 2.11: Arm Movement 18
Figure 2.12: Chassis 19
Figure 3.1: Circuit Diagram 21
Figure 3.2: Pin Configuration 22
Figure 3.3: Block Diagram of Microcontroller ATmega8 23
Figure 3.4:- Motor Driver IC L293D pin diagram 26
Figure 3.5:- Block Diagram of L293D 27
Figure 3.6:- 7805 Voltage Regulator IC 29
Figure 3.7:- Stepper Motor 30
Figure 3.8: Remote 31
Figure 3.9: Circuit Diagram of regulated power Supply 32
Figure 3.10: Bridge rectifier 35
Figure 3.11: Output: full-wave varying DC 35
Figure 3.12: Smoothing 36
PCE/EE/viii
9. ABSTRACT
In this project we worked in the development of an Autonomous Robot with Arm which
can move in any direction and pick up and put down things. It is capable of many capabilities
like it is fully remote controlled and can pick objects of 50 grams approximately. It can take the
object, hold it and put it anywhere of its reach, even to some height. It only works on 220V A.C.
supply.
When we press a button on remote, it sends a signal to our robot circuitry where our
receiver will decode it and sends the signal to the IC. It makes the various functioning motors
move and thus the whole robot moves accordingly. We used microcontroller for its coding,
various precise movement control and various peripheral devices for the support of this robot.
PREM RANJAN
RAJ SINGH REPASWAL
SAUMYA GARG
PCE/EE/viii
10. Chapter 1
INTRODUCTION
1.1 Embedded System
An embedded system is a computer system designed to do one or a few
dedicated and/or specific functions often with real-time computing constraints. It is
embedded as part of a complete device often including hardware and mechanical parts.
By contrast, a general-purpose computer, such as a personal computer (PC), is designed
to be flexible and to meet a wide range of end-user needs. Embedded systems control
many devices in common use today.
Embedded systems contain processing cores that are typically either
microcontrollers or digital signal processors (DSP). The key characteristic, however, is
being dedicated to handle a particular task. They may require very powerful processors
and extensive communication, for example air traffic control systems may usefully be
viewed as embedded, even though they involve mainframe computers and dedicated
regional and national networks between airports and radar sites (each radar probably
includes one or more embedded systems of its own).
Since the embedded system is dedicated to specific tasks, design engineers can
optimize it to reduce the size and cost of the product and increase the reliability and
performance. Some embedded systems are mass-produced, benefiting from economies of
scale.
Physically, embedded systems range from portable devices such as digital
watches and MP3 players, to large stationary installations like traffic lights, factory
PCE/EE/1
11. controllers, or the systems controlling nuclear power plants. Complexity varies from low,
with a single microcontroller chip, to very high with multiple units, peripherals and
networks mounted inside a large chassis or enclosure.
In general, "embedded system" is not a strictly definable term, as most systems
have some element of extensibility or programmability. For example, handheld
computers share some elements with embedded systems such as the operating systems
and microprocessors that power them, but they allow different applications to be loaded
and peripherals to be connected. Moreover, even systems that do not expose
programmability as a primary feature generally need to support software updates. On a
continuum from "general purpose" to "embedded", large application systems will have
subcomponents at most points even if the system as a whole is "designed to perform one
or a few dedicated functions", and is thus appropriate to call "embedded".
1.2 Variety of Embedded Systems
Embedded systems span all aspects of modern life and there are many examples
of their use.
Telecommunications systems employ numerous embedded systems
from telephone switches for the network to mobile phones at the end-user. Computer
networking uses dedicated routers and network bridges to route data.
Consumer electronics include personal digital assistants (PDAs), mp3 players,
mobile phones, videogame consoles, digital cameras, DVD players, GPS receivers,
and printers. Many household appliances, such as microwave ovens, washing
machines and dishwashers, are including embedded systems to provide flexibility,
PCE/EE/2
12. efficiency and features. Advanced HVAC systems use networked thermostats to more
accurately and efficiently control temperature that can change by time of day
and season. Home automation uses wired- and wireless-networking that can be used to
control lights, climate, security, audio/visual, surveillance, etc., all of which use
embedded devices for sensing and controlling.
Transportation systems from flight to automobiles increasingly use embedded
systems. New airplanes contain advanced avionics such as inertial guidance
systems and GPS receivers that also have considerable safety requirements. Various
electric motors — brushless DC motors, induction motors and DC motors — are using
electric/electronic motor controllers. Automobiles, electric vehicles, and hybrid
vehicles are increasingly using embedded systems to maximize efficiency and reduce
pollution. Other automotive safety systems include anti-lock braking
system (ABS), Electronic Stability Control (ESC/ESP), traction control (TCS) and
automatic four-wheel drive.
Medical equipment is continuing to advance with more embedded systems
for vital signs monitoring, electronic stethoscopes for amplifying sounds, and
various medical imaging(PET, SPECT, CT, MRI) for non-invasive internal inspections.
Embedded systems are especially suited for use in transportation, fire safety,
safety and security, medical applications and life critical systems as these systems can be
isolated from hacking and thus be more reliable. For fire safety, the systems can be
designed to have greater ability to handle higher temperatures and continue to operate. In
dealing with security, the embedded systems can be self-sufficient and be able to deal
with cut electrical and communication systems.
PCE/EE/3
13. In addition to commonly described embedded systems based on small computers,
new class of miniature wireless devices called motes are quickly gaining popularity as the
field of wireless sensor networking rises. Wireless sensor networking, WSN, makes use
of miniaturization made possible by advanced IC design to couple full wireless
subsystems to sophisticated sensors, enabling people and companies to measure a myriad
of things in the physical world and act on this information through IT monitoring and
control systems. These motes are completely self-contained, and will typically run off a
battery source for many years before the batteries need to be changed or charged.
1.3 Microcontrollers
A microcontroller (sometimes abbreviated µC, uC or MCU) is a small computer
on a single integrated circuit containing a processor core, memory, and
programmable input/output peripherals. Program memory in the form of NOR
flash or OTP ROM is also often included on chip, as well as a typically small amount
of RAM. Microcontrollers are designed for embedded applications, in contrast to
the microprocessors used in personal computers or other general purpose applications.
Microcontrollers are used in automatically controlled products and devices, such
as automobile engine control systems, implantable medical devices, remote controls,
office machines, appliances, power tools, toys and other embedded systems. By reducing
the size and cost compared to a design that uses a separate microprocessor, memory, and
input/output devices, microcontrollers make it economical to digitally control even more
devices and processes. Mixed signal microcontrollers are common, integrating analog
components needed to control non-digital electronic systems.
PCE/EE/4
14. Some microcontrollers may use four-bit words and operate at clock
rate frequencies as low as 4 kHz, for low power consumption (milliwatts or microwatts).
They will generally have the ability to retain functionality while waiting for an event such
as a button press or other interrupt; power consumption while sleeping (CPU clock and
most peripherals off) may be just Nano watts, making many of them well suited for long
lasting battery applications. Other microcontrollers may serve performance-critical roles,
where they may need to act more like a digital signal processor (DSP), with higher clock
speeds and power consumption.
1.4 Embedded Design of Microcontroller
A microcontroller can be considered a self-contained system with a processor,
memory and peripherals and can be used as an embedded system.[1] The majority of
microcontrollers in use today are embedded in other machinery, such as automobiles,
telephones, appliances, and peripherals for computer systems. These are called embedded
systems. While some embedded systems are very sophisticated, many have minimal
requirements for memory and program length, with no operating system, and low
software complexity. Typical input and output devices include
switches, relays, solenoids, LEDs, small or custom LCD displays, radio frequency
devices, and sensors for data such as temperature, humidity, light level etc. Embedded
systems usually have no keyboard, screen, disks, printers, or other recognizable I/O
devices of a personal computer, and may lack human interaction devices of any kind.
PCE/EE/5
15. 1.4.1 Interrupts
Microcontrollers must provide real time (predictable, though not necessarily fast)
response to events in the embedded system they are controlling. When certain events
occur, an interrupt system can signal the processor to suspend processing the current
instruction sequence and to begin an interrupt service routine (ISR, or "interrupt
handler"). The ISR will perform any processing required based on the source of the
interrupt before returning to the original instruction sequence. Possible interrupt sources
are device dependent, and often include events such as an internal timer overflow,
completing an analog to digital conversion, a logic level change on an input such as from
a button being pressed, and data received on a communication link. Where power
consumption is important as in battery operated devices, interrupts may also wake a
microcontroller from a low power sleep state where the processor is halted until required
to do something by a peripheral event.
1.4.2 Programs
Microcontroller programs must fit in the available on-chip program memory,
since it would be costly to provide a system with external, expandable, memory.
Compilers and assemblers are used to convert high-level language and assembler
language codes into a compact machine code for storage in the microcontroller's memory.
Depending on the device, the program memory may be permanent, read-only memory
that can only be programmed at the factory, or program memory may be field-alterable
flash or erasable read-only memory.
PCE/EE/6
16. 1.4.3 Other microcontroller features
Microcontrollers usually contain from several to dozens of general purpose
input/output pins (GPIO). GPIO pins are software configurable to either an input or an
output state. When GPIO pins are configured to an input state, they are often used to read
sensors or external signals. Configured to the output state, GPIO pins can drive external
devices such as LEDs or motors.
Many embedded systems need to read sensors that produce analog signals. This is
the purpose of the analog-to-digital converter (ADC). Since processors are built to
interpret and process digital data, i.e. 1s and 0s, they are not able to do anything with the
analog signals that may be sent to it by a device. So the analog to digital converter is used
to convert the incoming data into a form that the processor can recognize. A less common
feature on some microcontrollers is a digital-to-analog converter (DAC) that allows the
processor to output analog signals or voltage levels.
In addition to the converters, many embedded microprocessors include a variety
of timers as well. One of the most common types of timers is the Programmable Interval
Timer (PIT). A PIT may either count down from some value to zero, or up to the capacity
of the count register, overflowing to zero. Once it reaches zero, it sends an interrupt to the
processor indicating that it has finished counting. This is useful for devices such as
thermostats, which periodically test the temperature around them to see if they need to
turn the air conditioner on, the heater on, etc.
PCE/EE/7
17. Time Processing Unit (TPU) is a sophisticated timer. In addition to counting
down, the TPU can detect input events, generate output events, and perform other useful
operations.
A dedicated Pulse Width Modulation (PWM) block makes it possible for the CPU
to control power converters, resistive loads, motors, etc., without using lots of CPU
resources in tight timer loops.
PCE/EE/8
18. Chapter 2
AUTONOMOUS ROBOT WITH ARM
2.1 Aims
The aim of this module was to work as a group to design and construct an
autonomous robot with arm.
We will be aiming to improve our knowledge of robotics as well as electronic
circuit design and construction.
We will be working as a group, and thus should improve our skills of working
together to achieve goals.
2.2 Objectives
Construct an autonomous robot with arm:
• That controlled with an infra-red remote.
• Which can move in any direction.
• Can lift any object of small weight (maxi. Capacity 50 gm.).
• Put the objects to another place.
• Rotate its arm at single place.
2.3 Project Restrictions:
• It should be robust and should have long life.
PCE/EE/9
19. • Must be no larger than 20x20x20cm in dimensions.
• Must be made within a budget of rupees 5000.
2.4 Individual Task
• IR Transmitter
• IR Receiver.
• Signal Processing
• Robot Movement
• Arm Movement
• Power Supply
• Body/Chassis.
• Motor Control.
2.4.1 IR Transmitter
By blinking an infrared LED, the signal becomes more unique and therefore more
discernible from other light sources. Even as intensity varies based on lighting, angle and
distance, the constant rate of blinking can be relied upon for recognition.
The rate of blinking should be sufficiently fast so that the signal can be quickly
recognized as being ―on‖. Since it takes a few blinks to detect the signal, delivering a
PCE/EE/10
20. message with a slow blink would be very time consuming. But, the rate of blinking
shouldn’t be so fast that expensive high-speed electronics are necessary.
If the device relies on a signal rates already in use, inexpensive and reliable mass-
produced parts will be available. It turns out that a popular consumer device, the remote
control, provides the robot hobbyist just that opportunity. A common rate for remote
control infrared transmissions is between 35 and 40 kHz (35,000 and 40,000 blinks per
second), and that’s exactly what this project is designed to generate.
Figure 2.1:- IR Transmitter
PCE/EE/11
21. 2.4.2 IR Receiver
Figure 2.2:- IR Receiver
IR detectors are little microchips with a photocell that are tuned to listen to
infrared light. They are almost always used for remote control detection - every TV and
DVD player has one of these in the front to listen for the IR signal from the clicker.
Inside the remote control is a matching IR LED, which emits IR pulses to tell the TV to
turn on, off or change channels. IR light is not visible to the human eye, which means it
takes a little more work to test a setup.
IR detectors are specially filtered for Infrared light, they are not good at detecting
visible light. On the other hand, photocells are good at detecting yellow/green visible
light, not good at IR light
PCE/EE/12
22. IR detectors have a demodulator inside that looks for modulated IR at 38 KHz.
Just shining an IR LED won’t be detected, it has to be PWM blinking at 38KHz.
Photocells do not have any sort of demodulator and can detect any frequency (including
DC) within the response speed of the photocell (which is about 1KHz)
IR detectors are digital out - either they detect 38KHz IR signal and output low
(0V) or they do not detect any and output high (5V). Photocells act like resistors, the
resistance changes depending on how much light they are exposed.
2.4.3 Signal Processing
Typically microcontroller programs must fit in the available on-chip program
memory, since it would be costly to provide a system with external, expandable, memory.
Compilers and assemblers are used to convert high-level language and assembler
language codes into a compact machine code for storage in the microcontroller's memory.
Depending on the device, the program memory may be permanent, read-only memory
that can only be programmed at the factory, or program memory may be field-alterable
flash or erasable read-only memory.
Manufacturers have often produced special versions of their microcontrollers in
order to help the hardware and software development of the target system. Originally
these included EPROM versions that have a "window" on the top of the device through
which program memory can be erased by ultraviolet light, ready for reprogramming after
a programming ("burn") and test cycle. Since 1998, EPROM versions are rare and have
been replaced by EEPROM and flash, which are easier to use (can be erased
electronically) and cheaper to manufacture.
PCE/EE/13
23. Other versions may be available where the ROM is accessed as an external device
rather than as internal memory, however these are becoming increasingly rare due to the
widespread availability of cheap microcontroller programmers.
The use of field-programmable devices on a microcontroller may allow field
update of the firmware or permit late factory revisions to products that have been
assembled but not yet shipped. Programmable memory also reduces the lead time
required for deployment of a new product.
Where hundreds of thousands of identical devices are required, using parts
programmed at the time of manufacture can be an economical option. These "mask
programmed" parts have the program laid down in the same way as the logic of the chip,
at the same time.
A customizable microcontroller incorporates a block of digital logic that can be
personalized in order to provide additional processing capability, peripherals and
interfaces that are adapted to the requirements of the application. For example, the
AT91CAP from Atmel has a block of logic that can be customized during manufacturer
according to user requirements.
2.4.4 Robot Movement
2.4.4.1 Straight – Forward:-
Both wheels rotate at the same speed, but the right wheel rotates forward and the left
wheel rotates backward, so the robot turns to its left around its center. This makes a sharp turn in
place.
PCE/EE/14
24. Figure 2.3: - Straight – Forward
2.4.4.2 Straight – Backwards:-
Both wheels rotate forward at the same speed and the robot moves straight
backward.
Figure 2.4: - Straight – Backwards
2.4.4.3 Point Turn – Right:-
Both wheels rotate at the same speed, but the left wheel rotates forward and the
right wheel rotates backward, so the robot turns to its right around its center. This makes
a sharp turn in place.
Figure 2.5:- Point Turn – Right
PCE/EE/15
25. 2.4.4.4 Point Turn – Left:-
Both wheels rotate at the same speed, but the right wheel rotates forward and the
left wheel rotates backward, so the robot turns to its left around its center. This makes a
sharp turn in place.
Figure 2.6:- Point Turn – Left
2.4.4.5 Swing Turn - Forward Right:-
The left wheel rotates forward and the right wheel does not move, so the robot
pivots around the right wheel as it turns forward. This makes a wider turn.
Figure 2.7:- Swing Turn - Forward Right
2.4.4.6 Swing Turn - Backward Right:-
The right wheel rotates backward and the left wheel does not move, so the robot pivots
around the left wheel as it turns backward. This makes a wider turn.
PCE/EE/16
26. Figure 2.8:- Swing Turn - Backward Right
2.4.4.7 Swing Turn - Forward Left:-
The right wheel rotates forward and the left wheel does not move, so the robot
pivots around the left wheel as it turns forward. This makes a wider turn.
Figure 2.9:- Swing Turn - Forward Left
2.4.4.8 Swing Turn - Backward Left:-
The left wheel rotates backward and the right wheel does not move, so the robot
pivots around the left wheel as it turns backward. This makes a wider turn.
Figure 2.10:- Swing Turn - Backward Left
PCE/EE/17
27. 2.4.5 Arm Movement
The degrees of freedom, or DOF, are a very important term to understand. Each
degree of freedom is a joint on the arm, a place where it can bend or rotate or translate.
We can typically identify the number of degrees of freedom by the number of actuators
on the robot arm. Now this is very important - when building a robot arm we want as few
degrees of freedom allowed for our application, Because each degree requires a motor,
often an encoder, and exponentially complicated algorithms and cost.
Figure 2.11:- Arm Movement
2.4.6 Power Supply
This is a circuit which supplies the necessary voltages to all the circuits and systems on
the vehicle. The power source will be a 9V PP3 Battery. The 2 volt ―rails‖ initially
planned are 9V – to drive the motors, and 5V to drive the low power and logic circuitry.
The Battery is low soon. So, we use a transformer and diode rectifier circuit.
PCE/EE/18
28. 2.4.7 Body/Chassis
Part # Description
1 The base of the robot, also the main PCB.
2 Front skid
3 Free Wheel, shaped as a pulley
4 Plastic pulley
5 Battery holder
6 Pipe clamp use to hold the motors
7 Ni-Cd 7.2V battery pack
8 1200 rpm 6V motor
Figure 2.12:- Chassis
It is clear that the drive train of this robot is differential type, meaning the two
rear wheels are responsible of moving the robot forward and backward, but are also used
to turn the robot in any required direction depending the difference of speed between the
right and left wheels.
PCE/EE/19
29. The first thing that need some explanation is the fact that there are only 2 wheels,
Well, while not being the best thing to do, a caster wheel can sometimes be replaced with
a skid, when the robot weight and size are not important, and when the robot is designed
for indoor environment, where the robot can move on relatively smooth surfaces, where
friction won’t be a serious problem.
2.4.8 Motor Control
The motor control circuit controls the speed of each motor therefore steering it
around the line. It is done by motor controller IC L293D.
PCE/EE/20
31. 3.1 Microcontroller ATmega8
The ATmega8 is a low-power CMOS 8-bit microcontroller based
on the AVR RISC architecture. By executing powerful instructions in a
single clock cycle, the ATmega8 achieves throughputs approaching 1 MIPS
per MHz, allowing the system designed to optimize power consumption
versus processing speed.
3.1.1 Pin Configuration:
Figure 3.2: Pin Configuration
PCE/EE/22
33. 3.1.2 Features
• High-performance, Low-power AVR® 8-bit Microcontroller
• Advanced RISC Architecture
– 130 Powerful Instructions – Most Single-clock Cycle Execution
– 32 x 8 General Purpose Working Registers
– Fully Static Operation
– Up to 16 MIPS Throughput at 16 MHz
– On-chip 2-cycle Multiplier
• High Endurance Non-volatile Memory segments
– 8K Bytes of In-System Self-programmable Flash program memory
– 512 Bytes EEPROM
– 1K Byte Internal SRAM
– Write/Erase Cycles: 10,000 Flash/100,000 EEPROM
– Data retention: 20 years at 85°C/100 years at 25°C(1)
– Optional Boot Code Section with Independent Lock Bits
In-System Programming by On-chip Boot Program
True Read-While-Write Operation
– Programming Lock for Software Security
• Peripheral Features
– Two 8-bit Timer/Counters with Separate Prescaler, one Compare Mode
– One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture
Mode
PCE/EE/24
34. – Real Time Counter with Separate Oscillator
– Three PWM Channels
– 8-channel ADC in TQFP and QFN/MLF package
Eight Channels 10-bit Accuracy
– 6-channel ADC in PDIP package
Six Channels 10-bit Accuracy
– Byte-oriented Two-wire Serial Interface
– Programmable Serial USART
– Master/Slave SPI Serial Interface
– Programmable Watchdog Timer with Separate On-chip Oscillator
– On-chip Analog Comparator
• Special Microcontroller Features
– Power-on Reset and Programmable Brown-out Detection
– Internal Calibrated RC Oscillator
– External and Internal Interrupt Sources
– Five Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, and
Standby
• I/O and Packages
– 23 Programmable I/O Lines
– 28-lead PDIP, 32-lead TQFP, and 32-pad QFN/MLF
• Operating Voltages
– 2.7 - 5.5V (ATmega8L)
– 4.5 - 5.5V (ATmega8)
PCE/EE/25
35. • Speed Grades
– 0 - 8 MHz (ATmega8L)
– 0 - 16 MHz (ATmega8)
• Power Consumption at 4 Mhz, 3V, 25°C
– Active: 3.6 mA
– Idle Mode: 1.0 mA
– Power-down Mode: 0.5 μA
3.2 Motor Driver IC L293D
Figure 3.4:- Motor Driver IC L293D pin diagram
The Device is a monolithic integrated high voltage, high current four channel
driver designed to accept standard DTL or TTL logic levels and drive inductive loads
(such as relays solenoids, DC and stepping motors) and switching power transistors.
PCE/EE/26
36. To simplify use as two bridges each pair of channels is equipped with an enable input. A
separate supply input is provided for the logic, allowing operation at a lower voltage and
internal clamp diodes are included.
This device is suitable for use in switching applications at frequencies up to 5
kHz.
The L293D is assembled in a 16 lead plastic package which has 4 center pins
connected together and used for heat sinking The L293DD is assembled in a 20 lead
surface mount which has 8 center pins connected together and used for heat sinking.
Figure 3.5:- Block Diagram of L293D
PCE/EE/27
37. 3.3 Crystal Oscillator
A crystal oscillator is an electronic oscillator circuit that uses the
mechanical resonance of a vibrating crystal of piezoelectric material to create an
electrical signal with a very precise frequency. This frequency is commonly used to keep
track of time (as in quartz wristwatches), to provide a stable clock
signal for digital integrated circuits, and to stabilize frequencies for radio
transmitters and receivers. The most common type of piezoelectric resonator used is
the quartz crystal, so oscillator circuits designed around them became known as "crystal
oscillators."
Quartz crystals are manufactured for frequencies from a few tens of kilohertz to
tens of megahertz. More than two billion (2×109) crystals are manufactured annually.
Most are used for consumer devices such as wristwatches, clocks, radios, computers,
and cellphones. Quartz crystals are also found inside test and measurement equipment,
such as counters, signal generators, and oscilloscopes.
3.4 7805 Voltage Regulator IC
7805 is a voltage regulator integrated circuit. It is a member of 78xx series of
fixed linear voltage regulator ICs. The voltage source in a circuit may have fluctuations
and would not give the fixed voltage output. The voltage regulator IC maintains the
output voltage at a constant value. The xx in 78xx indicates the fixed output voltage it is
designed to provide. 7805 provides +5V regulated power supply. Capacitors of suitable
values can be connected at input and output pins depending upon the respective voltage
levels.
PCE/EE/28
38. Figure 3.6:- 7805 Voltage Regulator IC
3.5 Stepper Motor
A stepper motor (or step motor) is a brushless DC electric motor that divides a
full rotation into a number of equal steps. The motor's position can then be commanded
to move and hold at one of these steps without any feedback sensor (an open-loop
controller), as long as the motor is carefully sized to the application.
The stepper motor is an electromagnetic device that converts digital pulses into
mechanical shaft rotation. Advantages of step motors are low cost, high reliability, high
torque at low speeds and a simple, rugged construction that operates in almost any
environment. The main disadvantages in using a stepper motor is the resonance effect
often exhibited at low speeds and decreasing torque with increasing speed.
PCE/EE/29
40. 3.6 Infra-red Remote
A remote control is a component of an electronics device, most commonly a
television set, DVD player and home theater systems originally used for operating the
television device wirelessly from a short line-of-sight distance. Remote control has
continually evolved and advanced over recent years to include Bluetooth connectivity,
motion sensor enabled capabilities and voice control.
The main remote control technology used in the home is infrared. The signal
between a remote control handset and the device it is controlling are infrared pulses,
which are invisible to the human eye. The transmitter in the remote control handset sends
out a pulse of infrared light when a button is pressed on the handset. A transmitter is
often a light emitting diode (LED) which is built into the pointing end of the remote
control handset. The infrared light pulse represents a binary code that corresponds to a
certain command, such as (power on). The receiver passes the code to a microprocessor,
which decodes it and carries out the command.
Figure 3.8: Remote
PCE/EE/31
41. 3.7 Power Supply
There are many types of power supply. Most are designed to convert high voltage
AC mains electricity to a suitable low voltage supply for electronics circuits and other
devices. A power supply can by broken down into a series of blocks, each of which
performs a particular function.
For example a 5V regulated supply:
Each of the blocks is described in more detail below:-
Transformer - steps down high voltage AC mains to low voltage AC.
Rectifier - converts AC to DC, but the DC output is varying.
Smoothing - smooth the DC from varying greatly to a small ripple.
Regulator - eliminates ripple by setting DC output to a fixed voltage.
Figure 3.9: Circuit Diagram of regulated power Supply
PCE/EE/32
42. 3.7.1 Transformer
Transformers convert AC electricity from one voltage to another with little loss of
power. Transformers work only with AC and this is one of the reasons why mains
electricity is AC.
Step-up transformers increase voltage, step-down transformers reduce voltage. Most
power supplies use a step-down transformer to reduce the dangerously high mains
voltage (230V in UK) to a safer low voltage.
The input coil is called the primary and the output coil is called the secondary. There
is no electrical connection between the two coils, instead they are linked by an alternating
magnetic field created in the soft-iron core of the transformer. The two lines in the middle
of the circuit symbol represent the core.
Transformers waste very little power so the power out is (almost) equal to the power
in. Note that as voltage is stepped down current is stepped up.
The ratio of the number of turns on each coil, called the turns ratio, determines the
ratio of the voltages. A step-down transformer has a large number of turns on its primary
(input) coil which is connected to the high voltage mains supply, and a small number of
turns on its secondary (output) coil to give a low output voltage.
Vp Np power out = power in
turns ratio = = and
Vs Ns Vs × Is = Vp × Ip
Vp = primary (input) voltage Vs = secondary (output) voltage
Np = number of turns on primary Ns = number of turns on secondary
coil coil
Ip = primary (input) current Is = secondary (output) current
Rectifier
PCE/EE/33
43. There are several ways of connecting diodes to make a rectifier to
convert AC to DC. The bridge rectifier is the most important and it produces
full-wave varying DC. A full-wave rectifier can also be made from just two
diodes if a center-tap transformer is used, but this method is rarely used now
that diodes are cheaper. A single diode can be used as a rectifier but it only uses
the positive (+) parts of the AC wave to produce half-wave varying DC.
3.7.2 Bridge rectifier
A bridge rectifier can be made using four individual diodes, but it is also
available in special packages containing the four diodes required. It is called a
full-wave rectifier because it uses all the AC wave (both positive and negative
sections). 1.4V is used up in the bridge rectifier because each diode uses 0.7V
when conducting and there are always two diodes conducting, as shown in the
diagram below. Bridge rectifiers are rated by the maximum current they can
pass and the maximum reverse voltage they can withstand (this must be at least
three times the supply RMS voltage so the rectifier can withstand the peak
voltages). Please see the Diodes page for more details, including pictures of
bridge rectifiers.
PCE/EE/34
44. Figure 3.10 Bridge rectifier
Alternate pairs of diodes conduct, changing over the connections so the
alternating directions of AC are converted to the one direction of DC
Figure 3.11: Output: full-wave varying DC
(using all the AC wave)
3.7.3 Smoothing
Smoothing is performed by a large value electrolytic capacitor connected across
the DC supply to act as a reservoir, supplying current to the output when the varying DC
voltage from the rectifier is falling. The diagram shows the unsmoothed varying DC
PCE/EE/35
45. (dotted line) and the smoothed DC (solid line). The capacitor charges quickly near the
peak of the varying DC, and then discharges as it supplies current to the output.
Figure 3.12: Smoothing
Note that smoothing significantly increases the average DC voltage to almost the
peak value (1.4 × RMS value). For example 6V RMS AC is rectified to full wave DC of
about 4.6V RMS (1.4V is lost in the bridge rectifier), with smoothing this increases to
almost the peak value giving 1.4 × 4.6 = 6.4V smooth DC.
Smoothing is not perfect due to the capacitor voltage falling a little as it
discharges, giving a small ripple voltage. For many circuits a ripple which is 10% of the
supply voltage is satisfactory and the equation below gives the required value for the
smoothing capacitor. A larger capacitor will give fewer ripples. The capacitor value must
be doubled when smoothing half-wave DC.
5 × Io
Smoothing capacitor for 10% ripple, C =
Vs × f
Io = output current from the supply
Vs = supply voltage (peak value of unsmoothed DC)
f = frequency of the AC supply (50Hz in UK)
PCE/EE/36
46. 3.8 Resistors
This is the most common component in electronics. It is used mainly
to control current and voltage within the circuit. We can identify a simple
resistor by its simple cigar shape with a wire lead coming out of each end. It
uses a system of color coded bands to identify the value of the component
(measured in Ohms) A surface mount resistor is in fact mere millimeters in
size but performs the same function as its bigger brother, the simple resistor.
A potentiometer is a variable resistor. It lets you vary the resistance with a
dial or sliding control in order to alter current or voltage on the fly. This is
opposed to the ―fixed‖ simple resistors.
3.9 Condensers/Capacitors
Capacitors, or "caps", vary in size and shape - from a small surface
mount model up to a huge electric motor cap the size of a paint can. It
storages electrical energy in the form of electrostatic charge. The size of a
capacitor generally determines how much charge it can store. A small
surface mount or ceramic cap will only hold a minuscule charge. A
cylindrical electrolytic cap will store a much larger charge. Some of the
large electrolytic caps can store enough charge to kill a person. Another
type, called Tantalum Capacitors, store a larger charge in a smaller package.
PCE/EE/37
47. 3.10 Inductors
We remember from science class that adding electrical current to a
coil of wire produces a magnetic field around itself. This is how the inductor
works. It is charged with a magnetic field and when that field collapses it
produces current in the opposite direction. Inductors are used in Alternating
Current circuits to oppose changes in the existing current. Most inductors
can be identified by the ―coil" appearance. Others actually look like a
resistor but are usually green in color.
3.11 Diodes
Diodes are basically a one-way valve for electrical current. They let it
flow in one direction (from positive to negative) and not in the other
direction. This is used to perform rectification or conversion of AC current
to DC by clipping off the negative portion of a AC waveform. The diode
terminals are cathode and anode and the arrow inside the diode symbol
points towards the cathode, indicating current flow in that direction when the
diode is forward biased and conducting current. Most diodes are similar in
appearance to a resistor and will have a painted line on one end showing the
direction or flow (white side is negative). If the negative side is on the
negative end of the circuit, current will flow. If the negative is on the
positive side of the circuit no current will flow.
PCE/EE/38
48. 3.12 Transistors
The transistor performs two basic functions. 1) It acts as a switch
turning current on and off. 2) It acts as a amplifier. This makes an output
signal that is a magnified version of the input signal.
Transistors come in several sizes depending on their application. It
can be a big power transistor such as is used in power amplifiers in your
stereo, down to a surface mount (SMT) and even down to .5 microns wide
(I.E.: Mucho Small!) such as in a microprocessor or Integrated Circuit.
3.13 ICs (Integrated Circuits)
Integrated Circuits, or ICs, are complex circuits inside one simple
package. Silicon and metals are used to simulate resistors, capacitors,
transistors, etc. It is a space saving miracle. These components come in a
wide variety of packages and sizes. You can tell them by their "monolithic
shape" that has a ton of "pins" coming out of them. Their applications are as
varied as their packages. It can be a simple timer, to a complex logic circuit,
or even a microcontroller (microprocessor with a few added functions) with
erasable memory built inside.
3. 14 Microprocessors (MPUs)
Microprocessors and other large scale ICs are very complex ICs. At
their core is the transistor which provides the logic for computers, cars, TVs
PCE/EE/39
49. and just about everything else electronic. Packages are becoming smaller
and smaller as companies are learning new tricks to make the transistors
ever tinier.
PCE/EE/40
50. Chapter 4
CODING
; ---------==========----------==========---------=========---------
; Autonomous Robot with Arm
; ---------==========----------==========---------=========---------
DSEG ; This is internal data memory
ORG 20H ; Bit adressable memory
FLAGS: DS 1
CONTROL BIT FLAGS.0 ; toggles with every new keystroke
NEW BIT FLAGS.1 ; Bit set when a new command has been received
COMMAND: DS 1 ; Received command byte
SUBAD: DS 1 ; Device subaddress
TOGGLE: DS 1 ;Toggle every bit
ANS: DS 1 ;
ADDR: DS 1
STACK: DS 1 ; Stack begins here
CSEG ; Code begins here
;---------==========----------==========---------=========---------
PCE/EE/41
51. ; PROCESSOR INTERRUPT AND RESET VECTORS
;---------==========----------==========---------=========---------
ORG 00H ; Reset
JMP MAIN
ORG 0003H ; External Interrupt0
JMP RECEIVE
; ---------==========----------==========---------=========---------
; Interrupt 0 routine
; ---------==========----------==========---------=========---------
RECEIVE:
cpl p3.7
MOV 2,#255 ; Time Loop (3/4 bit time)
DJNZ 2,$ ; Waste Time to sync second bit
MOV 2,#255 ; Time Loop (3/4 bit time)
Djnz 2,$ ; Waste Time to sync second bit
Mov 2,#145 ; Time Loop (3/4 bit time)
Djnz 2,$ ; Waste Time to sync second bit
PCE/EE/42
54. JNZ CH4
CPL OP4
AJMP GO
CH4: MOV A,R0
XRL A,#05H
JNZ CH5
CPL OP5
AJMP GO
CH5: MOV A,R0
XRL A,#06H
JNZ CH6
CPL OP6
AJMP GO
CH6: MOV A,R0
XRL A,#0CH
JNZ go
MOV OUTPUT,#0FFH
PCE/EE/45
55. AJMP GO
GO:
;***********************************************************
MOV ANS,TOGGLE
MOV A,ANS
CPL ACC.5
MOV ANS,A
SETB NEW ; Set flag to indicate the new command
;################################################################
ANS1:
RETI
; ---------==========----------==========---------=========---------
; Main routine. Program execution starts here.
; ---------==========----------==========---------=========---------
MAIN:
MOV SP,#60H
PCE/EE/46
56. MOV OUTPUT,#0FFH
SETB EX0 ; Enable external Interrupt0
CLR IT0 ; triggered by a high to low transition
SETB EA
MOV ANS,#00H ;clear temp toggle bit
CLR NEW
LOO:
JNB NEW,LOO
CLR NEW
AJMP LOO
END
PCE/EE/47
57. Chapter 5
CONCLUSION
From the construction of this prototype, we can arrive at several conclusions for the final
Prototype:
The robot can move in any direction.
It is fully controlled by remote.
It can pick up light objects from a place and put them to another place.
It can also put objects to a height and put down them from the height also.
It takes power supply of 220V, 1-phase A.C.
It can pick a maximum weight of 50 grams.
PCE/EE/48