speed of photodiode

I'm building a lap timer for our motocross track. The whole circuit will be signaled by a laser switch which is a laser diode shining onto a photodiode. This will give the signal for my arduino to start and stop timing etc. So I have a few concerns, firstly will the photodiode change its resistance when the laser light is taken away for a few split seconds. U can imagine if a bike comes flying past its going to block the light for a very short time.

I set up a basic circuit with a battery, an LED and a photodiode. I shine the laser on the photodiode and the LED glows brightly. When I take the laser away the LED dims but slowly. So I'm concerned when the bike rides past the signal of the trip circuit will not change at all? Any suggestions? Or am I missing something?

This may not be entirely relevant, but I built a ski timer which followed the same principles. I ended up using an infrared gate, the datasheet from the manufacturer specified the response time though. I ended up using this. I believe the response time was 10ms, so if you use speed = distance / time you should be able to find out the maximum speed that it will detect (distance being the width of a rider / length of a bike).
If I recall correctly, assuming a skier had a leg width of 15cm, the max speed was 15 m/s or about 50 km/h)

Speed shouldn't be a problem. Check the specs, and I'll bet the photodiode works at MHz rates. In fact you might have to slow it down, or take several readings in a row to make sure it doesn't get falsly triggered by a bird, or flying piece of dirt, etc.

I think we need to see a schematic... You've got a laser and a photodiode, so what's the LED got to do with it?

It probably will take some experimentation. You have to make sure the sensor is not turned-on by sunlight (or other light), but that it's always turned-on by the laser, and turned-off when the laser is blocked. At outdoor events, of course the lighting will change through the day.

And in a tough environment like this, you might want to have a 2nd redundant system running in parallel, or at least one or two people with stopwatches.

I set up a basic circuit with a battery, an LED and a photodiode. I shine the laser on the photodiode and the LED glows brightly. When I take the laser away the LED dims but slowly.

Then there's something wrong with that circuit, or you've overheated the photodiode,
expect switching times measured in microseconds. With the correct circuit using
reverse-biased photodiode you can go even faster.

Or are you using an LDR and calling it a photodiode? Photodiodes are usually
made of silicon (although an LED can be used as a photodiode)

An LED and a photodiode? What part number is that photodiode?

DVDdoug:
Speed shouldn't be a problem. Check the specs, and I'll bet the photodiode works at MHz rates. In fact you might have to slow it down, or take several readings in a row to make sure it doesn't get falsly triggered by a bird, or flying piece of dirt, etc.

I think we need to see a schematic... You've got a laser and a photodiode, so what's the LED got to do with it?

It probably will take some experimentation. You have to make sure the sensor is not turned-on by sunlight (or other light), but that it's always turned-on by the laser, and turned-off when the laser is blocked. At outdoor events, of course the lighting will change through the day.

And in a tough environment like this, you might want to have a 2nd redundant system running in parallel, or at least one or two people with stopwatches.

I just put the components in a basic circuit to see how it works and I realized that the reaction time was so slow. The part I'm using is a LDR 10k. So what's the difference between a photodiode and a LDR?

As for the circuit, the laser diode will be powered separately and will not be part of the circuit. The LDR will be connected to an analog pin and a 5v pin so when the laser light is blocked the 5v signal will drop and the analog pin will read the drop.

I've been reeding up on photodiodes, light dependent registers and phototransistors, and what I'm thinking is I should use a phototransistor?

Yes, LDRs are slow compared to photo diodes and transistors.

As DVDdoug pointed out, how do you intend overcoming the possibility of false triggers or missing triggers due to natural light which contains both visible and infra-red light?

You will need to place the photo detector in a tube painted black (pvc pipe is ok) so as to limit the detectors field of view.
Experiment with the diameter and length of the tube.
Simply using a laser (or other light source in the visible or infra-red spectrum) is not sufficient and you will have to modulate the laser with a carrier (similar to what is done with remote controls) then demodulate that carrier and use it's absence as your trigger.

UnoDueTre:
Yes, LDRs are slow compared to photo diodes and transistors.

As DVDdoug pointed out, how do you intend overcoming the possibility of false triggers or missing triggers due to natural light which contains both visible and infra-red light?

You will need to place the photo detector in a tube painted black (pvc pipe is ok) so as to limit the detectors field of view.
Experiment with the diameter and length of the tube.
Simply using a laser (or other light source in the visible or infra-red spectrum) is not sufficient and you will have to modulate the laser with a carrier (similar to what is done with remote controls) then demodulate that carrier and use it's absence as your trigger.

Thanx for your help, can you maybe just explain "in simple terms" why the laser light on its own won't work? I don't understand what u mean when you say modulate with a carrier? Sorry I'm new to this so please bare with me.

As for false triggers I'm not really concerned about that, what I would do is design the program to basically discard any trigger signals that are not close to average lap times. So if a lap takes 1minute and 20 seconds I would design the program to discard anything less than 1.30 and 1.10 so if a rider rides past and his arms and body triggers the system the program will take the first trigger and discard the second one

What will discarding triggers based on a timing window going to solve?
Optical interference from natural light is not limited to time, it has nothing to do with the "beam" being interrupted by a riders hand, foot, leg or any other part.

calvingloster:
.....can you maybe just explain "in simple terms" why the laser light on its own won't work? I don't understand what u mean when you say modulate with a carrier? Sorry I'm new to this so please bare with me.

OK, assuming visible light, your sensor is not going to know the difference between natural light (which contains a broad spectrum of colours) and the light from your laser.
To overcome that, you modulate a carrier onto the laser and in this way when you demodulate the carrier, you can tell if the light is indeed from your laser.
Think of it this way, you are giving your light source a unique "signature" to be able to identify it from all the other light.

As for the darkened tube, it gives your sensor a narrower field of vision so as to minimize unwanted natural light falling on it and desensitizing it.
Think of it this way, you are trying to look at an aircraft flying overhead but the sun is in the same position in the sky, your eyes will be completely swamped by the sun's light that there is no chance of spotting the aircraft.
An extreme example but I'm sure you get the point.
Since your laser is more like a point source, the narrower the field of vision of your sensor the better (within reason).

The reason the tube should be black is to minimize reflections within it.

Are you building a lap timer to work out speed or a lap counter to count 'the field'?
In my experience, some days you can have a lot of people 'fall down' and miss a lap or two
I think you will need to do some math and work out 'average' bike length?
Wouldn't you get multiple interupts from leading edge of front tyre, trailing edge, frame (including rider, etc), rear wheel; before you get next 'clean' signal when bike has past sensor?
Setting upon the slowest corner would also give any sensor more time to react, (rather than being fet up on the start finish straight)
Quickest and cheapest way to find out how fast MX bike is going is get a bicycle speedometer fitted to it :smiley:

crazypj:
In my experience, some days you can have a lot of people 'fall down' and miss a lap or two

Absolutely.

I think you will need to do some math and work out 'average' bike length?
Wouldn't you get multiple interupts from leading edge of front tyre, trailing edge, frame (including rider, etc), rear wheel; before you get next 'clean' signal when bike has past sensor?

Yes the OP would need to take into account the length of time the beam is broken which is related to the bikes length and speed.

UnoDueTre:
What will discarding triggers based on a timing window going to solve?
Optical interference from natural light is not limited to time, it has nothing to do with the "beam" being interrupted by a riders hand, foot, leg or any other part.

Well there is no issue in my understanding in the first place. False triggers can happen and that's kewl with me, if they happen out of the time range I specify they will do nothing to the timing process of the program.

@calvingloster

To further explain modulation, consider this simplification:

You have a red laser which is on all the time, so it's like having a continuous stream of a optical source or carrier.
A carrier is the frequency at which the energy is "carried" and for radio/tv signals is measured in hertz (Hz) or millions of hertz or billions of hertz (MHz, Ghz).
All frequencies have a corresponding wavelength and due to the fact that light is actually very very high frequency radio (electromagnetic waves) it's more convenient to express the wavelength in nanometers (nm) rather then MHz or GHz.
The wavelength of red light is around 700nm.

Now comes the problem, natural light also contains red (plus other colours) and your sensor picks this up.
How is the sensor going to know what comes from where?

