0% found this document useful (0 votes)
29 views9 pages

ATKIN

taller
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views9 pages

ATKIN

taller
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Physics Education

PAPER

Investigating the Torricelli law using a pressure sensor with the Arduino
and MakerPlot
To cite this article: Keith Atkin 2018 Phys. Educ. 53 065001

View the article online for updates and enhancements.

This content was downloaded from IP address 132.174.255.250 on 14/08/2018 at 17:25


Paper
Phys. Educ. 53 (2018) 065001 (8pp) iopscience.org/ped

Investigating the Torricelli law


using a pressure sensor with the
Arduino and MakerPlot
Keith Atkin
E-mail: [email protected]

Abstract
This paper examines the Torricelli law for the flow of liquid from a small
drain hole in a container. It shows how the system can be modelled using
either a traditional calculus-based approach or a non-calculus step-wise
computer method appropriate to the background of the student group. An
experiment to measure the head of out-flowing liquid as a function of time is
then described. The conventional method of manual timing is replaced by a
pressure-sensing technique involving use of the Arduino microcontroller and
MakerPlot graphing software.

Introduction speed of the liquid is v. A streamline is shown


The Italian physicist Evangelista Torricelli from the liquid surface to the drain hole.
(1608–1647) is credited with the first quantitative Applying the Bernoulli principle to each end of
description of fluid flow from a small opening at the streamline, we have
the bottom of a container. He discovered that the 1 1
liquid drains at a rate proportional to the square PA + hρg + ρv2s = PA + 0 + ρv2 ,
(1) 2 2
root of the liquid height above the hole. It was
where vs is the downward velocity of the liquid
later shown that the Torricelli law is a special case
surface.
of the more general Bernoulli principle:
This simplifies to
1 2
P + hρg + ρv = constant v2 = v2s + 2gh.
(2)
2
which applies to all points along a streamline for The equation of continuity, based on the conser-
smooth non-viscous incompressible flow. Here P vation of volume, states
is pressure, ρ is fluid density, g is gravitational
Avs = av,
(3)
field strength, v is fluid velocity and h is height
above an arbitrary datum line. where A and a are the cross-sectional areas of the
container and drain hole, respectively.
Hence, vs = Aa v and, assuming that A  a ,
Derivation of the Torricelli law
it follows that we can neglect v2s in (2) and write
Figure 1 shows a cylindrical container open to the
atmosphere (pressure PA). The liquid has density v2 = 2gh.
(4)
ρ, and head h at time t. The initial head at time
zero is H, where heights are measured above a Equation (4) captures the essence of the Torricelli
datum line level with the drain hole. The efflux law.

1361-6552/18/065001+8$33.00 1 © 2018 IOP Publishing Ltd


K Atkin
Variation of head with time
The Torricelli law as expressed in (4) is relevant
where efflux speed is of interest but it is of equal
importance to ask how the head of liquid in the
container varies with time. PA
Substituting [3] in (4) we obtain
 a 2 H ρ
v2s = · 2gh. h
A
So, PA
Datum v
√ a
vs = k h where k ≡ 2g.
A
Now vs is the downward speed of the liquid sur-
face in the tank and measures the rate of change
of h with time. As h reduces with time, the inser-
tion of a minus sign enables us to write the differ­ Figure 1. Liquid draining from a container.
ential equation below.

dh √ Differentiating equation (4) with respect to


= −k h .
(5)
dt time, we have
dv dh
v =g
Solving the differential equation dt dt

There are two basic approaches: a traditional but dh


dt = −vs and s
v = Aa v
analytical method using the integral calculus or and so v dt = −g Aa v
dv

a computer-based step-wise method. For students i.e. dtdv = −g Aa and, as k ≡ Aa 2g,

familiar with calculus, there should be no par­ dv g
ticular problems; for students without a calculus (8) = −k .
dt 2
background, it may be profitable to use a simply
Integrating (8),
» we obtain
coded algorithmic technique.
v = −k g2 · t + c√where c is a constant.
When t  =  0, v   =   2gH and so finally
Calculus method …
Equation (5) is easily solved by simple integration.  g
(9) v = 2gH − k ·t .
2
´ dh
√ = −k dt + c where c is a constant,
´
h
found by observing that when t  =  0, h  =  H where In summary, we observe that the head h follows a
H is the initial head. quadratic variation with time, whereas the efflux
We obtain speed v , somewhat counter-intuitively, is found to
be a linear function of time.
k2 √
h = t2 − k H · t + H .
(6)
4
Numerical integration method
Setting h to zero gives us a quadratic in t which is
An alternative approach to solving [5] is to use
easily solved to give us the time tdrain to drain the
an approximate step-wise computer method.
container to the datum line.
This is of particular relevance for students
√ without the necessary skills in integral calculus
2 H
(7) tdrain = . which are required for the derivation of equa-
k
tions (6) and (9).
We can also find the efflux speed v as a function We can replace [5] with the approximate
of time. form

November 2018 2 Phys. Educ. 53 (2018) 065001


Investigating the Torricelli law using a pressure sensor with the Arduino and MakerPlot

Draining can Solution by step-wise method

