Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Tacca

Pages: 1

I am using the UARTPassThrough example as basis to send 9DOF wirelings data with BLE.
However, since I have 2 sensors, I am starting to wonder if there is a better way to do this.

I am calling this twice per sample (each sample is a reading from 2 wirelings sensors), with some delay between them:

Code: [Select]
    if (!lib_aci_send_data(PIPE_UART_OVER_BTLE_UART_TX_TX, (uint8_t*)sendBuffer, sendLength))
      SerialMonitorInterface.println(F("TX dropped!"));

I am trying to wrap my head around the specifics of this command, so I am looking something to go guide me deep in the GATT configurations, characteristics, attributes, etc.

Is there any project or code example with that in mind?

I am using a stack of:
- TinyZero
- WirelingAdapter[9DOFWireling;9DOFWireling]

Thank you all in advance.

General Discussion / Re: "Best" way to send sensor data via BLE?
« on: July 09, 2021, 05:36:09 PM »

The Micro SD card and Bluetooth Shields use the same Chip Select (CS) pin for SPI communication, making the boards incompatible with each other simultaneously. You can see the compatibility chart for our TinyShields here:

I apologize for my previous advice that might have sounded like a recommendation to use the Shields together. I meant that it might be best to use an SD Card instead of the Bluetooth TinyShield since it sounded like accuracy and speed were needed and that Bluetooth could cause a lot of practical problems like the question of distance between the Bluetooth receiver/smartphone and hardware stack while running.

I hope that clears up my former message.


That's fine, I decided to go with a low rate because it's just a hardware limitation that wouldn't invalidate my work, and I can always upgrade the module in the future.
However, I am trying to get the best of the throughput available, BlueNRG-MS limits its packages at 20 bytes and as far as my research went there is no way to increase this.
My message which 2 9DOF sensors data is averaging around 90 bytes.

An example of the msg: 999S0-1.23-4.567.89-1.23-4.567.89-1.23-4.567.89S1-1.23-4.567.89-1.23-4.567.89-1.23-4.567.89#

Do you have any recommendations on how to maximize the throughput of BlueNRG-MS? Have you or your coworkers done something similar already?

I am looking through compression/decompression but it might not be worth the time spent.

Thank you.

General Discussion / Re: "Best" way to send sensor data via BLE?
« on: July 05, 2021, 02:33:47 PM »
Hello Tacca,

Have you considered using a Micro SD Card TinyShield? You would be able to save all of the necessary data with timestamps to be able to process it later.

I am curious about the range of Bluetooth on a runner.

TinyCircuits is in the process of designing a new processor board that includes a newer Nordic BLE module that may support the Data Length Extension you have mentioned.

Hope that helps give you some ideas on what you can do. In the future, I may have more time to look into the code you are currently developing to give better insight.


Hello again Réna,

I bought a MicroSD board a while ago and was started testing a couple of days ago, I was having some difficulty with my stack, just now I gave it a little search and found out that the ST BLE Board board might be incompatible with the MicroSD card? is that it?

Is there a way that I can use both?


General Discussion / Re: "Best" way to send sensor data via BLE?
« on: July 05, 2020, 10:54:26 AM »
Hello Réna, thanks for the reply.

Now that you mention it, I had discarded the idea of a SD Card because I didn't want to have the runner plugging-unplugging the sd card for processing.
BUT... giving it another thought, it might be possible to just store (at a fast rate) and sync the data (at a safe rate) using SD card... this would imply in a little delay for the data showing on the device, but, the data amount would be good enough, solid and accurate.

I will probably order it since it might solve the problem.

Thank you again.

General Discussion / Re: "Best" way to send sensor data via BLE?
« on: June 17, 2020, 08:22:18 PM »
Hello Réna, thanks for the help.
The code I was working with is available at:

I kinda mixed both the examples found at tinycircuits learn section.
And this:

It's still a bit of a mess with a lot of commented code since I am still at the beginning of my research.

The idea I had was to have a concatenated String with the data I need, as you can see in this part:
Code: [Select]
      String msg = "";


And then, send it all truncating it in chunks of 20 bytes.
Code: [Select]
#define buffer_size 19

