The use of sensors in smartphones to do physical experiments is a boom in the past decade, such as acceleration sensor,1,2 light sensor,3,4 magnetometer,5,6 camera,7,8 and gyroscope. However, few people study the application of proximity sensors in physical experiments, although, in our view, the employment of the proximity sensor is more accurate than other sensors (see Table I). For further research, this paper proposes a method to measure the oscillation period of a simple pendulum based on the proximity sensor integrated in the smartphone and determines the experimental value of the gravitational acceleration. Theoretical background

1.
P.
Vogt
and
J.
Kuhn
, “
Analyzing simple pendulum phenomena with a smartphone acceleration sensor
,”
Phys. Teach.
50
,
439
440
(
Oct.
2012
).
2.
P.
Vogt
and
J.
Kuhn
, “
Analyzing free fall with a smartphone acceleration sensor
,”
Phys. Teach.
50
,
182
(
March
2012
).
3.
Dean
Li
,
Lilan
Liu
, and
Shaona
Zhou
, “
Exploration of large pendulum oscillations and damping using a smartphone
,”
Phys. Teach.
58
,
634
(
Nov.
2020
).
4.
J. A.
Silva-Alé
, “
Determination of gravity acceleration with smartphone ambient light sensor
,”
Phys. Teach.
59
,
218
(
March
2021
).
5.
A.
Yavuz
and
B. K.
Temiz
, “
Analyzing harmonic motions with an iPhone’s magnetometer
,”
Phys. Educ.
51
(
3
),
035006
(
2016
).
6.
U.
Pili
,
R.
Violanda
, and
C.
Ceniza
, “
Measurement of g using a magnetic pendulum and a smartphone magnetometer
,”
Phys. Teach.
56
,
258
(
April
2018
).
7.
S.
Becker
,
A.
Gößling
,
P.
Klein
, and
J.
Kuhn
, “
Using mobile devices to enhance inquiry-based learning processes
,”
Learn. Instr.
69
101350
(
2020
).
8.
K.
Hochberg
,
S.
Becker
,
M.
Louis
,
P.
Klein
, and
J.
Kuhn
, “
Using smartphones as experimental tools—A follow-up: Cognitive effects by video analysis and reduction of cognitive load by multiple representations
,”
J. Sci. Educ. Technol.
29
(
2
),
303
317
(
2020
).
AAPT members receive access to The Physics Teacher and the American Journal of Physics as a member benefit. To learn more about this member benefit and becoming an AAPT member, visit the Joining AAPT page.