I was planning to determine light speed by myself(which is 3*10^8 m/s). I have kept 2 sensors, and I need to know the time interval as light strikes the sensors. It lies somewhere about 50nanoseconds. Is it possible to measure such a small timeinterval using RPi?
2 Answers
I can offer a suggestion, not one that I or anyone else has tried to my knowledge.
SPI should operate at 250MHz on the Pi which means each bit is 8 nano seconds long.
If you can feed your two sensors into the SPI MISO line you should be able detect the difference in times by examining the SPI data. Perhaps MISO could be pulled up to 3.3V and your sensors could drive the gpio to ground.
The system itself can work with nanoseconds. For example the C function clock_gettime can return you the time in nanoseconds since epoch.
The GPIO of the Pi on the other hand can read reliably at around 14MHz (source). Meaning you can read a value 14 million times per second. Which is by far not enough to have nanosecond accuracy.
High-speed tasks like these are more suited for a microcontroller or FPGA.