The method and the results are on the Ampère's law lab. Do the analysis yourself first, then check the answers below.
Quick answer: The Biot–Savart law gives the field of a current element, dB = (μ₀/4π) I dl × r̂/r², and integrating it yields B = μ₀I/2πd for a long wire and μ₀I/2R at a loop's centre. These answers go with the AP Physics C lab on Ampère's law: the graph, the calculations, the uncertainties and the conclusion explained, for all 7 analysis questions.

The answers use the sample table. Your gradient will depend on how evenly you wind the coil, how close the phone sensor sits to the axis and the local background field, but the graph should be a straight line through the origin with n close to the value you counted.
Level: AP Physics C (Mechanics and E&M, calculus-based) · Curriculum: AP PC:E&M Unit 12
Question 1 Plot B against I
The points lie on a straight line through the origin, so B is proportional to I.
Question 2 Gradient
Gradient = (1480 − 245)/(1.20 − 0.20) = 1235/1.00 = 1.2 × 10³ μT/A (1235 μT/A).
Question 3 Turns per metre
n = gradient/μ₀ = 1.235 × 10⁻³/(4π × 10⁻⁷) = 9.8 × 10² m⁻¹, which is 1.7 % below the counted 1000 m⁻¹, in agreement within error.
Question 4 Background field
The sensor also measures Earth’s field (about 48 μT), which adds to the coil’s field. Subtracting it, or reversing I and halving the difference, removes the offset.
Question 5 Uncertainty
Taking the current error: 0.02/0.20 = 10 % on the smallest value but 1.7 % on the largest; the gradient from the whole range has about 3 % uncertainty.
Question 6 Finite coil
A coil of finite length has a weaker field at the centre than an infinitely long one. For L = 0.20 m and D = 0.040 m the factor is L/√(L² + D²) = 0.98, a reduction of about 2 %.
Question 7 Reducing error
Wind the wire in two layers on a longer tube to approach the infinite-solenoid limit, and use a more precise ammeter with shorter switch-on times so the coil does not heat and change its resistance. Both give a cleaner gradient.
