(I'll write both English and Italian because I don't know which is best/Scriverò sia in inglese che in italiano perchè non so quale sia meglio).
Hi everybody, I'm going to have my final exames this year (for high school), and I'd like to create something (I know that's a big idea, probably impossible), that can measure speed light, for my thesis.
I'd thought to use some photoresistors, the ones given in the starter kit (yeap I'm a noob), to make it clear, and shooting it with a laser beam. Then knowing the distance, I can calculate the light speed. The problem is: considering 1m as my distance, light will cover this distance in 3,3*10-9s. The function delay() works in milliseconds, which are 106 times bigger. So I can immage that this is not possible. Am I wrong? Is there any thing I can possibily do? Is there a way to keep the photoresistor always on, and when the beam hits it, it sends a signal back?
Salve a tutti, quest'anno farò i miei esami di maturità, e vorrei portare, come tesina, uno strumento in grado di misurare la velocità della luce. Ho pensato di usare dei fotosensori, quelli dati nello starter kit (sì sono nuovo) per capirci, e colpirli con un raggio lase. A quel punto, conoscendo la distanza, mi posso calcolare la velocità. Il problema è: prendendo una distanza di 1m, la luce lo percorrerà in 1/3 di nanosecondo (3,3*10-9s). La funzione delay() però lavora in millisecondi, che sono 106 volte più grandi. Quindi posso immaginare che la cosa sia impossibile da farsi. Sbaglio forse? C'è niente ch eposso fare? È possibile tenere il fotosensore sempre acceso, e quando riceve il raggio di luce, manda un segnale indietro?
The basic clock in the Arduino ticks at 16 MHz. In one tick of that clock (or one processor instruction in the best case) light travels about 19 meters.
You might be able to make a measurement if a light pulse were reflected from a distant mirror, for example 1000 meters away.
Speed of light 299,792,458 metres per second x 1S/1,000,000,000 nS = ~0.300meter/nS x 62.5nS/clock tick = 18.74 meter/clock
There are 16 clocks/uS = ~300 meters
~1200 meters in 4uS.
So if your code did something simple:
// set up the IO pins
distance = 0.0;
PORTD = PORTD & 0b11111011; // clear D2 (make it low)
startTime = micros();
PIND = 0x00000100; // toggle D2 to go high by writing to input register
while ((PORTD & 0b00001000) == 1){ // test to see if D3 is low
// hang out continually reading D3 until it goes low (or flip the setup & test & look for a high)
// assuming light turns on a transistor to pull the pin low
}
stopTime = micros();
elapsedTime = stopTime - startTime; // time in microseconds
speed = distance/elapsedTime;
So micros() has some resolution (3-4uS), light turning on the transistor needs some time, the code executing the instruction or two needs some time. You can look at the resulting assembly code and see how many instructions would be executed, and find out you're going to need a large distance and still have poor resolution.
Try a test - connect pin 4 to Gnd, and see what reading you get back for elapsedTime.
I don't know how scientists measure the speed of light, but that's the 1st question... It might require some special
Once you've determined how you are going to do it, then you can decide if anything in the starter kit is of any help.
I have a feeling the Arduino is too slow. The phototransistor and LASER will also have a response time that you may have to take into consideration... But, I don't even know if those components are appropriate for this experiment.
A photoresistor is slow. Takes like a second to respond to changes in light. Phototransistor might work.
Micros is right out the window. 4us resolution? That's 1/64th what the chip is capable of. Take over one of the timers, prescaler of 1, and start it when the pulse leaves, stop it when the signal returns. That gets you the delay in clock cycles. You'd need to count how many clock cycles the interrupt that stopped it took, and how many clock cycles were between when the timer started and when the light was turned on, and correct for that.
Delta_G:
What I would do is use two mirrors and bounce the light back and forth multiple times to increase the distance. But that will introduce some error as the light slows down as it enters the glass on the mirror and speeds back up again when it leaves the glass.
Use first-surface mirrors - cheap and easy to get from old projection TVs (though some are quite large, and a bit heavy).
Rather than a phototransistor - use a PIN photodiode, or an avalanche photodiode - much, much faster (though not easy to source nor inexpensive, IIRC).