t1 := 0 s g := 981 cm s–2

∆t := 0.1 s B := 10.4 cm (can ID)

tend : = 65 s b := 0.6 cm (drain hole ID)

tend
n:= H := 20 cm
∆t

( ) 2
b
n = 650 points k := B . √ 2.g h1 := H v1 := √ 2.g.H

tdrain := 2.√
k = 0.1474 cm1/2s–1 H
k

tdrain = 60.66 s
H h
for i ∈[1..n]

hi+1 := eval(hi – k. √ hi .∆t)

vi+1 := eval( √ 2.g.hi+1)


ti+1 := ti + ∆t
M := augment (t,h)
N := augment (t,v)

Figure 2. SMath worksheet.

Head versus time


24

20

16
h / cm

12

0
0 10 20 30 40 50 60
t/s
M

Figure 3. SMath plot for head h.

November 2018 3 Phys. Educ. 53 (2018) 065001


K Atkin

Efflux speed versus time


240

180
v / cm s–1

120

60

0
0 10 20 30 40 50 60
t/s
N

Figure 4. SMath plot for efflux speed v.

Filter circuit Leads to


Arduino
MPX5010DP
P1 P2

Drain

Figure 5. Experiment to measure h as a function of time.

November 2018 4 Phys. Educ. 53 (2018) 065001


Investigating the Torricelli law using a pressure sensor with the Arduino and MakerPlot

+5 V

GND

A0 To PC
50 pF 51 kΩ
3
MPX5010DP 2
1 Filter circuit ARDUINO

P1 P2

Transducer pins:
1 Output voltage (notch in pin)
2 Ground
3 Supply voltage

The other pins are not used.

Figure 6. Electrical connections.

∆h √ √ graphed. The IOP publication ‘SMath for Physics’


≈ −k h so that ∆h ≈ −k h · ∆t. by Liengme [1] is strongly recommended for
∆t
teachers and lecturers using this application for
Using a computer loop, we can then update h, v,
the first time.
and t as follows
√ Figure 2 shows how equations (10), (11),
(10) hi+1 = hi − k hi · ∆t, and (12), along with the various constants needed
for the computation, can be entered into a SMath

vi+1 = 2ghi+1 ,
(11) worksheet as a simple for-loop, and the results
displayed using the very versatile XY plot feature
ti+1 = ti + ∆t,
(12) (figures 3 and 4). The ‘eval’ function is peculiar to
SMath and has a dramatic effect on speeding up
where i is an integer loop variable ranging from the calculation of a SMath page.
1 to n.
A particularly convenient application for
running this algorithm is SMath Studio1. This Experimental investigation
software, created by Andrey Ivashov, is freely Previous contributors Ivanov et al [2] have
available to download. It provides, as does expen- described various methods for presenting the
sive software such as MathCad, a live worksheet above ideas to student groups. All these inter-
into which equations can be typed, solved and esting experiments require relatively laborious
1
SMath Studio is downloadable at https://en.smath.info
measurements. Use of computer interfacing can
and a primer is available at https://smath.info/wiki/GetFile. speed things up considerably. One such method
aspx?File=Tutorials/SMathPrimer.pdf. which I have tested is shown in figure 5. The idea

November 2018 5 Phys. Educ. 53 (2018) 065001


K Atkin

// Torricelli pressure sensor with XY MK5

int N; // integer equivalent of sensor voltage


float beta = 0.041; // sensor calibration gradient in V/cm
float V0 = 0.279; // sensor calibration intercept in volt
float V; // sensor output voltage
float H = 20; // head of water at t = 0 in cm
float h; // head of water at time t
float G = 0.0048876; // conversion factor (5/1023)
float Dt = 0.0133; // time step to give seconds on x-axis
float t = 0; // time in seconds

void setup()
{
Serial.begin(9600);
Serial.println(); // clear garbage
Serial.println("!RSET"); // reset XY plot
}

void loop()
{
N = analogRead(A0); // read input from sensor to port A0
V = G*N; // convert to voltage
h = (V-V0)/beta; // calculate head in cm
if(h<=H) // test for starting head H
{
Serial.print(t); // output t to channel 0
Serial.print(","); // separator
Serial.println(h); // output h to channel 1
t = t + Dt; // increment time
}
else
{
Serial.println();
Serial.println("!RSET"); // keep resetting plot till h <= H
}
}

Figure 7. The Arduino code.

here is to measure the variation of liquid head Hence, the sensor produces a voltage dependent
with time using a pressure sensor coupled to an on h. The manufacturers recommend a simple
Arduino microcontroller. The device used was the noise reducing filter circuit be placed between the
MPX5010DP, a piezo-resistive silicon transducer MPX5010DP output and the input of the micro-
(A similar device was used by Ladino et al to controller. This is shown in figure 6. With the
investigate the Gay-Lussac law [3]). This sensor other electrical connections.
costs just a few pounds and is manufactured by Before use, it is necessary to calibrate the
NXP and sold by Systs Ltd on Amazon. system. This is easily done by filling the can to
A 30 cm tall transparent cylindrical can is greater and greater measured heads h (with the
fitted with a short drain tube, of internal diam- drain tube plugged!) and recording the corre­
eter (ID) 6 mm, about 3 cm above the bottom sponding sensor voltages.
of the can. This marks the datum line. The sen-
A linear relation of the form V = βh + V0
sor has two ports P1 and P2. The device meas-
is obtained where V is the output voltage, β
ures the pressure difference between P1 and
= 0.041 V cm−1, and V0   =  0.279 V
P2. P1 is attached to the top of a narrow acrylic
tube (ID 3 mm), the bottom of which as held at This calibration is used in the Arduino code
the datum level. P2 is open to the atmosphere. to calculate h as a function of time t.

