# Arduino Break Beam Gravity GOAL: Measure acceleration due to Earth's gravity using Arduino microsecond timer circuit <img width="25%" src="view-20201205_171837.jpg"> <img width="36%" src="viewc-20201205_182222.jpg"> - Drop a ball at L = 10, 20, 30, 15, 25 inches 5x each. ``` O -> ball at L height | | (L-4) inches | | + -> sensor 1 | -> 4 in + -> sensor 2 ``` - Measure time in microseconds to fall between sensor 1 and sensor 2 when it breaks the light beam. - RESULT: my estimate is $g=9.5 m/s^2$. This is within 3% of true value. Air resistance probably affected my estimate. - OVERALL RESULT: you can use an Arduino Uno micro-second timer circuit to accurately estimate acceleration due to gravity. <video width="36%" controls><source src="breakbeam-measure-20201205_171839.mp4"></video> ================================ # Data ``` The data right of the serial port: --- Miniterm on /dev/ttyS4 9600,8,N,1 --- --- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --- setup elapsed_time 54112 elapsed_time 52152 elapsed_time 51488 elapsed_time 51888 elapsed_time 50536 elapsed_time 36364 elapsed_time 35464 elapsed_time 35548 elapsed_time 33984 elapsed_time 36768 elapsed_time 27836 elapsed_time 28036 elapsed_time 27056 elapsed_time 28044 elapsed_time 28972 elapsed_time 39532 elapsed_time 40480 elapsed_time 38668 elapsed_time 41200 elapsed_time 44512 elapsed_time 29268 elapsed_time 30200 elapsed_time 28488 elapsed_time 30252 elapsed_time 29868 ``` ================================ # What Do the Laws of Physics Say Should Happen? - $F=ma$ # newton's law - $a=F/m$ - Force of earth ($E$) gravity at surface on object with mass M. The acceleration is $F/m = g$ for any mass! - $F = G m_E m / r_E^2 = g m$ - Knowing the acceleration g we can get the velocity and position by integrating twice. - $ v = g t + v_0$ - $x = 1/2 g t^2 + v_0 t + x_0$ - Starting at height L, 0 velocity and triger sensors S apart: - fall L-S to sensor1 in t1 to v1. - fall S to sensor2 with initial velocity v1 in time t2 - $(L-S) = 0.5 g t_1^2$ # from x equation - $t_1 = sqrt(2 (L-S)/g)$ # rearrange: time to get to sensor 1 - $v1 = g t_1$ # velocity at sensor 1 from v equation - $v1 = g sqrt(2 (L-S)/g)$ # substitute t_1 from a above - $ v1 = sqrt(2 g (L-S))$ # simplify ---- - $S = 0.5 g t_2^2 + v_1 t_2$ # sensor fall S with initial v1 using x equation - $0.5 g t_2^2 + v_1 t_2 -S = 0$ # rearrange - quadratic formula $t = [-b +/- sqrt(b^2 - 4ac)] / 2a$. $a= 0.5 g$. $b= v1$. $c= -S$ - $t_2 = -v_1 +/- sqrt(v_1^2 + 4 \cdot 0.5 g S) / (2 \cdot 0.5 g)$ - $t_2 = -v_1 + sqrt(v_1^2 + 2 g S) / g $ # positive root, time has to be positive - Substitute v1: - $t_2 = [-sqrt(2 g (L-S)) + sqrt( (2 g (L-S)) + 2 g S)] / g$ - $t_2 = [-sqrt(2 g (L-S)) + sqrt(2 g L)] / g$ - $t_2 = [sqrt(2 g L) - sqrt(2 g (L-S)) ] / g$ - $t_2 = sqrt(2) [sqrt(L) - sqrt(L-S) ] / sqrt(g)$ - $t_2 = sqrt(2/g) [sqrt(L) - sqrt(L-S) ]$ RESULT: t_2 is the calculated time as measured by sensors S apart falling from a height of L ================================ # Statistical Data Analysis Pull the data into R ``` # observed sensor times in microseconds t = c(54112, 52152, 51488, 51888, 50536, 36364, 35464, 35548, 33984, 36768, 27836, 28036, 27056, 28044, 28972, 39532, 40480, 38668, 41200, 44512, 29268, 30200, 28488, 30252, 29868)/1.0E+06 # the heights the experiment was performed at l = c(rep(10,5),rep(20,5),rep(30,5),rep(15,5),rep(25,5)) S=4 myx = (sqrt(l)-sqrt(l-S)) # what the linear model inputs. t2 equation # make a linear estimate of the relationship (least squares: t = A*myx+B) mylm = lm(t ~ myx) summary(mylm) Residuals: Min 1Q Median 3Q Max -0.0021731 -0.0007420 -0.0003242 0.0008086 0.0037078 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.0001866 0.0012439 0.15 0.882 myx 0.0730061 0.0023870 30.58 <2e-16 *** # make a linear estimate of the relationship forcing 0 intercept mylm = lm(t ~ myx+0) summary(mylm) Residuals: Min 1Q Median 3Q Max -0.0021436 -0.0007521 -0.0003316 0.0008306 0.0037004 Coefficients: Estimate Std. Error t value Pr(>|t|) myx 0.0733548 0.0005332 137.6 <2e-16 *** ``` - RESULT: the empirical constant estimate is between 0.0730 and 0.0733: $t_2 = 0.073*[sqrt(l)-sqrt(l-S)]$ - From model: - $t_2 = sqrt(2/g) [sqrt(l)-sqrt(l-S)]$ - $sqrt(2/g) = 0.073$ - $2/g = (0.073*0.073)$ - $g= 2/(0.073*0.073)$ - $g= 375.30493526$ inches/s/s - $g = 9.5 m/s^2$ # 1 m = 39.37 inches - True: $g = 9.8m/s^2$ RESULT: My estimate of the acceleration due to gravity 9.5 m/s^2 is within 3% of the true value 9.8 m/s^2. Air resistance? ---- # Plot data ``` # what the model predicts given correct constants S=4 modelTgivenL = function(L){ gtrue = 9.8*39.37 # inches/s^2 return(sqrt(2/gtrue)*(sqrt(L) - sqrt(L-S) )) } modelEstTgivenL = function(L){ constestimate = 0.0733 # from linear fit return(constestimate*(sqrt(L) - sqrt(L-S) )) } png("drop.png",width=1024,height=1024) plot(t ~ l,pch="x",xlab="L height",ylab="sensor time",cex=2) points(seq(10,30), modelTgivenL(seq(10,30)),type="b", col="red",cex=2) points(seq(10,30), modelEstTgivenL(seq(10,30)),type="b", col="green",cex=2) title("drop times. black=measured red=model green=estimated model") dev.off() ``` <img src="drop.png"> - RESULT: modeling and empirical data line up pretty well. Times are a bit high for 20 inches (did I consistently hold it too low?) - TODO: I plugged in the measured distance between sensors = 4 inches. Could I have estimated this also to get two estimates, g and S, from the data? g can compensate S so you can't detangle. ================================ # Timer Construction - For timer construction see: ## <a href="README_RESULT_arduino-break-beam.html">README_RESULT_arduino-break-beam.html</a>