This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

One master controls and collects data from slaves at the same time

Hello,

I would like to ask you guys whether it is possible that one Bluetooth master device (smartphone) can control and collect data from two Bluetooth slave device (some kinds of sensors) simultaneously. Here, Bluetooth chip is NRF51822. This is for my project that needs to compare two sensor data in different location, which has to be time synchronized. I found that it is possible in theory, but don't know how to start from. It will be great also, if there is some firmware example to start from. I will be waiting for some helps. Thanks!

  • Hey.

    Connecting and communicating with two slave (peripheral in BLE) devices is no problem. The communication can never be simultaneously though. You must expect at least about 10 ms between receiving data from the two sensors. Synchronizing the devices with regards to time will also be challenging. I would expect a about 10ms uncertainty here as well. See this thread about this.

    Before i can advice you further on firmware, please provide a bit more information about your project:

    • Will you use nRF51822 for all three devices?
    • Can you tell me a bit more about what kind of sensors you will use?
    • How often will you need to send sensor data?

    Update 1.

    If you are to accurately measure the time between two points wirelessly, i see two options.

    1. Have accurately synchronized clocks on both measuring devices, and send the time to the master device.
    2. Have both devices send a packet immediately after detecting the pulse, and let the master calculate the time difference.

    For option 1, you must have mechanism for synchronizing the clock of the two devices. It is not enough to sync once, since the clocks will drift away from each other. (With a 30 ppm uncertainty on a clock, it can drift as much as 100 ms in one hour.) You must therefore develop some wireless synchronizing mechanism which is one regularly. If you wish to start developing this using BLE, you can start by reading the "getting started" page and looking at some tutorials.

    For option 2, BLE is not feasible. This is because packets are not sent immidiately, but on the next connection interval. You can use a proprietary 2.4 GHz protocol like Enhanced ShockBurst to send things immidately between the two sensors. You can then have one sensor send the result to a phone over BLE. Read about ESB here, and see the example code here.

  • Thanks for the great answer and here is the answer for your question:

    1. Two sensors will have nRF51822, but I am not sure about the chip in my smartphone (Galaxy S6).
    2. The purpose is to measure pulse wave velocity. Sensor is simple pulse detecting and output needs ADC conversion, either internal or external one if needed. Two sensors should detect pulse wave velocity (i.e. how fast a pulse moved from one location to the other). If we assume that the pulse can get up to 10m/s generally and two sensors are placed about 1 meter apart, it means that 100ms will be the lowest time taken for a pulse to travel. So, delay and time synchronization should be well justified to meet the 100ms (so as sampling rate and data transmission)

    I have read the thread you linked above and it is helpful. I will be look forward to have further advice based on the information I provided above. Thank you !

Related