Shop OBEX P1 Docs P2 Docs Learn Events
Photodiode, High speed count — Parallax Forums

Photodiode, High speed count

???O? ???????O? ???? Posts: 18
edited 2009-06-08 03:16 in Accessories
I am very new to Stamps, mine is in the mail, but·I have been reading code and reading these forums for about 2 years now. I cant seem to find any information on photodiodes to do what i need.
·
I am considering using a laser diode and photo diode to send and receive a signal. The laser will reflect of a nut spinning approx 80,000 RPM (highest worse case).·The·fiber optic will then send the·signal to the photo diode mounted on the board.· I currently have an "ebay" laser. I believe 5 mW 5volt· 550?(red) wavelength.·
·
Here is my question.·Can the·photodiode be hooked directly to the stamp pin, or is auxiliary circuit·required?·This auxiliary circuit, does it have the ability to adjust the voltage to the stamp to make sure that the photo diode only sees a full reflection of light and not just a partial fraction of light. Basically, as the nut rotates it gives less and less light to the diode, until it reaches a theoretical “0” being the corner of the nut. In real world, there is still a partial fragment of that will reflect off the less than perfect nut.· I would like to cut off this none full output to prevent erroneous results.·
·
I don’t want to use infrared.·
·Is a hall sensor a better option in this case?
·
I apologize if I sound half baked, this is the one area I cant seem to find what I need.
·
Thank you,

