Detect fast movement using photodiode


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Posts
    66

    Question Detect fast movement using photodiode

    I have used LDR and a LED to detect small objects moving across it ~ 1 cm.
    The object is 5mm x 5 mm.
    This design is useful to detect slow object.

    But I would like to detect very fast movement across LED and photodiode.

    However the output of a photodiode is analog. How do i go about interfacing this circuit to PIC16F877? To detect the photodiode input, I plan to enable PortB INTB interrupt so it will send a serial message to PC immediately. Is this circuit sufficient to detect fast movement or do I need IR or laser? The distance between tx and rx is ~1cm.

    Any suggestion is welcome.
    Last edited by Pic2008; - 21st November 2008 at 16:17.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    No need for analog.

    Tie the cathode of the photo diode to the PIC pin with a 10M ohm pull up. The anode of the photo diode to zero(ground). When no light is detected the PIC pin will go LOW.

    Used an IR diode for a dedicated light source.

    You will have to shield from ambient light to keep from having false readings.

    This is very similar to how a mouse works. Very fast and reliable.

    I have used this setup to detect parts moving in excess of 6 inches per second.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Aug 2008
    Posts
    66


    Did you find this post helpful? Yes | No

    Default

    That means I just connect the IR LED continously to 5V with series resistor , no need to modulate the IR Tx?

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pic2008 View Post
    That means I just connect the IR LED continously to 5V with series resistor , no need to modulate the IR Tx?
    Correct.
    As long as you do a little shielding for ambient light. Basically you can look at the modulation used in IR remote control applications as a way of electronically shielding.

    Ty it. Take a photodiode, put a piece of heat shrink or something else around it so only the end can receive light. Connect it to a meter instead of the PIC, have sitting in a shadow. Hit the end of the photodiode with IR or some other light source and test.

    You can also reverse the photodiode connection and have it detect light instead of dark.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Word on the street is: Use a PIC with Schmitt trigger inputs for better results. Better results due to Schmitt triggers hysteresis's gives input port a snap action, dampens analog effect.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Wink

    Quote Originally Posted by Joe S. View Post
    Word on the street is: Use a PIC with Schmitt trigger inputs for better results. Better results due to Schmitt triggers hysteresis's gives input port a snap action, dampens analog effect.

    Yesss Joe ...

    Much better, as comparators directly can generate the interrupt ...

    Over that I'd try to use a compensation stage to correct for ambiant light ... look at the attached scheme ... left side of Transistor T2.

    Alain
    Attached Images Attached Images  
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. Replies: 1
    Last Post: - 7th November 2007, 20:36
  2. Possible to detect I2C Device?
    By Squibcakes in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th March 2007, 10:13
  3. code conversion
    By saturnX in forum mel PIC BASIC
    Replies: 19
    Last Post: - 3rd October 2005, 17:17
  4. Detect baud rate
    By Dick M in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 2nd July 2005, 21:10
  5. A/D on 16F877. How fast can I go?
    By atomski in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 8th April 2004, 06:51

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts