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.

Device for experimental physics teachers
#5
OK, we made some tests, and we would welcome some inputs since the BLE is a strange beast… To recap, our goal is to make the arduino nano 33 sense BLE a standalone sensor platform, equivalent to the TI SensorTag. We want to be able to send the data of the accelerometer as fast as possible.

Following Domink’s advices, we tested two solutions:
- A nano program that sends to phyphox via BLE the accelerometer data ax, ay, az and a time-stamps each time a data is available (“one-data packets”) ;
- A nano program that measures the acceleration amplitude four times, and then send these four data plus a time-stamps to phyphox via BLE (“four-data packets”).
For these two tests, the data were also sent to the PC via USB serial.

The following graphs show the results. On the first graph we plot the number of data sent (written on the BLE server), the number of data received when using the one-data packets program and the four-data packets program. The second graph is a zoom of the same graph. The third graph represents de difference of time between two consecutive data packets, for both programs.

We can see that:
- The data sent through the serial port follow the speed of the sensor installed on the nano, 116 Hz, in both programs. All the available accelerometer data are written on the BLE server.
- When working with the one-data packets program, the rate of data reaching phyphox is about 58Hz instead of 116Hz. When working with the four-data packets program, the rate is 82 Hz. In both cases some data are lost.
- Not directly relevant but intriguing, when one zoom on the one-data packets program, one can see that the data are grouped by four. We have no explanation for this…
- Looking at the time difference between two consecutive packets in the one-data packets program,  a strange behavior appears: it favors 8-9 ms delays (corresponding to 116HZ, no loss of packets), 26ms delays (about 38Hz, two packets containing each one data have been lost) and 69 ms delays (about 14Hz, eight packets containing each one data have been lost). We cannot explain why these values are favored.
- Looking at the time difference between two consecutive packets in the four-data packets program,  a more understandable behavior is observed: either the delay is 34 ms (29Hz = 116/4, each packets containing four data, no data lost), or the double 69ms delay (14Hz, one packet of data containing four data has been lost). When one data packet is lost, the next one is caught.

Not being expert on BLE, we wonder whether these behaviors are normal and to be expected? If some Bluetooth experts have some insights on what is going on and how to improve the situation, they would be very welcomed!

Our personal conclusion is that it is important that the nano adds a time-stamps with the data it sends, and that reaching the 116Hz is not going to be possible as it stands. The choice between one-data and four-data packets will depend on whether you want to favor speed (four-data packets) or having the direction of the acceleration (one-data packets).

Cheers,

Fred and Gautier


Attached Files Thumbnail(s)
           
Reply


Messages In This Thread
RE: Device for experimental physics teachers - by fbouquet - 09-10-2020, 02:23 PM

Forum Jump: