Arduino Nano BLE Confusion

Hi. I'm working on a project with the Arduino Nano BLE. My project is very simple. All I want to do is have two Nanos advertising their IMU data to a third, central nano BLE. The central Nano will read the IMU measurements from the two nano BLEs, and identify which data came from which nano.

I have gone through the BLE tutorial on the arduino website but I do not understand
a) how to connect multiple nano BLEs to one central nano
b) how to replace the gesture sensor information being advertised with an IMU sensor.

From my understanding of BLE, I need to get the two peripheral nanos to form connections with the receiving nano.

Explained simply, how do I code this up? Thanks in advance.

If you have some specific questions please ask.

You don't. In BLE, centrals/clients connect to peripherals/servers and not the other way around. It is important to use precise language with BLE to understand what is going on. Start with a peripheral example and use a generic BLE app (I like BLE Scanner o iOS). See if you can match what you see in the source code with what you see in the app. Change the example sketches and play with it to get a better understanding.
If you have some specific questions please ask.

There are more examples with different data and sensors here in the forum. Have a look.

That is not correct. The peripherals/servers code will be the same in all cases. It is the central that will need to be able to handle multiple connections.

1 Like

To clarify, is it possible for me to have multiple "sensing" nodes sharing IMU data with a single "main" node which displays the data from the sensing nodes and is able to identify which data comes from which node?

In my example, would the sensing nodes be the centrals and the main node be the peripheral? That is very counterintuitive naming.

The sensors should be the peripheral/server. They provide the data.
In BLE the peripheral/servers are usually small low power devices with some state/data. The central/clients are usually more powerful devices with screens like mobile phones and tablets. It can be another Arduino as well.

Yes, central devices can connect to multiple peripherals and read/write data. Most central examples only connect to a single peripheral. So you will need to modify the code to support multiple peripherals.

The central device can identify the peripherals it connects to. The simplest way is to give them different device names. That way you can exchange the hardware and give the replacement hardware the same name. That is better then using the MAC address.

2 Likes

I see, thank you that makes sense.

One last clarification, I've done some digging and it appears that, according to some experimentation done by you and the github community, using the arduino Nano 33 BLE, it is not possible to connect one central to multiple slaves (to be clear, I only have access to a nano 33 BLE sense and 2 nano 33 BLEs).

https://forum.arduino.cc/t/how-to-connect-with-one-master-to-2-slaves/670681/8

My question is, are you aware if this is still the case, and if so, would I be able to recreate the functionality I want by connecting a peripheral to multiple centrals? Thank you in advance.

No, I have not tried this for a while. Sounds like a good experiment and opportunity to learn about the ArduinoBLE library. If you find out, maybe you can share it with the forum and other users can benefit from your experience.

The Peripheral and central role can be exchanged to some degree but not in all cases. Since you are just interested to connect Arduinos together, I think this can work.

Were you able to make any advancements in your project?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.