Open-source sensors system for doing simple physics experiments

An open-source platform to be used in high school or university laboratories has been developed. The platform permits the performance of dynamics experiments in a simple and affordable way, combining measurements of different sensors in the platform. The sensors are controlled by an Arduino microcontroller, which can be wirelessly accessed with smartphones or tablets. The platform constitutes an economical sensing alternative to commercial configurations and can easily be extended by including new sensors that broaden the range of covered experiments.


I. Introduction
We have designed and constructed a low cost platform that can be used to do simple physics experiments combining different sensors' data easily.The purpose of this work consist in implementing a cheap system that can be used in high schools and universities regardless of their budget in diverse experiments, allowing a higher customization than equivalent commercial sets.

II. System description
The initial requirements of the system are affordability, simplicity, flexibility and extensibility.Under the affordability requirement, we have decided to employ systems that can be easily found on the Internet at low prices.Simplicity means that users with little to no training can easily use the system in physics experiments without difficulty, but also, that its construction does not require special skills.Flexibility implies that the system should be portable enough to work on different types of experiments.Finally, its extensibility will allow users to include additional sensors in the platform to enhance its capabilities and to use it in new experiments.
In order to obtain an innovative platform as well as to add sharing features to it, almost exclusively open-source hardware and software components are used.Within this approach, the physics teacher community can work in open projects that can be used by other teachers, thus reducing the work of designing experiments with the platform.Following this condition, the characteristics of the system are published under a public GNU license in the GitHub repository [1].All the technical details of the platform hardware and software are detailed in that repository: software code, assembling diagrams and technical characteristics of the components.
We initially decided to include sensors in the platform that measure kinematic magnitudes: accelerometer, gyroscope, distance sensor and lightgate sensors.Other sensors, such as a magnetome- ter, a barometer, a thermometer, etc., can be easily added later.Figure 1 shows a diagram of the use of the platform in a physics experiment: the platform includes a mobile unit, which can be attached to a mobile body, containing sensors (s u , s v ,... in the figure) and a portable unit responsible for the Wi-Fi connection that allows the user to access the measured data, but which can also include additional sensors (s x , s y ,... in the figure).Measured data are collected by the portable unit and organized in vectors (M = (t i , x i , ...)) in the figure) also containing the time stamp of the measurements.Whenever it is desirable and possible, the mobile unit can be attached to a body in order to study its movement.Then, the connection between the mobile and the portable units must be based on wireless communications, allowing the studied body and the attached unit to move freely.In our case, communications between the mobile and the portable units are performed via Bluetooth.
The design of the mobile and the portable units was based on previous works of embedded systems [2] and they comprise the following elements: • Mobile unit: An Arduino Nano v3 controls a set of sensors.The version that has been tested in laboratory experiments included an infra-red line tracker, a motion processing unit consisting of 3-axis accelerometer, gyroscope and an ultrasound distance sensor.The AT-MEL serial interface of the microcontroller is connected to a HC-SR06 Bluetooth device.A LiPo battery supplies power to all the system.In its current design, the motion processing unit can be replaced by a similar one that also includes a 3-axis magnetometer together with the accelerometer and gyroscope which would permit to have a inertial measurement unit with 9 degrees of freedom.This system is programmed in Arduino 1. 6 [3] and it implements a simple protocol through a serial wireless connection, which is established by using Bluetooth connectivity that allows the initialization of the microcontroller as well as starting and stopping data acquisition.The main speed limitation in data measurements of the system is due to the Bluetooth connection.Figure 2 (top) shows an implemented mobile unit used in some physics experiments described below.
• Portable unit: It consists of a Raspberry Pi2 with Raspbian Jessie [4] as an operating system.The core process of the unit is programmed in Go [5] and it governs the overall system as well as offering a web front-end.This unit supports the Wi-Fi and bluetooth connections.The data recorded in the measurements are stored in a SD card, constituting the local persistent storage unit.These data can be accessed and retrieved by the users' laptops or smartphones via Wi-Fi connection.
Additionaly, the portable unit can also allocate other wired connected sensors using the GPI of the Raspberry Pi.In the current configuration of the system, four infrared emitter-receivers are connected to it.These can be used, for example, to measure instant speed at different points along the trajectory of a body.The unit can be powered by an ordinary USB battery, allowing to do physics experiments outside the laboratory.Figure 2 (bottom) shows the portable unit.

