Measuring time between two signals

Hello friends,

I am using a laser diode to launch light into optical fiber and at the other end of fiber there'll be a photodiode that senses the light signal.

I intend to measure the time between the launch and detection of optical signal. The laser diode is triggered ON from digital pin and photodiode sensed signal is fed into analog pin of arduino uno.

Is there any function which can be used to measure time between the launch of signal and its detection??

You want to measure speed of light but how long is the optical fiber ?

How long is the time you hope to measure (or what is the length of the optical fibre)? Arduinos aren't really suited to measuring very short times but if your optical fibre is several hundred km long you might have a chance.

Steve

and photodiode sensed signal is fed into analog pin

It takes 104 microseconds for analogRead() to read the input to the pin. Unless your fiber optic cable loops around the entire solar system, that time will distort any measurement you come up with for the speed of light.

Using a phototransistor, and an interrupt on a digital pin that the phototransistor would mean that you only needed to wrap the fiber optic cable around the earth a few times to get meaningful times for calculating the speed of light.

ard_newbie:
You want to measure speed of light but how long is the optical fiber ?

I am using a fiber 3 km long.

slipstick:
How long is the time you hope to measure (or what is the length of the optical fibre)? Arduinos aren't really suited to measuring very short times but if your optical fibre is several hundred km long you might have a chance.

Steve

I am currently using 3 km fiber. I can go upto 10 km long fiber.

If arduino is not that suitable, then what system should be looked upon or what can be the best possible solution for realizing the project??

What is the value of c for your fibre?

AWOL:
What is the value of c for your fibre?

Do you mean speed of light?

3x10^8 m/s.

I do not intend to use the speed-distance formula. I am asking is there any inbuilt watch function inside arduino uno that measures time difference between when digital pin is generating the trigger and analog pin is reading the received signal??

Yes there is, but it cannot measure intervals that short.

MorganS:
Yes there is, but it cannot measure intervals that short.

ok

thanks

can you suggest any other board that can be helpful in measuring such small time interval??

anshul_p:
Do you mean speed of light?

3x10^8 m/s.

No, that is (a little faster than) the speed of light in a vacuum.
What is the speed in your fibre?

Light should take ~ 10 us for 3 Km of optical fiber, it's good enough for an arduino.

AWOL:
No, that is (a little faster than) the speed of light in a vacuum.
What is the speed in your fibre?

Sorry I did not measure the speed of light in fiber. I do not have means to calculate it. I assume it to be 3x10^8 m/s. btw why do you ask so??

ard_newbie:
Light should take ~ 10 us for 3 Km of optical fiber, it's good enough for an arduino.

so how should i measure the time difference between transmitted and received signal?

When the light is emitted, you start a timer counter, and as soon as the photodiode detects the arrival of light, you trigger an interrupt and stop your timer.

I assume it to be 3x10^8 m/s

Bad assumption. You should do a tiny bit of research before embarking on a project like this.

This is the right figure bro !

ard_newbie:
When the light is emitted, you start a timer counter, and as soon as the photodiode detects the arrival of light, you trigger an interrupt and stop your timer.

No, you would use the capture capability.

ard_newbie:
This is the right figure bro !

The right figure for what?

ard_newbie:
When the light is emitted, you start a timer counter, and as soon as the photodiode detects the arrival of light, you trigger an interrupt and stop your timer.

Thanks for the input. Any specific function for timer??

I'm clueless and I'll have to read about it.