You are on page 1of 26

Experiment T15

Arduino mini-experiments
Advanced lab course for bachelor students in physics

Leon Mans
Vincenzo Sanfratello

RWTH Aachen University


October 25, 2022
Contents

1 Blink LEDs 2
1.1 1 LED Experiment . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 2 LED Experiment . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 3 LED Experiment . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2 Temperature measurement 8

3 Kinematics & speed of sound 10


3.1 Speed of sound . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.1.1 Experimental setup . . . . . . . . . . . . . . . . . . . . . . . 10
3.1.2 Example analysis on 10 cm measurement . . . . . . . . . . . 11
3.1.3 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.1.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

4 Acceleration 17
4.1 Elevator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.2 Gravitational and magnetic field of the Earth . . . . . . . . . . . . 18

5 Planck’s constant 22

1
Chapter 1

Blink LEDs

1.1 1 LED Experiment


A simple electrical circuit is constructed to be controlled by an Arduino UNO.
The setup is shown in Fig. 1.1 The data is read by a python script and plotted.
A ”1” is to be understood as the ”ON ” Status and a ”0” as the ”OF F ” Status of
the LED.

Figure 1.1: 1 LED Setup with an Arduino UNO.

2
A ”ON/OF F ” plot is presented in Fig. 1.2 displaying the LED status over a
period of 60 s.

Figure 1.2: Plot of 1 LED experiment data.

1.2 2 LED Experiment


The electrical circuit is upgraded and a second LED is added. The setup also
includes an Arduino NANO which is integrated directly into the circuit and is
used to control the LEDs. Fig. 1.3 shows the setup.

Figure 1.3: 2 LED Setup with an Arduino UNO and Arduino NANO.

3
The following plots shows the status of the LEDs over the measured time of
60 s. Fig. 1.5 shows the status of both LEDs. A ”1” stands for the first LED
blinking and −1 for the second LED. Because of the specific delays chosen for
this experiment both LEDs were never ”ON ” at the same time; instead their
”ON/OF F ” status was shifted by 1 s.

Figure 1.4: Top: Plot of first (blue) LED status over time. Bottom: Plot of
second (red) LED status over time.

4
Figure 1.5: Plot of both LEDs status over time.

1.3 3 LED Experiment


A final 3 LED setup is put together. The measurement is performed directly by
the Arduino UNO without the use of a secondary Arduino NANO. Fig. 1.6

Figure 1.6: 3 LED setup with an Arduino UNO.

5
Given that all three LEDs were set to turn ON and OFF at the same time we
refrain to plot them together. The following plots show the individual LED status
over the measured period of time instead.

Figure 1.7: Plots of each LED status in the 3 LED setup over time.

6
1.4 Conclusion
We conclude that the Arduino mini-controller setups used for controlling the blink-
ing of LEDs in electrical circuits provide the necessary time resolution for precise
measurements.

7
Chapter 2

Temperature measurement

A DS18B20 temperature sensor implemented on the arduino is used to measure


the temperature of hot water stored in a mug at room temperature over the time
of one hour. The measured data is saved on a laptop.

Figure 2.1: Experimental setup for the temperature measurement.

One would expect a temperature decay over time which follows the law:

T (t) = TC + (T0 − TC ) exp(−kt) (2.1)

With TC being the temperature of the environment, T0 the initial temperature


and k a factor depending on the setup which describes the rate of temperature
loss.

8
Figure 2.2 shows the measured data and the fitted exponential function. The
fit the initial temperature to be T0 = 78.84 ◦ C, the constant k = 5.857 × 10−4 s−1
and TC = 26.21. Because this experiment was performed at room temperature,
this TC seems reasonable. The fit in Figure 2.2 is not perfect, one reason for this
could be the non-constant temperature of the environment, but the exponential
fit describes the data as expected.

Figure 2.2: Measured temperature data and exponential fit.

The arduino is well suited for this experiment as it gives an accurate mea-
surement of the temperature and is able to log the temperature over time. A
thermometer that has to be read out manually would give the same results, but
of course it would have been more work to manually record the measurements.

9
Chapter 3

Kinematics & speed of sound

3.1 Speed of sound


3.1.1 Experimental setup
An electrical circuit as shown in Fig. 3.1 3.2 is constructed to measure the speed of
sound. The idea is simple; an acoustic sensor ”HC-SR04 Ultrasonic Sensor” issues
a total of 4 cycles of 40 kHz waves per 5 µs time interval, which are reflected
by an obstacle. The sensor measures outputs the time difference between sending
and receiving of the wave. An obstacle is put in place at distances [5, 7, 10, 15]
cm. Having measured the time difference, the speed of sound can be computed by
v = Distance
T ime
. The measurement is performed over 60 s.

Figure 3.1: Speed of sound electrical circuit setup.

10
Figure 3.2: Speed of sound measurement setup. Obstacle is put in the sound
wave’s path.

3.1.2 Example analysis on 10 cm measurement


