Shop OBEX P1 Docs P2 Docs Learn Events
Using IR sensors with BS2 — Parallax Forums

Using IR sensors with BS2

Sean BarnesSean Barnes Posts: 6
edited 2006-08-22 16:30 in BASIC Stamp
I am working on a project that I need some help with. I am trying to use an IR break-beam circuit to detect when a fruit fly moves across the beam.

Here are some details:
1) The fly is confined to a glass tube within which it will walk back and forth. The tube is not large enough for it to fly.

2) I do not expect the fly to completly break the IR beam but rather "cast a shadow" that can be sensed.

3) I set up the circuit and code similar to what's demonstrated in TestPhotoresistor.bs2 from "What's a Microcontroller", Chp 7.

4) In place of the photoresistor I have an IR detector with a visible light filter (Siemens #SFH205).

5) The IR emitter is from RadioShack, #276-142.

6) When I run the program, the RC Time reading in the Debug terminal remains at 00001 whether something is breaking the beam or not.

If anyone can help me make this work I would be grateful. Thanks.

Sean

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-08-20 18:41
    Fruit fly, pretty small.· IR-emitter's emission area, pretty big (comparably).· There's no beam, as such,; the fruit fly doesn't present enough area to block with, I figure.· An I-R detector is a binary situation (on or off.)·

    You'll have to use an I-R photo-transistor, with it you may find that the fruit fly presents enough area to result a measurable change in the photo-transistor's collector current.1· You'll want to use the least I-R emission ("intensity") possible.· Then you could use a comparator to·trigger a count/event·(i.e. VCE > x = nothing; VCE < x = fruit fly presence.)

    Post Edit -- 1 This will be a subtle variation, requiring some experimentation.

    Any chance the fruit flies might avoid I-R (and try to walk backward)?· Like, "Hey, what's that? ·Well, No Way!"

    Post Edited (PJ Allen) : 8/20/2006 10:16:36 PM GMT
  • willthiswork89willthiswork89 Posts: 359
    edited 2006-08-20 22:58
    Ive thought about doing a fly catching experiment, never though about how to build it though because you could only catch one or the others would fly out.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    -Learn somthing about everything, and Everthing about somthing-
  • Sean BarnesSean Barnes Posts: 6
    edited 2006-08-20 23:01
    PJ Allen,

    Thanks. I need to ask what the difference is between a detector and a photo-transistor?

    As for the fly's sensitivity to IR. IR is used often in fly behavioral monitoring. Research has not uncovered any indication that it affects the fly or that the fly even notices it.

    Sean
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-08-21 00:01
    OK...

    ··An I-R·photo-transistor will/can result an output in proportion to (or as a function of) the incident intensity (irradiance) from an I-R source --·an analog (or variable voltage/current) output.

    · An I-R·detector/sensor will turn on/off with the presence or absence of an I-R signal/source (all you can know is that there's enough to turn it on or not enough and it's off.)

    · The fruit-fly probably cannot block the I-R source (IRED).· But, now I'm thinking, that maybe you can place the I-R emitter behind a pin-hole that the fruit-fly might be able to block.· Whether enough I-R would get through such a hole to make a difference with a sensor is another matter.· Only experimentation·will tell.
  • AmaralAmaral Posts: 176
    edited 2006-08-21 02:29
    Well , I don't really understood what you are trying to build. if you could make an sketch would be easier. But I thing you are just trying to detect if a bug pass thru a hole, Photoresistor works great for that, you can even set the output to logical level with a transistor and a resistor , but is this sensitive to IR light ? check that before going on .

    Amaral
  • DaveGDaveG Posts: 84
    edited 2006-08-21 03:19
    Sean,

    What is the OD and ID of the glass tube? How thick is the body of the fly?
    What is the slowest and fastest rate that the fly will travel down the tube, in Inch/Sec?
    Thanks

    DaveG
  • T ChapT Chap Posts: 4,223
    edited 2006-08-21 04:19
    If you were to do as suggested and put a pin hole(.01 - .06 inches) in a piece of material, and press it against the glass tube, then, on the other side, mount a photodiode as shown below. Seal the entire area with black epoxy or caulking material to block as much external light as possible. Then, get a comparator, an LM339 for example, use a trim pot for a threshold and you should be able to find a level that works. The photodiode mentioned here will output 0 - 5 volts linearly with IR or incandescent light. Make sure all room light is masked from the photo diode. The diode sensor is on one of the flat sides in the center, use flashlight when you get the circuit running to determine which side to use. For greater sensitivity use a larger resistor on the diode.

    Photodiode:

    http://www.allelectronics.com/cgi-bin/item/PD-2/205/PHOTO_DIODE_.html

    Post Edited (originator99) : 8/21/2006 4:28:24 AM GMT
    363 x 302 - 15K
  • T ChapT Chap Posts: 4,223
    edited 2006-08-21 04:23
    Also here is a simpler schematic I got to work, I may in fact have the diode shown in reverse but if you get this far then switch it if doesn't work. You don't need the 10k either. Try this first. I don't have a photo diode in my library so an led is shown.
    352 x 227 - 11K
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2006-08-21 05:11
    Sean Barnes,

    If you modulate the IR and allow yourself to adjust the attenuation of the IR output either mechanical (pin-hole) or electrical (intensity).
    With a tuned LC on the receiver that matches the same frequency as the IR transmitters frequency, you can REALLY (100's of times)
    magnify the ability to detect something in-between the IR transmitter and IR receiver.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 8/21/2006 5:39:20 AM GMT
    1273 x 627 - 164K
  • T ChapT Chap Posts: 4,223
    edited 2006-08-21 06:54
    A long shot that would be very easy to set up:

    Get the Qprox sensor chip, hook up a small metal plate that sits under the tube, the thicker the better for the metal plate, try various caps to see if one will capture the fly. I have tried experiments with these chips with a metal plate and the right value cap, it will sense my hand at 6 inches away from it, so you may get it to sense the fly with the right cap.

    http://www.parallax.com/detail.asp?product_id=604-00038

    The thicker the plate, the more sensitive. This chip gives a High out when ot senses something.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-08-21 15:34
    willthiswork89 said...
    Ive thought about doing a fly catching experiment, never though about how to build it though because you could only catch one or the others would fly out.
    Funny you should mention this...Saw it at a Science Fair in Albany, NY.· I think the guy used ultrasound to detect a fly entering an aperture, and then he used venturi effect to draw the insect into a chamber with a screen.· Additional flies entering would open the valve and start the air flow, which would keep any previously captured flies from escaping.· The name of this project was quite appropriate too, although I can't remember the name.· It was something like, "Franestein's Fly Trap" or something.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Sean BarnesSean Barnes Posts: 6
    edited 2006-08-22 16:30
    Thanks to everyone for the help.

    Sean
Sign In or Register to comment.