On the fully automation of the vibrating string
J. Tajuelo1, J. S´aenz2, J. A. de la Torre1, L. de la Torre2, I. Z´u˜niga1, and J.
1Dept. F´ısica Fundamental UNED, Senda del Rey 9, 28040 Madrid, Spain,
2Department of Computer Sciences and Automatic Control, UNED, Juan del Rosal
16, 28040 Madrid, Spain
Abstract. This work explains how to develop a fully functional virtual
and remote laboratory (VRL) for a vibrating string of length Lwith
both ends ﬁxed. This laboratory is common in undergraduate studies of
vibrations and waves. We propose the construction of a virtual laboratory
explore the dependence between the frecuency of the vibrating string
and the physical parameters of the experiment. This work also explains
how to build a remote laboratory using LEGO MindstormsTM, Arduino,
and a LabVIEW speciﬁc software to control all the components. The
remote laboratory exhibits the same behavior of a classical hands-on
lab, allowing the user to measure diﬀerent physical quantities and their
dependence with the fundamental frequency of the vibration. Both the
virtual and the remote labs are accessible through UNILabs: a Content
Manager System created to host VRL on the cloud.
Keywords: virtual lab, remote lab, physics
Traditional experimental laboratory sessions and face-to-face lectures can be
complemented with new online experimental tools. While there already are lots
of Internet resources (many of them accessible for free) to fulﬁll many theoretical
aspects on education, engineering and scientiﬁc studies also need more speciﬁc
Internet based tools to cover the practical part of their teaching, as many works
have brought to light [4, 20]. In this sense, online labs make possible to illustrate
scientiﬁc phenomena that require costly or diﬃcult-to-assemble equipment, and
can be divided in two diﬀerent and complementary approaches:
–Virtual Labs provide computer based simulations which oﬀer similar views
and ways of work to their traditional counterparts. Nowadays, simulations
have evolved into interactive graphical user interfaces where students can
manipulate the experiment parameters and explore its evolution.
–Remote Labs use real plants and physical devices which are teleoperated in
real time. Remote experimentation through the Internet has been available
for more than a decade and its interest and use has been growing over the
years [10, 16, 18].
Past studies have shown that online and hands-on labs are equally eﬀective in
terms of learning outcomes . Moreover, online labs provide additional advan-
tages, such as that lab sessions can be watched by many people and recorded
or that online labs can be used in 24/7 from anywhere and can be accessed by
Given the complementary uses of the previous experimentation approaches,
it is probably best if an experiment itself is oﬀered in several ways. Here, we
present a lab implementation of a vibrating strings system that consist in both
forms: the virtual or simulated one and the real, remote one. For those readers
that might be interested in these resources, the virtual and remote laboratories
can be found in UNILabs, a network of interactive online laboratories. For those
readers interested in replicating the system or learning how to build a similar
one, the main instructions and tips to do so are given in this paper.
online lab interfaces. Since its appearance, more than a decade ago, EjsS has been
growing and nowadays it can also be used to easily create remote laboratories. It
has been massively used to create physics simulations: there are more than three
hundred at the ComPADRE-OSP digital library , as well as many virtual and
remote labs in the automatic control ﬁeld (for example, those at the UNILabs
network [5,8]). While all these applications were based on Java and deployed as
again, ComPADRE-OSP oﬀers a couple of hundred of them. However, to the
experiment in the present work and in .
All applications created with EjsS can be embedded into Moodle, the most
widely used free and open source Learning Management System (LMS), with
just a few clicks. For this, a plugin called EJSApp  is used. Not only the ap-
plications get embedded in the LMS but they also gain some additional features
automatically, such as: connection with a booking system that may be used for
controlling the access to the remote experiment, multilanguage support, saving
data and image ﬁles from the virtual or remote experiment application to the
users’ ﬁles repository in the LMS, grading, monitoring the time spent by users
working with the experiment and backup and restore options. The virtual and
remote labs developed in this work have been integrated in UNILabs, a portal
based in Moodle, using this solution.
2 Physical description of the experiment
Consider a string of length L, volumetric density ρand mass M, that oscillates
in the Y Z plane under a constant tension T. Fig. 1 shows a forces diagram on
an inﬁnitesimal length dy of the string. This inﬁnitesimal portion of the string
has a mass dm =µdy, with µ=M/L the linear density of mass. Net tensions
produced on the string are
Fy=Tcos(α+dα)−Tcos α , (1)
Fz=Tsin(α+dα)−Tsin α . (2)
Fig. 1. In an inﬁnitesimal portion of the string dy appear two tensions, one at each
end of the portion, so that under a small displacement assumption the horizontal net
tension is null.
Under the assumption of a small displacement in the vertical direction, a ﬁrst
order Taylor expansion of the forces gives
Fy= 0 ,(3)
Fz=T dα . (4)
Newton’s Second Law gives, then
T dα =dma (5)
By relating the angle αwith its Y Z components, taking derivatives and
aproximating in Taylor’s ﬁrst order we obtain an equation for the inﬁnitesimal
∂y2dy , (7)
so as the equation that describes the wave motion is
which is the so-famous wave equation . This equation describes the temporal
evolution of a transversal wave propagating at a speed v=pT/µ.
For a ﬁxed-ﬁxed string both ends are ﬁxed, so that the displacement at these
nodal points is zero. The temporal part of the solution to the wave equation can
be written as a linear combination of normal modes
z(y, t) =
Lcos (ωnt)e−nγt ,(9)
Here, γis a damping coeﬃcient. Fig. 2 shows the vertical oscillation of the string
as a function of the position x, for the ﬁrst four normal modes. Each nmode has
(n+ 1) ﬁxed nodes (positions where there is no displacement) and nanti-nodes
(positions with maximum displacement).
Equation 9 shows that the bigger the normal mode, the higher the damping
factor. Eventually, all the n > 1 modes vanish and the only surviving term gives
a “stationary” wave
z1(y, t) = A1sin πy
Note that the amplitude of the perturbation eventually goes to zero as a
consequence of its proper damping coeﬃcient −γ.
At a ﬁxed position y=L/2 we have
z1(t) = A1cos (2πf1t),(12)
where the fundamental frequency f1is given by
where ris the radius of the string and ρits volumetric density. If we select a
control parameter (as could it be the tension, for example), by measuring the
frequency fof the string as a function of this parameter we may stablish a
relationship of the kind
so as for diﬀerent tensions we may perform a least squares method to obtain the
constants αand βand, therefore, ﬁnd the density of a string just knowing the
length of the string and its radius, i.e.,
Fig. 2. First four normal modes of vibration for a ﬁxed-ﬁxed string. Each nmode has
(n+ 1) points where the oscillation is zero. The wave length of mode nis λn= 2L/n.
The key concept of this experimental set-up is the fact that there exists a de-
pendence between many parameters: a linear dependence between the period
and the length of the string, an inverse dependence between the frequency and
the radius, a square root dependence between the tension and the frecuency,
and so on. With these many diﬀerent cases, a student may explore with many
parameters, using linear-linear ﬁts, linear-log ﬁts, etc. so as to obtain physical
quantities measuring how the frequency depends on them.
3 Experimental device
A schematics of the device is shown in Fig. 3. There are ﬁve diﬀerent strings (2)
made of diﬀerent materials (copper, kanthal, constantan, and nickel) and with
diameters ranging from 0.3 mm to 0.5 mm. One of the ends of the strings (with
the exception of the central string) is ﬁxed on the aluminum structure of the
device, while the other end of the strings is connected to a dynamometer (10)
that measures the tension along the string. In the case of the central string, the
ﬁxed end is connected to the axis of a stepper motor (3), so that the tension can
be controlled. A LEGO carrier (7) is used to displace an aluminum rod in close
contact with the strings (8) along the yaxis, in such a way that the length of
the vibrating part of the strings can be changed from 380 mm to 550 mm. This
length is measured by means of a rule and an indicator attached on the mobile
rod (9). A DC-LED (Galaxy 1000) light source (1) illuminates the system from
above, and a linear stage (RS 340-3749) (6) is setup below the strings along
the xaxis. Two elements are attached on the top of this linear stage: i) a light
sensor (Phywe 08734-00) covered by an opaque cap with a 0.3 mm slit oriented
along the yaxis (5), and ii) a LEGO gear connected to a LEGO servo motor (4).
As can be seen in the close view of Fig. 3, the rotation axis of the LEGO gear
(11) does not coincide with its center, so that the perimeter of the gear roughly
describes an ellipse when the LEGO servo motor rotates (12). The position of
the opaque cap and the gear along the vertical direction has been ﬁne-tuned
in such a way that, ﬁrst, the cap of the light sensor is placed less than two
millimeters below the horizontal plane formed by the strings, and second, the
apex of the gear perimeter trajectory coincides with the horizontal plane formed
by the strings (13). The stepper motor and the linear stage are controlled by
two identical drivers (EasyDriver), and An Arduino I/O boardcard is used to
send the convenient digital signals. A power supply (Lendher 3003D) provides
the current required by both drivers, and a second identical power supply is used
for the DC-LED light source. An oscilloscope (PicoScope 2203) is used to read
the measurement from the light sensor. A LabVIEW code has been developed
to control all of the above mentioned elements.
Fig. 3. Fully developed experimental device, consisting of the following elements: (1)
DC LED light source, (2) strings, (3) stepper motor, (4) LEGO gear connected to
LEGO servomotor, (5) light sensor, (6) linear stage, (7) LEGO carrier, (8) mobile
aluminum rod, (9) rule and length indicator, and (10) dynamometers. The close-view
ﬁgure shows a frontal view of the string plucking element consisting of (11) the rotation
axis of the LEGO gear, (12) trajectory described by the LEGO gear perimeter, and
(13) string under study.
Fig. 4. VRL communications architecture
4 The Graphical User Interfaces
The graphical user interface (GUI) for both the virtual and remote lab is built
sliders and so on, in a HTML view that allows the user interaction. It gives the
student the control of the experimental environment (tension, length) as in a
hands-on laboratory. To connect both sides (LabVIEW on the server side and
EjsS on the client side) the lab architecture includes a JIL server, . JIL uses the
XML-RPC protocol to encode the messages and allow data exchange between
both sides, as shown in ﬁgure 4.
4.1 The EjsS Tool
EjsS is a tool that oﬀers an easy way to create simulations and remote laborato-
ries with a GUI for developers with no programming skills. These experimental
applications can be made according to the user needs of interactivity and vi-
sualization. Other VRL applications have been developed using EjsS and the
related papers deﬁne it as a tool that facilitates the development of applications
by researchers, teachers and students who want to focus in the simulation or
system theory and not in the technical programming aspects [12, 3].
EjsS also allows the user to run a ﬁnished application directly from the
editor. If the aim is to publish the VRL as an online application, the developer
can package it in order to run it in a standalone mode (in the case of Java) or
8, 11, 6, 19].
description, model and view tabs. The editor allows to build a simulation or re-
mote laboratory by adding the mathematical behavior and a graphical interface.
Then, the main application is divided in two parts:
–The model. Using this tab in the editor, a developer can deﬁne diﬀerential
equations, write some custom code and/or make connections to other soft-
ware or hardware. The complexity of the simulation and model depends only
on the implemented system, the requirements and the knowledge about it.
Fig. 5. Main view of the EjsS editor.
–The view provides to the users a GUI that determines the interaction and
visualization capabilities of the application. This view can be built using the
editor by adding single view elements from the right panel of the EjsS editor
(right side of Figure 5).
4.2 The basic GUI
The vibrating string experiment described in this work can be simulated using
EjsS, introducing equation 12 to generate the data and by creating an interactive
GUI. This GUI consists of buttons, sliders, numerical ﬁelds, check boxes, graphs,
and two and three dimensional graphical elements that allow one to change and
visualize parameters of the lab.
Figure 6 shows the basic structure of the virtual laboratory when the .xhtml
is served to the client. As it was said in previous sections, the virtual laboratory
is based on a simulation of the system behavior and the GUI. The virtual lab also
allows students to get familiar with the available interaction and the protocol, in
order to be prepared to the remote version of the lab. The application window is
Fig. 6. The virtual vibrating string system laboratory.
divided into three sections: a 2D and 3D graphical visual representation of the
system, the controls panel and the plots/graph panel.
–Visual representation (2D/3D): The top-left side of Figure 6 shows a 3D
model of the system in which the user can observe the basic parts of the
real structure of the vibrating string laboratory. In the remote version, this
panel contains a web-cam that allows to see the tension and length of each
string, or a general view of the lab, as in Figure 7.
–Controls panel: Using the controls, buttons and sliders of this panel shown in
top-right side of Figure 6, the user is helped to go through the experimental
protocol, highlighting each step and giving tool-tips to make it easier.
–Plots/Graphs panel: This part of the interface, at the bottom part of Fig-
ure 6, allows the user to see data in diﬀerent plots and graphs. The vibrating
string laboratory plots the light intensity versus, ﬁrst, the position of the lin-
ear stage (see section 5 for details in this calibration procedure), and second,
time (in order to obtain the frequency of the fundamental normal mode).
5 Experimental protocol
Three CCD cameras allow the student for the visualization of a general view
of the experimental setup as well as a close view of the measurement elements
(dynamometers and length indicator). Once the student connects to the remote
controller, an automated initialization procedure is executed by the device: The
DC-LED is turned on, and the linear stage and the LEGO carrier are displaced
Fig. 7. The Remote vibrating string system laboratory.
to their initial positions, determined by means of two LEGO limit switches. After
this initialization, the student has to proceed as follows:
1. Location of the strings’ positions: A complete sweep is performed by
the linear stage along its whole range of displacement, while the light sensor
attached on its top is continuously measuring the light intensity. Therefore,
the student can plot the function light intensity versus position along the
xaxis. As can be seen in Fig. 8a, the light intensity is roughly symmetric
with a local maximum at the center. This is because we use a single light
source placed at the center of the device in order to avoid multiple shadows
produced by multiple light sources. Thus, the student can determine the
position of each string from the ﬁve local minima in the light intensity.
2. Selection of the string and the length to explore: After this calibra-
tion, the linear stage is displaced to the string selected by the student, and
the LEGO carrier moves backward or forward to reach the desired length.
Then, the linear stage performs an automated ﬁne-tuning to ensure that the
thin slit of the light sensor is placed exactly below the string shadow.
3. Selection of the tension (if needed): If the string selected by the student
is the central one, the tension can be varied by the stepper motor. In that
purpose, by clicking an increase tension (or decrease) control, the stepper
motor rotates a ﬁxed number of steps in the clockwise (or counterclockwise)
direction, so that the tension is increased (or decreased) in steps of approx-
imately 0.05 N. The student observes the measurement of the dynamometer
by means of one of the CCD cameras, and is able to change the tension as
long as it is maintained below 10 N to avoid breakage of the string.
Fig. 8. a) Light intensity versus position of the light sensor along the xaxis. b) Light
intensity versus time after the gear hits one of the strings. The inset graph represents
a close view of the results from t= 3.5 s to t= 3.55 s.
4. Execution of the experiment and data acquisition: When the previous
steps have been completed, the device is ready to execute the experiment in
those conditions selected by the student. Then, by clicking the corresponding
control, the light sensor starts to measure the light intensity, and the LEGO
gear attached on the top of the linear stage performs a 360◦rotation, plucking
the string when it reaches its highest position. The Fig. 8b shows the results
of an actual experiment as an example. The instant in which the gear hits
the string and the relaxation dynamics are clearly observed. The student has
to analyze these data, calculating the frequency of the fundamental normal
5. Analysis of the results and comparison with theory: Once the student
has completed experiments under diﬀerent physical conditions, the depen-
dence relation between f1and the physical parameters of the string (T,
L,ρ) can be established. Then, the student should be able to discuss the
experimental errors and the validity of the theoretical model.
Traditional hands-on laboratories are useful to achieve experimental skills like:
–Knowing the principles, techniques and instrumental measure devices to
study physical phenomena.
–Evaluate limitations of the measure process.
–Explain the eﬀects of interference in measures, their consequences and how
to minimize the associated errors.
–Be able to calibrate measure instruments, take useful data collections and
perform a statistical analysis.
–Report correctly taken measures, and obtain relationships between physical
In distance learning education context, the implementation of new techniques
and metodologies that addapt these skills to the student is of the utmost im-
portance. These techniques should allow both the comprehension of the physical
experiment and the evaluation of the expected abilities. Therefore, alternatives
to hands-on laboratories should be studied in detail.
In this work we propose an eﬀective alternative that has been demonstrated
to be useful . On one hand, we develop a virtual laboratory that allows the
students to practice, to be familiar with the techniques of measure, and to in-
troduce them to the concept of data adquisition. The virtual laboratory should
be built in such a way that it is close related to a real laboratory. In spite of
being in a virtual mode, it is important for the user to pay attention to how to
eﬀectively measure physical quantities and how he or she has to collect correct
data. As a virtual laboratory, it lacks of proper physical (realistic) conditions,
and thereafter we need to oﬀer a proper alternative to the hands-on lab.
For this purpose we also explain in this work how to build, in a easily af-
fordable manner, a remote laboratory. This remote lab ensures that the data
adquisition is exactly the same a scientist would take if he or she was actually
in a lab. Through camera views, the experimentalist can control all the physical
parameters and can command the measure process. Raw data, extracted directly
from the experiment done in real time, will be used to analize results and to ob-
tain conclusions. We focus in this part on how to adapt a classical experiment to
be controlled with a computer. We use LEGO MindStormsTM construction kits,
stepper motors and an Arduino controller that are all connected in LabVIEW.
The control of LabVIEW is delegated in a JIL Server, which uses the XML-RPC
Simulations. This code is deployed in UNILabs, the webserver that allows the
user to connect to the lab with a web browser.
We choose the vibrating string as a prototypical example in the study of
vibrations and waves, which is one of the subjects that appears in the ﬁrst
courses on Physics degree. The construction of an accurate hands-on laboratory
can be sensitive and, as such, we provide an alternative solution for those learning
center that cannot aﬀord the physical lab. The selection of the vibrating string
was made with two ideas in mind. The ﬁrst one is the physical representation
of the experiment. This experiment allows the student to know the dependence
between many parameters. We know that the fundamental frequency of the
standing wave depends on the density of the string, its length, and the tension.
The relationship between this parameters goes, respectively, as the inverse of the
square root, the inverse, and the square root. This fact allows the student to learn
about diﬀerent representations (linear, inverse, logarithmic) in order to ﬁt data
collection to a curve. The second idea is to present how cost-eﬀective devices can
be used to build complex laboratories. With LEGOTM kits it is remarkably easy
to introduce experimentalists into robotic designs. The development of Arduino
boards also allows one to control stepper motors, light diodes, and so, in an
easy manner. These tools can be widely used to construct future laboratories,
compatible with the requirements of a given experimental setup and allowing the
students to measure, analyze and extract conclussion with laboratories developed
in the cloud.
1. J. Bermudez-Ortega, E. Besada-Portas, J.A. Lopez-Orozco, J.A. Bonache-Seco,
and J.M. de la Cruz. Remote web-based control laboratory for mobile devices
based on ejss, raspberry pi and node.js. In 3rd IFAC Workshop on Internet Based
Control Education, IFAC-PapersOnLine, volume 48, pages 158–163, Brescia, Italy,
2. James R. Brinson. Learning outcome achievement in non-traditional (virtual and
remote) versus traditional (hands-on) laboratories: A review of the empirical re-
search. Computers & Education, 87:218–237, 2015.
3. J. Chacon, H. Vargas, G. Farias Castro, J. Sanchez Moreno, and S. Dormido. EJS,
JIL Server and LabVIEW: How to build a remote lab in the blink of an eye. IEEE
Transactions on Learning Technologies, (99), 2015.
4. Gao-Wei Chang, Zong-Mu Yeh, Hsiu-Ming Chang, and Shih-Yao Pan. Teaching
photonics laboratory using remote-control web technologies. IEEE Transactions
on Education, 48(4):642–651, 2005.
5. Dictino Chaos, Jesus Chacon, Jose Antonio Lopez-Orozco, and Sebastian Dormido.
Virtual and remote robotic laboratory using ejs, matlab and labview. Sensors,
6. W. Christian and F. Esquembre. Modeling physics with easy java simulations. The
Physics Teacher, 45:475–480, 2007.
7. Wolfgang Christian, Francisco Esquembre, and Lyle Barbato. Open source physics.
Science, 334(6059):1077–1078, 2011.
8. L. de la Torre, M. Guinaldo, R. Heradio, and S. Dormido. The ball and beam
system: A case study of virtual and remote lab enhancement with moodle. IEEE
Transactions on Industrial Informatics, 11(4):934–945, Aug 2015.
9. L. de la Torre, R. Heradio, C. Jara, J. Sanchez Moreno, S. Dormido, F. Torres, and
F. Candelas. Providing collaborative support to virtual and remote laboratories.
IEEE Transactions on Learning Technologies, 6:312–323, 2013.
10. L. de la Torre, J. P. Sanchez, and S. Dormido. What remote labs can do for you.
Physics Today, 69:48–53, 2016.
11. Luis de la Torre, Juan P. Sanchez, Ruben Heradio, Carmen Carreras, Manuel
Yuste, Jose Sanchez, and Sebastian Dormido. Unedlabs - an example of ejs labs
integration into moodle. In World Conference on Physics Education, 2012.
12. G. Farias, R. D. Keyser, S. Dormido, and F. Esquembre. Developing networked
control labs a matlab and easy java simulations approach. IEEE Transactions on
Industrial Electronics, 57:32663275, 2010.
13. A. P. French. Vibrations and waves. CRC Press, 1971.
14. D. Galan, R. Heradio, L. de la Torre, S. Dormido, and F. Esquembre. Automated
experiments on EjsS laboratories. In International Conference on Remote Engi-
neering and Virtual Instrumentation, pages 78–85, Madrid, Spain, Feb 2016.
15. Christophe Gravier, Jacques Fayolle, Bernard Bayard, Mikael Ates, and Jeremy
Lardon. State of the art about remote laboratories paradigms - foundations of
ongoing mutations. International Journal of Online Engineering, 4(1):19–25, 2008.
16. R. Heradio, L. de la Torre, D. Galan, F. J. Cabrerizo, E. Herrera-Viedma, and
S. Dormido. Virtual and remote labs in education: a bibliometric analysis. Com-
puters & Education, 98:14–38, 2016.
17. R. Heradio, L. de la Torre, J. Sanchez, and S. Dormido. Making EJS applications
at the OSP digital library available from Moodle. In International Conference on
Remote Engineering and Virtual Instrumentation, pages 112–116, Porto, Portugal,
18. Ruben Heradio, Luis de la Torre, and Sebasti´an Dormido. Virtual and remote labs
in control education: A survey. Annual Reviews in Control, 42:1–10, 2016.
19. R. Pastor, J. Sanchez, and S. Dormido. Web-based virtual lab and remote exper-
imentation using easy java simulations. In Proceedings of the 16th IFAC World
20. M. Wannous and H. Nakano. Nvlab, a networking virtual web-based laboratory
that implements virtualization and virtual network computing tech. IEEE Trans-
actions on Learning Technologies, 3(2):129–138, 2010.