Top Banner
PROJECT REPORT ‘ADVANCED EMBEDDED SYSTEMS’ SUMMER TRAINING 2014 Submitted By:
91

Project Report on Embedded Systems

Feb 19, 2017

Download

Engineering

Suhani Singh
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Project Report on Embedded Systems

PROJECT REPORT

‘ADVANCED EMBEDDED SYSTEMS’ SUMMER TRAINING 2014

Submitted By:SUHANI SINGHECE – III Yr.

Page 2: Project Report on Embedded Systems

ACKNOWLEDEMENTSI owe a debt of gratitude to Mr. Guru Prabhat, H.O.D of our department, for providing us an opportunity to pursue this training and inspiring us to conceive the same.

It is also my duty to record my thankfulness to Mr. Pankaj Singh, our trainer for the course, who continually and convincingly conveyed excitement in regard to teaching. Without his guidance and persistent help, this successful learning process would not have been possible.I would also thank my colleagues for their help, whenever I needed it.

SUHANI SINGH

Page 3: Project Report on Embedded Systems

Student, ECE Department

ABSTRACT

This report contains the details of the content that was taught during the summer training. It includes the description of the theoretical as well as the practical content that we learnt during the training.

It also includes all the hardware and software details of the projects undertaken during the course.

Page 4: Project Report on Embedded Systems

CONTENTS1. Introduction2. Embedded Systems3. Examples of Embedded Systems4. Common features of an Embedded System5. Microprocessors6. Microcontrollers7. Comparison between Microprocessor and Microcontroller 8. The 8051 Architecture9. Atmel AVR10. Interfacing

Page 5: Project Report on Embedded Systems

1. Introduction

Microcontroller are widely used in Embedded System products. An Embedded product uses the microprocessor(or microcontroller) to do one task & one task only. A printer is an example of Embedded system since the processor inside it perform one task only namely getting the data and printing it. Although microcontroller are preferred choice for many Embedded systems, There are times that a microcontroller is inadequate for the task. For this reason in recent years many manufactures of general purpose microprocessors such as INTEL, Motorolla, AMD & Cyrix have targeted their microprocessors for the high end of Embedded

Page 6: Project Report on Embedded Systems

market.One of the most critical needs of the embedded system is to decrease power consumptions and space. This can be achieved by integrating more functions into the CPU chips. All the embedded processors have low power consumptions in additions to some forms of I/O,ROM all on a single chip. In higher performance Embedded system the trend is to integrate more & more function on the CPU chip & let the designer decide which feature he/she wants to use.

2. Embedded Systems

Page 7: Project Report on Embedded Systems

An Embedded system is a computer that has been built to solve only a few very specific problems and is not easily changed. An embedded system usually does not look like a computer, often there is no keyboard or monitor or mouse. But like any computer it has a processor and software, input and output. The word embedded means it is built into the system. It is a permanent part in a bigger system. For example, a controller is embedded in an elevator and tells the motor to move the elevator to different floors based on buttons that are pushed. A decoder is embedded in a satellite television set-top box to read a signal from the dish and send something that a TV understands. Often this type of system must do its work in a specific amount of time. This is called real-time computing. If a set-top box got

Page 8: Project Report on Embedded Systems

interrupted to do another task, you would see a bad picture on the TV, for example.

Because many embedded systems are built to only perform a few very specific tasks they often do not need a full operating system. Some embedded systems use specially-built small and simple operating systems that start very quickly, others do not need one at all. Embedded systems are not adapted as easily, but they are built to perform their tasks much more reliably. Because the hardware is simpler, it is also often cheaper to build and runs faster.

Page 9: Project Report on Embedded Systems

3. Examples of Embedded SystemsEmbedded systems are used everywhere in modern life and there are many examples of their use, including:

Page 10: Project Report on Embedded Systems

A telecommunication system uses them for telephones, cell phone network, and wifi routers.

Consumer electronics include clock radios, MP3 players, mobile phones, video game consoles, digital cameras, DVD players, GPS receivers, home security systems, and printers.

Household appliances, like microwave ovens, washing machines and dishwashers have embedded systems.

Transportation uses embedded systems for everything from locomotives for trains, airplanes and automobiles.

Industry uses electric motors with electronic motor controllers, card readers and CNC machines which automatically make metal parts.

Medical devices like defibrillators, automated blood pressure readers, and automated insulin pumps.

