This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Illuminance vs. distance with SensorTag
My telephone has only accelerometer (with g), so I have to use a SensorTag. An additional advantage is that it is more simple to attach the SensorTag (CC2650 of Texas Instruments) to a bluetooth mouse (see photo). A difficulty, that I could not solve in the phyphox program, is a difference between the time intervals of the SensorTag and the mouse. Their data were saved in different files (zipped together) and treated by a Python code. A rather small light diode lamp was used and the result is not bad.

Attached Files
.phyphox   MI _ HID Mouse and Intensity.phyphox (Size: 12.71 KB / Downloads: 26)
Beautiful data and nicely done. It is great to see all these well-designed contributions.

To link data from sensors that are not synchronized, the following workaround helps with "slow" data rates like in this case:
Let both sensors write to a buffer of size 1 and set a sleep rate for the analysis process so that it is executed at approximately the rate that you would like to get. Then take the data from both buffers without deleting their content (disable the clear function) and append them to a larger buffer each. This way, you always append the latest value from both buffers and if one has a new value, it will be paired with copy of the old value from the other sensor as it is still in the buffer. You can also generate a matching time axis using the timer-module. A downside to this approach is that values may appear multiple times or might be missed - depending on how you choose your sleep-value compared to the sensor rate. But for this type of experiment this does not really matter.

In any case, I will bump "write a proper interpolation function" a bit further up on my todo list Smile

One other note to anyone who wants to try this experiment:
You will not be able to do any experiment with a Bluetooth mouse on iOS. The iPhone filters the entire HID service and phyphox cannot even see that this device offers such a service. Similar to when the mouse is used as an actual cursor on Android, but it cannot be deactivated on iOS. Therefore it cannot be accessed from our generic BLE interface, but would require an explicit implementation for pointer devices.
Thank you for your suggestions and comments, Sebastian!

I will definitely try the "slow" data acquisition to allow the phyphox program to present the final figure by itself. It would be nice to add a possibility to phyphox to change the sleep time as a parameter of the program.

Another "problem" which I have not mentioned is that here the mouth motion is not registered when it does not move, while the light intensity is recorded continuously. For the moment the program is just a sum of two independent blocks developed independently. Some changes have to be done for their better integration together. For this I have to understand better the existing program for the mouse.

And I am awaiting for the "proper interpolation function" even while I do not think that phyphox should be overloaded with additional functions. I prefer to use phyphox for collection of data which can be treated somewhere else.
Hi solid,

thanks for sharing! I have tried to adapt the experiment to my Logitech mouse - unfortunately without success. Which mouse did you use, the microsoft mobile 3600? Thanks for your help and best regards,

Bonjour Sebastian

Exactly, I had the same problem with my old Logitech mouse, so I bought the Microsoft Bluetooth mouse 3600.
I have still the problem to synchronize it correctly with the slow sensor tag. Also for measurements of the magnetic field of a permanent magnet.. (see Magnétisme (in French) )
Little update:
I just submitted a beta version for the next phyphox update 1.1.6 (well, it is more alpha than beta as there are not even all features for this version included), which includes a new interpolation module. This is not (yet) supported by the editor, but if you are comfortable with directly editing XML, you can try to use this module for synchronization. The idea is to interpolate the data from one sensor at the times at which data from the other has been taken or to interpolate both at predefined intervals. (

You can join the public beta test at The Android version should be available within an hour (maybe a bit longer due to caching of the Play Store app) and the iOS version right after Apple has reviewed this version (probably tomorrow).
Hey Sebastian, thanks for the Update!

Finally my Bluetooth Mouse 3600 arrived and i could do some tests myself. I modified the original "HID Mouse: Illuminance vs. distance (Bluetooth)" so it can be used with the SensorTag CC2650 - currently desperately trying to get the cc2541 up and running, but that's another topic.

The optical sensor of the cc2650 provides data each 800 milliseconds (default) but as we know the refresh rate of the mouse is considerably higher. This leads to multiple assignments of different distance values to one and the same illuminance value. A sleep rate, as Sebastian suggested, of 0.8 assigns one illuminance to one distance value. However, data may be lost in this case if the mouse is moved to fast. You can use no-sleep but then you probably have multiple distance values for each illuminance value and might treat the data later. Maybe I give the interpolation a try somewhat later.

The other file (TEST suffix) is more of a "work in progress" with more possibilities as part of a planned experiment cycle or student experiment. The idea is that the students see that illuminance and distance are somehow connected (the greater the distance, the lower the measured value) and to let the students make guesses how the illuminance corresponds to the distance (e.g. 1/r, 1/r^2, ... ). Instead of using the logX/logY for the grahp, i let phyphox evaluate every log because I want to calculate the exponent. Haven't figured that out yet and I'm not sure if this might be more of a bug than a feature. ;D

Anyway, it's nice to do the experiment with the SensorTag. Thanks to all who contributed to the original "illuminance vs. distance"-file!

Here are some screenshots, how the measurements (LED flashlight) with and without sleep rate differ (top is with sleep, bottom without sleep)

Attached Files Thumbnail(s)

.phyphox   HID Mouse Light - SensorTag.phyphox (Size: 7.22 KB / Downloads: 15)
.phyphox   HID Mouse Light - SensorTag_TEST.phyphox (Size: 10.63 KB / Downloads: 13)
Thanks for the update, Sebastian. I'll look into SensorTag as soon as possible, but it sounds like a great concept from the start.

Mod note: Spam deleted. This is the one and only warning before this account gets purged…

Forum Jump: