Sie sind auf Seite 1von 8

Home

Search

Collections

Journals

About

Contact us

My IOPscience

Physics experiments with Nintendo Wii controllers

This article has been downloaded from IOPscience. Please scroll down to see the full text article. 2011 Phys. Educ. 46 57 (http://iopscience.iop.org/0031-9120/46/1/007) View the table of contents for this issue, or go to the journal homepage for more

Download details: IP Address: 46.190.52.169 The article was downloaded on 14/04/2012 at 12:23

Please note that terms and conditions apply.

FEATURES
www.iop.org/journals/physed

Physics experiments with Nintendo Wii controllers


Martyn D Wheeler
Leicester Grammar School, London Road, Great Glen, Leicester LE8 9FL, UK E-mail: martyn.wheeler@physics.org

Abstract This article provides a detailed description of the use of Nintendo Wii game controllers in physics demonstrations. The main features of the controller relevant to physics are outlined and the procedure for communicating with a PC is described. A piece of software written by the author is applied to gathering data from a controller suspended from a spring undergoing simple harmonic motion, a pair of controllers mounted on colliding gliders on a linear air track, and a person jumping from a balance board.

Introduction
Data-logging makes a signicant contribution to experimental physics taught in secondary schools [1]. The use of computer-based equipment to record experimental measurements offers benets to both pupils and the teacher within a classroom environment. For instance, the pupil can focus upon the learning outcomes of an experiment without becoming bogged down manipulating lots of experimental data, whilst the teacher can spend more time helping pupils interpret graphs readily displayed by software. An example where the use of data-loggers yields signicant benets is the classic investigation into the relationship between the resultant force acting upon a dynamics trolley and the resulting linear acceleration [2]. A traditional approach would be to use ticker tape to measure the acceleration of the trolley. This process is very time-consuming and the pupils can easily get lost in the rather tedious manipulation of the data. However, the datalogging approach allows the data to be gathered by a pupil group comfortably within a single lesson (including repeat measurements); allowing more time to be spent upon looking at the ideas that the experiment is trying to explore rather than just the experiment itself.

The Nintendo Wii controller (or WiiMote) is primarily a way of interacting with the Nintendo Wii gaming console. The WiiMote allows the user to interact with the game by gesture recognition and select objects on the screen via pointing. However, it has been noted by a number of authors [3, 4] that the controller offers a number of intriguing possibilities for conducting physics experiments. The usefulness of the WiiMote as an experimental tool stems from its ability to detect motion through the use of a three-axis accelerometer and to track its position in space via optical sensor technology. The combination of these features coupled with its wireless communication via Bluetooth offers a novel way to demonstrate physics principles such as simple harmonic motion (SHM) and collinear linear collisions. There have been two previous studies that have demonstrated the efcacy of the WiiMote as a low-cost data-logging system. The study presented here owes much to the original work of Vannoni and Straulino [3] where they illustrated the use of a WiiMote for analysing the motion of a pendulum using both the accelerometer and optical sensor. More recently, Rooney and Somers [4] have shown that the accelerometer in the WiiMote
PH YSICS EDUCATION 46 (1)

0031-9120/11/010057+07$33.00 2011 IOP Publishing Ltd

57

M D Wheeler can be used to investigate SHM on a spring. The current work takes these studies further by presenting a fully functioning piece of software that interfaces with the WiiMote directly without the need or technical knowledge to write scripts in third party programs such as GlovePie [5]. In addition, some new experiments that make use of multiple WiiMotes and the Wii Balance Board are presented to further increase the usefulness of these devices within the physics classroom. it also calculates the total acceleration from the vector sum of the individual accelerations. It should be noted that even when the accelerometer is stationary, the total acceleration will be equal to 1g owing to the sensor being accelerated by the Earths gravitational eld. According to the technical specications of the WiiMote [9], the accelerometer can measure acceleration with a full-scale range of 3g which is sufcient for the experiments described in this article. Position sensor Here the WiiMotes camera is utilized to determine its absolute distance away from a pair of infrared (IR) light sources. In the standard Wii setup, this pair of IR light sources is provided by the Sensor Bar which sits on top of the users TV screen allowing the console to track the position of the player. The name Sensor Bar is rather a misnomer since it does not actually sense anything; rather the Sensor Bar consists of two groups of IR LEDs separated by a xed distance of 20 cm that are picked up by the camera on the front of the WiiMote. The Sensor Bar that comes with a Wii is powered via a socket on the rear of the console and hence is not convenient for use in a classroom. However, a wireless version of the Sensor Bar can be bought for around 10 (see gure 1) that does not require a Wii Console for use. Alternatively a Sensor Bar can be made using a pair of either IR LEDs or 3 V lamps, in this case the LEDs or lamps should be positioned such that they are separated by a distance of 20 cm (in a line perpendicular to the WiiMotes camera) in order for the software to be properly calibrated. The distance between the WiiMote and the Sensor Bar can be calculated using triangulation. The WiiMote captures the two light sources on its 1024 pixel 768 pixel CCD array which forms two images. Given the angular elds of view (FOV) of the camera in both the horizontal (41 ) and vertical (31 ) directions, it is possible to determine the average angle subtended per pixel, pix = 0.040 , on the CCD. Direct measurement by the software of the separation, r , of the two images on the camera in terms of pixels will therefore determine the angle subtended by the two light sources and the WiiMote, combining this with the known (realworld) distance, d , between the IR LEDs on the Sensor Bar of 20 cm allows a calculation of the
January 2011

Description of the software


The software used for the experiments outlined in this article, WiiMote Physics, was written by the author and is freely available for download [6] to anyone who wishes to use it. The software itself was written in Visual C#. NET and utilizes the WiiMoteLib application programming interface (API) [7]. Prior to using the software to gather experimental data the Wii controller must be paired with the PC using a standard Bluetooth radio (the controller is put into pairing mode by simultaneously pressing the 1 + 2 buttons). It has been found that not all Bluetooth radios will pair up with the WiiMote. In the authors experience, Bluetooth radios that work with the native Microsoft Bluetooth stack are the most reliable and can be obtained for a few pounds sterling (further details of working Bluetooth devices can be found at [8]). Once the WiiMote and PC are successfully paired, the software can be started and experiments can be carried out. The software can connect with multiple Wii controllers provided that they have all been paired with the PC. Each controller opens up in its own window within the main program. The exact data that is passed from the controller to the PC is determined by the options the user has selected. At present, there are six predened modes of operation which are discussed below. However, additional modes of operation can easily be added in future due to the modular structure of the source code. Accelerometer This mode of operation retrieves the X , Y , and Z values of the acceleration from the WiiMotes internal accelerometer (in multiples of the acceleration due to gravity, g ). In addition,
58
PHYSICS EDUCATION

Physics experiments with Nintendo Wii controllers

Figure 1. Photograph showing the WiiMote and Sensor Bar in a setup to investigate circular motion. The WiiMote is attached to the turntable with blu-tack and the wireless Sensor Bar is placed around 50 cm from the turntable to provide a light source for the WiiMotes IR camera to track as described in the text. The approximate location of the WiiMotes accelerometer sensor is also indicated in the gure.

distance, z , between the WiiMote and Sensor Bar using equation (1)

z=
2 tan

d
r pix 2

in simple harmonic motion. The use of this mode is described in detail in the sections SHM on a spring and Collisions on a linear air track below. Circular motion Here the accelerometer is utilized to measure the centripetal acceleration of the WiiMote placed on, for instance, a rotating turntable as shown in gure 1. In addition, the WiiMotes IR camera is set to monitor a light source placed near to the turntable (e.g. one of the LEDs on the Sensor Bar as illustrated in gure 1). As the WiiMote is set rotating on the turntable the IR camera will see the light source briey upon each revolution and a trigger pulse is generated on the screen of the software. This allows the user to determine the time period for a single revolution by measuring the time interval between trigger pulses and hence explore the relationship between angular velocity and centripetal acceleration for uniform motion in a circle.
PHYSICS EDUCATION

(1)

Motion sensor In this mode the relative motion of the WiiMote perpendicular to the Sensor Bar is determined by tracking the pixel position of the LED images on the WiiMotes camera. This can be used to track the small amplitude motion of the WiiMote suspended on a simple pendulum as described in detail within [3]. One-dimensional motion This mode of operation, as the name suggests, is specic to looking at the motion of the WiiMote along a single axis, for example when the controller is suspended from a spring and set
January 2011

59

M D Wheeler

acceleration
0.3

displacement
6.0

0.2 displacement / m

4.0 acceleration / m s -2
January 2011

0.1

2.0

0.0

0.0

0.1

2.0

0.2

4.0

0.3 0.0 0.5 1.0 1.5 2.0 2.5 time / s 3.0 3.5 4.0 4.5 5.0

6.0

Figure 2. Graph showing the raw data gathered from the WiiMote during the investigation of SHM on a spring. The dashed line represents the displacement of the WiiMote from the Sensor Bar placed on the floor as a function of time. The solid line represents the variation of the acceleration of the WiiMote measured along the main axis of the controller.

Balance Board The Wii Balance Board is another add-on that can be used with the Nintendo Wii gaming console. The Wii Balance Board is designed to be stood upon by the game player and four pressure sensors located at the corners of the board track the position of the players centre of gravity. The Wii Balance Board may be paired up with a PC in exactly the same way as the WiiMote. In this particular mode of operation, the program will retrieve the size of the force acting upon each of the four individual sensors and the total force acting on the Wii Balance Board. An example of the use of this mode of operation is described in the section Impulse and momentum change during a jump.

Example experiments
In this section, three specic experimental demonstrations are described for the purpose of illustrating what can be achieved with the WiiMote or Wii Balance Board and the WiiMote Physics Software.
60
PHYSICS EDUCATION

SHM on a spring The classic demonstration of a linear simple harmonic oscillator formed by a mass suspended from a spring provides the rst illustration of the use of the WiiMote. In this case, the WiiMote itself forms the mass suspended from four standard springs in series. Figure 2 shows some typical results taken using this apparatus. In this experimental arrangement, the component of the acceleration that is important is the one that points directly along the WiiMotes main axis. The solid line in gure 1 shows the acceleration along the direction of motion which, as expected for a simple harmonic oscillator, varies sinusoidally with time. The second trace displayed in gure 2 (dashed line) shows the variation in displacement with time of the WiiMote above the oor as determined by the triangulation method described above. It can be seen that the shape of the displacementtime graph has the opposite phase of the accelerationtime graph as expected from the denition of SHM. Analysis of the results in a spreadsheet gives a time period for the springmass system of 0.98 s. The force constant of the spring was determined in a separate experiment using the WiiMote

Physics experiments with Nintendo Wii controllers (utilizing the software in position sensor mode and observing the variation in position as masses were attached to the WiiMote) to be 5.4 N m1 . Combining these two measurements and using the springmass SHM given by equation (2), containing WiiMote 2 is initially at rest and the glider holding WiiMote 1 is pushed towards it at around 0.4 s. At around 3.1 s the two gliders collide as evidenced from the sudden changes in the gradients of the two displacementtime graphs. Since the two gliders have the same mass (0.38 kg) WiiMote 1 remains stationary after the collision while WiiMote 2 moves off with approximately the same velocity as WiiMote 1s initial velocity, as expected from the conservation of linear momentum. WiiMote 2 continues moving with a steady velocity until it reaches the airtrack buffers whereupon it recoils in the opposite direction (as evidenced by the sudden change in gradient). The motion then continues with further collisions between the gliders and between the gliders and buffers. The acceleration data gathered from the WiiMotes is shown in the bottom half of gure 3. The correspondence between the displacement and acceleration data is apparent by the spikes occurring in the acceleration graph in coincidence with the changes in the velocities of the gliders as they undergo collisions. While the gliders are stationary or travelling with a constant velocity the acceleration along the axis of the controller is seen to be zero. Looking at the collision between the two gliders at around 3.1 s it can be seen that WiiMote 1 is accelerated in the opposite direction to its initial velocity while the glider carrying WiiMote 2 is accelerated in the same direction to WiiMote 1s initial velocity. The magnitudes of the accelerations suffered by each of the gliders are roughly equal (7 m s2 ) but their directions are opposite in accordance with Newtons third law of motion. The power of computer-collected data is the ability to quickly look at the data after the experiment and begin to extract quantitative information about the physics. For example, the collision between WiiMote 1 and the airtrack buffers at around 9.4 s was analysed to look at the agreement between the acceleration and displacement data. Importing the data into a spreadsheet and determining the gradient of the displacementtime data before and after the collision it is found that the change in velocity during the collision is 0.61 m s1 , yielding a change in momentum of 0.23 kg m s1 . The spike in the accelerationtime graph was integrated using a spreadsheet and the area under
PHYSICS EDUCATION

T = 2

m , k

(2)

the mass of the WiiMote is determined to be 0.13 kg which is in good agreement with the value of 0.125 kg measured using a laboratory balance. The key feature of the results shown in gure 2 is that both traces represent actual data gathered in real-time from the WiiMote and there is no need for any post-processing of the data to see the connection between the acceleration and displacement. The experiment is very simple and cheap to set up and provides an excellent starting point for a discussion on the mechanics of oscillatory motion. The experiment can easily be extended to show the effect of adding more mass to the WiiMote, connecting more springs between the WiiMote and the ceiling, or studying the effect of forced vibrations and resonance by attaching the spring to a vibration generator. The one point that must be noted is that the data acquisition rate from the WiiMote is limited to a maximum of around 200 Hz placing an upper limit on the frequencies that can be measured in these experiments. Collisions on a linear air track The second use of the software utilizes two WiiMotes to demonstrate the acceleration and displacement of a pair of gliders moving on a linear air track. In this experiment each WiiMote is held in place on the glider using blu-tack and a pair of IR LEDs is placed at one end of the track in order to determine the displacement of each glider. Care has to be taken such that the gliders do not get too close to the IR LEDs as the images will move out of the eld of view of the IR camera on the front of the WiiMote; it has been found that minimum displacement of around 3040 cm is generally sufcient to meet this requirement. Figure 3 illustrates typical data taken from this experimental setup using a pair of WiiMotes. The graph consists of the displacement and acceleration of both WiiMotes gathered simultaneously. As can be seen from the displacement data shown in the top two traces of gure 3, the glider
January 2011

61

M D Wheeler

WiiMote 1 2.5

WiiMote 2 40

2.0 displacement / m

30 acceleration / m s -2

1.5

20

1.0

10

0.5

0.0 0 2 4 6 8 time / s 10 12 14 16 18

10

Figure 3. Plots displaying the raw data gathered from a pair of WiiMotes undergoing a series of collisions on a linear air track. The solid lines represent the displacement time (top half of graph) and acceleration time (bottom half of graph) data for WiiMote 1 while the dashed lines show the same data for WiiMote 2.

the peak was found to be 0.55 m s1 , yielding an impulse of 0.21 kg m s1 . The agreement between the two sets of data is excellent given the simplicity of the experimental arrangement and forms a good introduction to a discussion of the full form of Newtons second law of motion. Overall, this demonstration provides a very simple but visual way of illustrating the intimate connection between Newtons third law of motion and the conservation of linear momentum and also a way of introducing Newtons second law at advanced level. The experiment could be extended to investigate the efcacy of crumple zones that pupils have designed by placing them on the air-track gliders and analysing the acceleration time curves for collisions with different buffers. Alternatively, at a more junior level, the motion of a single glider can be studied to illustrate the real-time formation of a displacementtime graph. Impulse and momentum change during a jump The nal demonstration utilizes the Wii Balance Board to illustrate the changing forces that occur
62
PHYSICS EDUCATION

as a person jumps off a platform. Figure 4 displays the total force applied to the Balance Board as a function of time. Initially the person is stationary and their weight is being registered (around 750 N). As they begin to jump the downwards force is initially seen to decrease slightly as they bend their legs in preparation for lift off. The force is then seen to rapidly increase as they push against the board until it reaches a maximum at the moment they leave the board. The force then rapidly decreases and eventually reaches the zero level of the balance board. As in the case of air-track collisions described in the section Collisions on a linear air track, the data can be used to introduce the relationship between force and impulse in Newtons second law of motion. The data could be analysed by pupils to determine the size of the impulse as the person jumps off the board and hence arrive at an estimate of their launch velocity. Rather than a person jumping off the board, the same setup can also be used to capture the bouncing of a ball on the Wii Balance Board. This will generate a series of impulse spikes on the
January 2011

Physics experiments with Nintendo Wii controllers costs around 5. This price falls within the budget range of most school science departments and is signicantly cheaper than commercial alternatives. The second advantage is the familiarity of the hardware to pupils. Many pupils will already own or have played on a Nintendo Wii console and hence it is an item that they are used to within another context. This is an excellent opportunity to widen the appeal of physics by relating it to a real-life application. The controllers are obviously limited in scope compared with commercial data-loggers in that they can only perform a small range of functions. Commercial systems can be used to investigate a much wider variety of physical phenomena. However, it is the authors view that Wii controllers will nd their place amongst the repertoire of tools available to the modern physics teacher.

2500 2000 force / N 1500 1000 500 0 0 0.5 1 1.5 time / s 2 2.5 3

Figure 4. Graph showing the variation of total force acting upon the Wii Balance Board during a jump. The jump begins at around 1.5 s and the person leaves the board at around 2.1 s.

graph corresponding to each time the ball hits the board. From this data, it is possible to determine the variation of time intervals between bounces of the ball and the decreasing magnitude of collision force as the ball dissipates its initial energy.

Acknowledgments
The author is grateful to Brian Peek for the help received in incorporating his WiiMoteLib API into the WiiMote Physics software and to Dr Laurence Rogers for his help in reading through and suggesting improvements to the manuscript.
Received 16 July 2010, in nal form 20 August 2010 doi:10.1088/0031-9120/46/1/007

Conclusions
The work presented in this article has shown that Nintendo Wii controllers such as the WiiMote and Balance Board can be used as low-cost dataloggers for demonstrating a range of physics principles. Moreover, a piece of software written by the author has been used to conduct all of the experiments presented in this article and previous publications [3, 4]. The software is freely available to anyone who wishes to use it [6] and requires only a very limited technical knowledge to implement. This article has only illustrated a few of the possible experiments that Wii Controllers offer themselves to investigating, other experiments include looking at distancetime graphs of pupils holding the WiiMote, centripetal acceleration in circular motion, the small and large amplitude oscillations of pendulum bob, looking at the acceleration of a rocket and the force exerted upon lift off, moments and balancing on a Wii Balance Board, and dropping a WiiMote on parachute. There are two signicant advantages to using Wii controllers as data-loggers in the classroom. The main advantage is the cost; provided a PC is available, a WiiMote can be purchased for less than 30 and Bluetooth adaptor typically

References
[1] Rogers L T 2005 Teaching Secondary Science Using ICT ed D Sang and R Frost (London: Hodder Education) pp 1659 [2] www.practicalphysics.org/go/Experiment 219. html [3] Vannoni M and Straulino S 2007 Low-cost accelerometers for physics experiments Eur. J. Phys. 28 7817 [4] Rooney F and Somers W 2010 Using the WiiMote in introductory physics experiments TCNJ J. Stud. Scholarsh. 12 18 [5] http://glovepie.org/ [6] http://wiimotephysics.codeplex.com/ [7] http://wiimotelib.codeplex.com/ [8] http://wiibrew.org/wiki/ List of Working Bluetooth Devices [9] www.analog.com/en/sensors/inertial-sensors/ adxl330/products/product.html
Martyn Wheeler works as a physics teacher at Leicester Grammer School, UK. He has a strong interest in the use of data-logging and computer games as tools for teaching and learning physics.

January 2011

PHYSICS EDUCATION

63

Das könnte Ihnen auch gefallen