Military devices, like walkie-talkies, satellites and the guiding systems for missiles.

Page 11: Project Report on Embedded Systems

4. Common Features of an Embedded System

Embedded systems are designed to do a specific task, unlike general purpose computers.

It does not look like a computer - there may not be a full monitor or a keyboard.

Many embedded systems must be able to do things in real-time - in a short amount of time (almost instantly from a human view).

Many embedded systems must be very safe and reliable, especially for medical devices or avionics controlling airplanes.

Starts very quickly. People don't want to wait a minute or two for their car to start or emergency equipment to start.

Page 12: Project Report on Embedded Systems

It uses a special operating system (or sometimes a very small home-made OS) that helps meet these requirements called a real-time operating system, or RTOS.

The program instructions written for embedded systems are referred to as firmware, and are stored in read-only memory or flash memory chips. They run with limited computer hardware resources: little memory, small or non-existent keyboard and/or screen.

Embedded systems are not always standalone devices. Sometimes they are built as a set, like the various parts of a car - the radio, the throttle control, the pollution control, etc. Sometimes they can communicate to the internet or a cell-phone network and they may have a USB reader or other connections.

5. Microprocessors

Page 13: Project Report on Embedded Systems

A microprocessor incorporates the functions of a computer's central processing unit (CPU) on a single integrated circuit (IC), or at most a few integrated circuits. All modern CPUs are microprocessors making the micro- prefix redundant. The microprocessor is a multipurpose, programmable device that accepts digital data as input, processes it according to instructions stored in its memory, and provides results as output. It is an example of sequential digital logic, as it has internal memory. Microprocessors operate on numbers and symbols represented in the binary numeral system.

The integration of a whole CPU onto a single chip or on a few chips greatly reduced the cost of processing power. The integrated circuit processor was produced in large numbers by highly automated processes, so unit cost was low. Single-chip processors increase reliability as there are many fewer electrical connections to fail. As

Page 14: Project Report on Embedded Systems

microprocessor designs get faster, the cost of manufacturing a chip (with smaller components built on a semiconductor chip the same size) generally stays the same.

Intel 4004 is generally regarded as the first commercially available microprocessor, and cost $60. The first known advertisement for the 4004 is dated November 15, 1971 and appeared in Electronic News. The project that produced the 4004 originated in 1969, when Busicom, a Japanese calculator manufacturer, asked Intel to build a chipset for high-performance desktop calculators. Busicom's original design called for a programmable chip set consisting of seven different chips.

Page 15: Project Report on Embedded Systems

6. 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.

Page 16: Project Report on Embedded Systems

Microcontrollers are used in automatically controlled products and devices, such as automobile engine control systems, implantable medical devices, remote controls, office machines, appliances 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

Page 17: Project Report on Embedded Systems

digitally control even more devices and processes.

Figure shows the block diagram of a typical microcontroller. The design incorporates all of the features found in micro-processor CPU: ALU, PC, SP, and registers. It also added the other features needed to make a complete computer: ROM, RAM, parallel I/O, serial I/O, counters, and clock circuit.

Page 18: Project Report on Embedded Systems

7. Comparison between Microprocessor and Microcontroller The microprocessor must have many additional parts to be operational as a computer whereas microcontroller requires no additional external digital parts.

1. The prime use of microprocessor is to read data, perform extensive calculations on that data and store them in the mass storage device or display it.

Page 19: Project Report on Embedded Systems

The prime functions of microcontroller is to read data, perform limited calculations on it, control its environment based on these data. Thus the microprocessor is said to be general-purpose digital computers whereas the microcontroller are intend to be special purpose digital controller.

2. Microprocessor need many opcodes for moving data from the external memory to the CPU, microcontroller may require just one or two, also microprocessor may have one or two types of bit handling instructions whereas microcontrollers have many.

3. Thus microprocessor is concerned with the rapid movement of the code and data from the external addresses to the chip, microcontroller is concerned with the rapid movement of the bits within the chip.

4. Lastly, the microprocessor design accomplishes the goal of flexibility in the hardware configuration by enabling large amounts of memory and I/O that

Page 20: Project Report on Embedded Systems

could be connected to the address and data pins on the IC package. The microcontroller design uses much more limited.

8. The 8051 Architecture

