line follower rescue robot project paper

Upload: wasif-anjum-alif

Post on 12-Oct-2015

74 views

Category:

Documents


1 download

DESCRIPTION

This project is based on a line following robot which will be triggered after any kind of emergency signal. After that, it will rescue the whole area from the dangerous situation. Arduino UNO is used for controlling the robot.

TRANSCRIPT

  • LINE FOLLOWING EMERGENCY RESCUE ROBOT

    PRESENTED BY: ALLSPARK DEPARTMENT: EEE

    SECTION: A

    15/01/14

    USING ARDUINO

    RAIHAN NISHAT

    [12.01.05.004] [email protected]

    SUMABA ISLAM

    [12.01.05.009] [email protected]

    MD. ASADUZZAMAN

    [12.O1.O5.012] [email protected]

    RAKIB HASSAN

    [12.01.05.020] [email protected]

    MD. WASIF ANJUM

    [12.01.05.030] [email protected]

  • 1

    Line Following Rescue Robot

    Abstract:

    This project is based on a line following robot which will be triggered after any kind of emergency signal. After that, it will rescue the whole area from the dangerous situation. Arduino UNO is used for controlling the robot.

    Keywords: Line following robot (LFR), DC Motor, Arduino UNO, Battery, Body Kit, Speed Controlled Driver, High, Low, Data, Transmitter, Receiver, Encoder, Decoder.

    INTRODUCTION

    utomated system has become a vital part of our life. Among all the systems, we have tried to make

    the basic automated system which follows a black line on the floor. We have made Line following

    robot using Arduino. We have chosen the rescue part as an application for this project. This robot

    will be used for extinguishing fire. Initially, the robot is inactivated and connected to a receiver module. There is a

    temperature sensor with transmitter in a specific place. After an increment of defined temperature, the transmitter will send a data and the robot will be turned on. Instantly, the robot will detect the line and start to move forward.

    In the meantime, it will reach its destination and start to do its objective. It will move by following a black line on the

    floor. The speed of the motor is controlled by the motor shield driver. The reading of temperature is counted by

    temperature sensor. For sending data, transmitter and receiver are used. We have divided our whole project into six

    steps. They are illustrated below with a simple flow chart.

    Fig 1: Step by Step Process of Making Line Following Rescue Robot

    A

    Setting Up Body kit

    and Connection

    Importing Code to Arduino

    Adding Temparature Sensor

    Adjusting Transmitter & Receiver

    Preparing Motor Shield

    Preparing Sensor Bar

    Collecting All Parts

  • 2

    Line Following Rescue Robot

    REQUIRED EQUIPMENTS

    Arduino Uno R3

    Robot Body Kit

    IC LM293D

    2 DC Motors

    Light Depending Resistors

    White LEDs

    Resistors

    Black Tape

    Connecting Wires

    LM35

    RF Pair Module

    HT12E

    HT12D

    BUZZER

    PCB

    9V Battery and Pack

    AC to DC Adapter

    Soldering Equipment

    Bread Board

  • 3

    Line Following Rescue Robot

    SCHEMATIC DIAGRAM

    Fig 2: Arduino with Reciever Module

    Fig 3: Transmitter Module

  • 4

    Line Following Rescue Robot

    WORKING PRINCIPLE

    Sensor Bar:

    This Line Follower Robot takes advantage of the photo-resistor (CDs) known as Light Dependent Resistor (LDR). The

    LDR will decrease its resistance in the presence of light and increase its resistance in the dark. The region under the

    LDR is illuminated with a high intensity white LED, the white surface will reflect most of the light to the LDR surface

    while the black track line will absorb most of the light, therefore less light will reflect to the LDR surface. As the robot

    move on the black track line the LDR will continuously capture the reflected light and send the data to the analog

    input of Arduino.

    In our project we have used four white LEDs as they have a reasonable enough brightness to illuminate the floor and

    create contrast between the floor and the black line for our sensor to detect. We choose White LEDs because they

    are best as their output come with the greatest brightness for the lowest current. Four of these are connected in

    parallel with Pin 9. We use the appropriate current limiting resistors for our LEDs.

    Finally, we connect up three light dependent resistors (LDR) in between the LEDs to Analog Pins 0, 1, and 2. One side

    of the LDR goes to ground, the other to +5v via a 1K ohm resistor. The wire from the analog pins goes between the

    resistor and the LDR pin.

    Fig 4: Sensor Part connected to Motor and Arduino

    The breadboard above was used for testing purposes. However, for making the robot we build a sensor bar that

    houses the four LEDs and the three LDRs. These are positioned so that they are all close together and pointing in the

    same direction. We soldered up the LED and sensor circuit onto a small piece of printed circuit (PCB) board and placed

  • 5

    Line Following Rescue Robot

    The three LDRs in-between the four LEDs and just slightly higher than the LEDs so that the light from them did not

    shine onto the sensor.

    Fig 5: Sensor Bar in PCB

    The sensor bar is then attached to the front side of our robot in such a way that the LEDs and LDRs are about 1cm or

    half an inch above the floor (see Figure 10-11). Then we bolted the sensor bar to the chassis.

    Motor Driver Shield:

    In our project we use L293D IC as motor driver which can control the speed of 2 DC Gear motor for both forward and

    reverse direction individually.

    L293D is a dual H-bridge motor driver integrated circuit (IC). Motor drivers act as current amplifiers since they take a

    low-current control signal and provide a higher-current signal. This higher current signal is used to drive the motors.

    Fig 6: Schematic Diagram of LM293D

    L293D contains two inbuilt H-bridge driver circuits. In its common mode of operation, two DC motors can be driven

    simultaneously, both in forward and reverse direction. The motor operations of two motors can be controlled by

  • 6

    Line Following Rescue Robot

    Input logic at pins 2 & 7 and 15 & 10. Input logic 00 or 11 will stop the corresponding motor. Logic 10 and 10 will

    drive the motor towards straight.

    Enable pins 1 and 9 (corresponding to the two motors) must be high for motors to start operating. When an enable

    input is high, the associated driver gets enabled. As a result, the outputs become active and work in phase with their

    inputs. Similarly, when the enable input is low, that driver is disabled, and their outputs are off and in the high-

    impedance state. By varying the value (0 to 255) of enable pin, each motor speed can be controlled individually.

    Controlling Motor Speed Using Sensor Bar:

    In this project we have used black track on white surface. As we use three LDRs, the center LDR should be always on

    the top of black line. So the value of the center LDR should be greater than the left or right LDR as the black track

    absorbs the white light and minimum light is reflected to the center LDR. In this condition the robot moves straight.

    Fig 7: Reflection and absorption of white light

    But when the black line turns to left or right side then the above condition is changed.

    When the black line turns to right, moving towards straight at a certain time minimum light is reflected to the right

    LDR. Then the value of right LDR becomes greater than the center LDR. When this situation arises the left motor

    speeds up and the right motor slows down thus the robot turns right and reaches the initial condition.

    Similarly when the black line turns to left, moving towards straight at a certain time minimum light is reflected to the

    left LDR. Then the value of left LDR becomes greater than the center LDR. When this situation arises the right motor

    speeds up and the left motor slows down thus the robot turns left and reaches the initial condition.

  • 7

    Line Following Rescue Robot

    Not Gate (7404)

    Parallel DataDecoder IC

    (HT12D)Serial Data

    RF Reciever 434 MHz

    Fig 8: Speed of Both Motors and Direction

    RF Pair Based Fire Alarm System:

    This is the second major part of our project. In This part we will transmit an emergency fire alarm signal wirelessly to

    the robot from the place where fire is occurred. Our robot is always in standby mode when it receives the signal it

    will automatically start and go to the fire affected area.

    Now we will discuss how this part works. We followed the following diagram to complete this part.

    Fig 9: Flow Chart of RF Pair Module System

    S

    e

    r

    i

    a

    l

    D

    a

    t

    a

    Buzzer

    TemparatureSensor (LM35)

    Comparator (LM324)

    Encoder IC (HT12E) Serial Data

    RF Transmitter 434 MHz

  • 8

    Line Following Rescue Robot

    Brief Description of all required components for RF pair module system is stated below-

    RF Module (Transmitter & Receiver):

    The RF module, operates at Radio Frequency. The corresponding frequency range varies between 30 kHz & 300 GHz.

    In this RF system, the digital data is represented as variations in the amplitude of carrier wave. This kind of modulation

    is known as Amplitude Shift Keying (ASK).

    Fig 10: RF Pair Module

    RF module comprises of a RF Transmitter and a RF Receiver. We have chosen a RF pair module (transmitter/receiver)

    which operates at a frequency of 434 MHz. An RF transmitter receives serial data and transmits it wirelessly through

    RF through its antenna connected at pin 4. The transmission occurs at the rate of 1Kbps - 10Kbps.The transmitted

    data is received by an RF receiver operating at the same frequency as that of the transmitter.

    Pin Description: RF Transmitter

    Pin No Function Name

    1 Ground (0V) Ground

    2 Serial data input pin Data

    3 Supply voltage; 5V Vcc

    4 Antenna output pin ANT

    RF Receiver

    Pin No Function Name

    1 Ground (0V) Ground

    2 Serial data output pin Data

    3 Linear output pin; not connected NC

    4 Supply voltage; 5V Vcc

    5 Supply voltage; 5V Vcc

    6 Ground (0V) Ground

    7 Ground (0V) Ground

    8 Antenna input pin ANT

  • 9

    Line Following Rescue Robot

    The RF module is often used along with a pair of encoder/decoder. The encoder is used for encoding parallel data for

    transmission feed while reception is decoded by a decoder. HT12E-HT12D, HT640-HT648, etc. are some commonly

    used encoder/decoder pair ICs. In our project we have used HT12E as encoder and HT12D as decoder.

    Encoding and Decoding:

    In simple words, encoding is wrapping up the data. The data could be anything like simple binary data (in the form

    of 1's and 0's) or it could be an audio signal or it could be certain text. But here we are dealing with the encoding that

    is used for binary signals. The wrapped data is called as a Packet. This packet is sent through a medium (Through

    wire or wireless) to the decoder part where it gets unwrapped or decoded. It is exactly similar to posting an

    envelope. Encoding is when we put the letter into envelope, the postman is medium to take the envelope to the

    recipient and when recipient opens the envelope then it is called decoding.

    So, essentially to apply encoding and decoding technique in our digital world we need three entities:

    (1). a sender or in electronics sense, it is Transmitter.

    (2). to receive this sent data we need a receiver.

    (3). and of course we need an address of the receiver. The role of address in electronics is played by address lines.

    Fig 11: HT12E Transmitter Side

    The encoder has four input lines. These lines are used to give input which we want to encode. In encoding, we are

    wrapping up the data which means if we want to send a binary signal 1001 to other end, we have to make data pins

    as 1001. Now, to make data pin like this, what we need to do is to give high or 5 volts (which in digital means 1) to

    pins D0 and D3 while we have to provide pins D1 and D2 with 0 volt. (Ground). This altogether gives us 1001

    which is transmitted out from the Data out pin of the HT12E.

  • 10

    Line Following Rescue Robot

    The input given to data pin is in parallel form which is being transmitted into serial form from the data output pin.

    The figure below will clear this:

    Fig 12: HT12E Transmitting Process

    Our data is now been encoded and will be transmitted. The transmission medium is wireless. The data flows in serial form through the transmitter and reaches the other end i.e. to the receiver. Receiver now decodes this signal.

    HT12D (Receiver side):

    The encoded data which is coming from the transmitter side goes into the Data in (Din) pin. The data which was in

    serial order gets decoded and the output is generated at the for data line pins in same order as that on transmitter

    pin.

    Fig 13: HT12D Receiver Side

  • 11

    Line Following Rescue Robot

    When there is no input at the data in pin, the output pins i.e. data lines remains high. The figure below shows the decoding taking place in HT12D:

    Fig 14: HT12D Receiving Process

    7404 Inverter:

    As the name implies, inverter will invert the number entered. If we enter 0, we will get a 1 on its output, and if we enter a 1, we will get a 0 on its output. The inverter gate is also known as NOT and its output is Y= /A.

    Truth Table:

    A(Input) Y(Output)

    0 1

    1 0

    Fig 15: 7404 Hex Inverter

  • 12

    Line Following Rescue Robot

    LM324 Comparator:

    Fig 16: LM324 Comperator

    The LM324 consist of four independent, high gain, internally frequency compensated operational amplifiers which

    were designed specifically to operate from a single power supply over a wide voltage range. Operation from split power

    supplies is also possible so long as the difference between the two supplies is 3 volts to 32volts. In our project we use

    this IC as a cooperator.

    LM35 Temperature Sensor:

    To measure the temperature of the room we have used this temperature sensor.

    Features of this temperature sensor:

    Calibrated Directly in Celsius (Centigrade)

    Linear + 10 mV/C Scale Factor

    0.5C Ensured Accuracy (at +25C) LM35 has an advantage over linear temperature

    Rated for Full 55C to +150C Range

    Suitable for Remote Applications Fig 17: LM35 Sensor

  • 13

    Line Following Rescue Robot

    Low Cost Due to Wafer-Level Trimming

    Operates from 4 to 30 V

    Less than 60-A Current Drain

    Low Self-Heating, 0.08C in Still Air

    Nonlinearity Only C Typical

    Low Impedance Output, 0.1 for 1 mA Load

    RF Based Fire Alarm System Circuit Diagram:

    We connected all the required components of RF transmitter and receiver according to the following circuit diagram.

    Fig 18: RF Pair Module Circuit

  • 14

    Line Following Rescue Robot

    In our project we would like to transmit the fire alarm signal when the room temperature is above 80 C. Now our

    temperature sensor senses the room temperature and converts it to the voltage level. Then we adjust a voltage by

    varying pot which is greater than the voltage of temperature sensor and the pot is connected to the non-inverting

    terminal of the LM324 comparator. The output of temperature sensor is connected to the inverting terminal of the

    comparator. At room temperature (26 C) the non-inverting terminal is 540 mV greater than the inverting terminal.

    So when the inverting terminal crosses the initial value and 540 mV value then the comparator provides digital low

    (0 V) value to the output. Encoder HT12E takes this output as data input and then it passes the data to the RF

    transmitter. The transmitter then transmit the signal to the RF receiver and then the receiver passes the data to the

    HT12D decoder. Then the decoder decodes the signal and passes it to the 7404 inverter. The inverter inverts the

    digital low (0 V) value to digital high (5 V) then the buzzer buzzes.

    We connected a wire between the +VE terminal of buzzer and in a digital pin of Arduino. We write a code that is,

    when the buzzer buzzes then the robot starts navigating.

    The robot will now follow the black line and it will stop at the end of the line which is in the fire affected room.

    ARDUINO CODE

    #define lights 7

    #define Speed1 10 // Enable Pin for motor 1(left)

    #define Speed2 11 // Enable Pin for motor 2(right)

    #define Input1 8 // Control pin 1 for motor 1(left)

    #define Input2 9 // Control pin 2 for motor 1(left)

    #define Input3 2 // Control pin 1 for motor 2(right)

    #define Input4 3 // Control pin 2 for motor 2(right)

    #define receiver 4 // receiver pin

    #define buzzer 5

    int LDR1, LDR2, LDR3; // sensor values

    // calibration offsets

    int leftOffset = 0, rightOffset = 0, centre = 0;

    // pins for motor speed and direction

    int speed1 = 10, speed2 = 11;

    // starting speed and rotation offset

  • 15

    Line Following Rescue Robot

    int startSpeed = 90, rotate = 40;

    // sensor threshold

    int threshold = (10);

    // initial speeds of left and right motors

    int left = (startSpeed+30), right = (startSpeed-30);

    // Sensor calibration routine

    void calibrate ()

    {

    for (int x=0; x

  • 16

    Line Following Rescue Robot

    void setup ()

    {

    // set the motor pins to outputs

    pinMode (lights, OUTPUT); // lights

    pinMode (speed1, OUTPUT);

    pinMode (speed2, OUTPUT);

    pinMode (Input1, OUTPUT);

    pinMode (Input2, OUTPUT);

    pinMode (Input3, OUTPUT);

    pinMode (Input4, OUTPUT);

    pinMode (buzzer, OUTPUT);

    pinMode (receiver, INPUT);

    calibrate ();

    delay (4000);

    digitalWrite (lights, HIGH);

    delay (100);

    // set motor direction to forward

    digitalWrite (Input1, HIGH);

    digitalWrite (Input2, LOW);

    digitalWrite (Input3, HIGH);

    digitalWrite (Input4, LOW);

    }

    void loop ()

    {

    if (digitalRead (receiver) ==HIGH)

    {

    analogWrite (speed1, 150);

    analogWrite (speed2, 120);

  • 17

    Line Following Rescue Robot

    delay (300);

    digitalWrite (speed1, LOW);

    digitalWrite (speed2, LOW);

    delay (50);

    for (;;)

    {

    digitalWrite (buzzer, LOW);

    left = startSpeed+30;

    right = (startSpeed-30);

    // read the sensors and add the offsets

    LDR1 = analogRead (0) + rightOffset;

    LDR2 = analogRead (1);

    LDR3 = analogRead (2) + leftOffset;

    // if LDR1 is greater than the centre sensor + threshold turn right

    if (LDR1 > (LDR2+threshhold)) {

    right = (startSpeed-30) - rotate;

    left= startSpeed + (rotate+20);

    }

    // if LDR3 is greater than the centre sensor + threshold turn left

    if (LDR3 > (LDR2+threshhold)) {

    right = (startSpeed-30) + rotate;

    left = startSpeed - rotate;

    }

    If (LDR1>400 && LDR2>400 && LDR3>400)

    {

    for (;;)

    {

    digitalWrite (speed1, LOW);

    digitalWrite (speed2, LOW);

    digitalWrite (lights, LOW);

  • 18

    Line Following Rescue Robot

    }

    }

    // send the speed values to the motors

    analogWrite (speed1, left);

    analogWrite (speed2, right);

    }

    }

    }

    TROUBLESHOOT

    We faced some difficulties for making our robot. Now we will discuss about how we have troubleshot these problems.

    Motor Speed:

    One of the most important part of this project is motor. We have used two DC gear motors. Which can operate within

    12V and 600 mA. We have faced severe problem when we observed that two motors provide different speed at same

    voltage and current. As a result the robot was just rotating. Then we varied the speed of two motor individually by

    Arduino code. As our right motor was rotating fast we slowed it down and we speeded up the left motor. Then the

    robot went straight.

    Caster Wheel:

    Our robot has a free caster Wheel which can rotate according to the robots direction. But when the robot went

    straight it created some problems and the robot took a turn. We have overcome this problem by replacing that caster

    wheel with another one.

    Sensor Bar:

    Another important part of our project is sensor bar. As we have soldered the sensor circuit in a printed circuit board

    (PCB) and we are very beginner in this section, there were some mistakes. The LDR surface was not at the same level

    from the ground thats why we did not get exactly same value from the 3 LDR. We have overcome the problem by

    calibrating the sensor value in Arduino code. At first we took 10 readings of the sensor then we have averaged the

  • 19

    Line Following Rescue Robot

    Value. Then we have declared two variables called leftoffset and rightoffset.

    Leftoffset and rightoffset are the difference between the center sensor and left and right sensor respectively.

    Width of track:

    In our sensor bar we have used 3 LDR and 4 LED. The center LDR is in between two LEDs. Our sensor bar is designed

    to keep the center LDR (with its surrounding two LED) on the lack line. We have uses PVC black tape for making our

    track. When we used a narrow black line we observed that our robot didnt follow the line. Then we made the line

    wider and the robot smoothly navigated the line.

    Making of fire Alarm Circuit:

    We have used a RF (Radio Frequency) pair for transmitting emergency rescue signal and receiving that signal. At first

    we planned to use the pair using Arduino. But we faced some serious problem transmitting data from one Arduino

    to another Arduino. In addition, its a matter of cost. So, we discussed about this problem with our Teacher. Then he

    advised us to complete this part without programming. Then we have constructed a RF based fire alarm system which

    is completely hardware based.

    Power consumption:

    At primary stage we provided 2 different power source for Arduino and motor driver. But the power we provided to

    the motor driver was not sufficient for driving two motor perfectly. Then we used single power supply source of 12V

    and from this source we powered up Arduino, motor driver and receiver circuit. As we have used 8 normal AA

    Batteries, the source couldnt provide constant voltage and current continuously. When the batteries were new they

    provided much power and as a result the motor provided greater speed and sometimes it couldnt read the line and

    when the batteries became older the power provided by the source was minimum and the robot couldnt run. We

    have solved the problem by changing the motor speed in the code. When the source provided much power we slowed

    down the speed of motor and when the source provided low power then we speeded up the motor.

    APPLICATIONS

    Our project has a vast field of application. As it is based on wireless communication it can be controlled by wireless

    command in various sector. Here are some application of our Project.

    1. As our main objective was not only to follow lines but also emergency rescue of various fire probable place where

    people cannot reach easily or automatic action is necessary. So this robot can be used in,

  • 20

    Line Following Rescue Robot

    (a) Big mills and factory especially in Our Garment Industry.

    (b) School, College, University and

    (c) In House to rescue the place from fire.

    2. This robot can be used as automated cars running on roads with embedded magnets

    3. Wireless guidance system for industrial robots moving on shop floor.

    4. Industrial applications.

    5. Home applications.

    FUTURE WORK PLAN

    * Now we are using single RF pair module. So the signal will only be transmitted from one particular place and our

    robot will reach there. In future we have a plan to place several RF transmitter in different places. If fire occurs in any

    particular place then the transmitter placed in that place transmit fire alarm signal and the robot will go to that

    particular place.

    * We have a plan to join a robotic hand on the top of the robot so that it could carry some load (for e.g. Carbon di

    oxide gas cylinder) and take necessary steps to control fire.

    * As it is an emergency rescue robot it should take proper action if some obstacle disturbs its movement. So we will

    add an obstacle avoidance feature using Ultrasonic Sensor.

    * After completing the modification we will use the robot for practical uses such as it can be used to deliver mails

    within the office buildings, in case of delivering medicines in a hospital, transporting small goods from one room to

    another room in house etc.

    LIMITATIONS

    We are very beginner in the sector of robotics. Our line follower emergency rescue system has some limitations

    which we cannot troubleshoot because of shortage of time. The limitations are given below:

    It cannot take a 90 turn as we use only three sensor.

    It cannot read a narrow black line.

    The speed is not very fast.

  • 21

    Line Following Rescue Robot

    PHOTO SNAPSHOTS

  • 22

    Line Following Rescue Robot

    CONCLUSION

    Robotics and Automation based systems and technologies are vastly advancing in the field of Electrical and

    Electronics engineering. Mostly in developed countries which are exposed to modern high end technologies, many

    researches are carried out in this field. These kinds of systems have proved to be highly advantageous in many areas

    like educational, military and industrial applications. But unfortunately in developing countries like Bangladesh,

    advancement of robotics systems is relatively slow in progress. It is due to many factors such as, low exposure

    to modern technologies, unaffordable cost etc. Actually robotics based systems are limited to research work carried

    out in universities. Undergraduate students possess sufficient skills to carryout research work in these areas. Those

    skills can even be used to develop robot systems in large scale as commercial products. But still, sufficient support

    and technical expertise is not provided. The line following robot project challenged the group to cooperate,

    communicate, and expand understanding of electronics, mechanical systems, and their integration with

    programming. This project would not have been successful without every member of the group contributing and

    communicating during the problem-solving process, and without the knowledge and perfect advice of Mr. Hasib

    Md. Abid Bin Farid, Assistant professor, Department of EEE, AUST. Overall, the line following robot was a

    tremendous success and an incredible learning opportunity for everyone involved.

    The main objective of our project was to make a line follower robot which have a special feature to do emergency

    rescue for some particular places. In this project we have learned about the implementation of a line follower robot

    using an Arduino. The programming and interfacing of the Arduino has been mastered during the implementation.

    We also acknowledged how to dump the program in the Arduino. Our soldering skills is also very much improved.

    REFERENCES

    1. Beginning Arduino, Michael McRoberts

    2. Beginning Arduino Programming, Brian Evans

    3. Hasib Md. Abid Bin Farid, Assistant professor, Department of EEE, AUST

    4. http://aust-eee-2211-project.webnode.com/

    5. http://letslearnelectronics.blogspot.com/2012/07/introduction-to-encoding-and-decoding_1610.html

    6. http://letsmakerobots.com/node/12336?page=1

    7. http://www.buildcircuit.com/how-to-use-rf-module-with-arduino/

    INTRODUCTIONFig 1: Step by Step Process of Making Line Following Rescue RobotREQUIRED EQUIPMENTSSCHEMATIC DIAGRAMWORKING PRINCIPLEFig 4: Sensor Part connected to Motor and ArduinoARDUINO CODETROUBLESHOOTAPPLICATIONSFUTURE WORK PLANLIMITATIONSPHOTO SNAPSHOTSCONCLUSIONREFERENCES