Up to now I have only mentioned a single wavelength or carrier like a normal light or laser or the sun.
To be able to differentiate our light source from others, let's make the carrier pulse on and off at some rate.
It now has a "signature" that the others don't have.
This is known as adding a sub-carrier.

We change (or modulate) the main continuous carrier with our sub-carrier and transmit that.
Now when the sensor receives our signal, the first thing it does is strip the main carrier and is left with the sub-carrier only.
It amplifies this sub-carrier (as we are only interested in it's presence) and sets a circuit that will give a digital output that is high for as long as our carrier and sub-carrier is present.

Look at drawing 1 which shows the "transmitter" (your modulated laser).
Then look at drawing 2where it shows the receive side (your sensor and demodulation).

Hope this makes it clearer for you.

EDIT:

This is the way all remotes work (TV remote, car key FOB) just that in those applications, multiple functions are required and depending on which button is pressed, different data is added to the sub-carrier.

Drawing_1.jpg

Drawing_2.jpg

I still don't get the carrier modulator thing. Why won't a simple tube work to block unwanted light out? Obviously some light will still enter and cause current to flow but my program will make the analog pin "wait and listen" for a certain amount of current to trigger the timing. Like I would specify any voltage above this trigger, if it fluctuates but is below this do nothing. I dano if that explains it.

The time that the sensor is triggered won't matter. As long as its not so fast the sensor doesn't pick it up. if the bike breaks the beam multiple times then the program will only take the first break. It will listen to the second break and third break depending on how many there are and compare it to an "average lap time" and if it far out then it discards it. Say a lap is 20seconds for example. Then I specify in the program if the time taken when the beam was broken is bigger than 25s and smaller than 15s it should not do the "read time and display on screen" so if u ride and your first lap is 21s the program will accept it. If your arm breaks the beam at 21s it will take it. When your body hits it it will probably measure 1/100th of a second so that's less than 15s so it discards the time.

Look I'm not too concerned with falling and stuff, that's a good point and I never thought of that. But I will have2 design it for that sometime. HOWEVER for now I am just concerned about the trigger "mechanism".

UnoDueTre:
@calvingloster

To further explain modulation, consider this simplification:

You have a red laser which is on all the time, so it's like having a continuous stream of a optical source or carrier.
A carrier is the frequency at which the energy is "carried" and for radio/tv signals is measured in hertz (Hz) or millions of hertz or billions of hertz (MHz, Ghz).
All frequencies have a corresponding wavelength and due to the fact that light is actually very very high frequency radio (electromagnetic waves) it's more convenient to express the wavelength in nanometers (nm) rather then MHz or GHz.
The wavelength of red light is around 700nm.

Now comes the problem, natural light also contains red (plus other colours) and your sensor picks this up.
How is the sensor going to know what comes from where?

Up to now I have only mentioned a single wavelength or carrier like a normal light or laser or the sun.
To be able to differentiate our light source from others, let's make the carrier pulse on and off at some rate.
It now has a "signature" that the others don't have.
This is known as adding a sub-carrier.

We change (or modulate) the main continuous carrier with our sub-carrier and transmit that.
Now when the sensor receives our signal, the first thing it does is strip the main carrier and is left with the sub-carrier only.
It amplifies this sub-carrier (as we are only interested in it's presence) and sets a circuit that will give a digital output that is high for as long as our carrier and sub-carrier is present.

Look at drawing 1 which shows the "transmitter" (your modulated laser).
Then look at drawing 2where it shows the receive side (your sensor and demodulation).

Hope this makes it clearer for you.

EDIT:

This is the way all remotes work (TV remote, car key FOB) just that in those applications, multiple functions are required and depending on which button is pressed, different data is added to the sub-carrier.

Thanx that makes sense now but I rate that's abit out of my league haha. Please remember that this is my first arduino project so I'm tryna keep it relatively simple.

The part I'm using is a LDR 10k.

This is why I am such a pedant.

I think that it is probably doable without modulating the laser. If the laser is shining directly on the photodiode, and the photodiode is inside a black tube that is aimed at the laser (to shield it ffom the sun and other bright light sources), then nothing else it sees is going to be anything near as bright as the laser. But modulation would make it easier to cope with vibration and anything else that affects the alignment of laser and photodiode.