The Intel 8051 is an 8-bit microcontroller which means that most available operations are limited to 8 bits. There are 3 basic "sizes" of the 8051: Short, Standard, and Extended. The Short and Standard chips are often available in DIP (dual in-line package) form, but the Extended 8051 models often have a different form factor, and are not "drop-in compatible".

Page 21: Project Report on Embedded Systems

BLOCK DIAGRAM

Some of the features that have made the 8051 popular are:

4 KB on chip program memory. 128 bytes on chip data memory (RAM). 4 register banks. 8-bit data bus 16-bit address bus

32 general purpose registers each of 8 bits

Page 22: Project Report on Embedded Systems

16 bit timers (usually 2, but may have more, or less).

3 internal and 2 external interrupts. Bit as well as byte addressable RAM area of 16

bytes. Four 8-bit ports, (short models have two 8-bit

ports). 16-bit program counter and data pointer. 1 Microsecond instruction cycle with 12 MHz

Crystal. 8051 models may also have a number of special,

model-specific features, such as UARTs, ADC, Op-Amps, etc...

PINOUT DESCRIPTION

Page 23: Project Report on Embedded Systems

4 Ports: Pins 1-8 for PORT 1

Pins 10-17 for PORT 3

Pins 21-28 for PORT 2

Pins 32-39 for PORT 0

RST (PIN 9): It is the resetting pin for the device

(8051).

Page 24: Project Report on Embedded Systems

XTAL (PIN 18): It is the output of inverting amplifier

which is a part of the on-chip oscillator. When

external clock is used, it is left unconnected.

XTAL (PIN 19): It is the input to the inverting

amplifier which is a part of the on-chip oscillator

circuit. When external clock is used, it is connected

to the external oscillator.

VSS (PIN 20): It is the circuit ground. All the voltage

are specified with respect to it.

VCC (PIN40): It is for the power supply, +5V.

PSEN (PIN 29): It is program store enable. It is

output control signal. It is a read strobe to external

program memory.

ALE (PIN 30): It is the Address Latch Enable signal.

Page 25: Project Report on Embedded Systems

RAM MEMORY SPACE ALLOCATION

There are 128 bytes of RAM in 8051 where the

addresses are assigned from 00H to 7FH.

The 128 bytes are divided into different segments as:

1) 32 bytes from location 00 to 1FH are

assigned for Register banks and Stack

2) 16 bytes from location 20H to 2FH for R/W

Memory

3) 80 bytes from locations 30H to 7FH are for

Scratch pad for read/write Storage.

Page 26: Project Report on Embedded Systems

TYPICAL APPLICATIONS OF 8051

MICROCONTROLLER

8051 chips are used in a wide variety of control systems, telecom applications, and robotics as well as in the automotive industry. By some estimation, 8051 family chips make up over 50% of the embedded chip market. The 8051 has been in use in a wide number of devices, mainly because it is easy to integrate into a project or build a device around. The following are the main areas of focus: 1. Energy Management: Efficient metering systems help in controlling energy usage in

Page 27: Project Report on Embedded Systems

homes and industrial applications. These metering systems are made capable by incorporating microcontrollers.2. Touch screens: A high number of microcontroller providers incorporate touch-sensing capabilities in their designs. Portable electronics such as cell phones, media players and gaming devices are examples of microcontroller-based touch screens.3. Automobiles: The 8051 finds wide acceptance in providing automobile solutions. They are widely used in hybrid vehicles to manage engine variants. Additionally, functions such as cruise control and anti-brake system have been made more efficient with the use of microcontrollers. So the microcontroller 8051 has great advantage in the field of the automobiles. 4. Medical Devices: Portable medical devices such as blood pressure and glucose monitors

Page 28: Project Report on Embedded Systems

5. Microcontrollers are used to display data, thus providing higher reliability in providing medical results.

8051 DEVELOPMENT BOARD

Page 29: Project Report on Embedded Systems

9. ATMEL AVRAVR stands for Advanced Virtual RISC or Automatic Voltage Regulator.

The AVR is a modified Harvard architecture 8-bit RISC single chip microcontroller which was developed by Atmel in 1996. The AVR was one of the first microcontroller families to use on-chip flash memory for storage

ATmega16 ATmega16 is an 8-bit high performance

microcontroller of Atmel’s Mega AVR family with

low power consumption.

Atmega16 is based on enhanced RISC (Reduced

Instruction Set Computing).