void sendMessage(String msg)
  uint8_t sendBuffer[msg.length() + 1] = {};
  msg.getBytes(sendBuffer, msg.length() + 1);

  uint8_t sentLength = 0;
  int sizeSendBuffer = sizeof(sendBuffer);

  while (sentLength < sizeSendBuffer)
    int arraySize = buffer_size;
    if ((sizeSendBuffer - sentLength) < buffer_size)
      arraySize = (sizeSendBuffer - sentLength);

    uint8_t sendBufferTruncated[arraySize] = {};
    uint8_t sendLength = 0;

    while (sendLength < arraySize)
      if (sendBuffer[sentLength] != 0)
        sendBufferTruncated[sendLength] = sendBuffer[sentLength];

    lib_aci_send_data(PIPE_UART_OVER_BTLE_UART_TX_TX, (uint8_t *)sendBufferTruncated, sendLength);
    SerialMonitorInterface.print("SENT> ");
    SerialMonitorInterface.println((char *)sendBufferTruncated);


About the accuracy and the data I need... I do need the more messages I can get per second, and at least, all the sensor data (except for the fusion data maybe). I will be tracking knee movements each steps, so average runners cadence falls at 160ish steps per minute, I will be tracking only one knee so, 80ish steps per minute, which means 1.3 steps per second, a step each 650ms.

With the rate and model I have now, I need like around 60 to 80 bytes of data per full message, which means 4 truncated messages and I had a kind of a stable measurement at 120 ~ `130ms per message (4 messages, so it would send a message each 30ms). A full message per 120ms would mean 5,4 messages per step, this is not good enough for what I had in mind.

This considering I am using only 1 sensor. Since I plan to use 2 wirelings, the data length would double and I would get only 2,7 messages per step.

During this meantime, I found some possible workarounds:
1 - Maybe tinycircuits have a BLE 5.0 available? (the Data Length Extension feature would kinda solve my problem)
2 - Implement all my research in Cpp (which is not my strongest haha) and data fusion in the device itself, sending only my own fusion data.

I appreciate any thoughts you may have.
Thank you in advance.

General Discussion / "Best" way to send sensor data via BLE?
« on: May 28, 2020, 05:38:47 PM »

I am facing a problem with my project.
I am trying to send 9axis sensor data via BLE, I managed to do that via UART example by truncating a concatenated message of the data, into chunks of 20 bytes each.
The problem is, the 9 axis data plus fusion becomes 3~4 messages (60 to 80 bytes), and I plan to use 2 9axis sensors (wirelings), which would double the length of the message I need to send. This decresce my throughput by a lot.
Right now, using only one sensor, I can't go below 120ms or I start loosing some of the data.

Is there a best way? Any thoughts are appreciated.

Hello Tacca,

We are actually about to come out with a Kickstarter that would allow you to use multiple 9-Axis sensors in a smaller and cheaper format that takes care of any addressing conflicts you would run into by stacking multiple 9-Axis TinyShields. They also have different sized cables that work well with having sensors on different parts of the body.

I would recommend signing up for the TinyCircuits newsletter so that you can see when our new line of boards come out. The format of the line of Whisker sensors would work perfectly for this application!

Best regards,
Laveréna Wienclaw

Hello Laveréna,

I will subscribe and I am looking forward to see this new project.
And depending on the mobility and depth that this Whisker sensor can provide, it would definitely help my master's project thesis.
Unfortunately, since it's not even on Kickstarter yet, I think it won't arrive in time for me to use it in my research, but who knows right.

Thank you.

TinyDuino Processors & TinyShields / Using multiple 9AXIS IMU TinyShield
« on: August 22, 2019, 02:36:05 PM »

I am pretty new into the arduino and circuits world, and after doing some research I ended up here, strongly believing that tinycircuits might be the way for me.

I want to get data from multiple IMU's fixed at some body parts, I want these data timestamped/synced and collected on the go (like being feeded to a smartphone)...

My question is, am I able to stack multiple (3 or more) 9AXIS IMU shields together with a single TinyZero unit?

First idea was 1 TinyZero + 9AXIS + ExtenderCable + 9AXIS  + ExtenderCable + 9AXIS...
The data would be streamed via cable from the TinyZero to the Smartphone, and the energy source would be this too.

The second idea is a bit more expensive, a group of [1 TinyZero (lithium battery) + BLE + 9AXIS] per body part, so, 3 or more of each, then I would get all them via android app and figure out how to connect to multiple devices and sync the data from the multiple devices.

So before I spending quite a good amount in these circuits, is it possible? Is there a better way to achieve this?
If so, Is there any public projects near this that I can dig in?

Thank you very much.

Pages: 1
SMF spam blocked by CleanTalk