The obstacle is placed 5 cm away from the acoustic sensor’s end; therefore the total
distance is 10 cm. The distance is measured by a tape measure. The error on the
distance measured is estimated as σd = 1√mm11
(assuming accuracy up to 1 mm).
Notice that the error on the total distance is σtot, d = 2σ since the wave travels
the 5 cm twice. Fig. 3.3 shows all the measured data. Notice that there seem to
be three regions where data is measured at around 300 µs, 100 µs and 0 µs. By
using literature values for the sound of speed at v = 343 ms we should measure a
duration of ∼ 291 µs. We cut all data that is far below expectancy. Fig. 3.4 shows
the cut data. A pattern is noticeable. Most data points are concentrated in four
different values and a few are spread randomly in between. We interpret this as
the sound wave being reflected mostly on four different points at slightly different
distances.

0.1 m
A value for the speed of sound vs = Duration
is computed for each data point.
We approximate the uncertainty σt on the duration measurement by using the
standard deviation in lack of direct uncertainties from the experimental setup.
The uncertainty on vs is
r
σ tot,d
2  sσ 2
t
σv = +
t t2
where t: Duration and σt : Standard deviation on duration.

11
The final value of vs is calculated by combining all measurements using
P vi
i σ2
v̄ = P 1i
i σ2
i
s
X 1
σ¯v =
i
σi2

Figure 3.3: Raw data of duration on 10cm speed of sound measurement.

Figure 3.4: Cut data of duration on 10cm speed of sound measurement.

12
For the first measurement of 10 cm (or 5 cm distance to obstacle) we obtain a
value of vs = 331.26 ± 16.38 ms by this method.

3.1.3 Results
The following figures show the data similarly to above for each total distance of
14 cm, 20 and 30 cm. The same procedure as above is used to calculate the speed
values and their uncertainty.

Figure 3.5: Cut data of duration on 14cm speed of sound measurement.

13
Figure 3.6: Cut data of duration on 20cm speed of sound measurement.

14
Figure 3.7: Cut data of duration on 30cm speed of sound measurement.

15
Table 3.1 lists the calculated values for the speed of sound and the statistical
uncertainty for each distance.

Results
Total distance [cm] v̄ [m/s] σv̄ [m/s]
10 331.26 16.38
14 300.55 14.95
20 304.05 14.22
30 334.41 16.59

Table 3.1: Caption

3.1.4 Conclusion
By combining these measurements once more we obtain a final value of vs =
315.73 ± 7.72 ms . The sound of speed at 20°or dry air is 343.2 ms 1 . Therefore
the measurement misses the literature value by ∼ 8% and does not lie within the
calculated uncertainty. On all measurements the same pattern can be observed.
Most of the data points concentrate at specific values and some data is spread
randomly in between. Without further knowledge of the sensor functionality we
cannot make a definitive statement on the cause of the pattern. Since the wave
emitted spreads into space evenly, one possibility could be that the sensor is pick-
ing up reflected waves at different points of the obstacle. This would explain the
slightly different duration values.

We conclude that the method used does not provide an adequate precision for
sound of speed measurements. Systematic errors also should be investigated, spe-
cially regarding the functionality of the acoustic sensor.

1
https://de.wikipedia.org/wiki/Schallgeschwindigkeit

16
Chapter 4

Acceleration

4.1 Elevator
A LSM9DS1 board is used to measure the acceleration and magnetic field of the
Earth in three dimensions. First of all, the acceleration in an elevator is measured.

Figure 4.1: Experimental setup for the acceleration measurement in an elevator.

Normally, the force acting on an object on the surface of Earth should be

F = mg (4.1)

and therefore, the acceleration is g in the negative z-direction. In an elevator, the


force necessary to carry the passenger to a higher or lower floor is added.

F (t) = mg + ma(t) = m(g + a(t)) (4.2)


Therefore, the acceleration acting on the object is g + a(t).

17
Figure 4.2: Measurement of the elevator acceleration when going up- and down-
wards.

Figure 4.2 shows that the acceleration increases by about 1 sm2 when riding
upwards and decreases by about 1 sm2 when riding downwards. As expected, an
object in the elevator on a scale would become heavier when going up due to the
increased normal force acting on it, and lighter for the opposite direction. It would
also be expected that the function a(t) is zero before and after the end of the ride,
as the acceleration returns to normal, so it has to rise and then fall again for the
case of the ride upwards and vice versa, which is represented in the data.

4.2 Gravitational and magnetic field of the Earth


Now the acceleration and the magnetic field due to the Earth are measured by
rotating the arduino board with the sensor around all three axes in steps of 22.5◦ .

Figure 4.3: The sensor with its coordinate system on the right.

The coordinate system is defined on the table on which the experiment was
performed, the z-axis is orthogonal to the table plane, the x-axis points along the

