phyphox
3 min read
Physics experiment app by RWTH Aachen University. Turns the phone into a lab instrument using its built-in sensors. Available on Android (F-Droid, Play Store) and iOS (App Store). Open source under GPLv3.
Sensors Used
| Sensor | Data |
|---|---|
| Accelerometer | Linear acceleration (with/without g), vibration |
| Gyroscope | Rotation rate (rad/s) |
| Magnetometer | Magnetic field strength, calibrated/uncalibrated |
| Microphone | Audio waveform, frequency, amplitude |
| Speaker | Tone generation, sonar output |
| Barometer | Absolute pressure (hPa) |
| GPS | Position, speed, altitude |
| Ambient light | Illuminance (lux) |
| Proximity | Near/far state |
| Camera | Photometric data, depth (LiDAR/ToF where available) |
| Bluetooth | External sensors via BLE |
Built-in Experiments
Mechanics
| Experiment | Sensor | Measures |
|---|---|---|
| Acceleration (without g) | Accelerometer | Raw linear acceleration |
| Acceleration with g | Accelerometer | Raw acceleration incl. gravity |
| Acceleration Spectrum | Accelerometer | FFT of acceleration, dominant frequency |
| Centrifugal acceleration | Gyroscope + Accelerometer | Relationship between angular and centrifugal acceleration |
| Inclination | Accelerometer | Angle of inclined plane |
| Pendulum | Gyroscope | Pendulum frequency → gravitational acceleration |
| Spring | Accelerometer | Frequency of spring pendulum |
| Roll | Gyroscope | Rotational speed inside rolling tube |
| Free fall (magnetic) | Magnetometer | Drop along magnet array → linear acceleration |
| Motion stopwatch | Accelerometer | Stopwatch triggered by shocks |
| (In)elastic collision | Accelerometer | Energy loss of bouncing ball |
Acoustics
| Experiment | Sensor | Measures |
|---|---|---|
| Audio Scope | Microphone | 10ms oscilloscope view with edge trigger |
| Audio Spectrum | Microphone | FFT, dominant frequency |
| Audio Autocorrelation | Microphone | Autocorrelation, signal frequency |
| Audio Amplitude | Microphone | Signal amplitude (calibratable) |
| Frequency history | Microphone | Frequency over time |
| Acoustic Stopwatch | Microphone | Time between sound events |
| Free fall (acoustic) | Microphone | Fall duration via sound |
| Doppler effect | Microphone | Doppler shift from a base frequency |
| Speed of Sound | Microphone (2 phones) | Sound velocity with measuring tape |
| Sonar | Microphone + Speaker | Distance or speed of sound |
| Tone Generator | Speaker | Sine tone at configurable frequency |
Magnetism
| Experiment | Sensor | Measures |
|---|---|---|
| Magnetic field | Magnetometer | Raw field data (calibrated/uncalibrated) |
| Magnetic Spectrum | Magnetometer | FFT of magnetic field |
| Magnetic ruler | Magnetometer | Speed and distance via magnet markers |
| Linear acceleration on air track | Magnetometer | Acceleration along magnetic track |
Other
| Experiment | Sensor | Measures |
|---|---|---|
| Elevator | Barometer | Speed and height travelled in elevator |
| Pressure | Barometer | Raw pressure data |
| Pressure in a bag | Barometer | Pressure under applied weight |
| Light | Light sensor | Raw ambient light |
| Optical stopwatch | Light sensor | Time intervals via brightness threshold |
| Proximity stopwatch | Proximity | Time intervals via near/far transitions |
| Gyroscope | Gyroscope | Raw rotation rate |
| Location (GPS) | GPS | Raw position data |
Remote Access
Enable in-app via the menu. Phyphox starts a web server on port 8080 — open http://<phone-ip>:8080 from any browser on the same network to control the experiment and view live graphs.
REST API
All endpoints return JSON. The phone IP and port 8080 are the base URL.
GET /get?<buffer>[=threshold] — read sensor data
/get?time&acc_x&acc_y&acc_z # latest value from each buffer
/get?acc_x=full # entire buffer
/get?time=3 # values where time > 3
/get?acc_x=42|time # values where time buffer > 42
Response:
json
{
"buffer": {
"acc_x": { "size": 1000, "updateMode": "partial", "buffer": [0.12, ...] }
},
"status": {
"measuring": true,
"timedRun": false,
"session": "abc123"
}
}
GET /control?cmd=<command> — control experiment
| Command | Effect |
|---|---|
?cmd=start | Start measurement |
?cmd=stop | Pause measurement |
?cmd=clear | Clear buffers and stop |
?cmd=set&buffer=abc&value=42 | Write value into a buffer |
GET /config — experiment structure (v1.1.6+)
Returns buffer names/sizes, input configuration, and recommended export groups.
GET /meta — device metadata (v1.1.8+)
Returns device and app version information.
GET /time — clock sync (v1.1.8+)
Maps experiment time to Unix time. Response is an array of {experimentTime, systemTime, event} objects (events: start, pause).
GET /export?format=<n> — bulk export
| Format | n |
|---|---|
| Excel | 0 |
| CSV | 2 |
Data Export
From the app: menu → Export. Formats: CSV, TSV, Excel. Can also be triggered over the network via /export.
Custom Experiments
Web Editor
Visual (Blockly-based) editor at phyphox.org/editor. Build experiments by wiring together input, analysis, and view blocks. Export as .phyphox XML file, then load onto device via QR code, URL, or file share.
File Format
Experiments are XML files with a .phyphox extension:
xml
<phyphox version="1.0">
<title>My Experiment</title>
<category>Mechanics</category>
<description>...</description>
<data-containers>
<container name="time" size="1000"/>
<container name="acc" size="1000"/>
</data-containers>
<input>
<sensor type="accelerometer" rate="100">
<output component="x">acc</output>
</sensor>
</input>
<analysis>
<!-- consecutive math operations on containers -->
</analysis>
<views>
<view label="Graph">
<graph label="Acceleration" unitX="s" unitY="m/s²">
<input axis="x">time</input>
<input axis="y">acc</input>
</graph>
</view>
</views>
<export>
<set name="Data">
<data name="Time">time</data>
<data name="Acceleration">acc</data>
</set>
</export>
</phyphox>
View elements: <graph>, <value>, <edit>, <button>, <slider>, <toggle>, <dropdown>
Input types: accelerometer, gyroscope, magnetometer, pressure, light, proximity, gps, microphone, camera, bluetooth
External Hardware
BLE sensors can be integrated via the Bluetooth input module. Arduino and MicroPython libraries are available for building custom sensor peripherals.
Experiment collection (all built-in .phyphox files): github.com/phyphox/phyphox-experiments