embedded robotics : notes (2008)

66
1 ,I 2 IT Fundamentals of Embedded Robotics Fundamentals of Embedded Robotics (Notes) Professor. Rabinder Henry Professor .Amit Patwardhan www.ppcrcc.in December,2008

Upload: rabinder-henry

Post on 11-Apr-2017

39 views

Category:

Engineering


5 download

TRANSCRIPT

Page 1: Embedded Robotics : Notes (2008)

1 ,I2IT Fundamentals of Embedded Robotics

Fundamentals of Embedded Robotics (Notes) Professor. Rabinder Henry Professor .Amit Patwardhan

www.ppcrcc.in December,2008

Page 2: Embedded Robotics : Notes (2008)

2 ,I2IT Fundamentals of Embedded Robotics

Contents 1. Introduction to Robotics 2. Sensors 3. Actuators 4. Introduction to Microcontrollers 5. Microcontroller Programming 6. Introduction to Robotic Kit 7. Design of Simple Robot

Page 3: Embedded Robotics : Notes (2008)

3 ,I2IT Fundamentals of Embedded Robotics

Chapter 1: INTRODUCTION TO ROBOTICS Definition of Robot

Machines designed to do physical work with decision-making abilities are categorized as

robots. The study of Robots can be defined as Robotics. In general terms a robot can be

defined as a re-programmable general-purpose manipulator with external sensors that can

perform various task .The programming gives intelligence to the Robot.

History of Robotics

Czech writer introduced the word Robot from the Czech word “robota” meaning work, in

1921.Issac Asimov Famous Russian writer introduced the word Robotics in 1942.After

the Second World War mechanical arms resembling human arms were designed to move

objects and pick objects in industry. The mechanical arms are also called as manipulators.

There were controlled through links like master slave operation.

First Generation Robots

The first generation robots are repeating, pick and place or point-to-point movement type

mechanical design.

Second Generation Robots

The use of sensor to sense the physical quantities like light, touch, sound, pressure etc

and move in response to the sensed signal marked the beginning of second generation

Robots.

Third Generation Robots

The third generation robots are designed to imitate human intelligence and high speed

processing of information using computers. Such robots have artificial intelligence and

decision-making abilities.

Fourth Generation Robots

These are the future Robots that can produce their own replicas.

Page 4: Embedded Robotics : Notes (2008)

4 ,I2IT Fundamentals of Embedded Robotics

Types of Robots

The Robots can be classified into different types based on their movement, behavior, and

application and how they are made.

Mobile Robots:

Robots, which can move on their own, are called Mobile Robots.

Stationary Robots:

Robots that are fixed but have arms to move are called Stationary Robots

Adaptive Robots:

Robots that can adapt to the environment are called Adaptive Robots.

Non-Adaptive Robots:

Robots that cannot adapt to the environment are called non-adaptive Robots.

Domestic Robots:

Robots that are designed to do the household work like washing, cleaning are called

Domestic Robots.

Industrial Robots

Robots that perform function like welding, carrying weight, inspection, cutting, and

painting are called Industrial Robots.

Entertainment Robots

Robots that are made to entertain human like dancing, talking, etc are called

Entertainment Robots.

Need of Robots

Robots can work continuously for 24 hrs 7 days a week throughout the year.

Robots can never get sick.

Robots can do any dangerous tasks that humans cannot do.

Robots can do work more accurately than humans.

Robots can assist humans in various tasks.

What Robots can do, can be summarized in four DS?

Page 5: Embedded Robotics : Notes (2008)

5 ,I2IT Fundamentals of Embedded Robotics

Dangerous, Dirty, Dull, Difficult

Use of Robots

In industry to pick and place objects, welding, cleaning, cutting etc

In car plants to do painting, spraying and assembly of cars.

In houses to clean, to wash etc

In hospitals to do operations and scans.

In Space to repair satellites.

In underwater to take pictures

In general life for entertainment.

Robot A Robot has the ability to sense the environment and then take decision by using its

intelligence and according to it can perform an action. So the three important parts of a

Robot are Sensors, Brain and Effectors.( Refer Figure 1)

Figure : Block Diagram of a Robot and environment

Environment

Sensors

Effectors

Brain

Page 6: Embedded Robotics : Notes (2008)

6 ,I2IT Fundamentals of Embedded Robotics

A Robot may be designed to sense any kind of physical quantity like light, sound. Touch,

temperature, pressure, movement etc. The device, which performs sensing, is called

Sensor.

A Robot need a brain to understand the sensed quantity and should plan its action. Using

Computers, processors or microcontrollers one can program the Robot to take decisions.

A Robot also has effectors. When the brain decides the action they give instructions to

the effectors, which can be wheels or arms, which move according to brains decision.

What can be called a Robot?

An automated machine can be called Robot only if it satisfies the following

1.Sense and get information from surrounding

2.Can perform many functions called multitasking

3.Can be reprogrammed to perform many type of functions

4.Can be autonomous that means can perform actions on their own.

How to describe a Robot?

The following things can describe a Robot

Degrees Of Freedom (DOF):

The number of directions in which the Robot can move can be defined as Degrees of

Freedom.

Workspace

The total area in which the Robot can move can be defined as workspace.

Payload

The total weight the Robot can move or lift can be defined as payload.

Repeatability:

The number of time the Robot can repeat the same task.

Manipulators:

The arms or any mechanism used by the Robot to move object is called Manipulators.

Prismatic Manipulators:

Page 7: Embedded Robotics : Notes (2008)

7 ,I2IT Fundamentals of Embedded Robotics

The Robot movements of its arms in linear directions are called prismatic manipulators

Rotary Manipulators:

The arms of Robot which perform angular movements are called Rotary Manipulators

Kinematics:

The kinematics describes the mechanics of movement of different parts in any

mechanical design including Robots.

Designing a Robot

To design a Robot one should make the body that is mechanical design and the plan the

motion of the Robot and finally give some intelligence to the Robot to take decisions.

Figure 2: Robot model The Robot Design can be generally consists of three major issues. 1. Mechanical Design 2. Control System 3. Electronics and programming

Mechanical design

Brain /Controller/Computer

Sensor

Motion Planning

Electronics

Page 8: Embedded Robotics : Notes (2008)

8 ,I2IT Fundamentals of Embedded Robotics

Interdisciplinary Study:

Robotics is interdisciplinary filed meaning it necessary to have some knowledge every

subject to design a simple Robot

Figure 3: Interdisciplinary domain

Physics

Electronics

Programming

Mechanics

Chemistry

Mathematics

Robotics

Page 9: Embedded Robotics : Notes (2008)

9 ,I2IT Fundamentals of Embedded Robotics

Chapter 2: SENSORS The most important function of the Robot is to obtain information from the surroundings.

