conecting one central BLE to several perihperal BLE

userHead Gandelman Roma 2015-09-26 23:54:48 11130 Views5 Replies
is it possible to connect several peripherals BLE to a single CENTRAL one.
I want to put several sensors in different locations . where each of the sensors is connected to arduino and BLE.
the data is gonna be transmitted to main BLE that is defined as CENTER,
I tried that with 2 peripherals and 1 center , and connection was made only between the central and one of the peripherals
any settings I need to change?
2018-02-06 22:25:03 This can be achieved with the BBC Microbit.
In the web block IDE you can give each microbit a radio group ID, then all micro bits in the same group can receive the same data even without pairing. (clever huh)

Use radio send value 'name' + value, to send data to all microbits with same radio group ID
To see if the data received is for this device use..
On radio receive 'name' + value
IF 'name' == value doAction ELSE ignore as not for me to respond.
I guess its a bit like doing a WEB URL POST or GET REQUEST

Javascript example..

// set group same ID for all devices that you want to connect

// transmit code
input.onButtonPressed(Button.A, () => {
radio.sendValue("SID", 1)

// receive code
radio.onDataPacketReceived(({ receivedString: SID, receivedNumber: value }) => {
if (SID == "01") {
if (value == 1) {
do whatever
if (value == 0) {
do something else
userHeadPic brianmoreau
2018-01-11 17:47:43 Is it possible to detect specific BLE device's mac address to do specific task? Cause i am trying to connect two different Bluno to do different task. Like to ask how to use the mac address for while loop or if else userHeadPic 16agm060d
2015-09-29 14:02:36 Xbee could build a mesh~ userHeadPic Leff
2015-09-28 20:50:00 that's a shame
Ill try your solution , but it takes several seconds to make a new connection , that's a big delay if you have many BLEs
do you know if XBEE transceivers have the same problem?
userHeadPic Gandelman Roma
2015-09-28 14:35:14 Hi Roman,

Sorry it does not support multiple connection between several peripherals BLE to a single CENTRAL one. But it can be done by a different way, I called it Switching connection.

The basic idea and steps:
  1. Set the BLE devices to be CENTRAL( One ) or PERIPHERAL( others )
  2. Keep record the MAC address of the PERIPHERAL BLE from the first to the last one.
  3. Set the CENTRAL BLE with AT comands AT+CMODE=UNIQUE and AT+BIND=0x0017ea9397e1( NOTE: just an example of a BLE mac address) to bind the first BLE;
  4. After finishing the data transmission from the first one, then use AT command "AT+RESTART" to disconnect the LINK with the first BLE.
  5. Repeat the step3 to bind the second BLE device.
  6. Repeat the step4 ...

****till the last one and then go back to LINK with the first BLE device.

Btw, this post can help you to enter AT mode in code. How do I know my Bluno is connected in code?


I had some spare time to finish the code, it worked. However, for the connection to link with another BLE requires some time, so the link just can not switch from one to another very quickly. I test with 10 seconds, it would be fine.

(104.94 KiB) Downloaded 1550 times

Here is the code:

NOTE: Once you entered AT mode using code "Serial.print("+++")", it won't print any info through serial port, i.e. the Serial.print("....") won't work.

Code: Select all
/*my Bluno Mega2560  0xC8A030FA0CEF;
  my Romeo BLE   0x20CD3987C659
  my bluno  0xD03972C4CF0F
  my Bluno Mega1280 0xB4994C5C2E77
char* peripheral[] = {"0xC8A030FA0CEF", "0x20CD3987C659", "0xD03972C4CF0F", "0xB4994C5C2E77"};
unsigned long previousMillis = 0;   
const long interval = 15000;           // interval at which to awitch the connection (milliseconds), at least 10 seconds
int linkTo = 0;

void setup() {
  pinMode(13, OUTPUT);

void loop() {
  unsigned long currentMillis = millis();

  if (currentMillis - previousMillis >= interval) {
    previousMillis = currentMillis;
  if (linkTo > 3) linkTo = 0;

void atBind(char* peripheralAdd) {
  digitalWrite(13, HIGH);
  delay(100); //can't be omitted, same below
  Serial.print("+++");// Enter AT mode of itself
  delay(700); // 700 milliseconds MUST be added or AT ode not work
  Serial.println(peripheralAdd);  delay(100);
  Serial.println("AT+RESTART");  delay(100);
  digitalWrite(13, LOW);

void control() {
  for (int i = 0; i++; i < 2) {
userHeadPic Leff