Simple beam break sensor


Results 1 to 24 of 24

Threaded View

  1. #6
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default Well

    To start with I must say that the data sheets for these products are not that detailed.

    It seems to be a good match between the LED and the Receiver and that is a good start. Around 940 nm so this will not be a problem.

    Your big problem here is that you MUST modulate the LED with a 38kHz carrier frequency for the receiver to work. To make things even more difficult you can not just modulate it with 38k always, it has do be done in bursts. Please keep in mind that the PIC can only provide 25 mA current and that will not be enough for this to work well. You will need a mosfet or ULN 2001 or anything faster than a relay.

    Let me explain some more...
    In a better datasheet for a TSOP it will say the minimum number of carrier cycles for the receiver to decode the signal. 6-10 is a quite normal number. It will also say that a gap (off time) must be usually around 10-15 cycles between bursts.... and if any burst is longer than 70 cycles you will need a gap at least as long as the burst. VISHAY is a great place to find good datasheets.

    This is for the gismos and gadgets inside the TSOP to work.. if the carrier is always on the AGC will adjust the sensitivy lower and then you will not get any result. There are some new TSOP by Vishay (TSOP4038, TSOP58038 are specially made for light barrier systems)that can be modulated continously but I hardly think this one has that based on the date 2007 and the poor datasheet.


    If you want to use this one you must find a way to send bursts of 38kHz square wave to the LED and each of these bursts should probably be 10-70 cycles and followed by a gap where the LED is off for a time period similar to 15-20 cycles.

    The easiest way would require 2 pins on your PIC. One HPWM set up to 38k (manually) and the other pin connected to the receiver to check if the output pin goes low. Pros: Since you have modulated the LED and it is only turned on in short bursts you can drive it really hard. 300-500 mA would probably work depending of how often you send a burst. More current=more light= longer distance!

    If you only have one pin I would recommend you to use a AD or comparator input and read a LDR or PIN diode. In this case you can leave the LED on and check for a drop in the AD voltage when the beam is broken. Cons: The background light in the room can really influence the result. Indoor with a proper optical filter the ambient light should not be a problem when using IR. In this application a cheap laser pointer could probably work better than the LED since you will get a much higger mW/mm2 on the receiving end. But that would be harder to aim :-)

    As mentioned before... use lens, a normal magnifying lens in front of the LED and one more in front of the receiver helps alot if they are properly focused. This you can easily see if you try with a RED led, then you will see what happens when you move the lens in front of the LED.

    And if you go for a IR led solution get a optical filter. It sais that the TSOP has a built in filter but adding the dark piece of plastic Melanie suggested to "borrow" from a neighbour will help alot.
    Last edited by Jumper; - 24th July 2009 at 17:50.

Similar Threads

  1. Need a cheap touch sensor idea.. here it is
    By mister_e in forum Code Examples
    Replies: 20
    Last Post: - 16th April 2016, 23:42
  2. Ultrasonic distance sensor with PIC16F84A
    By MrRoboto in forum mel PIC BASIC
    Replies: 3
    Last Post: - 29th June 2009, 10:01
  3. PICBASIC PRO-coding for wireless sensor node
    By syazila in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 10th February 2009, 01:05
  4. Replies: 0
    Last Post: - 3rd February 2009, 00:23
  5. Replies: 6
    Last Post: - 18th January 2008, 09:17

Members who have read this thread : 0

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