It contains 131 powerful instructions.

Page 30: Project Report on Embedded Systems

ATmega16 has 16 KB programmable flash

memory, static RAM of 1 KB and EEPROM of 512

Bytes.

ATmega16 is a 40 pin microcontroller.

PIN DIAGRAM The figure below shows the pin diagram of

Atmega16.

Page 31: Project Report on Embedded Systems

Atmega16 contains a total of 40 Pins.

o 4 Ports -> PORT A (8 Pins)

-> PORT B (8 Pins)

-> PORTC (8 Pins)

-> PORTD (8 Pins)

o 2 Power Pins for- AC supply and DC supply

AC Power supply pin: AVCC (PIN 30)

Page 32: Project Report on Embedded Systems

DC Power supply pin: VCC (PIN 10)

o 2 Pins to connect crystal oscillator

o 2 Ground Pins (GND)

o 1 Reference Pin (AREF)

o 1 Reset Key (RESET)

All the ports, Port A, B, C and D have their own

functions as described in the figure. The LEDs,

Motors or any output determining devices can be

connected on any of the 4 Ports. But as we take a

careful look at the Microcontroller board, we see

that, the port for the “Sensors” if fixed i.e.

PORTB.

Page 33: Project Report on Embedded Systems

Picture above shows the ATmega16 development board provided by Revert Technologies during the training.

The softwares used for interfacing with ATmega16 are:

WINAVR Atmel Studio 6

Page 34: Project Report on Embedded Systems

SinaProg

10. Interfacing1. LED INTERFACING

Overview

Like a normal diode, an LED consists of a chip of semiconducting material impregnated, or doped, with impurities to create a p-n junction. As in other diodes, current flows easily from the p-side, or anode, to the n-side, or cathode, but not in the reverse direction. Charge-carriers—electrons and holes—flow into the junction from electrodes with different voltages.

The materials used for an LED have a direct band gap with energies corresponding to near-infrared, visible or near-ultraviolet light. LED development began with infrared and red devices made with gallium arsenide. Advances in materials science have made possible the production of devices with ever-shorter wavelengths, producing light in a

Page 35: Project Report on Embedded Systems

variety of colors. Conventional LEDs are made from a variety of inorganic semiconductor materials, producing the following colors:

Aluminum gallium arsenide (AlGaAs) — Red and Infrared

Aluminum gallium phosphide (AlGaP) — Green

Aluminum gallium indium phosphide (AlGaInP) — High-brightness

Orange-red, Orange, Yellow, and Green

Gallium arsenide phosphide (GaAsP) — Red, Orange-Red, Orange, and Yellow

Gallium phosphide (GaP) — Red, Yellow and Green

Gallium nitride (GaN) — Green, Pure Green (or Emerald green), and Blue

// Program to blink all the 8 LED’s on the board.

#include<avr/io.h>

#include<util/delay.h>

Page 36: Project Report on Embedded Systems

int main(void)

{

DDRB=0xFF; //Initialize all the pins of PORTB high

while(1)

{

PORTB=0xFF; //LED’s on PORTB ‘ON’

_delay_ms(150);

PORTB=0x00; //LED’s on PORTB ‘OFF’

_delay_ms(150);

}

return ;

Page 37: Project Report on Embedded Systems

}

*The above program, when burned on the development board, makes all the LED’s blink together and then turn them all OFF together.

LED BLINKING

// Program for alternate blinking of LED’s.

#include<avr\io.h>

#include<util\delay.h>

Page 38: Project Report on Embedded Systems

int main(void)

{

DDRB=0xFF; //All pins of PORTB set high

while(1)

{

for(int i=2; i<257; i=i*4)

{

PORTB=i;

_delay_ms(1500);

}

for(int j=1; j<129; j=j*4)

Page 39: Project Report on Embedded Systems

{

PORTB=j;

_delay_ms(1500);

}

}

return;

}

Note: The sequence of blinking the LEDs has to be

controlled by the user by giving the appropriate commands

in the program. In the above program, the sequence of

blinking of the LED’s is 2-4-6-8-1-3-5-7.

2. SEVEN SEGMENT DISPLAY INTERFACING

OVERVIEW

Page 40: Project Report on Embedded Systems

What is seven segment display?

A seven segment display is an electronic device used to display numeric digits from 0 to 9 and some hexadecimal numbers from A to F. A seven segment display is a combination of LED’s in such a manner that one can display numbers and some alphabets on it by controlling its LED’s. The LED’s are connected in such a manner that is appears as digit 8.

Seven segment displays are used in digital clocks, digital electronic meters and many other electronic devices for displaying numeric values. These are used as counters to display counting from 0-99. They are also used in CD and DVD players.

TYPES OF SEVEN SEGMENT DISPLAYS There are two types of seven segment displays:

Page 41: Project Report on Embedded Systems

1. Common Cathode – All the LED’s are connected in common and are directed to ground. The signal is given to all the eight anode pins in order to get the desired pattern. The h pin is used for decimal point. 2. Common Anode - The anode of all LED’s are connected in common and directed to a +5V supply. Then by applying ground or logic zero to a particular segment connection, the appropriate segment will light up. An additional resistor must be added to the circuit to limit the amount of current flowing through each LED Segment.

Page 42: Project Report on Embedded Systems

CONNECTION OF SEVEN SEGMENT DISPLAY USING ATmega16

The image below shows seven segment display (common cathode) connected to atmega16 development board.

// Program to display numeric values from 0-9 on a seven segment display#include<avr/io.h>

Page 43: Project Report on Embedded Systems

#include<util/delay.h>

int main(void){ DDRB = 0b11111111; // PORTB defined as output port while(1) { PORTB = 0b00111111; //for displaying 0 _delay_ms(1000); PORTB = 0b00000110; //for displaying 1 _delay_ms(1000); PORTB = 0b01011011; //for displaying 2 _delay_ms(1000); PORTB = 0b01001111; //for displaying 3 _delay_ms(1000); PORTB = 0b01100110; //for displaying 4 _delay_ms(1000); PORTB = 0b01101101; //for displaying 5 _delay_ms(1000); PORTB = 0b01111101; //for displaying 6

Page 44: Project Report on Embedded Systems

_delay_ms(1000); PORTB = 0b00000111; //for displaying 7 _delay_ms(1000); PORTB = 0b01111111; //for displaying 8 _delay_ms(1000); PORTB = 0b01101111; //for displaying 9 _delay_ms(1000); } return;}

3. LCD INTERFACING

OVERVIEW

A brief introduction of LCD (Liquid Crystal Display)

A liquid-crystal display (LCD) is a flat panel display, electronic visual display, or video display that uses the light modulating properties of liquid crystals. Liquid crystals do not emit light directly.

Page 45: Project Report on Embedded Systems

LCDs are available to display arbitrary images (as in a general-purpose computer display) or fixed images which can be displayed or hidden, such as preset words, digits, and 7-segment displays as in a digital clock. They use the same basic technology, except that arbitrary images are made up of a large number of small pixels, while other displays have larger elements.

LCDs are used in a wide range of applications including computer monitors, televisions, instrument panels, aircraft cockpit displays, and signage. They are common in consumer devices such as video players, gaming devices, clocks, watches, calculators, and telephones, and have replaced cathode ray tube (CRT) displays in most applications. They are available in a wider range of screen sizes than CRT and plasma displays, and since they do not use phosphors, they do not suffer image burn-in. LCDs are, however, susceptible to image persistence.

Page 46: Project Report on Embedded Systems

PIN DESCRIPTION

The pinout diagram of an LCD is shown below:

Page 47: Project Report on Embedded Systems

The pinout description of each pin is shown in the following image:

Note:

Page 48: Project Report on Embedded Systems

RS 0 = Instruction Input 1 = Data input R/W 0 = Write to LCD Module 1 =Read from LCD

Module EN Enable signal always goes high to low (1-0)

Commonly used LCD Command Codes

CONNECTIONS FOR DISPLAYING CHARACTERS ON LCD

Page 49: Project Report on Embedded Systems

Image below shows the proteus design for displaying characters on LCD:

The LCD is interfaced using atmega16 microcontroller. This microcontroller has 40 pins with 4 8-bits ports. Here, PORTD is used as output port which is connected to the data pins of LCD.The control pins (pins 4-6) are controlled by pins PC0, PC1 andPC2 of PORTC.

Page 50: Project Report on Embedded Systems

// Program to display character ‘A’ on LCD

#include<avr/io.h>#include<util/delay.h>#define RS PC0 //for Register Select#define RW PC1 //for Data read and write#define EN PC2 //for Enable pin

void cmd (unsigned char a) // function for sending commands{ PORTD = a; PORTC&=(1<<rs); PORTC&=(1<<rw); PORTC|=(1<<en); _delay_ms(150); PORTC&=(1<<en);}

Page 51: Project Report on Embedded Systems

void data (unsigned char a) //function for sending data to data reg{ PORTD = a; PORTC|=(1<<rs); PORTC&=(1<<rw); PORTC|=(1<<en); _delay_ms(150); PORTC&=(1<<en);}

void main(){ DDRD = 0xFF; //PORTD as output port DDRC = oxFF; //PORTC as input port cmd(0x38); // use 8 bit mode of lcd display cmd(0x0E); //command for ON the lcd while(1) { Cmd(0x80); //put cursor at 1st position data(‘A’); //passing string value for displaying

Page 52: Project Report on Embedded Systems

}}

