Home
Search
Collections
Journals
About
Contact us
My IOPscience
The use of a Nintendo Wii remote control in physics experiments
This article has been downloaded from IOPscience. Please scroll down to see the full text article. 2013 Eur. J. Phys. 34 1277 (http://iopscience.iop.org/0143-0807/34/5/1277) View the table of contents for this issue, or go to the journal homepage for more
Download details: IP Address: 155.54.213.13 The article was downloaded on 04/08/2013 at 19:57
Please note that terms and conditions apply.
IOP PUBLISHING
EUROPEAN JOURNAL OF PHYSICS
Eur. J. Phys. 34 (2013) 1277–1286
doi:10.1088/0143-0807/34/5/1277
The use of a Nintendo Wii remote control in physics experiments ´ 1 , A Arenas 2,3 , M J Nu´ nez ˜ 2 and L Victoria 2 F J Abellan 1 2
Departamento de F´ısica, Universidad de Murcia, E-30100 Murcia, Spain Departamento de Electromagnetismo y Electr´onica, Universidad de Murcia, E-30100 Murcia, Spain E-mail:
[email protected]
Received 17 May 2013, in final form 18 July 2013 Published 2 August 2013 Online at stacks.iop.org/EJP/34/1277 Abstract
In this paper we describe how a Nintendo Wii remote control (known as the Wiimote) can be used in the design and implementation of several undergraduate-level experiments in a physics laboratory class. An experimental setup composed of a Wiimote and a conveniently located IR LED allows the trajectory of one or several moving objects to be tracked and recorded accurately, in both long and short displacement. The authors have developed a user interface program to configure the operation of the acquisition system of such data. The two experiments included in this work are the free fall of a body with magnetic braking and the simple pendulum, but other physics experiments could have been chosen. The treatment of the data was performed using Bayesian inference. (Some figures may appear in colour only in the online journal) 1. Introduction
Since Johnny Chung Lee developed the ‘Wiimote Whiteboard’ application in June 2008, the Wiimote has been used as a support tool in experimental physics laboratories, as well as for other applications [1–4]. An accelerometer is included in the Wiimote, which records data about the three components of acceleration (ax, ay, az) and these data are used for modelling different types of movement, such as free fall, circular motion, oscillating movement, etc. In addition, the Wiimote incorporates a camera of acceptable resolution with an IR filter, which allows the position coordinates (X, Y) of a point source of IR radiation that moves in a plane to be located and followed. The Wiimote itself sends these coordinates every 10 ms by Bluetooth communication to a PC, where they, along with the exact time, are logged before being processed to characterize the physical model of movement. The Wiimote has already been used in laboratory experiments for tracking points illuminated by reflection, where the authors have conducted several studies of the Wiimote’s 3
Author to whom any correspondence should be addressed.
c 2013 IOP Publishing Ltd Printed in the UK & the USA 0143-0807/13/051277+10$33.00
1277
´ et al F J Abellan
1278
Figure 1. Diagram indicating the communication flows between the IR source, the Wiimote and
the PC with a Bluetooth device.
motion tracking performance [5]. However, when used with standard fluorescent lighting only, the reflective brightness of the stickers they use appears to be at the limit of what the Wiimote can distinguish from ambient light sources. For this reason, it is suitable to use an IR focus so that the Wiimote camera can capture the reflective tracking points clearly. In addition this method requires the background of the entire field of the experiment to be covered with black paper to avoid unwanted multiple reflective points, which confuse the Wiimote camera. Therefore, the use of the Wiimote to track points illuminated by reflection must be limited to cases of small areas of displacement because the radiant surface of the focus should always be more extensive than the surface of the experiment and the background must be completely covered with black paper. In the case of large displacement, it is better to use specific sources of IR radiation attached to the centre of the trackable object. By fixing a punctual IR source (LED) to the moving object under study, the Wiimote camera will locate and track this source, and then provide its trajectory during the experiment. Using the Wiimote camera it is possible to locate and send the coordinates of up to four different IR points at the same time, thus widening the variety of laboratory experiments that can be designed. See figure 1.
2. Experimental setup
Figure 2 presents an experimental setup composed of a Wiimote supported on a tripod, and a moving object (a simple pendulum) to which an IR LED has been attached. Behind the pendulum is a rigid board with four IR LEDs at its corners, which are used to calibrate the measuring system. The elements of the experimental setup and procedure are as follows.
2.1. The Wiimote
The Wiimote includes a camera with an effective vision range of 33◦ horizontal and 23◦ vertical and an IR filter that allows us to detect the maximum amplitude for IR light sources with 940 nm wavelength [3]. To take advantage of the camera’s range of vision, the Wiimote should be perpendicular to the plane of motion of the moving object at a distance d = 1.7 · L, where L is the maximum displacement of the object in the horizontal direction of the Wiimote.
The use of a Nintendo Wii remote control in physics experiments
1279
Figure 2. Experimental setup consisting of the following elements: Wiimote attached to a tripod (W); moving object (O); IR LED shining through a hole in the disc (L); rigid panel with four LEDs in the corners to calibrate the measurements (RP); corner LEDs (CL).
Figure 3. IR LED mini-flashlight. The IR LED and switch are clearly visible.
2.2. Mini-flashlight
Figure 3 shows a cheap LED mini-flashlight, with a high radiant power LED4,5. The small size (41 mm × 23 mm × 7 mm) and weight (5.5 g) of this mini-flashlight make it suitable for fixing to the moving object. 4 5
Dealxtreme website: www.dealextreme.com/c/led-keychains-900. Vishay website: www.vishay.com/docs/81011/tsal6400.pdf.
´ et al F J Abellan
1280
Figure 4. Sketch showing the parameters of a simple pendulum of mass, m, length, l, and displacement of the vertical, θ .
2.3. General procedure
The first step is to match the Wiimote and the PC Bluetooth devices. Once this has been done, the application ‘WiiLab’ installed on the PC can be run. This sends a ‘connection completed’ notice, meaning that the system is ready to start receiving data6. At this point, we consecutively switch on the mini-flashlight, start the data collection in the ‘WiiLab’ application and set the object in motion. Then data acquisition will begin according to the configuration (number of points, total number of samples, frequency of sampling, etc) programmed in the ‘WiiLab’ application. After acquisition, the data are stored in a computer file for further analysis. From the coordinates of the positions of the calibration LEDs read by the Wiimote, the coefficients of the geometric transformation matrix that makes the points of the experimental plane correspond with those of the Wiimote plane are determined. Subsequently, the Wiimote readings must be corrected with this matrix to avoid the appearance of nonlinearities in the Wiimote’s coordinate results, as shown in [5]. 3. Practical experiments
Initially, two well-known experiments taken from Mechanics were chosen to test the correct functioning of the proposed method: the oscillating motion of a simple pendulum and the free fall of a body with magnetic braking (Phoenix free fall). For the simple pendulum setup we proposed two experiments, one for the case of small oscillations (A) and one for large oscillations (B). 3.1. Simple pendulum. Small oscillations
Let us remind ourselves that the simple pendulum comprises a non-stretch wire of length, l, with no mass, at one end of which there is a mass, m, of negligible size. See figure 4. The other end of the wire is attached to a fixed point. By moving the pendulum from the vertical to angle θ 0, and letting it drop, it begins to oscillate with respect to the vertical. 3.1.1. Theory.
6 See supplementary material at http://colos.inf.um.es/WiiLab/WiiLab.zip for downloadable computer code and tutorial WiiLab.
The use of a Nintendo Wii remote control in physics experiments
1281
Applying the law of energy conservation, assuming no losses through friction in the wire or the mass, m, and making some transformations, the following expression can be obtained: d2 (θ ) d (θ ) + (ωo )2 sin θ = 0, + 2γ (1) 2 dt dt an equation that can only be solved analytically for small amplitude oscillations, when the approximation sin θ ≈ θ is valid, i.e. when θ ≡ θ (t) < π /9, so that (1) is: d2 (θ ) d (θ ) + 2γ + (ωo )2 θ = 0 2 dt dt and the solution is θ = θ (t ) = θ0 e−γ t (cos ωt + (γ /ω) sin ωt ),
(2)
(3)
with the initial conditions: θ (t = 0) = θ0 and [dθ /dt](t=0) = 0, where 2π , T T being the period of the pendulum and γ the damping factor, which are related by the equation: ω=
ω2 = ω02 − γ 2 , where T0 is the period defined as: 1/2 l 2π T0 = = 2π . (4) ω0 g As can be seen, T0 depends on the length of the pendulum, l, and the acceleration of gravity, g, but not on the amplitude of oscillation. In summary, the oscillation period of a simple pendulum, T, depends on the amplitude of oscillation, θ 0, in a non-trivial way; but for small amplitudes, θ 0 < π /9, corrections due to the amplitude θ 0 can be overlooked. The classical simple pendulum experiment to determine the acceleration of gravity, g, from the period measured, T, consists of measuring the time, t, which the pendulum takes to complete a number, n, of oscillations and then dividing the measured time by n. Assuming that the damping factor is negligible, T ∼ = T0, and thus (4) allows a simple determination of gravity acceleration, relating the time that the pendulum takes to complete a full swing, i.e., the period T, with its length: 1 ∼ 2 1 g = 4π 2 2 = 4π 2 . T T0 Logically, the higher the value of n, the lower the error in determining the period T. However, neglecting the damping causes an error greater than it seems at first sight. Here, we propose the application of Bayesian analysis to infer the parameters of the model more accurately [6]. This is possible because we have a time series available with a large number of data (100 samples per second) that will allow us to: (1) check the solution of the differential equation (equation (3) of the model), and (2) accurately determine the period, T, and the damping coefficient, γ .
´ et al F J Abellan
1282
Figure 5. Graph of the angular position (x = θ · L) in arbitrary units and the fitted curve (red line).
On the basis of the series of data obtained by the acquisition system proposed in previous sections, the data series for the angular position of the pendulum can be obtained:
3.1.2. Measurement procedure and results.
{Xi}: coordinate of the position of the moving object in successive instants of time ti {Yi}: coordinate of the position of the moving object in successive instants of time ti {θ i}: angular positions of the moving object in successive instants of time ti where xi θi ∼ = sin θi = . l If we fit the angular position data series to the solution given by (3) we can infer the distribution function of the two parameters, ω and γ , from which the value of T0 and g can be deduced. The values are: ω = (3.189 417 ± 0.000 006) rad s−1 γ = (0.001 858 ± 0.000 005) s−1 . Figure 5 shows a graph with the values of a time series (5000 data) for the angular position and the filled curve of (3). It is also possible to determine the distribution function for T0 shown in figure 6. The obtained value of 1.97 001 s is determined with a margin of error of the order of 0. 000 01 s. 3.2. Simple pendulum. Large swings
For large swings where θ 0 > π /9, the approach taken in (2) is not possible and the oscillation period will depend on amplitude. In this case, the object of the experiment is to determine the dependence of the period on the initial angle of separation θ 0. Theoretically, it can be demonstrated that the normalized period is given by the expression: π 2 d∅ 2 T (θ0 ) = , (5) T0 π 0 1 − K 2 sin2 ∅1/2
3.2.1. Theory.
where
K = sin θ0 /2 .
The use of a Nintendo Wii remote control in physics experiments
1283
Figure 6. Function of the distribution of the period with a determined value of 1.970 01 ±
0.000 01 s.
It is possible to obtain a good approximation of the period T by developing the integrating term in a power series of K and integrating each term of the development. This gives: 1 θ0 θ0 9 T = T (θ0 ) ≈ T0 1 + sin2 + sin4 + ···. (6) 4 2 64 2 The classic form of this experiment consists of measuring the time (T/4) that the pendulum takes to pass through the upright after being released from a position with angle θ 0. This measurement is made for different values of the angle (θ 0) and a graphical representation of the normalized measured periods is made to observe the match with the curve resulting from the numerical evaluation of the integral of (5). Once again, there is an alternative way to address the problem when a large number of data are available after using the procedure proposed in this paper. By processing these data adequately, we obtain the values of the initial angle, θ 0, and its respective periods for each swing, so that we can represent the normalized periods (T/T0) versus the initial angular position and compare the result with the curve of the theoretical value of the period given by (5). See figure 7.
3.2.2. Measurement procedure and results.
3.3. Phoenix drop tower
The experimental setup of the drop tower is inspired by a popular fairground attraction consisting of a tower from which a car containing passengers is dropped freely. This car is guided by a vertical rail, at the lower end of which there is a magnetic device (Lenz tube), which makes the platform brake gently towards the end of its fall. See figure 8. 3.3.1. Theory.
The equation describing the vertical position of the free falling body is:
gt 2 , 2 where h is the vertical space travelled and g is the acceleration due to gravity. The terminal velocity, VT, of a magnet in freefall inside an aluminium tube is given by the expression [7]: Mg , VT = Km2 h=
1284
´ et al F J Abellan
Figure 7. Representation of the experimental value of the normalized period versus the initial angle (θ 0). The red curve represents the theoretical value of the normalized period given by equation (6).
Figure 8. Representation of the Phoenix drop tower consisting of two cars, with (left) and without
(right) a magnetic brake. Aluminium tube (AT), car (G), magnets (M), plastic tip (T), panel LED (L), car (C), mini-flashlight (F), (P) panel and slide guide (SG).
The use of a Nintendo Wii remote control in physics experiments
1285
Figure 9. Graphic representing the falling movement of the two cars; red dots and black dots, with and without braking, respectively. Theoretical optimal curves: black line, free fall, and red line, braked fall.
where M is the mass of the falling body (tube + car), g the acceleration due to gravity, m the magnetic moment of the magnet and K is a constant that depends on the inner diameter, thickness and conductivity of the tube. This experiment is normally used as an example of uniformly accelerated motion and involves the problem of the distribution of optical sensors that allow the position of a falling body to be located at different moments during its fall. Increasing the number of sensors increases the accuracy of the result of the experiment but also the complexity of the installation. With the proposed data acquisition procedure, this problem is simplified because it is only necessary to attach an IR LED to the moving object for its position to be located. A homemade scale model of a tower is used to carry out this experiment. The model in figure 8 has two identical vertical rails with their respective cars, one with and the other without a magnetic brake. A mini-flashlight with IRLEDs is attached to each car. To perform the calibration prior to carrying out the measurements of length, we installed a circuit with a 1.5 V (type AA) battery with an IR-LED in the four corners of the rectangular panel that supports the two rails. The tripod with the Wiimote is placed in front of the model at a distance of 2 m. Following the steps described in subsection 2.3 will provide data relating to the freefall with and without magnetic braking. Figure 9 presents the two sets of data (with and without braking, red and black) and demonstrates the reproducibility of the experiment. The theoretical curve with the optimal value of g and the straight line corresponding to the braking effect in the final stretch of the fall, with a uniform motion at a constant velocity (terminal velocity), vT , overlaps the data sets. In this case we can infer the distribution function of the two parameters, g and VT. The values are:
3.3.2. Measurement procedure and results.
g = (9.80 ± 0.15) m s−2 VT = (0.624 ± 0.009) m s−1 . We suppose the free fall to be ideal: air resistance is taken to be negligible and we consider that the data fit a model of constant acceleration, independent of time, i.e., of speed. We consider this model because, when we estimate the speed-dependent terms of force, calculated at its maximum value (v max ≈ 4.5 ms for a free fall of 1 m), we find: max (FS ) = G · η · S 2 · vmax ≈ 10−4 N (with G = 10) 1
´ et al F J Abellan
1286
for the viscous Stokes term and max(FR ) =
1 2
· Cgeom · ρair · S · (vmax )2 ≈ 0.06 N (with C = 1)
for the air resistance term. This involves a correction in the acceleration, a ≈ 0.1 m s−2, which is within the error of our fitting, g = 0.15 m s−2. 4. Conclusions
We propose a data acquisition system for use in kinematic experiments based on the Wiimote from a Nintendo console. This procedure was applied in a free fall experiment (with and without magnetic braking) and for a simple pendulum. The quality of the results obtained in these experiments demonstrates that the Wiimote can be used as a precise and cheap method to capture the trajectories of small and large movements, which may include the constant or variable accelerations presented in various physics experiments. The accuracy of the data obtained and the low noise level allow an excellent fit to the equations for the movement model corresponding to each situation, and the determination of the model parameters through the application of Bayesian inference. Acknowledgments
We gratefully acknowledge Miguel Celdr´an, who created the ‘WiiLab’ software used in the data acquisition system of this work. This work was supported by the program ‘Proyectos de innovaci´on educativa con TIC’ of the Universidad de Murcia in Spain 2010–11. References [1] Peek B and Lee J Ch www.brianpeek.com/page/wiimotelib.aspx and http://johnnylee.net/ [2] Lee J Ch 2008 Hacking the Nintendo Wii remote IEEE Pervasive Comput. 7 39–45 [3] Ochoa R, Rooney F G and Somers W J 2011 Using the Wiimote in introductory physics experiments Phys. Teach. 49 16–18 [4] Vannoni V and Straulino S 2007 Low-cost accelerometers for physics experiments Eur. J. Phys. 28 781–7 [5] Tomarken S L, Simons D R, Helms R W, Johns W E, Schriver K E and Webster M S 2012 Motion tracking in undergraduate physics laboratories with the Wii remote Am. J. Phys. 80 351–4 [6] Bretthorst G L 1988 Bayesian Spectrum Analysis and Parameter Estimation (Lecture Notes in Statistic vol 48) ed J Berger et al (Berlin: Springer) p 197 [7] Sawicki C A 1997 A Lenz’s law experiment Phys. Teach. 35 47–49