DP
(ΜΟΛΩΝ ΛΑΒ&#917[noparse];)[/noparse]

Comments

  • kwinnkwinn Posts: 8,697
    edited 2009-05-31 05:11
    ΜΟΛΩΝ ΛΑΒΕ, I doubt very much that the photodiode can be connected directly to the prop pin, even using a high resistance pull up resistor.

    I am going to assume that you are using a hex nut, so you will have 6 reflective surfaces. At 80,000 RPM that would produce an output signal with a frequency of 8,000 Hz. A photo diode produces a relatively small signal when light falls on it, and will probably need to be amplified and converted to a logjc level pulse to be counted. At such a low frequency almost any op amp that operates from a single supply should work.

    You may also find that a red led and phototransistor would also work, and that the phototransistor is sensitive enough that it could be hooked directly to the prop pin with only the pull up resistor being required.

    In either case the mounting and alignment of the source/emitter and the reflectivity of the nut will be the most critical factors.
  • ???O? ???????O? ???? Posts: 18
    edited 2009-05-31 05:21
    Thank you kwinn,

    It was my understanding that a phototransitor would not work due to the speed involved. That is why I was planning to use a diode. Athought i would be happy to use if it fits my application.

    You would be correct on the hex nut 6 side. 8000hz

    Would I use an op amp circuit similar to what is used with the infra red circuits?
  • LeonLeon Posts: 7,620
    edited 2009-05-31 05:24
    Why don't you want to use IR? A reflective opto switch should cope with your requirements.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle

    Post Edited (Leon) : 5/31/2009 5:36:02 AM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-05-31 07:30
    A phototransistor will work fine at these speeds if you connect it through a common base transistor buffer. This will keep the voltage across the phototransistor constant, thus limiting the Miller effect lag that plagues most simple phototransistor circuits. The main downside to this is the requirement for a multi-voltage supply.

    -Phil
  • kwinnkwinn Posts: 8,697
    edited 2009-05-31 15:43
    I think Leon and Phil are both correct in what they state. Most phototransistor circuits will work in and somewhat beyond the audio frequency range. The op amp circuit similar to that used in IR circuits should be fine as long as it is not one that includes a filter for a specific frequency (usually 38KHz). I have also found that a peak detection type of circuit with a small amount of positive feedback works very well at cleaning up the signal if needed.
  • ???O? ???????O? ???? Posts: 18
    edited 2009-05-31 17:13
    Phil Pilgrim (PhiPi) said...
    A phototransistor will work fine at these speeds if you connect it through a common base transistor buffer. This will keep the voltage across the phototransistor constant, thus limiting the Miller effect lag that plagues most simple phototransistor circuits. The main downside to this is the requirement for a multi-voltage supply.

    -Phil

    · Do you have a resource avaliable that I may look at? I would like to look at this more....

    ··Can you elaborate on the multi-voltage supply? what are the requirments for the circuit?

    Leon said...
    Why don't you want to use IR? A reflective opto switch should cope with your requirements.

    Leon

    I have a paranoia for things·I cant see. I actually have no real reason.

    I have seen most of the people doing exactly what i am doing, and just assumed do the same. I am trying to not to reinvent the wheel, as I have very little background in electronics. I may try opto switch.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    DP
    (ΜΟΛΩΝ ΛΑΒ&#917[noparse];)[/noparse]
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-05-31 18:46
    Here's a circuit I've used successfully a 20KHz with an optoisolator:

    attachment.php?attachmentid=61262

    The voltage across the phototransistor will be a constant 6.4V, which keeps the Miller capacitance from having to charge and discharge with varying current. The divider values and ratio will depend on your app.

    -Phil

    Post Edited (Phil Pilgrim (PhiPi)) : 5/31/2009 7:47:29 PM GMT
    306 x 280 - 1K
  • LeonLeon Posts: 7,620
    edited 2009-06-02 15:41
    I have had problems with noise giving false counts with an opto-switch. It could have been fixed in software, but I used a 74HC14 to clean the signal up.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • ???O? ???????O? ???? Posts: 18
    edited 2009-06-02 15:46
    Phil, Thank you for the picture. I am about to show you the extent of my knowledge....

    Left to right

    Componets are as follows

    phototransistor, (npn device?) , two resistors (approx value?),·(logic symbol?), where is the optioisolator? I am still a little confused on the circuit. what gives me the ablity to adjust the cutoff point at which light will no longer act as a signal? The resistor value before the junction? I want to make sure i have a definitive on, off, for my count.

    There may be a few mechanical options i can take such as painting the nut black and "shinning" up the flat spots. But I am trying to gather knowledge on the electrical side.

    If you have any more specs on the exact parts used in the circuit above i would really appreciate it.

    Thanks again,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    DP
    (ΜΟΛΩΝ ΛΑΒ&#917[noparse];)[/noparse]

    Post Edited (ΜΟΛΩΝ ΛΑΒ&#917[noparse];)[/noparse] : 6/2/2009 3:51:56 PM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-06-02 16:07
    An optoisolator is just an LED/phototransistor combination. What works for an optoisolator will also work with a phototransistor. My schematic just shows a phototransistor, which is what you would use. The discrete transistor can be any general-purpose PNP, such as a 2N3906, 2N2907, etc. The resistor values have to be determined by experiment. They will depend both on the average photocurrent from the phototransistor, as well as on its range; so there's no way to predict ahead of time what the values should be. The logic symbol is a Schmitt-triggered buffer, which is used to eliminate noise. Leon suggested a 74HC14, which would be perfect in this position.

    -Phil
  • CounterRotatingPropsCounterRotatingProps Posts: 1,132
    edited 2009-06-02 19:03
    "·use optics for data transmission "

    EDIT: moved to new thread, see below... thanks



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    No matter how much you push the envelope, it'll still be stationery.

    Post Edited (CounterRotatingProps) : 6/2/2009 8:36:23 PM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-06-02 20:00
    H,

    I think that topic should be started in a new thread. Short answer: at those speeds, a photodiode would be a more appropriate receiver.

    -Phil
  • CounterRotatingPropsCounterRotatingProps Posts: 1,132
    edited 2009-06-02 20:27
    OK - thanks Phil ... I've moved·it to:

    http://forums.parallax.com/showthread.php?p=812304

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    No matter how much you push the envelope, it'll still be stationery.

    Post Edited (CounterRotatingProps) : 6/2/2009 8:35:17 PM GMT
  • ???O? ???????O? ???? Posts: 18
    edited 2009-06-05 22:58
    I have ordered the parts for your diagram Phil. I will give it a try this next week.·I also ordered a couple of trimmers to fine tune the resistance.

    One question i do have, i was reading the process controll pdf, and came across the tach diagram.

    will this work for my application? Is it still nessicary to clean up the signal w/ a 74HC14?

    I have attached the ciruit from the parallax PC manual.

    Would this ciruit work if i simply replaced the emitter and reciever to something matched to my wavelength.

    It appears there are more "matched" sets for sale in the IR range. I am going to give these a shot as well two. I just want to make sure i have an accurate signal before i procede.

    Thanks,


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    DP
    (ΜΟΛΩΝ ΛΑΒ&#917[noparse];)[/noparse]
  • ???O? ???????O? ???? Posts: 18
    edited 2009-06-08 03:16
    So....I was able to hook up the circuit shown in my previous post. Using a match set of IR emitter, and phototransistor.

    Having a couple of problems.

    First i had to switch the transistor to long leg vss and short leg vdd to get any data. There is no flat marking denoting cathode. This seems backwords, but maybe not?

    Anyway, then·I had to increase the resistance to Rc to 10.2kΩ, to get data.

    Now when i say data, i mean i was getting results, not good results. I was getting an average of 62 with a range from 52 to 74, with a mode of 64.

    The emmiter hooked to vdd not a pin.

    HIGH 9······························· 'red led on
    COUNT 8,300, tach1··········· ' count pin 8
    DEBUG DEC tach1················
    LOW 9
    ······························· 'red led off

    I am holding the reciever over the emmiter by hand. but the emiiter is stationary.

    the red led in the program is just an led on the board to tell me the count is in session.

    Why am i getting these values? where have i gone wrong?




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    DP
    (ΜΟΛΩΝ ΛΑΒ&#917[noparse];)[/noparse]

    Post Edited (ΜΟΛΩΝ ΛΑΒ&#917[noparse];)[/noparse] : 6/8/2009 3:22:19 AM GMT
Sign In or Register to comment.