4. MOTORS AND SENSORS INTERFACING

OVERVIEW

MOTORSA motor is a device that creates motion. It may refer to an engine of some kind. It converts electrical energy into mechanical energy.

TYPES OF MOTORS

1. AC MotorAC Motor is an electrical motor driven by alternating current (AC). It commonly consists of two basic parts, an outside stationary stator having coils supplied with alternating current to produce a rotating magnetic field,

Page 53: Project Report on Embedded Systems

and an inside rotor connected to the output shaft that is given a torque by the rotating field.

There are two main types of ac motors, depending on the type of rotor used. They are induction motors and synchronous motors. Other types of motors include eddy current motors, AC/DC mechanically commutated machines, etc.

2. DC MOTORS

Page 54: Project Report on Embedded Systems

A DC Motor relies on the fact that like magnetic poles repel and unlike magnetic poles attract each other. A simple DC motor typically has a stationary set of magnets in the stator and an armature with a series of two or more windings of wire wrapped in insulated stack slots around iron pole pieces (called stack teeth) with the ends of the wires terminating on a commutator. Since the series-wound DC motor develops its highest torque at low speed, it is often used in traction applications such as electric locomotives, and trams. The DC motor was the mainstay of electric traction drives on both electric and diesel-electric locomotives, street-cars/trams and diesel electric drilling rigs for many years.

If external power is applied to a DC motor it acts as a DC generator, a dynamo.

Page 55: Project Report on Embedded Systems

3. STEPPER MOTORS

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.Switched reluctance motors are very large stepping motors with a reduced pole count, and generally are closed-loop commutated.

TYPES OF STEPPER MOTORS

Page 56: Project Report on Embedded Systems

There are four main types of stepper motors:1.Permanent magnet stepper (can be subdivided into

'tin-can' and 'hybrid', tin-can being a cheaper product, and hybrid with higher quality bearings, smaller step angle, higher power density)

2.Hybrid synchronous stepper3.Variable reluctance stepper4.Lavet type stepping motor

Permanent magnet motors use a permanent magnet (PM) in the rotor and operate on the attraction or repulsion between the rotor PM and the stator electromagnets. Variable reluctance (VR) motors have a plain iron rotor and operate based on the principle that minimum reluctance occurs with minimum gap, hence the rotor points are attracted toward the stator magnet poles. Hybrid stepper motors are named because they use a combination of PM and VR techniques to achieve maximum power in a small package size.

Page 57: Project Report on Embedded Systems

4. SERVO MOTORS

A servomotor is a rotary actuator that allows for precise control of angular position, velocity and acceleration. It consists of a suitable motor coupled to a sensor for position feedback. It also requires a relatively sophisticated controller, often a dedicated module designed specifically for use with servomotors.Servomotors are not a specific class of motor although the term servomotor is often used to refer to a motor suitable for use in a closed-loop control system.

Page 58: Project Report on Embedded Systems

Servomotors are used in applications such as robotics, CNC machinery or automated manufacturing.

SENSORS

A sensor is a converter that measures a physical quantity and converts it into a signal which can be read by an observer or by an (today mostly electronic) instrument. For example, a mercury-in-glass thermometer converts the measured temperature into expansion and contraction of a liquid which can be read on a calibrated glass tube. A thermocouple converts temperature to an output voltage which can be read by a voltmeter. For accuracy, most sensors are calibrated against known standards.

Page 59: Project Report on Embedded Systems