18
edge of the table to the right and the y-axis points to the front. The measurement
in the xy-plane is started with the y-axis of the sensor pointing in the negative
direction of the table’s y-axis and it is then rotated clockwise. The xz-measurement
is started with the sensor y-axis pointed along the negative x-axis and rotated
clockwise. The last measurement in the yz-plane is started with the sensor’s y-
axis pointed in the z-direction and rotated counterclockwise. The acquired data
is shown in Figure 4.4.

Figure 4.4: Measured data of the gravitational field along the three axes.

This data follows the expectations, because in a gravitational field pointing in


the z-direction, the measurement in the xy-plane shouldn’t depend on the angle
and in the other planes, the acceleration in z-direction should be zero because the
measurement direction is orthogonal to the gravitational field while it rotate in the
xy-plane of the sensor. The same measurement also quantified the magnetic field
of the Earth, which is shown in Figure 4.5. The largest source for errors in this
measurement is the inaccurate rotation, which could differ from the actual value
by as much as 5◦ . That would also explain why the magnetic field doesn’t follow
a pure sine angular distribution.

19
Figure 4.5: Measured data of the magnetic field along the three axes.

As can be seen from the elevator measurement, the accelerometer can record
a change in acceleration as it would be expected from theory, but for example the
measured value for the acceleration due to gravity g is not that accurate, as it
slightly above 10 sm2 when the real value is 9.81 sm2 . But nonetheless, it is enough
for a qualitative assessment. For the magnetic field, one limitation of the arduino
setup is the rotation that is performed by hand which makes it inaccurate, this
could be fixed with a dedicated setup were the measurement device could be fixed
and rotated along each axis with a fixed angular scale. But in the end, some sort
of accelerometer or Hall probe would have to be used in this experiment, so it
doesn’t make a difference that they are operated with an arduino other than the
fact that it makes data acquisition easier. It can be used in this experiment, but

20
a fixed setup with fixed rotation axes would be better and more accurate.

21
Chapter 5

Planck’s constant

The goal of this experiment is to measure Planck’s constant with LEDs. Such
an LED only emits light after a certain threshold voltage is applied to it so that
the electrons in the n-zone can cross over to the p-zone and fill the holes in that
zone, thereby releasing photons with the energy of the energy difference between
the different regions. That means that a LED which emits photons with a higher
energy requires a higher threshold voltage to turn on. After this voltage is reached,
the electric current is expected to rise linearly. To measure the threshold voltage,
the current in LEDs with different wavelengths depending on the applied voltage is
measured with an arduino. This arduino increases the voltage in steps of 0.00122V
and the resulting current is recorded on a laptop.

Figure 5.1: The setup of the experiment with a green LED.

22
Figure 5.2: Measured current curves for different LEDs.

The curves in Figure 5.2 show the threshold voltages at which the current
rises for different LEDs and as expected, the LEDs with a higher wavelength have
a lower threshold voltage. The black line on the left shows the infrared LED
and the one on the right the ultraviolet LED. Now these threshold voltages are
determined by fitting the linear parts of the curves with linear regressions. Then
the intersection of these curves with the x-axis represents the different threshold
voltages, which is shown in Figure 5.3

Figure 5.3: Fitted current curves for the threshold voltages.

Now these threshold voltages are plotted against the inverse wavelengths, which
can be seen in Figure 5.4.

23
Figure 5.4: Linear regression for the threshold voltages.

hc
Evolt = U e = = Eγ (5.1)
λ
hc 1
U= (5.2)
e λ
Now the slope of the linear function is equal to m = hc e
. The fitted value for
−6 −6
m is (1.3116 × 10 ± 0.0767 × 10 ) V m. It follows that the measured value
for Planck’s constant is h = (7.01 × 10−34 ± 0.41 × 10−34 ) Js. The value of this
constant according to literature is 6.626 × 10−34 Js, this value is in the error range
of the fitted value, they are compatible.
That means that the experimental setup is generally suited to measure the Planck
constant because there is a relationship between the threshold voltage and the
color of the LED. But of course, there is no single point at which the LED is
considered on, so this threshold voltage can only be estimated. Also, not all
the electric energy from the voltage is converted to photons, some of it is also
converted to heat because the LED acts as a resistance like any electrical device.
The fact that higher photon energies require higher threshold voltages because
the electrons have to be brought to a level that is energetically higher is true,
but if there’s already a large energy difference between the conduction band on
the n-side and the valence band on the p-side, the threshold voltage wouldn’t
have to be very high to release high energy photons. Planck’s constant can be
accurately measured with a photo cathode and a counter field to measure the
kinetic energy of the electrons released by the photons, as the entire energy of the
photon is transferred to the photon, there’s a stronger relationship between the
kinetic energy and thus the measured counter voltage than there is between the
color and the threshold voltage of the LED, which makes the measurement more
accurate. Here the traditional method would be more accurate. When talking
about the LED experiment itself, the arduino is useful for recording the measured
data of the current, if it was performed manually, one would have to turn up the
voltage by hand and judge the point at which the current is high enough to record

24
the voltage at that point as the threshold voltage, which would make it harder and
less accurate.

25

You might also like