For this Robots use the sensors to obtain information from the Physical world.

Sensors

'Sensor' is `a device that detects a change in a physical surrounding and turns it into a

signal which can be measured or recorded. The sensor ‘transduces’ (converts) power

from one system to another in the same or in the different form.

Figure 1: Sensor operation

In general we describe a sensor as device, which converts physical value into measurable

electric signal.

Classification of Sensors:

The sensors can be classified into different types depending up on various parameters.

Location of Sensor in a Robot

Conversion principle

External Physical Stimulus

Materials from which sensors are made

Application

Sensor

Input Energy/ Signal

Output Energy/ Signal

Sensing Process

Page 10: Embedded Robotics : Notes (2008)

10 ,I2IT Fundamentals of Embedded Robotics

Location of Sensor in a Robot:

The position where the sensor is located on the Robots Chassis and the signal it senses

can be of two types.

1.Internal Sensors:

Internal Sensors indicate the status of the internal state of the Robot like position, angle

of location and joint conditions etc.

2.External Sensors:

External Sensors Provide feed back on the external factors like light, sound, temperature

and humidity etc.

Conversion Principle:

1.Passive Sensor

Receives passive energy from the environment like light sensor

2.Active Sensor

Makes observation like emitting energy like ultrasonic sensors etc

External Physical Stimulus:

Sensors can be classified on the basis of the signal being detected. The sensor ability to

sense different forms energy in nature and convert them into measurable signal is listed

down below in the table.

Table 1: Sensors

Stimulus Properties

Sound (Acoustic) Wave (Amplitude, Phase) , Wave Velocity

Electric Charge, Current, Voltage, Phase. Conductivity,

Resistivity

Magnetic Magnetic Flux, Permeability, Magnetic field

Thermal Temperature, Specific Heat,

Mechanical Pressure, Force, Position, Angle, Torque,

Shape, Stress, strain

Optical Wave, Wavelength, Amplitude, Reflectivity,

Refractive Index

Page 11: Embedded Robotics : Notes (2008)

11 ,I2IT Fundamentals of Embedded Robotics

Application:

Different type of sensors is used for different types of Applications.

Bio-Sensors:

Sensors used to obtain information from living cells like blood cells, tissues etc

Chemical Sensors:

Sensors used to obtain information about different types of chemicals.

Motion Sensors:

Sensors used to obtain information about the motion of a body are called motion sensors.

Conversion Mechanism:

Light Sensor

Detect light in the surrounding and gives out electrical signal. There are many types of

light sensors. The common types of light sensors are Photodiodes, Phototransistors, LDR

(Light Depended Resistor), Infrared Transmitter and Receiver (IR Pair Sensor).

Photo diode It is diode, which can detect light. They are used as photo detectors. They are made of semiconductors, when light falls on them they emit electrons resulting in current flow.

Phototransistor Its is Bipolar Junction Transistor which can detect light. They are also used for light detection. They also amplify the current generated when light falls on them.

Page 12: Embedded Robotics : Notes (2008)

12 ,I2IT Fundamentals of Embedded Robotics

Light dependant resistor (LDR) It is a photo resistor. Resistance decreases when light falls on it. It is used generally used to detect obstacles.

Infrared Sensor Infrared is the frequency of the light higher than the visible range. LED, which emits light in Infrared frequency is called as Infrared Transmitter.

Sound Sensor

Detect sound in the surrounding and gives out electrical signal. There are many types of sound sensors. The common types of sound sensors are SONAR and Ultrasonic sensors. They are used in Robotics to detect obstacles and measure the distance. Ultrasonic Sensor: This sensor emits sound in the ultrasonic range and detects reflected sound frequency falling on it.

Page 13: Embedded Robotics : Notes (2008)

13 ,I2IT Fundamentals of Embedded Robotics

Pressure Sensor

These sensors detect pressure or force in the surrounding and gives out electrical signal.. The common types are strain sensors. They are used in Robotics to detect obstacles and measure the distance

Temperature Sensor

These sensors detect pressure or force in the surrounding and gives out electrical signal.. The common types of pressure sensors are strain sensors. They are used in Robotics to detect obstacles and measure the distance Properties of Sensors The working sensors can be described through their properties. The four important properties of any kind of sensors are Input Range, Output Range, Sensitivity and stability. Input Range This describes the range of signals the sensor can detect from the surrounding. Example a temperature sensor can detect from 0 degrees to 100 degrees. Output Range This describes the range of output signals the sensor can generate depending on the input signal from the surrounding. Example a photodiode gives 2 volts to 5 volts as output signal depending on the amount of light falling on it.

Page 14: Embedded Robotics : Notes (2008)

14 ,I2IT Fundamentals of Embedded Robotics

Sensitivity The sensitivity of the sensor is capability of the sensor to detect even small changes in the input. Example temperature sensor can detect temperature in short range. For 0 degrees it gives output voltage of 5 volts and for 10 degrees it gives output voltage of 10 volts .so the sensitivity of the sensor is 10 degrees Stability The stability of the sensor is capability of the sensor to detect only the required signal and not other signals like noise, disturbance etc present in the surroundings.

Page 15: Embedded Robotics : Notes (2008)

15 ,I2IT Fundamentals of Embedded Robotics

Chapter 3: ACTUATORS Actuators are devices used to produce action or motion. The input to the actuator is generally electric signal and the output signal is linear or rotary motion. In a Robot the decision taken by the controller is executed by the actuator in terms of motion or position change. In Robotics actuator are different types of motors and their related driver circuits. Types of actuators: There are different types of actuators depending on the input energy. Electrical power Fluid power Piezoelectric Shape Memory Alloys Actuators can also be classified based on the motion they generate. Linear: Solenoid, hydraulic/pneumatic jacks Rotary: Motors, hydraulic/pneumatic drives Electrical Actuators: In response to sensor input to the Robot, the actuators generate the motion or movement. Commonly used actuators in the Robots for linear and rotary motion are electrical actuators. The commonly used electrical actuators are Motors. Electric Motors: Electric Motors convert electrical energy into mechanical energy that is motion. There are two types of electric motors.

Actuator

Input Energy Output Motion

Figure 1 :Actuator Working Principle

Page 16: Embedded Robotics : Notes (2008)

16 ,I2IT Fundamentals of Embedded Robotics

AC motors: Works on AC power supply. These are used in most of the household devices and industries. Not suitable for Robotics Example fans DC motors: Small gadgets, due to availability of DC power source. Large DC Motors are used in locomotive engines, easier to control Selection of Motors for Robotics The selection of a motor for using in Robots is depended on the following parameters. 1.Cost of the motor 2.Size of the motors 3.Power required for running the motor 4.Accuracy of the motor 5.Application Motors for Robotics: The most commonly used motors for making Robots are simple DC Motors. The DC motors work on Direct Current (DC). Stepper Motors and Servo Motors are also very popular DC type motors in Robotics. But simple DC motors are cheap and easily available everywhere DC Motors: DC Motors operate in DC voltage. They can rotate in clockwise as well as anticlockwise direction. The speed of DC motor can be controlled. Working of DC Motors:

Page 17: Embedded Robotics : Notes (2008)

17 ,I2IT Fundamentals of Embedded Robotics

The direction in which the motor rotates is determined by the applied polarity of voltage (VDC) or the direction of the current flow Changing the amount of power supplied to the motor will vary the speed of rotation of the motor. Advantages: DC Motor generates high-speed rotation. They generate very low torque. Gears can be used to reduce the speed but they increase the torque of the motor. They are very easy to connect to power supply and operate. Driver for DC Motors: Drivers are the current amplifying circuits. Drivers Convert low current control signal into high current control signal to run the motors. H – Bridge Driver Circuit Using: The most common type of driver circuit is called H-Bridge. H-Bridge is electronic circuit which enables DC motors to run forward and backward.

Low Current

Motor Driver

High Current

Page 18: Embedded Robotics : Notes (2008)

18 ,I2IT Fundamentals of Embedded Robotics

H-bridge can be made using four-power transistor like TIP 122 or TIP 127 as shown in Figure. H-bridge also available as Integrated Chips Like L293D or L298D. The switching of the transistors determines the direction of the motor rotation as given below in the tabular column. Stepper Motors: Stepper Motors operate in DC voltage and rotate in steps. The rotation is very precise and can be made to stop at an angle.

Stop 0 0 0 0

Stop

Anti-Clockwise

Clockwise

Output at Motor

1 1 1 1

0 1 1 0

1 0 0 1

Q4 Q3 Q2 Q1

Page 19: Embedded Robotics : Notes (2008)

19 ,I2IT Fundamentals of Embedded Robotics

Servo Motors Servomotor is a device with internal position feed back and are commonly used is precision rotation in Robotics.

Servomotor Servomotors are the most popular motors in Robotics. These motors are designed to rotate less than 360 degrees but can be rotate continuously.

Page 20: Embedded Robotics : Notes (2008)

20 ,I2IT Fundamentals of Embedded Robotics

Chapter 4: INTRODUCTION OF MICROCONTROLLER Robot process information from the environment; then based on the programming or logic they determine the proper course of action. The controller in the Robot does the processing of the received signal and decision. The controller is also called the brain of the Robot. Functions performed by the controller in a Robot. 1.It receives signal from the sensor 2.The sensed signal is processed by the logic or program written in the controller. 3.Based on the programming it decides the action. 4.Action decided is given to the actuator to perform the motion. There are many types of controller that can be used as the brain of the Robot. 1.Mechanical Controllers 2.Discrete Electronics Controllers 3.Integrated Chip (IC) Controllers The most commonly used controllers are the Integrated Chip Controllers example Microprocessor, Microcontrollers and Personal Computer (PC). Microprocessor: The microprocessor is a programmable digital electronic component, which has Central Processing Unit and built on single Integrated Chip.

Personal Computer:

Page 21: Embedded Robotics : Notes (2008)

21 ,I2IT Fundamentals of Embedded Robotics

The motherboards of PC or Laptop can also programmed as the brain of the Robot. But they are more suitable complex Robots used in industries. Microcontroller The microcontroller is an entire computer on a single chip. The advantage of designing a Robot with microcontroller is that a large amount of electronics needed for certain applications can be reduced. This makes it the ideal device for use with mobile robots and other applications where computing power is needed. The microcontroller is popular because the chip can be reprogrammed easily to perform different functions, and is very cheap. The microcontroller contains all the basic components that make up a computer. It contains the following Microprocessor ROM Read Only Memory RAM Random Access Memory Timer Bus ADC Analog to Digital Converter DAC Digital to Analog Converter Input and Output Ports. The microcontroller consists of both hardware and software. It can be interfaced with external devices and the same time it can be programmed and reprogrammed to perform certain task. Microcontrollers are used in all modern electronic devices like mobiles, washing machines, toys, Robots, Automobiles, medical instruments etc The same Microcontroller are commonly used as the controller or the brain for the Robots.

A single chip Microcontroller

RAM ROM

I/O Port Timer

Serial COM Port

CPU

Page 22: Embedded Robotics : Notes (2008)

22 ,I2IT Fundamentals of Embedded Robotics

Embedded System Design: The concept of using a microcontroller for specific application is called Embedded System Design Intel 80C51 Microcontroller: Intel 8051 is the most commonly used microcontroller by beginners in Robotics. Intel introduced 8051 in 1980 and popular even today for embedded system design and in Robotics. Many companied manufacture the same IC. The Robotic Kit has Atmel 892051 type microcontroller, which can be used, as the brain of the Obstacle detecting Robot.

Features of 892051

• Compatible with MCS®-51Products

• 2K Bytes of Reprogrammable Flash Memory – Endurance: 1,000 Write/Erase Cycles

• 2.7V to 6V Operating Range

• Fully Static Operation: 0 Hz to 24 MHz

• Two-level Program Memory Lock

• 128 x 8-bit Internal RAM

• 15 Programmable I/O Lines

• Two 16-bit Timer/Counters

• Six Interrupt Sources

• Programmable Serial UART Channel

• Direct LED Drive Outputs

• On-chip Analog Comparator

• Low-power Idle and Power-down Modes

• Green (Pb/Halide-free) Packaging Option

Page 23: Embedded Robotics : Notes (2008)

23 ,I2IT Fundamentals of Embedded Robotics

Figure 4.1: Pin Diagram of AT89C2051

Page 24: Embedded Robotics : Notes (2008)

24 ,I2IT Fundamentals of Embedded Robotics

Pin Description

VCC Supply voltage.

GND Ground.

Port 1

The Port 1 is an 8-bit bi-directional I/O port. Port pins P1.2 to P1.7 provide internal pull-

ups. P1.0 and P1.1 require external pull-ups. P1.0 and P1.1 also serve as the positive input

(AIN0) and the negative input (AIN1), respectively, of the on-chip precision analog

comparator. The Port 1 out-put buffers can sink 20mA and can drive LED displays directly.

Page 25: Embedded Robotics : Notes (2008)

25 ,I2IT Fundamentals of Embedded Robotics

When 1s are written to Port 1 pins, they can be used as inputs. When pins P1.2 to P1.7 are

used as inputs and are externally pulled low, they will source current (IIL) because of the

internal pull-ups. Port 1 also receives code data during Flash programming and verification.

Port 3

Port 3 pins P3.0 to P3.5, P3.7 are seven bi-directional I/O pins with internal pull-ups.

P3.6 is hard-wired as an input to the output of the on-chip comparator and is not accessible

as a general-purpose I/O pin. The Port 3 output buffers can sink 20 mA. When 1s are

written to Port 3 pins they are pulled high by the internal pull-ups and can be used as

inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL)

because of the pull-ups.

Port 3 also serves the functions of various special features of the AT89C2051 as listed

below:

Port pins and their alternate functions

Port 3 also receives some control signals for Flash programming and verification.

RST

Reset input. All I/O pins are reset to 1s as soon as RST goes high. Holding the RST pin

high for two machine cycles while the oscillator is running resets the device. Each machine

cycle takes 12 oscillator or clock cycles.

XTAL1

Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

Page 26: Embedded Robotics : Notes (2008)

26 ,I2IT Fundamentals of Embedded Robotics

XTAL2

Output from the inverting oscillator amplifier.

Oscillator Characteristics

The XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier

which can be configured for use as an on-chip oscillator. Either a quartz crystal or ceramic

resonator may be used. To drive the device from an external clock source, XTAL2 should

be left unconnected while XTAL1 is driven. There are no requirements on the duty cycle of

the external clock signal, since the input to the internal clocking circuitry is through a

divide-by-two flip-flop, but minimum and maximum voltage high and low time

specifications must be observed.

Circuit diagram for connection of Crystal Oscillator

Note: C1, C2 = 30 pF ± 10 pF for Crystals

= 40 pF ± 10 pF for Ceramic Resonators

Page 27: Embedded Robotics : Notes (2008)

27 ,I2IT Fundamentals of Embedded Robotics

Circuit Diagram for Crystal Oscillator with external clock

Special Function Registers

A map of the on-chip memory area called the Special Function Register (SFR) space is

shown in the table below. Note that not all of the addresses are occupied, and unoccupied

addresses may not be implemented on the chip. Read accesses to these addresses will in

general return random data, and write accesses will have an indeterminate effect. User

software should not write 1s to these unlisted locations, since they may be used in future

products to invoke new features. In that case, the reset or inactive values of the new bits

will always be 0.

Restrictions on Certain Instructions

The AT89C2051 and is an economical and cost-effective member of Atmel’s growing

family of microcontrollers. It contains 2K bytes of Flash program memory. It is fully

compatible with the MCS-51 architecture, and can be programmed using the MCS-51

instruction set. However, there are a few considerations one must keep in mind when

utilizing certain instructions to pro-gram this device. All the instructions related to jumping

or branching should be restricted such that the destination address falls within the physical

program memory space of the device, which is 2K for the AT89C2051. This should be the

Page 28: Embedded Robotics : Notes (2008)

28 ,I2IT Fundamentals of Embedded Robotics

responsibility of the software programmer. For example, LJMP 7E0H would be a valid

instruction for the AT89C2051 (with 2K of memory), whereas LJMP 900H would not.

Branching Instructions

LCALL, LJMP, ACALL, AJMP, SJMP, JMP @A+DPTR – These unconditional

branching instructions will execute correctly as long as the programmer keeps in mind that

the destination branching address must fall within the physical boundaries of the program

memory size (locations 00H to 7FFH for the 89C2051). Violating the physical space limits

may cause unknown program behavior. CJNE [...], DJNZ [...], JB, JNB, JC, JNC, JBC, JZ,

JNZ – With these conditional branching instructions the same rule above applies. Again,

violating the memory boundaries may cause erratic execution. For applications involving

interrupts the normal interrupt service routine address locations of the 80C51 family

architecture have been preserved.

MOVX-related Instructions, Data Memory

The AT89C2051 contains 128 bytes of internal data memory. Thus, in the AT89C2051

the stack depth is limited to 128 bytes, the amount of available RAM. External DATA

memory access is not supported in this device, nor is external PROGRAM memory

execution. Therefore, no MOVX [...] instructions should be included in the program. A

typical 80C51 assembler will still assemble instructions, even if they are written in

violation of the restrictions mentioned above. It is the responsibility of the controller user

to know the physical features and limitations of the device being used and adjust the

instructions used correspondingly.

Idle Mode

In idle mode, the CPU puts itself to sleep while all the on-chip peripherals remain active.

The mode is invoked by software. The content of the on-chip RAM and all the special

Page 29: Embedded Robotics : Notes (2008)

29 ,I2IT Fundamentals of Embedded Robotics

functions registers remain unchanged during this mode. The idle mode can be terminated

by any enabled interrupt or by a hardware reset. The P1.0 and P1.1 should be set to “0” if

no external pull-ups are used, or set to “1” if external pull-ups are used. It should be noted

that when idle is terminated by a hardware reset, the device normally resumes program

execution, from where it left off, up to two machine cycles before the internal reset

algorithm takes control. On-chip hardware inhibits access to internal RAM in this event,

but access to the port pins is not inhibited. To eliminate the possibility of an unexpected

write to a port pin when Idle is terminated by reset, the instruction following the one that

invokes Idle should not be one that writes to a port pin or to external memory.

Power-down Mode

In the power-down mode the oscillator is stopped, and the instruction that invokes

power-down is the last instruction executed. The on-chip RAM and Special Function

Registers retain their values until the power-down mode is terminated. The only exit from

power-down is a hardware reset. Reset redefines the SFRs but does not change the on-chip

RAM. The reset should not be activated before VCC is restored to its normal operating

level and must be held active long enough to allow the oscillator to restart and stabilize.

The P1.0 and P1.1 should be set to “0” if no external pull-ups are used, or set to “1” if

external pull-ups are used.

Programming the Flash

The AT89C2051 is shipped with the 2K bytes of on-chip PEROM code memory array in

the erased state (i.e., contents = FFH) and ready to be programmed. The code memory

array is programmed one byte at a time. Once the array is programmed, to re-program any

non-blank byte, the entire memory array needs to be erased electrically. Internal Address

Counter: The AT89C2051 contains an internal PEROM address counter which is always

reset to 000H on the rising edge of RST and is advanced by applying a positive going pulse

to pin XTAL1.

Page 30: Embedded Robotics : Notes (2008)

30 ,I2IT Fundamentals of Embedded Robotics

Programming Algorithm

To program the AT89C2051, the following sequence is recommended.

1. Power-up sequence: Apply power between VCC and GND pins Set RST and XTAL1 to

GND

2. Set pin RST to “H” Set pin P3.2 to “H”

3. Apply the appropriate combination of “H” or “L” logic levels to pins P3.3, P3.4, P3.5,

and P3.7 to select one of the programming operations shown in the PEROM

To Program and Verify the Array:

4. Apply data for Code byte at location 000H to P1.0 to P1.7.

5. Raise RST to 12V to enable programming.

6. Pulse P3.2 once to program a byte in the PEROM array or the lock bits. The byte-write

cycle is self-timed and typically takes 1.2 ms.

7. To verify the programmed data, lower RST from 12V to logic “H” level and set pins

P3.3 to P3.7 to the appropriate levels. Output data can be read at the port P1 pins.

8. To program a byte at the next address location, pulse XTAL1 pin once to advance the

internal address counter. Apply new data to the port P1 pins.

9. Repeat steps 6 through 8, changing data and advancing the address counter for the entire

2K bytes array or until the end of the object file is reached.

10. Power-off sequence: set XTAL1 to “L” set RST to “L” Turn VCC power off.

Data Polling

The AT89C2051 features Data Polling to indicate the end of a write cycle. During a write

cycle, an attempted read of the last byte written will result in the complement of the writ-

ten data on P1.7. Once the write cycle has been completed, true data is valid on all outputs,

and the next cycle may begin. Data Polling may begin any time after a write cycle has been

initiated.

Page 31: Embedded Robotics : Notes (2008)

31 ,I2IT Fundamentals of Embedded Robotics

Ready/Busy

The Progress of byte programming can also be monitored by the RDY/BSY output

signal. Pin P3.1 is pulled low after P3.2 goes high during programming to indicate BUSY.

P3.1 is pulled High again when programming is done to indicate READY.

Program Verify

If lock bits LB1 and LB2 have not been programmed code data can be read back via the

data lines for verification:

1. Reset the internal address counter to 000H by bringing RST from “L” to “H”.

2. Apply the appropriate control signals for Read Code data and read the output data at the

port P1 pins.

3. Pulse pin XTAL1 once to advance the internal address counter.

4. Read the next code data byte at the port P1 pins.

5. Repeat steps 3 and 4 until the entire array is read. The lock bits cannot be verified

directly. Verification of the lock bits is achieved by observing that their features are

enabled.

Chip Erase

The entire PEROM array (2K bytes) and the two Lock Bits are erased electrically by

using the proper combination of control signals and by holding P3.2 low for 10 ms. The

code array is written with all “1”s in the Chip Erase operation and must be executed before

any non-blank memory byte can be re-programmed.

Reading the Signature Bytes

Page 32: Embedded Robotics : Notes (2008)

32 ,I2IT Fundamentals of Embedded Robotics

The signature bytes are read by the same procedure as a nor-mal verification of locations

000H, 001H, and 002H, except that P3.5 and P3.7 must be pulled to a logic low. The

values returned are as follows.

(000H) = 1EH indicates manufactured by Atmel

(001H) = 21H indicates 89C20519

Programming Interface

Every code byte in the Flash array can be written and the entire array can be erased by

using the appropriate combination of control signals. The write operation cycle is self-

timed and once initiated, will automatically time itself to completion. Most major

worldwide programming vendors offer support for the Atmel AT89 microcontroller series.

Please contact your local programming vendor for the appropriate software revision.

Chapter 5: MICROCONTROLLER PROGRAMMING Microcontrollers are programmed in the assembly language. Assembly language makes

it easy to understand the basic working of the microcontroller as it is developed

specifically for the purpose. Here we will discuss about the assembly programming and

the instructions used commonly for writing simple programs.

The microcontroller contains on chip memory and all the programs are stored in

that same memory. Since 8051 is an 8-bit microcontroller, therefore all the memory is

aligned in the form of 8-bit Registers. The most commonly used registers in 8051 are-: A

(accumulator), B, R0-R7, DPTR (Data pointer), and PC (Program counter), out of which

the last two are 16-bit registers given to address the external memory. Here in our case at

the beginning level we will concentrate only on the registers A, B, and Rn (R0-R7). The

frequently used instructions used to program 8051 are given below.

Assembly language

In assembly language the format of the instruction consists of four fields:

[label:] mnemonic [operand] [;comments]

label is the name given to any part of the program like a sub-routine

Page 33: Embedded Robotics : Notes (2008)

33 ,I2IT Fundamentals of Embedded Robotics

mnemonics are the instructions to be performed

operands are the values on which the instructions are carried out.

Comments are also an important part of the program and should be used wherever

required because they help in knowing what function is performed by which part of the

program.

The fields in the bracket are optional and may not be present in every line.

Most frequently used instructions in 8051 Assembly language program

ACALL

It stands for ‘Absolute call’, and calls the subroutine with the address within 2k

bytes from the current Program Counter (PC). There is a limit of 2k bytes, because the

internal memory of 8051 is of 2k bytes only. It is a 2 byte instruction where one byte is

for opcode and one byte for the address. The syntax of this instruction is as follows:

ACALL 8-bit target address

ADD

This instruction performs the addition of source byte value to the accumulator, and then

stores the result in accumulator. The syntax is as follows:

ADD A, source byte

CJNE

This stands for Compare and Jump if Not Equal. The values of source and

destination bytes are compared and if they are not equal then the PC jumps to the

specified target address. The syntax for this instruction is as follows:

CJNE destination byte, source byte, target

CLR

This stands for Clear, and it clears either register A or a single bit. The syntax for

this instruction is as follows:

CLR <register or bit>

Examples for this are -:

CLR A ; sets all the bits of register A to Zero.

CLR C ; clears the carry flag (CY)

Page 34: Embedded Robotics : Notes (2008)

34 ,I2IT Fundamentals of Embedded Robotics

CLR P1.5 ; clears the port bit P1.5

CLR ACC.5 ; clears bit 7 of accumulator

CPL

This instruction stands for Compliment, and it complements the contents of

register A. The result is 1’s compliment i.e. all 1’s become 0’s and all 0’s become 1’s. the

syntax is as follows:

CPL A

DJNZ

It stands for Decrement and Jump if Not Zero. This instruction decrements a byte

by one and if the result is not equal to zero then it jumps to the target address. Syntax for

this instruction is as follows:

DJNZ byte, target

INC

This instruction increments the value of register or memory location specified by

one. Its syntax is as follows:

INC byte

JB

Jump if Bit instruction is used to check the value of a bit and jump to a target

address if a given bit is high. The syntax for this instruction is as follows:

JB bit, target

JNB

Jump if Not Bit instruction is used to check the value of a bit and jump to a target

address if a given bit is low. The syntax for this instruction is as follows:

JNB bit, target

JBC

Page 35: Embedded Robotics : Notes (2008)

35 ,I2IT Fundamentals of Embedded Robotics

Jump if Bit is set and Clear bit, is used to check if the bit specified is set then

jump to the target address and then clear the bit. The syntax for this instruction is as

follows:

JBC bit, target

JC

Jump if Carry, is used to check the status of carry flag and if the carry bit is set to

one then jump to the given target address. The syntax for this instruction is as follows:

JC target

JNC

Jump if Not Carry, is used to check the status of carry flag and if the carry bit is

set to zero then jump to the given target address. The syntax for this instruction is as

follows:

JNC target

JNZ

Jump if Not Zero, is used to check the status of bit and if the bit is not set to zero

then jump to the given target address. The syntax for this instruction is as follows:

JNZ bit, target

JZ

Jump if zero, is used to check the status of bit and if the bit is set to zero then

jump to the given target address. The syntax for this instruction is as follows:

JZ bit, target

LCALL

It stands for ‘Long call’, and calls the subroutine with the address in 64k bytes of

maximum ROM space of 8051. It is a 3-bytes instruction in which one byte is opcode and

two bytes are 16-bit address. The syntax of this instruction is as follows:

LCALL 16-bit target address

Page 36: Embedded Robotics : Notes (2008)

36 ,I2IT Fundamentals of Embedded Robotics

LJMP

It stands for ‘Long Jump’, and is used to jump to any address location within 64k

bytes of memory of 8051. It is a 3-bytes instruction where one byte is the opcode and two

bytes are the 16-bit target address. The Syntax of this instruction is as follows:

LJMP 16-bit target address

MOV

The MOV instruction copies the data from one location in memory to the other.

The basic syntax of MOV is as follows:

MOV destination, source ; copy source to destination.

There are 15 possible combinations of this instruction out of which few

commonly used are listed below

MOV A,#data ;loads the data into accumulator A.

MOV A,Rn ;loads the value in register Rn into A.

MOV A,direct ;loads the data stored at memory location direct into A.

MOV Rn,A ;loads the value in A into the register Rn.

MOV direct,A ;loads the value in A to the memory location direct.

This instruction can also be used to copy a single bit to or from a register, as

shown in the example below.

MOV P1.3,C ;copies the carry bit to port pin P1.3.

MOV C,P3.1 ;copies the bit at port pin P3.1 to carry bit.

RET

Return from subroutine, is used to return from a subroutine previously entered by

instructions LCALL or ACALL. The syntax for this instruction is as follows:

RET

SETB

Page 37: Embedded Robotics : Notes (2008)

37 ,I2IT Fundamentals of Embedded Robotics

This stands for SET Bit, and is used to set the indicated bit as high or 1. The bit

here can be carry or any directly addressable bit of a port, register or RAM location. The

syntax for this instruction is as follows:

SETB bit

SJMP

It stands for ‘Short Jump’, and is used to jump to any address location within 2k

bytes of memory of 8051. It is a 2-bytes instruction where one byte is the opcode and one

byte is the 8-bit target address. The Syntax of this instruction is as follows:

SJMP 8-bit target address

Page 38: Embedded Robotics : Notes (2008)

38 ,I2IT Fundamentals of Embedded Robotics

Chapter 6: INTRODUCTION TO ROBOTIC KIT This chapter briefly explains the electronic components and the tools required to make simple Robots. To build a Robot one has to make a mechanical chassis and electronic circuit to make it work. Electronic Components The most important components of any electronic circuit are Resistors, Capacitors, Diodes, Transistors, Potentiometers, Integrated Circuits, Connectors and Printed Circuit Boards. Resistors

The first and the foremost component is the resistor. The resistor’s function is to reduce the flow of electric current. The electronic symbol of the resistor is below.

Resistor Electronic Symbol There are two classes of resistors – Fixed resistors and the variable resistors.

Fixed Resistor Potentiometer (POT) There are 11 types of fixed resistor in the Robotic Kit. They are standard quarter watt (1/4 watts) resistor of 6 mm long and 2 mm thickness. Variable Resistors In variable resistors the resistor value can be changed. They are also called as Potentiometers or POT. There are 11 different values of fixed resistor in the Robotic Kit and 3 POTS of different values.

Page 39: Embedded Robotics : Notes (2008)

39 ,I2IT Fundamentals of Embedded Robotics

Resistor value calculation (Resistor Array) For fixed resistors we can calculate the value by using the color-codes as given in Table 6.2, we can Capacitors

Capacitors are the second most common passive component, and there are few circuits that do not use at least one capacitor. The capacitor's function is to store electricity, or electrical energy. The capacitor also functions as a filter, passing alternating current (AC), and blocking direct current (DC). This symbol is used to indicate a capacitor in a circuit diagram.

Electronic Symbol of Capacitor The kit has two types of Electrolytic capacitors and 5 types of ceramic capacitors.

Ceramic Capacitor Electrolytic Capacitor Reading the value of capacitor: • A three-digit code is used to indicate the value of a capacitor • 1st and 2nd digits from the left show the 1st figure and the 2nd figure • 3rd digit is a multiplier • The value thus obtained is in pF • Example: 103 indicates 10 x 103, or 10,000 pF = 10 nanofarad (nF) = 0.01 microfarad (μF) Diodes A diode is a semiconductor device, which allows current to flow through it in only one direction.

Page 40: Embedded Robotics : Notes (2008)

40 ,I2IT Fundamentals of Embedded Robotics

Electronic Symbol of diode

Diodes The stripe in the diode is cathode and the other end is anode. Transistors The transistor's primary function is to amplify an electric current. Many different kinds of transistors are used in analog circuits, for different reasons. However, the transistors are used in digital circuits primarily as a switch. Integrated Circuits An integrated circuit contains transistors, capacitors, resistors and other parts, all integrated with high density on one chip. They are similar to a circuit made out of these separate electronic components. ICs are available in various packages, some of them being SIP (Single Inline Package), DIP (Dual In-line Package), SOIC (Small-Outline Integrated Circuit), QFP (Quad Flat Package) etc. The SIP and the DIP are the through-hole packages for using them with Veroboards and Printed Circuit Boards (PCB).

Integrated Circuits

Page 41: Embedded Robotics : Notes (2008)

41 ,I2IT Fundamentals of Embedded Robotics

Integrated Circuit Bases (IC Bases): To place the IC ‘s on the PCBs or Veroboards bases are required so that we can reuse the same IC ‘s again in another circuit.

IC Bases

IC placed on the Veroboard Battery The kit has one 6-volt Lead acid battery. This battery provides the necessary DC voltage to work electronic

IC with base

Page 42: Embedded Robotics : Notes (2008)

42 ,I2IT Fundamentals of Embedded Robotics

Battery Connectors: Various types of connectors are required on a PCB or Veroboards for external interface. The kit contains 2 Burg Strips, which are easy to use as connectors.

Burg Strip

Connecting with Burg Strip Tools The kit has the following mechanical tools and electronic tools.

Page 43: Embedded Robotics : Notes (2008)

43 ,I2IT Fundamentals of Embedded Robotics

Mechanical Tools: Hacksaw: The small size hacksaw is provided to PCBs and Plastic Car.

Stripper and Pliers: The small blue pliers are used for holding wires and to work on the breadboard. The red color stripper is used to cut the wire .It is used to remove the plastic sleeves of the wire and leave the copper wire for further connection or for soldering.

Screw Driver Set: The screwdriver set consists of 16 different types of tips to tighten or loosen different types of screws.

Page 44: Embedded Robotics : Notes (2008)

44 ,I2IT Fundamentals of Embedded Robotics

Hand drill: The hand drill along with bits is used for making drill on the PCB and Toys for putting screw.

Tweezers; A tweezers are used to pick ICS and to place them on the PCBS and Breadboard. They are also used to insert the wires in the breadboard.

Screws and Sleeves: The screws and sleeves provided in the kit are for fixing the PCB on the mechanical Chassis made out of the toy.

Page 45: Embedded Robotics : Notes (2008)

45 ,I2IT Fundamentals of Embedded Robotics

Screws, Nuts and Sleeves Electronic tools. Digital Multimeter

Digital Multimeter A digital multimeter is used to test voltage and current levels along with the resistance of different parts of circuits. Breadboard

The breadboard is a reusable device used design prototype of electronic circuit without soldering them for testing purpose.

Page 46: Embedded Robotics : Notes (2008)

46 ,I2IT Fundamentals of Embedded Robotics

Breadboard Breadboard with Components Veroboard: The Veroboard is type of device used to design prototype of electronics circuit by soldering the electronic components. The kit contains one medium size Veroboard and 4 small size Veroboards for making simple circuits.

Veroboard Frontside Veroboard Backside

Page 47: Embedded Robotics : Notes (2008)

47 ,I2IT Fundamentals of Embedded Robotics

Veroboard with Electronic components Single Core Wire and Multicore Wire The Robotic Kit has 5 colors of single core wire and 1 10-core wire. The 5 different color wires are necessary for following the standard of making electronic circuit on breadboard or Veroboards.

Single core wires 10-core Wire Red Colour wire is always used to connect Vcc to components Black Color wire is used to connect the ground. White color for connecting signals

Page 48: Embedded Robotics : Notes (2008)

48 ,I2IT Fundamentals of Embedded Robotics

Yellow for The Single core wires are used while working with breadboards. The multicore wire is provided for using in the Veroboards to connect terminals. Printed Circuit Board (PCB): The PCB are used to mechanically support and connect electronic components on etched pathways called tracks.The completely designed Printed Circuit board is given in each kit for assembling the components at the end of the course.

Printed Circuit Board Soldering Iron and Stand: The Soldering Iron is device to apply heat to melt solder to attach electronic components to Veroboards and Printed Circuit Boards.

Soldering Iron Soldering Iron Stand:

Page 49: Embedded Robotics : Notes (2008)

49 ,I2IT Fundamentals of Embedded Robotics

The soldering Iron stand is provided in the kit to keep the hot Iron when soldering components for safety purpose

Soldering Iron Stand Solder: Solder is metal alloy, which melted by applying heat for attaching electronic components to Veroboards and Printed Circuit Boards. The kit contains lead free solder.

Solder Insulation Tape: The insulation tape is provided for insulation wires and boards to prevent shocks from open wires carrying current.

Page 50: Embedded Robotics : Notes (2008)

50 ,I2IT Fundamentals of Embedded Robotics

Insulation Tape

Page 51: Embedded Robotics : Notes (2008)

51 ,I2IT Fundamentals of Embedded Robotics

Chapter 7: DESIGN AND ASSEMBLY OF SIMPLE ROBOT A simple way to design and assemble the Robot using the Robotic Kit is explained in this chapter. Aim: To make simple obstacle detection Robot. The Obstacle detection Robot is simple Robot, which detects any obstacle on its way and stops. Once the obstacle is removed it starts moving. This Robot is built with the toy car given in the kit and using the 8051 microcontroller as the brain of the Robot which will be programmed to stop and move when an obstacle comes in its way. To detect obstacle the Robot will be using IR sensors. There is IR LED and Photodiode as explained in Chapter 2.L293d Motor driver as explained in Chapter 3 drives the motors. Building A Mechanical chassis for the Robot Step1: Take the tumbling toy car in the Kit and remove screws at the bottom.

Toy Car Removing Screws Step 2: Take the stripper and cut the wires. Leave two wires from the motor as shown in the figure.

Page 52: Embedded Robotics : Notes (2008)

52 ,I2IT Fundamentals of Embedded Robotics

Remove the top cover Cut the wires using stripper Step 3: The mechanical chassis with gear and motor is ready for use.

Remove the copper plates Robot Mechanical Chassis Step 4: The final chassis looks like the figure shown above. Building Electronic Circuit on Breadboard and Testing Before starting to make the electronic circuit using controller, sensor and actuator for the Robot. It is a must to test the circuits using breadboard before soldering them on Veroboard. Using a Breadboard: A breadboard is used to make up temporary circuits for testing. The breadboard has tiny holes or sockets 0.1” grid. The leads of most of the electronic components can be pushed into the holes. The connection has to be made with single core plastic wires of 0.9mm in diameter.

Page 53: Embedded Robotics : Notes (2008)

53 ,I2IT Fundamentals of Embedded Robotics

The breadboard has two rows of holes at the top and bottom, which are horizontally connected.

There is a separation in the center of the board .On both sides of the separation the holes are connected vertically in blocks of 5 with out any link through the center.

The Red Lines shows the horizontally short top rows for Vcc

The black Line shows the horizontally short bottom rows for ground

The red wire shows connection between two horizontal rows

The black wire shows connection between two horizontal rows

Page 54: Embedded Robotics : Notes (2008)

54 ,I2IT Fundamentals of Embedded Robotics

Placing Components: This shows the placement of IC in the middle, with pins on both sides so that all the pins can be connected without any shorting. The connection to be made to IC can be found in the Pin diagram of every IC.

The wires should always be connected along the surface of board and wires should not crossover the IC.

The green line shows the separation in the center

The yellow line shows the vertically connected columns in blocks of 5

Wire connected along the surfaces of the board

Page 55: Embedded Robotics : Notes (2008)

55 ,I2IT Fundamentals of Embedded Robotics

Step 1: First the ground is connected to the IC as shown below.

Step 2: Second the Vcc ground is connected to the IC as shown below.

Step 3: The other components are connected are per the circuit diagram as shown below.

Page 56: Embedded Robotics : Notes (2008)

56 ,I2IT Fundamentals of Embedded Robotics

Step 4: After completing the placement of components, first connect the ground of the board to the negative of the battery and Vcc of the board positive terminal of the battery. Step 5.Use the multimeter to check the connectivity of the circuit. Step 6: If the circuit is not working then do the following 1.Check voltage across the terminals using the multimeter. 2.Check whether all the wires are connected properly. 3.Check whether the component terminals are pushed into the holes properly Building Sensor, Controller and Actuator for the Robot: The obstacle detection Robot has two sensors one in the front and one at the back of the car. The controller and driver circuit for the motor is placed on the top of the vehicle. Block Diagram of the Robot The block diagram shows the components of the Robot.

Sensors

Controller Unit (8051) Actuator

ROBOT

LED

Light

Rear Sensor

Front Sensor

Page 57: Embedded Robotics : Notes (2008)

57 ,I2IT Fundamentals of Embedded Robotics

Placement of Sensor This diagram shows the placement of sensors. Working of the Robot: The working of the Robot is explained in the following flow chart.

Photodiode

SENSORS

CONTROL UNIT (µC)

ACTUATORS (DC MOTOR)

FORWARD

REVERSE

STOP

IF SFRONT =1

IF SREAR =1

IF SFRONT =1

IF SREAR =1

REVERSE

REVERSE FORWARD

FORWARD

STOP

NO

YES

NO NO

NO

YES YES

YES

Page 58: Embedded Robotics : Notes (2008)

58 ,I2IT Fundamentals of Embedded Robotics

As per the flow diagram, the microcontroller receives signals from the sensors placed in

front (SFront) and at the rear end (SRear) of the vehicle. Based on the signals the vehicle is

moved forward and backward. If the signal from SFront is high (i.e. this sensor detects the

object) then the microcontroller turns the direction of the motor to make the vehicle move

in reverse direction, else the vehicle will continue moving in the forward direction.

When signal from SFront is high and the vehicle starts moving back then, the signal from

SRear is checked by the microcontroller. Now if SRear is high then the vehicle stops,

otherwise the vehicle continues moving in reverse direction. This process takes place when

initially the vehicle was moving in the forward direction. If initially the vehicle was

moving in reverse direction then SRear is checked first and then SFront is analyzed for similar

conditions as explained above.

Sensor Circuit: The sensor used in the Obstacle detection Robot is IR LED and Photodiode Pair. The

sensor is used to detect obstacles when the Robot moves.

Principle of Sensor

The IR LED (Transmitter) emits light and the Photodiode (receiver) receives light. The

LED and Photodiode are to be placed as shown below. When Robot moves if there is no

obstacle on its way then the Photodiode will not receive any light. But when there is a

obstacle, the light emitted by the LED falls on the obstacle and gets reflected which is

received by the Photodiode. This indicates to the Robot that

ROBOT

LED

No Obstacle

Light

Page 59: Embedded Robotics : Notes (2008)

59 ,I2IT Fundamentals of Embedded Robotics

there is obstacle on its way. The Robot stops there till obstacle moves away and the Photodiode starts getting light .The presence and absence of obstacle is indicated by the output connected at Pin number 1 of LM324 IC as shown as shown in the circuit diagram below.

Sensor Circuit Diagram Breadboard Testing The Robotic Kit has one LM324 IC. It is a Quad Opamp Comparator Circuit, which contains Opamp. It is used as a comparator. It is 14 Pin IC. The Pin number and details for LM324 IC are shown below.

Photodiode

Light

Photodiode

LED

ROBOT Obstacle

Page 60: Embedded Robotics : Notes (2008)

60 ,I2IT Fundamentals of Embedded Robotics

PIN Details for LM324: Step1: Take the breadboard given in the Kit. Step 2: Connect all the components as shown in the circuit diagram. Step 3: Connect the battery to the Breadboard circuit to give supply Step 4: Take any card or paper and place it as obstacle near the LED and Photodiode Step 5: If the LED at the output of the circuit glows then the circuit is working properly Step 6: If the LED is not glowing trouble shoot the circuit. Step 7: Use the multimeter to check the potentials. Step 8: Vary the POT value to check whether the LED glows. Step 9: check the Vcc and Ground connections properly Step 10: If nothing happens redo the connections properly Actuator and Motor Driver Circuit In the obstacle detection Robot, the DC motor in the toy car is used as the actuator. A motor driver circuit has to be designed using L293d IC given in the Robotic kit to control the motor.

Page 61: Embedded Robotics : Notes (2008)

61 ,I2IT Fundamentals of Embedded Robotics

DC Motor Motor Driver Circuit: The L293D is the commonly used motor driver IC .It is 16 PIN IC .It has two H-Bridge inside which allows the motor to be run in both clockwise and anti-clockwise by changing the polarity. This motor is responsible for the movement of the vehicle.

Circuit Diagram for L293D Motor Driver Breadboard Testing: Step 1:Take the Breadboard in the Robotic Kit

Page 62: Embedded Robotics : Notes (2008)

62 ,I2IT Fundamentals of Embedded Robotics

Step2; Connect all the components as shown in the circuit diagram in the exact pins of the ICS Step3: Give power supply to the circuit using the battery Step 4: Check whether the motor is running Step 5: If the motor is not running trouble shoot the circuit Microcontroller Circuit The control unit consists of a microcontroller, which receives signals from sensors, and decides what operation to be performed by the system. The microcontroller used here is 8051 core. The microcontroller here is interfaced with a DC motor whose motion is controlled on the basis of the signals received from the sensors at the front and rear of the vehicle. The circuit diagram of the of controller is given below.

Complete ciruit diagram: The following circuit diagram shows the connection of the Sensors,controllers and the motor driver .

Page 63: Embedded Robotics : Notes (2008)

63 ,I2IT Fundamentals of Embedded Robotics

Complete Robot Circuit Diagram Assembling the Robot using Designed PCB: Step1 : Take the designed PCB in the Robotic Kit

Page 64: Embedded Robotics : Notes (2008)

64 ,I2IT Fundamentals of Embedded Robotics

Step 2: Select components as given in the reference sheet Step 3: Connect the soldering to the Power Supply Step4: Solder the Components as shown in the figure below.

Step5 : Please follow the Reference sheet and place and solder all the components. The final PCB will look like this .

Page 65: Embedded Robotics : Notes (2008)

65 ,I2IT Fundamentals of Embedded Robotics

Step 6: The Programmed controller is given in the Kit. Just place the controller in the controller IC base. Step 7:Take the PCB with components and mount it on the chassis using the screws and sleeves in the Robotic Kit.

L293d

AT89C2051 LM324

Reset Circuit

Indication LED’s

Page 66: Embedded Robotics : Notes (2008)

66 ,I2IT Fundamentals of Embedded Robotics

The final Robot Looks like this !!!