Sensors are used in everyday objects such as touch-sensitive elevator buttons (tactile sensor) and lamps which dim or brighten by touching the base. There are also innumerable applications for sensors of which most people are never aware. The most widely used sensors measure temperature, pressure or flow. Applications include manufacturing and machinery, airplanes and aerospace, cars, medicine and robotics.

TYPES OF SENSORS

1. IR SENSORAn infrared sensor is an electronic instrument that is used to sense certain characteristics of its surroundings by either emitting and/or detecting infrared radiation. It is also capable of measuring heat of an object and detecting motion. Infrared waves are not visible to the human eye.

Page 60: Project Report on Embedded Systems

Infrared technology is found in many of our everyday products. For example, TV has an IR detector for interpreting the signal from the remote control. Key benefits of infrared sensors include low power requirements, simple circuitry, and their portable feature.

TYPES OF IR SENSORS Infra-red sensors are broadly classified into two types:

Thermal infrared sensors – These use infrared energy as heat. Their photo sensitivity is independent of wavelength. Thermal detectors do not require cooling; however, they have slow response times and low detection capability.

Quantum infrared sensors – These provide higher detection performance and faster response speed. Their photo sensitivity is dependent on wavelength. Quantum detectors have to be cooled so as to obtain accurate measurements. The only exception is for detectors that are used in the near infrared region.

Page 61: Project Report on Embedded Systems

APPLICATIONSThe following are the key application areas of infrared sensors:

Tracking and art history Climatology, meteorology, and astronomy Thermography, communications, and alcohol testing Heating, hyperspectral imaging, and night vision Biological systems, photobiomodulation, and plant

health Gas detectors/gas leak detection Water and steel analysis, flame detection Anesthesiology testing and spectroscopy Petroleum exploration and underground solution Rail safety. 

2. TEMPERATURE SENSOR

Temperature sensors are devices used to measure the temperature of a medium. There are 2 kinds on temperature sensors: 1) contact sensors and 2) noncontact sensors. However, the 3 main types are thermometers, resistance temperature detectors, and thermocouples. All three of these sensors measure a physical property (i.e. volume of a liquid, current through a wire), which changes as a function of temperature. In addition to the 3 main

Page 62: Project Report on Embedded Systems

types of temperature sensors, there are numerous other temperature sensors available for use.Contact SensorsContact temperature sensors measure the temperature of the object to which the sensor is in contact by assuming or knowing that the two (sensor and the object) are in thermal equilibrium, in other words, there is no heat flow between them.Examples (further description of each example provide below) Thermocouples Resistance Temperature Detectors (RTDs) Full System Thermometers Bimetallic Thermometers

Noncontact SensorsMost commercial and scientific noncontact temperature sensors measure the thermal radiant power of the Infrared or Optical radiation received from a known or calculated area on its surface or volume within it.

Page 63: Project Report on Embedded Systems

A TEMPERATURE SENSOR

3. PROXIMITY SENSOR

A proximity sensor is a sensor able to detect the presence of nearby objects without any physical contact.A proximity sensor often emits an electromagnetic field or a beam of electromagnetic radiation (infrared, for instance), and looks for changes in the field or return signal. The object being sensed is often referred to as the proximity sensor's target. Different proximity sensor targets demand different sensors. For example, a capacitive or photoelectric sensor might be suitable for a plastic target; an inductive proximity sensor always requires a metal target.The maximum distance that this sensor can detect is defined "nominal range". Some sensors have adjustments

Page 64: Project Report on Embedded Systems

of the nominal range or means to report a graduated detection distance.

APPLICATIONS Parking sensors, systems mounted on car bumpers

that sense distance to nearby cars for parking Ground proximity warning system for aviation safety Vibration measurements of rotating shafts in

machinery Top dead centre (TDC)/camshaft sensor

in reciprocating engines. Sheets break sensing in paper machine. Anti-aircraft warfare Roller coasters Conveyor systems Beverage and food can making lines Mobile devices

Page 65: Project Report on Embedded Systems

o Touch screens that come in close proximity to the face

o Attenuating radio power in close proximity to the body, in order to reduce radiation exposure

//Program to drive DC Motors

#include<avr/io.h>

#include<util/delay.h>

void main()