III. Use in the laboratory
The system described above can be used in different ways in the physics laboratory depending on the users' skill and knowledge of physics.We have tested the platform in two basic experiments: an air track in order to study an uniformly accelerated movement and a pendulum to analyze periodic motion and to obtain the gravity acceleration.Figure 3 shows the mobile and portable units being used in the air track experiment.In this experiment, the mobile unit included a 3-axis accelerometer, a 3-axis gyroscope and an ultrasonic distance sensor.In addition, four static infrared beacons were placed at fixed points of the trajectory and connected to the portable unit.The sampling frequency was about 25 samples/s (∆t ≈ 0.0394 s).This frequency was the result of a compromise between the measuring capabilities of the Arduino and the data communication limitations between the Arduino board and the Raspberry, using the bluetooth connection.With the arrangement of sensors used in the experiment, users can measure the cart acceleration (accelerometer), average velocities between different points (infrared beacons), and the change in the position with time (ultrasound sensor and infrared beacons).From the data recorded by the different sensors, the user can analyze the uniformly accelerated movement and the relationships between kinematics magnitudes.On the other hand, in a pendulum experiment, users can combine the accelerometer and gyroscope measurements to study the acceleration and speed in different points and the periodic dependence of both magnitudes.Infrared beacons can also be used to measure the passage of time at different points of the pendulum trajectory and enrich the physical measurements.See [6] for more details on an air track experiment.Recorded data are stored in the SD card as a plain CSV file with data of all the sensors used in the experiment.The CSV files are transferred to the users' computer or mobile devices using the Wi-Fi established by the portable unit.The rows of the CSV file are tagged with the acquisition time, in order to ease the analysis of the data by simply importing the file on any spreadsheet program.Figure 4 shows some results of the measurements with the air track.The measurements of the ultrasound distance sensor and the component of the accelerometer along the direction of the movement are represented as a function of time.From the data shown there, it can be observed how the experimental noise of the ultrasound sensor increases noticeably with the distance to the reflecting screen.We have checked this noise and, according to iments, it is due to the air exiting from the air track holes.Reducing or eliminating the airtrack pumping, that noise drastically decreases, as well as when the distance between the sensor and the reflecting screen decreases.This can be seen as a possible limitation of the used sensor, which can be solved using, for example, an optical distance sensor.The superposition of the data from the accelerometer and distance sensors allows a clear identification of the collision events between the cart and a rubber band at the end of the air track.From the diference in distances reached after consecutive rebounds (marked as example in the figure) users can obtain the restitution coefficient of the collision.Complementary, from the accelerometer data, users can obtain the change in speed during each collision and compare that result to the one obtained by analizyng the maximum distance before and after the bounce.As an illustrative result, a parabollic curve y = 0.8 − (1/2)0.2(t− 56.75) 2 is shown in the figure.The distance 0.8 was chosen to displace a little the theoretical curve upwards over the experimental points for clarity.The acceleration -0.2 m/s 2 corresponds to the average acceleration measured by the accelerometer sensor as shown in the figure.The agreement between different sensor data can help users to investigate relationships between different magnitudes in an experiment.

IV. Discussion
A cheap open-source system to be used in simple experiments has been developed.It comprises the hardware and software of a sensorized platform.The technical characteristics and the control software of the system can be downloaded for free from the Github repository [1].The system permits the measurement of different magnitudes in the same experiment and the analysis of various phenomena.The electronic components used in the system can be acquired on the Internet by less than 100e, and additional cheap sensors can be also included.Unlike commercial sensor systems, this one constitutes an extensible and customizable platform that can be modified by adding other sensors and including other software characteristics.The use of the Githup repository also allows the collaboration between users that can add new characteristics to the platform.

Figure 1 :
Figure 1: A conceptual diagram showing the main components of the system.It comprises a mobile unit that includes several sensors (su, sv, ...) controlled by an Arduino board and a portable unit with a Raspberry Pi that communicates with the Arduino and establishes a Wi-Fi network.It can also host additional sensors (sx, sy, ...).The measurements of all the sensors can be transferred into the users' devices as series of vectors M via a web front-end implemented in the Raspberry Pi.

Figure 2 :
Figure 2: Mobile (top) and portable (bottom) units of the system.Portable unit shows the connections of four additional infrared sensors attached to it (connections A, B, C, and D in the figure).

Figure 3 :
Figure 3: Photography of an air track experiment using the platform.While the mobile unit is on the moving cart, the portable unit stays on the table with four static infra-red beacons connected to it.

Figure 4 :
Figure 4: Example of combined data recorded with the platform in an air track experiment.The dependence of the distance and the acceleration along with the direction of movement recorded in the same experiment are shown jointly.