Shop OBEX P1 Docs P2 Docs Learn Events
responce of a BS2 or B2p on a photocell changing its status — Parallax Forums

responce of a BS2 or B2p on a photocell changing its status

aridaiosaridaios Posts: 57
edited 2004-10-18 22:45 in BASIC Stamp
Hello friends,

I am wondering how fast a BS2 or BS2p could understand
that a photocell connected to one of its I/O pins has received a shot
from a rotating laser.
This is a fast phainomenon. I assume that the laser would have 300 prm
and the photocell would be aproximately 30meters away from the laser.
Any ideas?

Michael

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-10-17 12:36
    Well, you certainly don't want to use a photocell -- they are slow responders. If you use a phototransistor you'll get better results, and you could use the BASIC Stamp COUNT function to determine the rate. My boss and I created a speedo for his mill that measures up to 7500 rpm with a stock BS2; 300 rpm will be no problem.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • aridaiosaridaios Posts: 57
    edited 2004-10-17 13:12
    Dear Jon,

    at your project probably you used a laser and a phototransistor at close range.
    Do you think that the time the rotational laser with 300rpm will light the phototransistor which is 30meters away is long enough to triger it?

    Michael
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2004-10-17 13:19
    Jon, I wonder:

    If you rotate a laser at 300 rpm, or 5 cycles per second,

    then the distance travelled at 30 meters equals

    2 * pi * 30 = 188.4 m travelled in one cycle.

    So the speed of the rotating 'end' of the laser beam is

    188.4 * 5 = 942 m/s.

    Assuming the sensor has a 1 cm wide surfuce,

    this sensor will be illumunated for approx.

    0.01 / 942 = 10.6 us.

    Is the stamp capable of detecting that small pulses?

    The further away the rotating laser is from the sensor,

    the smaller the width of the sensor, or the higher the

    rotation speed of the laser, the width of the pulse

    will be smaller. Or did I misinterpret the setup?

    regards peter
  • aridaiosaridaios Posts: 57
    edited 2004-10-17 13:52
    Peter you are right if we suppose that the phototransistor is 1cm wide. It has probably less than 0,5cm of width.
    The problem is even worst.

    regards
    Michael
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-10-17 14:29
    We actually used a magnetic (Hall effect) sensor on the mill speedo project -- your question was whether the BASIC Stamp was fast enough to handle 300 RPM. The answer is a solid "Yes."

    As for gathering light, you may need some kind of lens to gather and focus your laser light onto the sensor so that you get it to trigger properly.· Perhaps you can increase the sensitiving of your receiver by taking the optotransistor output into a comparitor -- that will let you adjust the trigger threshold for the light you have.· It's likely that you're going to need a fairly sensitive setup, so you should shield your receving end carefully.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-10-17 14:33
    The COUNT function can detect pulses as narrow as 4.16 uS (when using a stock BS2).· Using a BS2p you can get down to 1.2 uS with COUNT.
    Peter Verkaik said...

    Jon, I wonder:

    <snip>

    Assuming the sensor has a 1 cm wide surfuce, this sensor will be illumunated for approx.

    0.01 / 942 = 10.6 us.

    Is the stamp capable of detecting that small pulses?

    <snip>

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2004-10-17 14:49
    The pulsin command may be better in this case

    10 us pulse once every 0.2 seconds.

    The bs2p detects as small as 0.75 us. Cool.

    regards peter

    Quick Facts

    attachment.php?attachmentid=73629
    505 x 121 - 6K
  • DaveGDaveG Posts: 84
    edited 2004-10-17 17:09
    I suspect that the pulse width from the photodetector will be somewhat longer than 10.6us because
    of the divergence of the laser beam. I suggest that you measure the size of the laser spot at 30 meters and
    factor this additional illumination time into the pulse-width calculation.

    I would also suggest using a PIN photodiode because of its fast response time. Most phototransistors are
    too slow for your application.

    Dave
  • aridaiosaridaios Posts: 57
    edited 2004-10-17 19:00
    Does anyone have any links for information on PIN photodiodes?
    Where can I buy them?

    Michael
  • Tracy AllenTracy Allen Posts: 6,657
    edited 2004-10-18 01:32
    Digikey has PIN photodiodes, for example, Panasonic PN334 with 2 nanosecond on/off time. That is a lot faster than the Stamp can respond. For the Applied Sensors text, we used the PDB-V113 from Photonic Detectors. It is a large area (not PIN) photodiode with a response time under 1 microsecond. Large area means more response for a given amount of light, but also a larger capacitance. To get the fast response, you have to put the photodiode in a transconductance or cascode circuit that avoids a voltage swing across the diode.

    I'm not sure what you want the Stamp to do once it receives the "shot" from the laser. In addition to the COUNT and PULSIN commands that others have mentioned, you might look at the POLLWAIT 8 command on the BS2p. The Stamp sits there waiting indefinitely for an input on a selected pin, and as soon as that input occurs, the program continues with execution of the instruction after the POLLWAIT 8. It lets you sychronize a segment of code with an external input.

    The manual does not say exactly how short the pulse can be, but my guess is ~1 microsecond; that the "response time" of 160 microseconds stated in the manual has more to do with the interpretation of the next instruction than it does with the detection of the input pulse.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • DaveGDaveG Posts: 84
    edited 2004-10-18 02:41
    Michael,

    What is the type and model number of the laser you are using? Do you have any specifications on the output power or
    beam divergence angle? These specs would be helpful in selecting a suitable photodetector.
    Will the laser and photodetector be used outside? Outdoor applications usually require special considerations to reduce the
    effect of sunlight, such as using filters and sunshades.

    Dave
  • aridaiosaridaios Posts: 57
    edited 2004-10-18 06:17
    Dear Dave,

    My application is an outdoor.

    I am planning to buy a rotational laser lets say Topcon http://www.topconlaser.com/hardware/RLH1Sa.html·or http://www.topconlaser.com/hardware/RLH2Sa.html·or http://www.topconlaser.com/hardware/RLH3CS.html.

    Firstly I·want to build·my custom laser sensor based on a BStamp which I am going to use for controlling

    simple, custom made earthmoving equipment·. For solving of hardware and software problems of the sensor

    I am using a laser diode (class 2, 600nm, <1mW) in a range or 5m (beam diameter 6.5mm).

    michael
  • DaveGDaveG Posts: 84
    edited 2004-10-18 22:45
    Michael,

    Since you are going to buy a Topcon laser, you might consider buying one of their matching receivers and
    using its optics and detector.

    Dave G
Sign In or Register to comment.