1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Electronics request for help with IR beam break sensors - if poss :)

Discussion in 'Modding' started by Tactus, 30 Sep 2007.

  1. Tactus

    Tactus What's a Dremel?

    Joined:
    30 Sep 2007
    Posts:
    6
    Likes Received:
    0
    Hi guys/gals,

    I am currently researching into beam break sensors and its hard to find much useful information on the net :wallbash:, not too sure if ive been looking at the right stuff and i was wondering if any of you folks have could help point me in the right direction, thanks. :)
     
  2. Cinnander

    Cinnander What's a Dremel?

    Joined:
    19 Apr 2007
    Posts:
    393
    Likes Received:
    2
    Was there anything in particular you wanted to know? If you're looking at setting one up yourself, *afaik* Maplin used to stock something which you could put across, eg, a door frame, if you don't mind not building it yourself (though you may have to solder that together).

    Pre-edit: seems they still do: linkies
     
  3. DougEdey

    DougEdey I pwn all your storage

    Joined:
    5 Jul 2005
    Posts:
    13,933
    Likes Received:
    33
    Yup, It's a velleman kit. Not sure where you are but they are easily obtainable in most countries, very easy to use and you don't need high end soldering equipment. I've used a few to turn on PCs, they are simple.
     
  4. Tactus

    Tactus What's a Dremel?

    Joined:
    30 Sep 2007
    Posts:
    6
    Likes Received:
    0
    Well, i'm building it from scratch, as part of a larger circuit.

    Basically looking at having 2 infra red LED's on one side of the door and 2 photodiodes on the other side, wondering if anyone knows if its possible to get IR LED's that are on different wavelengths of IR (with the corresponding photodiodes) so they don’t interfere with one another.

    The idea being that the overall system it will be part of will be able to tell in which direction a person is going depending on the order in which the beams are broken. - thanks but maplins was the first site i checked, LED wise i wasn’t too sure about how focused the LED's were (some having a wider transmission angle than others) the backup plan if we cant get different LED's for each beam we're planning on a quick fix to focus the LED's (put a small tube around each LED/photodiode) not only to reduce the spread but to limit the amount of interference (the LED/photodiode would be pointing at each other).

    so im wondering if anyone can shed some light on the subject of IR LED's with reguards to different wavelengths/focus charachteristics and where is the best place to find them - afaik we're not allowed to use lasers :p

    Bare in mind this is just the research stage of the project, so havnt quite decided on the best method :p


    Thanks :)
     
    Last edited: 1 Oct 2007
  5. Cinnander

    Cinnander What's a Dremel?

    Joined:
    19 Apr 2007
    Posts:
    393
    Likes Received:
    2
    IR (and UV, for that matter) LEDs spread wise look the same as other LEDs - so to prevent interference as you said sticking both ends in a short tube might help.
    You'll get interference from TV remotes etc whatever you do - that is, at least, that your photodiodes will pick them up. If you "send" a signal (e.g. flash the LEDs) then perhaps you could filter out extraneous IR but why make it complex :p
    If you buffer (op-amp) then integrate (resistor then op-amp [and yes, this is my solution to everything]) the output from your photodiodes (individually), then you will have a "high" voltage across a capacitor, in which a small dimple will appear when the beam is broken. You could then use a comparator to detect when the voltage drops below a certain point to signal that the beam was broken.
    If you do that for both "channels", then you can see which comparator fires first to tell the direction (it's too early for me to think how you might do that at the moment :D). This will then be immune to outside IR (unless someone shines a tv remote into the detector while walking through it).
    Does that make sense? I can explain it better (with pretty diagrams and so on) if you wish
     
  6. mvagusta

    mvagusta Did a skid that went for two weeks.

    Joined:
    24 Dec 2006
    Posts:
    4,639
    Likes Received:
    523
    1 vote here for circuit diagrams! i'd like to learn more about op-amps & using ir diodes, and i'm sure many other members & visitors would also :thumb:
     
  7. jakenbake

    jakenbake full duplex

    Joined:
    5 Jun 2005
    Posts:
    495
    Likes Received:
    3
    ew. analog. get a PIC u-controller. :lol:
     
  8. Tactus

    Tactus What's a Dremel?

    Joined:
    30 Sep 2007
    Posts:
    6
    Likes Received:
    0
    Thanks Cinnander, yeh sounds good if u got any quick diagrams to throw in sure :) that sounds good. For the sensor circuit that seems good as with a low output when the beam is broken it wud allow the controll part of the circuit to then count it.

    Thanks jakenbake ill do some research into the PIC u-controller afaik that would be a nice controller to feed into with what cinnander suggested.

    I'm also wondering wether to have the IR diode pulsed or "always on" to help with each photodiode expecting a diff pulse.

    Thanks alot to both of you helping alot on my research :)
     
  9. Cinnander

    Cinnander What's a Dremel?

    Joined:
    19 Apr 2007
    Posts:
    393
    Likes Received:
    2
    Yup as jake said you could go the digital route too if you have no problem programming micros -- you could use a PIC or a ATTiny or something (ATTiny13 is an 8-pin thingy (same as a 741 op-amp or 555) you can program with C or assembler. I don't have experience with these so he'd probably be better equipped to tell you what you'd need to do program wise.
    I'll do you some pictures of the analogue method and upload them later today -- first I need more coffee and luch :D (9 o'clock lectures should be banned).
    Oh just another thought, if you use a micro-controller on each side you could flash the LEDs in some pattern which the other end is set to look for, which might help with interference from outside sources.
     
    Last edited: 2 Oct 2007
  10. jakenbake

    jakenbake full duplex

    Joined:
    5 Jun 2005
    Posts:
    495
    Likes Received:
    3
    if you have the tools, using a PIC is pretty easy. You would need a programmer/dev board of some sort if you've never used a PIC before. If this is a school project, which it kinda sounds like it is, then I would assume there would be these things laying around in a lab somewhere.

    You can program a PIC in C or Assembly, I (personally) like assembly more.

    In all honesty, you could incorporate Cinnander's analog idea into a PIC and do less programming, but more outside IC's.

    Now, knowing nothing about IR leds, couldn't you do two different frequencies? maybe IR just rides on one frequency... i'm not sure

    how would you be able to tell the difference between a pulse and when someone walked thru?
     
  11. cpemma

    cpemma Ecky thump

    Joined:
    27 Nov 2001
    Posts:
    12,328
    Likes Received:
    55
    High frequency pulsing. You're better off transmitting a pulse train code, just as a remote does. More resistant to outside interference. There are plenty of transmit/receive chips around, Holtec make a common series.
     
  12. jakenbake

    jakenbake full duplex

    Joined:
    5 Jun 2005
    Posts:
    495
    Likes Received:
    3
    well i can run pretty fast... ;) haha, juuuuuuuuuust kidding

    edit: oh, and i think you mean holtek? i was just looking around and couldn't find anything on holte'c'
     
  13. Cinnander

    Cinnander What's a Dremel?

    Joined:
    19 Apr 2007
    Posts:
    393
    Likes Received:
    2
    Righto, as promised. For your approval I humbly submit the old fashioned style analogue method :D

    Pic (Ignore the pin numbers)
    Pic2
    What you are looking at here is a bunch of op-amps (4) and a handful of other passive components.
    Initially, the signal from your photodiode/phototransistor (Point A) is set into an op-amp which is configured as a non-inverting amplifier with a gain of about 5.5. This just means the output is the input voltage times 5 (up to the limit of 9V, or ~7V with a realistic op-amp). This gain is to account for the non-linear characteristics of the photo-whatsit (and so the gain may need to be adjusted by tweaking R2 and R3. Gain = [R2/R3]+1. Ambient light may also require this to be changed). This means it only takes a little bit of IR shining on the receiver to give this op-amp "full" output, at Point B.
    Next, is a comparator. This is a configuration who's output is 'on' if one input (+) is greater than the other(-), off otherwise. This is really only there to take the amplified yet still *analogue* signal (i.e. it could still be anywhere in the middle, despite the amplifier making the sensitivity great) and to turn it into a on/off signal. Essentially the two 22k resistors provide the -IN pin with 4.5V, and the output of this op-amp will be high when the output from the proceeding stage (+IN) was >4.5V.
    The 10k resistor, 10uF cap and the next op-amp form an integrator with a fairly short charge/discharge time. Again this may need to be tweaked -- bigger values = slower, for both R and C components. "Slower" in this case equates to better rejection of flickering light levels/IR interference, etc. however it means that the sensor won't pick up fast moving objects going through the beam as well (it will take a while to react, sort of thing). The output of the integrator is taken at Point C, and will be a rising or falling voltage (until it hits a rail) depending on the state of the input signal.
    Finally, another comparator, this time we compare the integrated signal (Point C) with a reference (Point D). This is adjustable which allows you to modify the sensitivity of the thing a bit.
    The output, at Point E, is either a high/low voltage depending on what the circuit makes of your input signal. In this case, the LED will light when something blocks the beam (Blocked beam => Low input to amplifier => Low output => Comparator 'off' => Integrator discharge(s) => Comparator 2 goes 'on' when integrated voltage falls below the reference, D), and turn off when the beam is unobstructed. (Open beam => high input to amplifier => high(er) output => comparator 'on' => integrator charge(s) => comparator 2 goes 'on' when integrated voltages rises above reference).
    The beauty of this is that if you use an LM324 Quad Op-Amp chip (14pin DIL) you only need 8 external components (7 Resistors, 1 Cap) plus whatever your 'output' device is (LED etc).
    I quickly sim'd it with Crocodile Physics (woot), which is where that graph comes from, and this needs some explanation. Red = Output from integrator (Point C), Blue = Reference voltage for final comparator (point D), Green = Output from whole circuit (Point E). As you can see, when something briefly affects the input the integrator discharges quickly, at which point the comparator is triggered because it's (+) input (red) is no longer above it's (-) input (blue line). The trick is to adjust the values of R6, C1 and R7 until you get it sensitive enough :D The idea is, ambient noise/interference wont drop the red line below the blue one.

    If that's too complex, you can just stick with the first two op-amps (i.e. take your output from before R6), which will work but be a bit more sensitive to noise, etc.
    I'm sure this isn't perfect, and the PIC/AVR alternative might allow you to do more fancy signalling and such. Plus, practise programming micros :D (Physically, AVRs require a parrallel port connector, 5 resistors, and some wire to build a programmer, I'd imagine PICs are about as simple)
     
    Last edited: 2 Oct 2007
  14. mvagusta

    mvagusta Did a skid that went for two weeks.

    Joined:
    24 Dec 2006
    Posts:
    4,639
    Likes Received:
    523
    that's awesome cinnander :thumb: nicely explained aswell! so can i use this circuit for controlling a pair of ir send & recieve leds? I'd like to be able to make sensors that activate if you wave your hand infront of it. I think all i'd need to do is align the two irleds at an angle towards each other to align the distances of the "triangle", and experiment with sensitivity settings to suit: 1) the range between irleds & target distance/waving distance 2) to suit acceptable waving speeds & 3) to suit varying lighting conditions. What do you think?
     
  15. cpemma

    cpemma Ecky thump

    Joined:
    27 Nov 2001
    Posts:
    12,328
    Likes Received:
    55
    Have a look at Velleman's MK120 kit Cinnander linked, also simple analogue and very cheap (£7.99 @ Maplin).

    Possibly moddable to find the direction of travel. My idea there would one transmitter, two detector modules side-by-side so they're both in the beam, then something like the "quiz" circuit which sees who pressed their button first to separate ingoing from outgoing.

    http://www.velleman.be/downloads/files/schema/receiver.jpg

    http://www.velleman.be/downloads/files/schema/transmitter.jpg

    http://www.velleman.be/downloads/0/manual_mk120.pdf
     
  16. Cinnander

    Cinnander What's a Dremel?

    Joined:
    19 Apr 2007
    Posts:
    393
    Likes Received:
    2
    You mean a sort of proximity detector? Totally do-able, in fact, you can buy the LED/Photodiode "pre-made", Maplin used to sell them but don't appear to any more. Rapid do, though.
    If you want it normally off and to trigger when you put your hand near, you'd want to switch the phototransistor and the 22k resistor around (so it pulls up instead of down).

    edit: for the original problem, cpemma's method for determining direction of travel seems feasible too, or (I should imagine) you could do it with logic gates.
     
    Last edited: 3 Oct 2007
  17. mvagusta

    mvagusta Did a skid that went for two weeks.

    Joined:
    24 Dec 2006
    Posts:
    4,639
    Likes Received:
    523
    cool, thanks mate :D
     
  18. Tactus

    Tactus What's a Dremel?

    Joined:
    30 Sep 2007
    Posts:
    6
    Likes Received:
    0
    jakenbake
    cpemma
    cinnander

    Sorry I wasn’t able to access the inet for a couple days.

    jakenbake; Thanks for the input again, I believe the control circuit part will be a pic or at least that’s the general idea I’m given from my team mate doing that part of the system, he's currently trying to find out more information on it. It'll need to be able to add and subtract from the total amount of people in the room, and be able to turn the lights/appliances off when the number hits 0, also need to be able to not kill itself when somone magically appears in the room when the number is at 0 and walks out lol.

    cpemma; I'm going to look into pulsing some more but have to see where it goes, with the possibility of "always on" or pulsed depends on complexity of the circuit required and the laziness factor of myself. My team seem pretty adamant that they would be fine having the LED beam put through a tube (as its going to be directional anyway) also thanks for the link, ive been stuck for finding some transmitter circuits and wasn’t able to find a circuit diagram for basic models currently on the market. Yes that’s could be an easier way of doing it, 2 separate receivers but 1 transmitter, if they are directionally pointing at the transmitter sounds good though it depends on the beam width of the IR diode maybe?

    cinnander; don’t know what else to say but "wow" - thanks yeh I do get the explanation cause its pretty much covering parts of the theory ive done - now for me to do some maths time to get to grips more with it! lol - and yes that LM324 sounds great thanks a lot! :) if i can get to grips more with the basic circuit i'd deffo want to go play with that chip. This does fit in with the on off o/p signal I’m looking to be able to fit in with the PIC/control circuit of the system perfectly, if i have any questions mind if i bug you? :p


    Thanks again to u all^^
     
  19. Cinnander

    Cinnander What's a Dremel?

    Joined:
    19 Apr 2007
    Posts:
    393
    Likes Received:
    2
    No problem... as long as it's not about PIC specifics - looks like jake is your man there :p
    Though, it sounds like it might be easier to implement the counting and switching of lights and such with a pic (etc), so you might be able to cram everything into one pic and use that... with the option of my circuit used to clean up the input signal.
    An alternative to tubing/focusing the LEDs: you might be able to get IR laser-diodes which would be bigger but still you don't have to worry about cross talk... only problem is seeing the beam so that you can 'aim' them. (You could always mod a webcam :D)
    Again another alternative could be one IR and one UV LED/phototransistor, if you can find them.
     
  20. daveppeters

    daveppeters What's a Dremel?

    Joined:
    26 Oct 2003
    Posts:
    41
    Likes Received:
    0
    Why not put an LED on each side? - that way you've got them pointing opposite each other and don't need to worry about interference, wavelengths, etc. Something like this:

    IR LED --------------- Photodiode
    Photodiode ------------ IR LED

    As far as the electronics go, I know nothing about PIC's and such, but perhaps you could use something like this circuit: http://grandprix-race-central.com/modules.php?name=Downloads&d_op=getit&lid=4. It is an electronic finish line for a Pinewood Derby track, but it is designed to detect in what order things break the IR Beam. I'm sure it could be adapted to what you need, and it's a simple solution! :thumb:
     

Share This Page