Arduino nano 33 BLE sense transmitting sensor readings and receiving using HM-10 with Arudino mega

Hi all,

I am looking into Arduino nano 33 BLE sense and was wondering isit possible to transmit sensor readings to another Arduino mega with HM-10? By using the internal bluetooth in nano 33 BLE sense to transmit data and receiving using HM-10 with Arudino mega.

Both are BLE 4.0 device but didn't find any working example yet.

Thank you.

Welcome to the forum.

by using a HM-10 you are losing all the advantages of BLE. If you must use the HM-10 it is probably easier to use two of them.

The Arduino Nano 33 BLE together with the ArduinoBLE library gives you full access of GATT. This allows you to create services and characteristics that provide the sensor data in a nice interface. You would need a BLE module that allows full GATT access for your mega.

The HM-10 uses GATT to create a service with some characteristic to emulate a serial connection. So, you need to serialize the data on your sensor and then parse the data on your Mega. You can try to create the HM-10 service and characteristic on the Arduino Nano 33 BLE. That may work but I read that the HM-10 often does not work together with other devices (this could be intentional).

Do you already have the hardware?

Hi,

Thank you for the reply.

I have not gotten the hardware yet as I am new to the Arduino nano 33 BLE sense and was still thinking what is the right approach for my project.

My intention of using the Arduino nano 33 BLE sense is to eliminate of getting external components such as the IMU sensor and HC-05/HM-10. I am also planning to explore the machine learning portion of the Arduino nano 33 BLE as I read some examples online and this may help my project in the future.

My main concern for now is if I am using Arduino nano 33 BLE sense, what is the best approach to send the sensors reading data to another Arduino uno/mega? I was looking into HM-10 because it is also a BLE 4.0 device which is the same as the Arduino nano 33 BLE.

Thank you.

Why do you need to send the data to a uno or mega? What are they going to do that can't be done on the BLE Sense?

Could you use a board with integrated BLE like the ESP32?

As previously mentioned, the HM10 is a very poor solution.

If you absolutely must have BLE integration with an uno or mega I would take a look at Adafruit Bluefruit LE UART Friend - Bluetooth Low Energy (BLE).

I agree with cattledog, why do you want to use the Arduino Mega?

There are quite a few alternatives. e.g., Arduino Nano 33 IoT.

https://store.arduino.cc/arduino-nano-33-iot

@cattledog @Klaus_K
My plan is to have a wearable device with the Arduino nano 33 BLE sense to get the sensors reading and transmit over to Arduino uno/mega. The Arduino uno/mega will then be integrated with DC motors to do certain movement based on the sensor readings.

I have tried Arduino pro-mini communicating with Arduino mega using HC-05 before. However, I am not too sure for this case as I wanted to use the Adruino nano 33 BLE sense instead on the wearable device.

What will be the better approach for this case? Getting 2 Arduino nano 33 BLE? Thank you.

Definitely a better approach. You can probably save some money and not use a sense version for the device which is not worn. However, there are other options for a BLE device without the inertial measurement.

be integrated with DC motors to do certain movement based on the sensor readings.

Can you please describe more about what the receiving device is going to be doing.

I would consider as a possible alternative BLE receiver to use for the motor controller

A) Uno Uno Wi-Fi Rev2 This is a 5v device with 20ma output currents on the i/o which may be useful depending on what it is going to operate.

B) Arduino MKR 1010

c) ESP32. There are many different versions of the ESP32 Development board.

Hi,

Thank you for the reply.

The receiving device will be doing like basic movement of a car. Basically a wearable device to control the movement of the car through hand gesture. I am planning of using an Arduino Uno with the motor driver L298 to drive the DC motor.

I would consider as a possible alternative BLE receiver to use for the motor controller

A) Uno Uno Wi-Fi Rev2 This is a 5v device with 20ma output currents on the i/o which may be useful depending on what it is going to operate.
B) Arduino MKR 1010

c) ESP32. There are many different versions of the ESP32 Development board.

What alternative BLE receiver will be more suitable for my receiver device? Thank you.

The LN298 is pretty obsolete, and there are many better FET based H bridge drivers available. See the selection at Pololu.

I am planning of using an Arduino Uno with the motor driver L298 to drive the DC motor.

In that case, the Uno WiFi Rev2 might be your best choice. It's more expensive than either the Nano 33 BLE or the other two options, but its probably closest to what you are familiar with.

The LN298 is pretty obsolete, and there are many better FET based H bridge drivers available. See the selection at Pololu.

Sure will look into it.

In that case, the Uno WiFi Rev2 might be your best choice. It's more expensive than either the Nano 33 BLE or the other two options, but its probably closest to what you are familiar with.

Does the Uno WiFi Rev2 works similarly to the Arduino uno/mega? And does this mean the Arduino nano 33 BLE sense can use its internal Bluetooth module to communicate directly with Uno WiFi Rev2 without any external Bluetooth components? Thank you.

The board uses a u-blox NINA-W102 which is on the board and communicates with the main processor which is an ATMega 4809. This architecture is similar to that used by the Nano33 IOT and the MKR1010 but they have different main processors. The WiFi NINA module runs separate firmware. No external components are required.

I have never used a uno wifi rev2. It is clearly different from the uno/mega but appears to be designed for beginner IOT applications and has Arduino support and documentation.

Since you are going to use a Nano BLE Sense on the wearable part, and since you could use one on the base motor control, its not totally clear to me which is going to be more simple--using two of the same devices with less familiar I/O on the motor side, or instead to use the Uno WIFi Rev2 with more familiar 5v I/O and a more simple but slower 8bit processor.

Both routes will use the same ArduinoBLE library.

Thank you for the advice. I have tried searching online to see if anyone has done the Bluetooth communication before between Nano BLE sense and Uno Wifi Rev2, but sadly I didn't find any example yet. I will think about it and decide again what to get.

I will think about it and decide again what to get.

One other issue with the Uno WiFi Rev 2 is the possible need for firmware updates to the WiFi NINA portion of the board.

I do not know how often this needs to be done, and how easily it runs.

I can see postings on this board where it goes well and others where people have issues.
https://forum.arduino.cc/t/can-t-get-wifinina-firmware-updated-to-version-1-4-8/897289

I have tried searching online to see if anyone has done the Bluetooth communication before between Nano BLE sense and Uno Wifi Rev2, but sadly I didn't find any example yet

BLE is probably less used than WiFi on the Uno WiFi Rev2 and more of the tutorials will be for wifi. Choosing this board for BLE application because of the I/O or form factor is not typical.

The BLE library used is the same one as with the Nano33 and the other Arduino BLE boards. If the wearable unit is going to be the peripheral/server, then the Uno WiFi Rev 2 will be the central/client and all the BLE examples for two devices connected to each other should be applicable to your situation.

The examples that come with the ArduinoBLE library and the online reference will provide you most of what you need to get this working. You should start with a peripheral example and a generic BLE app on your smartphone to understand the basic of GATT (services and characteristics, UUIDs).

It is not that difficult and if you have any questions we are here to help.

About the roles in BLE, there are two. One is the peripheral/server, and one is the central/client. Typically, the sensor device running on a small battery is the peripheral and the smartphone is the central. In your case you will have a choice between making the motor device the peripheral or the sensor. I think both options are valid. Here are some points that may help you make the choice.

  • the peripheral device can be controlled by a smartphone app
  • the peripheral code is slightly less complex because it just needs to worry about the data in the characteristics
  • the central code is slightly more complex because it needs to handle the connection (scan, connect, reconnect, find the service and characteristic, subscribe ...)