{

DDRB=0b00011110;

while(1)

{

Page 66: Project Report on Embedded Systems

PORTB=0b00010010; //forward motion

_delay_ms(50000);

PORTB=0b00001100; //backward motion

_delay_ms(50000);

PORTB=0b00000010; //Right turn

_delay_ms(50000);

PORTB=0b00010000; //left turn

_delay_ms(50000);

}

}

Page 67: Project Report on Embedded Systems

LINE FOLLOWER A line follower robot is a machine that can follow a path. The path can be visible like a black or white line or can be multi-colored. From industrial point of view, line following robots have been implemented in semi to fully autonomous plants.

Line following robots have many practical applications like automated cars running on roads with embedded magnets; guidance systems for industrial robots moving on floors, defense applications etc.

Page 68: Project Report on Embedded Systems

//Program for line follower robot using atmega16#include <avr/io.h>

int main(void){

DDRB = 0b00000000; // For SensorsDDRD = 0b00001111; // For Motorsint ls=0, rs=0;

while(1) { ls = (PINB&0b00000001); // Left Sensor at PB0

rs = (PINB&0b00000010); // Right Sensor at PB1if((ls==0b00000000)&(rs==0b00000000)){

PORTD = 0b00000000; // Stop the motorsls=0;rs=0;

}if((ls==0b00000001)&(rs==0b00000000)){

PORTD = 0b00001000; // Turn Rightls=0;rs=0;

}if((ls==0b00000000)&(rs==0b00000010)){

PORTD = 0b00000001; // Turn Leftls=0;rs=0;

}

Page 69: Project Report on Embedded Systems

if((ls==0b00000001)&(rs==0b00000010)){

PORTD = 0b00001001; // Move Forwardls=0;rs=0;

} }

return 0;}

EDGE AVOIDER Edge avoider is a mobile device, which senses and avoids the absence of surface below it. This concept was designed to protect the robot from falling.

This technology has been suggested for running busses and other mass transit systems and may end up as a part of autonomous cars navigating the freeway.

//Program for Edge Avoider robot using atmega16

#include <avr/io.h>#include<util/delay.h>#define F_CPU 100000UL

Page 70: Project Report on Embedded Systems

int main(void){

DDRB = 0b00000000; // Input Port for SensorsDDRD = 0b00011110; // Output Port for Motorsint ls=1, rs=1;

while(1) { ls = (PINB&0b00000001); // Left Sensor at PB0

rs = (PINB&0b00001000); // Right Sensor at PB3if((ls==0b00000001)&(rs==0b00001000)){

PORTD = 0b00010010; // Move Forward}if((ls==0b00000000)&(rs==0b00000000)){

PORTD = 0b00001100; // Move Back_delay_ms(2000);PORTD = 0b00010000; // Turn Right_delay_ms(2000);

} }

return 0;}

5. DTMF INTERFACING

Page 71: Project Report on Embedded Systems

DTMF stands for Dual Tone Multi-frequency Signaling.DTMF is the generic name for pushbutton telephone signaling equivalent to the Bell System’s Touchtone. DTMF signaling is quickly replacing dial-pulse signaling in telephone networks worldwide.

APPLICATIONS OF DTMF

1. DTMF is used for telecommunication signaling over analog telephone lines in the voice frequency band between telephone headsets and other communication devices.

2. It is becoming popular in interactive control applications such as telephone banking and electronic mail systems.

3. DTMF tones are mainly used in telephone switching centres for detection of called/dialed numbers.

DTMF CONTROLLED ROBOT

Page 72: Project Report on Embedded Systems

//Program for operating DTMF controlled robot

#define F_CPU 1000000UL#include <avr/io.h>#include<util/delay.h>

int main(void){

int DTMF = 0;DDRA = 0b00000000; // For DTMFDDRB = 0b00011110; // For Motors

while(1)

Page 73: Project Report on Embedded Systems

{ DTMF = (PINA&0b00001111);

if(DTMF==2){

PORTB = 0b00010010; //Move forward}elseif(DTMF==8){

PORTB = 0b00001100; //Move backward}elseif(DTMF==4){

PORTB = 0b00010000; //Turn Left}elseif(DTMF==6){

PORTB = 0b00000010; //Turn Right}elseif(DTMF==5){

PORTB = 0b00000000; //Stop}

}return 0;

}

Page 74: Project Report on Embedded Systems

11. BIBLIOGRAPHY1. en.wikipedia.org2. https://eezey.com3. www.codeproject.com