November 2018 6 Phys. Educ. 53 (2018) 065001


Investigating the Torricelli law using a pressure sensor with the Arduino and MakerPlot

Figure 8. Sample experimental results.

Depth versus time comparison with theory


25

20

15
h / cm

10

0
0 10 20 30 40 50 60
t/s

Figure 9. Comparison with theory.

The Arduino code is shown in figure 7. To To run the experiment, the can is filled with
obtain a graphical output, I use MakerPlot2, a water to a level a couple of centimetres above the
readily downloadable software package which I desired initial level H. The drain plug is removed
have described in a number of my previous papers and plotting starts automatically when the water
[4–7]. The Arduino is connected to a PC, with passes level H.
Arduino code and MakerPlot loaded together. It
was found most convenient to use MakerPlot’s
XY plotting interface, using the X-axis for time Results
and Y-axis for measured depth. The outcome of a typical run with H  =  20 cm, is
shown in figure 8, in which the predicted drain
time of just over 60 s is confirmed. A closer com-
2
MakerPlot is downloadable from makerplot.com. parison of theory and experiment is possible by

November 2018 7 Phys. Educ. 53 (2018) 065001


K Atkin
using the data-logging facility in the MakerPlot Acknowledgments
XY window. The log file is first opened and all I should like to thank Simon Gray and Professor
contents deleted. The ‘Log to File’ button is David Hughes for their useful comments in the
pressed and the run made. After the graph is com-
writing of this paper.
pleted the log file is saved and may be transferred
to a SMath page (see Liengme [1] p 9-4). Received 26 June 2018, in final form 10 July 2018
The results are quite sensitive to the value of Accepted for publication 27 July 2018
the parameter k, which is a function of the ratio of https://doi.org/10.1088/1361-6552/aad680
areas a and A.
2 √ References
In fact, k = (b/B) 2g where b and B are
the internal diameters of the drain tube and can, [1] Liengme B V 2015 SMath for Physics, A Primer
(Bristol: IOP Publishing) (http://iopscience.
respectively. iop.org/book/978-1-6270-5925-1)
In my experiment b  =  6  ±  0.5 mm and [2] Ivanov D, Nikolov S and Petrova H 2014 Testing
B  =  104  ±  0.5 mm. These values with their Bernoulli’s law Phys. Educ. 49 436
uncertainties give rise to maximum and minimum [3] Ladino L A and Rondon S H 2015 Gay-Lussac
values of k: experiment Phys. Educ. 50 713
[4] Atkin J K 2016 Construction of a simple low-
kmax = 0.1747 cm1/2 s−1 and kmin = 0.1227cm1/2 s−1 . cost teslameter and its use with Arduino and
MakerPlot software Phys. Educ. 51 024001
[5] Atkin J K 2016 Using the Arduino with
Figure 9 shows the experimental curve in green,
MakerPlot software for the display of
with theoretical curves (in red and brown) corre­ resonance curves characteristic of a series
sponding to kmax and kmin. It is seen that the exper­ LCR circuit Phys. Educ. 51 065006
imental results lie within these error bounds. [6] Atkin J K 2017 Using the Arduino with
MakerPlot software for the display of
electrical device characteristics Phys. Educ.
Conclusion 52 065007
[7] Atkin J K 2018 An Arduino-based experiment
I have shown how the topic of fluid flow, exempli- designed to clarify the transition to total
fied by the Torricelli law can be presented to stu- internal reflection Phys. Educ. 53 025003
dent groups in a direct way, both theoretically and
experimentally. Such experiments would be suit-
able for real-time lecture demonstration or labo- Keith Atkin graduated in physics in
1964, and in 1975 obtained an MSc for
ratory project work. Free software such as SMath research into the application of
is seen to bring both power and simplicity to the computers in physics teaching. He was
modelling of a physical system, while another a founder member of Star Centre at
Sheffield Hallam University, UK and
successful application of the Arduino in physics
an Associate Lecturer in physics at
teaching has once again been demonstrated. Hallam and afterwards at the
This type of experiment can of course be University of Sheffield. He is the
improved and extended. For example, interested author of Computer Science (M&E
Handbooks, 1980) and Solving Problems in Physics (blurb.
readers may wish to modify the software to dis- com 2012). He is a Chartered Physicist, a Fellow of the
play the efflux speed in real time, so as to obtain Royal Astronomical Society, and retains an active interest in
verification of figure 4. all aspects of physics education.

November 2018 8 Phys. Educ. 53 (2018) 065001

You might also like