connecting two Bluetooth transmitters to one Bluetooth receiver

Dear folks,

We are working on a Bluetooth related data collection project.

We would like to receive data from two sensor units by using BT technology. Our setup is as follows:

  1. one BT receiver (dongle) connected to the laptop that has Arduino IDE environment.
  2. Two BT transmitters. Each transmitter is attached to one sensor unit.
  3. two microcontrollers. Teensy 3.2. Each is connected to one BT receiver and an analog sensor.

Our goal is to achieve the connection of two BT transmitters to one BT reciever. Our BT hardware is shown in the link. Using the BlueSMiRF - SparkFun Learn. We use Teensy 3.2 as

We have no connection problem when we only pair one BT receiver to one transmitter for data collection. Data from one sensor unit is successfully transmitted to the BT receiver that is connected to the laptop. But the data collection becomes problematic when we add another BT transmitter (which is connected to another sensor unit). The problems can be described in two areas:
First, the arduino IDE software shows the errors mainly saying that the access is denied.
Second, we use a matlab program to read and collect the data. The matlab prompt window shows the error saying that an unsuccessful read. A timeout occurred before the terminator was reached.

The Bluetooth part code for this setup is written like this in each teensy microcontrooler:

#define BLE Serial1

void setup(){

Serial.begin(115200);
BLE.begin(115200);
}

void loop(){

BLE.print();
}

I don't know if we miss anything in the code. Hope everyone can give me some tips. Thank you so much.

Ji

But the data collection becomes problematic when we add another BT transmitter (which is connected to another sensor unit). The problems can be described in two areas:

Do you understand why the process of connecting bluetooth devices is called pairing? Not tripling?

Hey Pauls,

Thank you so much for the reply. Sorry I don't understand why. And do I need to use another receiver then to make two pairs?

Ji

Your setup is unclear but it appears that you have two sensors with bluetooth, only one of which can connect with PC. This is unsurprising, and you now probably understand that "pair" means "two". The important thing is that at least one thing works.

If at least one of your blueteeth can be configured as a master, you might get round this controlling the power to it and configuring the auto-connection on the fly. I believe the simplest arrangement is:

Two modules A and B, which are Arduino+Sensor+bluetooth.
Sensor module A has master bluetooth, B is a slave
A collects its own data, Variable A, and was auto-connected to B, thereby being able to collect Variable B.
A disconnects from B and is reconfigured to auto connect with PC, thereby being able to send both variables.
A disconnects from PC and is reconfigured to connect to B, and the loop goes round again.

I believe anything else will involve at least another bluetooth dongle controlled by PC, or another arduino with two bluetooth modules to collect data from existing and feed a single stream to PC by cable. The latter would mean the existing PC dongle becomes redundant, but probably absolves you from further fiddlearsing around with Matlab. Both of these options would mean the collection devices you already have would remain unaltered.