ldr project repoert

Upload: satvik

Post on 28-Feb-2018

242 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/25/2019 ldr project repoert

    1/35

    TRAINING PROJECT REPORT SUBMITTED IN PARTIAL FULFILMENT

    OF THE REQUIREMENTS

    FOR THE AWARD OF THE DEGREE OF

    BACHELOR OF TECHNOLOGY

    IN

    ELECTRONICS AND COMMUNICATION ENGINEERING

    LDR CAMERA

    SUBMITTED TO:

    Dr. MUKUL SARKAR

    ASST. PROF.

    EE, IIT DELHI

    SUBMITTED BY:

    IKJOT SINGH 006960!"#$

    M%&%r%'% A(r%)*+ I+)-* /

    T*1&+/2/(3, N*4 D*2&-

    DEPARTMENT OF ELECTRICAL ENGINEERING

    INDIAN INSTITUTE OF TECHNOLOGY DELHI

    HAU5 KHAS, NEW DELHI##0 0#6

    JUNEAUGUST !0#7

  • 7/25/2019 ldr project repoert

    2/35

    CERTIFICATE

  • 7/25/2019 ldr project repoert

    3/35

    ACKNOWLEDGEMENT

    It is often said that life is a mixture of achievements, failures, experiences, exposures and efforts to

    make your dream come true. There are people around you who help you realize your dream. Iacquire this opportunity with much pleasure to acknowledge the invaluable assistance of Indian

    Institute of Technology and all the people who have helped me through the course of my journey in

    successful completion of this project.

    I would like to articulate my gratitude and appreciation to my project guide Dr. M82 S%r8%r

    ho has always been a constant motivation and guiding factor throughout the project time in and

    out as well. It has been a great pleasure for me to get an opportunity to work under his guidance and

    complete the project successfully. I express my thanks to M-)). C&%+%+- A+%+, P& S1&/2%r,

    IITDfor her kind cooperation during the period of my summer internship.

    I am grateful to my friends who gave me the moral support in my times of difficulties. !ast but not

    the least I would like to express my special thanks to my family for their continuous motivation and

    support.

    Ikjot "ingh

    #$$%&%'$()*+

  • 7/25/2019 ldr project repoert

    4/35

    A)r%1

    -owadays cameras are widely used in robots to understand gestures of an object or during

    navigation. / simple nonconventional image sensor made with photoresistors and diodes is

    presented for taking gestures of an object as input. The single pixel of the designed image sensor is

    done with a !01 #!ight 0ependent 1esistor and a diode. 2utput of this device is fed to the

    3/T!/4 and actions are triggered according to the program written in 3/T!/4 by taking image

    as an input. The image sensor consists of an array of *$ x *$ pixels and occupies an area of 5 x 5

    cm(. The image sensor is designed and fabricated on a dotted 674. /rduino 3ega (8%$ is used for

    analog to digital conversion of the obtained signal. 7aptured image is viewed and processed in

    3/T!/4. The clear *$ x *$ pixels grayscale image was viewed after completion of this project.

  • 7/25/2019 ldr project repoert

    5/35

    INDE;

    7ertificate i

    /cknowledgement ii

    /bstract iii !ist of 9igures iv

    !ist of 6hotographs v

    #. INTRODUCTION

    *.*. 2bjective

    *.(.6rerequisites

    *.(.*. !ight 0ependent 1esistor #!01

    *.(.(. /rduino

    *.(.+. 3/T!/4!. PRINCIPLE CONCEPT AND WORKING

    (.*.7oncept of 0igital Images

    (.(.7haracteristics of !01

    (.+.orking 7oncept of project

    (.'.:lemental circuit and 6rototype circuit

    $. BUILDING THE PROJECT

    +.*."oftware

    +.*.*. Interfacing 3/T!/4 with /rduino

    +.*.(. 7ommands used in 3/T!/4

    +.*.+. 7ode /lgorithm

    +.(.;ardware

    +.(.*. ;ardware required and their description

    +.(.(. "oldering

    +.(.+. "teps for making the hardware

    +.(.'. Testing

    +.(.8. 6recautions

    R*)2)

    C/+12)-/+

    R**r*+1*)

  • 7/25/2019 ldr project repoert

    6/35

    L-) / F-(r*

    S.NO. FIGURE

    NO.

    FIGURE DESCRIPTION PAGE

    NO.* *.* 6hoto 1esistor "ymbol

    ( *.( /rduino pin diagram

    + (.* 6ixel value in binary image

    ' (.( 6ixel value in gray scale image

    8 (.+ 1esistance vs illumination graph of !01

    8 (.' 7oncept diagram of this project

    % (.8 :lemental 7ircuit

    5 (.% 6rototype circuit of !01 3ultiplexing

    ) '.*#a#f 2utput 3/T!/4 9igures that are captured by

    the !01 camera.

  • 7/25/2019 ldr project repoert

    7/35

    L-) / P&//(r%

  • 7/25/2019 ldr project repoert

    8/35

    CHAPTER: # INTRODUCTION

    #.# O'*1-=*

    The main objective this project is to design an image sensor using photoresistors and to

    acquire the captured image in the computer for further processing. The processed image can

    be linked with a software for giving inputs to operating system. 4y achieving this device one

    can control his computer by gestures.

    #.! Pr*r*>-)-*)

    This project is the assemblage of the study of some devices and software which must be

    known by a person working on this project. 4asic element used in this project is 6hotoresistor or lightdependent resistor #!01, for controlling and operation of hardware

    /10

  • 7/25/2019 ldr project repoert

    9/35

    unique photoresistors may react substantially differently to photons within certain

    wavelength bands.

    #.!.! Ar-+/

    /rduino is an opensource prototyping platform based on easytouse hardware and

    software. /rduino boardsare able to read inputs light on a sensor, a finger on a button, or a

    Twitter message and turn it into an output activating a motor, turning on an !:0, publishing

    something online. ?ou can tell your board what to do by sending a set of instructions to themicrocontroller on the board. To do so you use the /rduino programming language#based on

    iring, and the /rduino "oftware #I0:,based on6rocessing.

    2ver the years /rduino has been the brain of thousands of projects, from everyday objects to

    complex scientific instruments. / worldwide community of makers students, hobbyists, artists,

    programmers, and professionals has gathered around this opensource platform, their

    contributions have added up to an incredible amount ofaccessible knowledgethat can be of great

    help to novices and experts alike.

    /rduino was born at the Ivrea Interaction 0esign Institute as an easy tool for fast prototyping,

    aimed at students without a background in electronics and programming. /s soon as it reached a

    wider community, the /rduino board started changing to adapt to new needs and challenges,

    differentiating its offer from simple )bit boards to products for IoT applications, wearable, +0

    9igure *.*6hotoresistor

    symbol

    6hotograph *.*

    7ommercial !01

    https://www.arduino.cc/en/Main/Productshttps://www.arduino.cc/en/Reference/HomePagehttps://www.arduino.cc/en/Reference/HomePagehttps://www.arduino.cc/en/Reference/HomePagehttp://wiring.org.co/https://www.arduino.cc/en/Main/Softwarehttps://www.arduino.cc/en/Main/Softwarehttps://processing.org/https://processing.org/http://forum.arduino.cc/http://forum.arduino.cc/https://www.arduino.cc/en/Main/Productshttps://www.arduino.cc/en/Reference/HomePagehttp://wiring.org.co/https://www.arduino.cc/en/Main/Softwarehttps://processing.org/http://forum.arduino.cc/
  • 7/25/2019 ldr project repoert

    10/35

  • 7/25/2019 ldr project repoert

    11/35

    developed by the !I-6/7C #linear system package and :I"6/7C #:igen system package

    projects. 3/T!/4 D*E is a highperformance language for technical computing. It integrates

    computation, visualization, and programming environment. 9urthermore, 3/T!/4 is a modern

    programming language environmentF it has sophisticated data structures, contains builtin editing

    and debugging tools, and supports objectoriented programming. These factors make 3/T!/4

    an excellent tool for teaching and research. 3/T!/4 has many advantages compared to

    conventional computer languages #e.g., 7, 921T1/- for solving technical problems.

    3/T!/4 is an interactive system whose basic data element is an array that does not require

    dimensioning. The software package has been commercially available since *&)' and is now

    considered as a standard tool at most universities and industries worldwide. It has powerful built

    in routines that enable a very wide variety of computations. It also has easy to use graphics

    commands that make the visualization of results immediately available. "pecific applications are

    collected in packages referred to as toolbox. There are toolboxes for signal processing, symbolic

    computation, control theory, simulation, optimization, and several other fields of applied science

    and engineering.

  • 7/25/2019 ldr project repoert

    12/35

    CHAPTER: ! PRINCIPLE CONCEPT AND WORKING

    !.# C/+1*

  • 7/25/2019 ldr project repoert

    13/35

    9igure (.( H 6ixel values in gray scale image.

    /n image can be of class uint), uint*%, single, or double. :ach pixel color is of a value between

    $ and * as depicted below. / pixel whose pixel color is $ is displayed as black, and a pixel whose

    color components pixel color is * is displayed as white.

    !.! C&%r%1*r-)-1) / LDR

    !01s are light dependent devices whose resistancedecreases when light falls on them and

    increases in the dark. hen a light dependent resistoris kept in dark, its resistance is very high.

    This resistance is called as dark resistance. It can be as high as *$*( J. /nd if the device is

    allowed to absorb light its resistancewill decrease drastically. If a constant voltageis applied to

    it and intensity of light is increased the currentstarts increasing. 9igure below shows resistance

    vs. illumination curve for a particular !01.

    6hotocells or !01s are nonlinear devices. There sensitivity varies with the wavelength of light

    incident on them. "ome photocells might not at all response to a certain range of wavelengths.

    4ased on the material used different cells have different spectral response curves.

    http://www.electrical4u.com/electrical-resistance-and-laws-of-resistance/http://www.electrical4u.com/types-of-resistor-carbon-composition-and-wire-wound-resistor/http://www.electrical4u.com/types-of-resistor-carbon-composition-and-wire-wound-resistor/http://www.electrical4u.com/electrical-resistance-and-laws-of-resistance/http://www.electrical4u.com/electrical-resistance-and-laws-of-resistance/http://www.electrical4u.com/electrical-resistance-and-laws-of-resistance/http://www.electrical4u.com/voltage-or-electric-potential-difference/http://www.electrical4u.com/electric-current-and-theory-of-electricity/http://www.electrical4u.com/electrical-resistance-and-laws-of-resistance/http://www.electrical4u.com/electrical-resistance-and-laws-of-resistance/http://www.electrical4u.com/types-of-resistor-carbon-composition-and-wire-wound-resistor/http://www.electrical4u.com/electrical-resistance-and-laws-of-resistance/http://www.electrical4u.com/electrical-resistance-and-laws-of-resistance/http://www.electrical4u.com/voltage-or-electric-potential-difference/http://www.electrical4u.com/electric-current-and-theory-of-electricity/http://www.electrical4u.com/electrical-resistance-and-laws-of-resistance/
  • 7/25/2019 ldr project repoert

    14/35

    !.$ W/r8-+( C/+1*

  • 7/25/2019 ldr project repoert

    15/35

    use an /rduino

    in place of the

    /07. /rduino

    sends the data

    received from the

    !01 matrix

    serially to the

    computer. 3/T!/4 is programmed to read that data and store it in a matrix. /fter the scanning

    process the image is displayed on the computer screen.

    !.E2**+%2 1-r1- %+ Pr//3

  • 7/25/2019 ldr project repoert

    16/35

  • 7/25/2019 ldr project repoert

    17/35

    -ow one can extend this circuit to a 3x- matrix #here in this project *$x*$ matrix have been

    used.

    W&3 U)-+( / D-/*) 4-& LDR

    0uring making this project firstly a matrix of !01 without 0iodes were made, when it was

    connected and run by the /rduino and 3/T!/4, no output was shown. Then after searching for

    the problem this was found that all the resistors in the matrix were being activated

    simultaneously as they were all connected to each other. 4ut for this project to properly only one

    !01 must be activated at instance. "o this problem was resolved by soldering a 0iode with each

    !01. /fter this when the multiplexing code was run, outputs were shown as expected.

  • 7/25/2019 ldr project repoert

    18/35

    CHAPTER: $ E;PERIMENTAL PROCEDURE

    The making of this project is divided into two parts i.e. ;ardware and "oftware. "oftware partsinclude the interfacing of /rduino with 3/T!/4 through

  • 7/25/2019 ldr project repoert

    19/35

    This support package helps to make an object in 3/T!/4 which will communicate with

    /rduino.

    S*

  • 7/25/2019 ldr project repoert

    20/35

    S/* %)-1 1/%+) -+ MATLAB

    121 It will clear the command window in 3/T!/4.

    C2*%r %22 It will clear all the variable in the workspace of 3/T!/4

    5*r/) It will create a matrix of zeros.

    "yntax pic N zeros#m,n

    It will create mxn matrix with all values $ and stores it in variable Mpic.

    C/%+) r*2%* / Ar-+/ /'*1

    These commands are case sensitive.

    %r-+/

    It creates a connection to unofficial #clone /rduino hardware on the specified port and

    enables users to operate /rduino through 3/T!/4 by this object.

    "yntax aN arduino #port, board=

    :xample

    aN arduino #Mcom8, Muno=

    This example command will connect to the /rduino

  • 7/25/2019 ldr project repoert

    21/35

    pin3ode#a,+,output=

    this will set the mode of the +rdpin as output.

    -(-%2Wr-*

    This will set the value of the digital pin as high or low i.e. * or $.

    "yntax

    digitalrite#a,pin,value=

    here value can be * or $.

    :xample

    digitalrite#a,*8,*=

    this will set the *8thpin as high.

    %+%2/(R*%

    This command will read the analog value that is present on the specified analog pin and

    and is mapped into $*$('. This commands returns the value so a variable must beneeded to store that value.

    "yntax

    KariableN analog1ead#a,pin=

    :xample

    KalN analog1ead#a,+=

    This will read a value from the third analog pin of the /rduino and store it to the variableval in 3/T!/4.

  • 7/25/2019 ldr project repoert

    22/35

    S/* %)-1 I%(* Pr/1*))-+( 1/%+) -+ %2%

    #to run these commands Image 6rocessing Toolbox must be installed in 3/T!/4

    %!(r%3

    It converts the matrix / to the intensity image I. The returned matrix I contains values inthe range $.$ #black to *.$ #full intensity or white.

    "yntax I N mat(gray#/

    -)&/4

    It displays the image I in a ;andle Lraphics figure, where I is a grayscale, 1L4

    #truecolor, or binary image. 9or binary images, imshow displays pixels with thevalue $ #zero as black and * as white

    "yntax imshow#I

    -//2

    It will display the image I in Image viewer app windows in which various functions are

    provided to make changes in the image.

    $.#.$ C/* A2(/r-&

    *. Interface the /rduino with 3/T!/4 by creating the /rduino object.

    !. 0efine all the pin modes of pins from (% to '8 as @outputA and set all the even pins asM* and all the odd pins as M$ between (% and '8 #here even pins are columns and odd

    pins are rows.

    $. 7onstruct a +0 zeros matrix of *$x*$x+$.

    . 9or kN*+ to (( repeat step 8

    7. "et the column pin#(Ok as M$ and for jN*+ to (( repeat step %.

  • 7/25/2019 ldr project repoert

    23/35

    6. "et the row pin#(OkP* as M* and read the analog value from analog pin#k*+ andstore it into +0 matrix.

    . 7onvert the +0 matrix to gray scale.

    ". 9inally display the image.

  • 7/25/2019 ldr project repoert

    24/35

    $.! H%r4%r*

    $.!.# H%r4%r* R*>-r* %+ &*-r *)1r-

  • 7/25/2019 ldr project repoert

    25/35

    6hotograph +.* /ll 6arts 1equired

  • 7/25/2019 ldr project repoert

    26/35

    $.!.! S/2*r-+(

    B%)-1 S/2*r-+( G-*

    *. 3ake sure soldering iron tip is clean and tinned with solder.

    (. ;eat the pad and component legs with tip of the iron simultaneously, be careful not to

    burn the printed circuit board or any plastic or insulation.

    +. hilst the iron is still in contact with the area, apply a small amount of solder to the

    join, hold the iron on until the solder flows properly.

    '. 7heck to make sure the solder joint is nice and shiny and that it does not bridge any

    connections.

    8. 7lean off the soldering iron and tin the tip, try to keep the tip well tinned with a nice

    shiny layer of solder at all times.

    S/2*r-+( T-

  • 7/25/2019 ldr project repoert

    27/35

    %.

  • 7/25/2019 ldr project repoert

    28/35

    +. /fter soldering the pins along a row, now solder the diodes to the other left pins of

    !01 that are still erect. #here I have soldered the diodes after placing them so that a

    single pixel acquires smallest area.

    '. -ow repeat the above steps for each row and you will leave with *$$ diodes pins

    erected in the back side of the !01 matrix.

    8. -ow start soldering column wise such that all the pins in a column are connected

    together.

    %. The final device after completing soldering will appear like the following images. The

    open ends are further connected to the bug strips in order to ease attachments.

    6hotograph +.' 9inished 0evice #9ront view

  • 7/25/2019 ldr project repoert

    29/35

    6hotograph +.8 9inished 0evice #4ack view

    $.$.$ T*)-+(

    Testing is the important part in making a hardware with correct connections. hilesoldering one must continuously check the consecutive connections by multimeter

    selected in buzzer mode. Test the circuit after soldering each row separately so that bugs

    can be found there only.

    $.$. Pr*1%-/+)

    2nly work in an environment that is well lit and ventilated.

    /lways unplug the soldering iron when it is unattended.

    4e careful to keep clothes, hair, power cables and skin etc. away from the soldering

    iron tip and the metal shaft.

  • 7/25/2019 ldr project repoert

    30/35

    4e careful when returning the iron to its stand, make sure it is secure and does not

    fall off.

    /lways handle the iron by the plastic handle.

    6oint the circuit away from yourself and others whilst trimming down component

    legs, and be careful of any sharp bits of metal whilst handling the circuit or

    components.

  • 7/25/2019 ldr project repoert

    31/35

    RESULT

    F-+%2 F%r-1%* H%r4%r*

    This is the final fabricated hardware of this project. 6hotograph '.* shows the !01 matrix

    connected with the /rduino 3ega (8%$ with connecting wires. There is a

  • 7/25/2019 ldr project repoert

    32/35

    I%(*) %8*+ r/ LDR C%*r% %+ *r%1* -+ MATLAB

    The images were taken by the !01 7amera and extracted in 3/T!/4. In testing of the

    finalized device, a finger was scrolled over the image sensor from left top corner to the left

    bottom corner and output images are shown as follows.

    9igure'.* #a 9igure '.* #b

    9igure '.* #c 9igure '.* #d

    !eft 4ottom!eft 4ottom

    !eft Top!eft Top

    !eft 4!eft 4

    !eft T!e

  • 7/25/2019 ldr project repoert

    33/35

    9igure

    '.* #e

    9igure

    '.* #f

    9igure '.* #a, #b, #c, #d, #e, #f are the output 3/T!/4 9igures that are captured by the !01

    camera.

    !eft 4ottom!eft 4ottom

    !eft Top!eft Top

  • 7/25/2019 ldr project repoert

    34/35

    CONCLUSION

    / simple nonconventional image sensor was fabricated using photoresistors and diodes on a

    puff board. The single pixel includes a !01 and 0iode in series. The image sensor consists of an

    array of *$ x *$ pixels and occupies an area of 5 x 5 cm(. The image sensor was designed and

    fabricated on a dotted 674. The clear *$ x *$ pixel grayscale image was viewed in result of this

    project. 9uture work of this project will be focused on the gestural input through !01 camera.

    ork will be carried on by first increasing its speed by making a hardwired chip and will try to

    reduce the power consumption of this project.

  • 7/25/2019 ldr project repoert

    35/35

    REFERENCES

    #. &