How to send simple commands to arduino nano 33 ble from phone bluetooth app with buttons

I'm new to bluetooth on arduino (and in general), and I'd like to get some pointers on how to approach something that I would consider quite simple.

I have the simple peripheral examples working (battery monitor and LED). I used the "nRF Connect" app on my Android phone to connect and read the battery data, or turn on/off the LED. All good and well.

This is great for demonstrating the capability and for debugging the buetooth connection. But if I want to control a robot (forward, reverse, turn right, turn left, etc.), I don't see myself typing a 1 or a 0 in the form every time. Of course one could write an app for Android, but I would hope that if I don't need anything fancy, there should be an app out there that allows you to assign buttons and automate sending the values?

It seemed that the Adafruit Bluefruit Connect app does just that, but it requires a UART connection to the bluetooth module. That's standard for the Adafruit bluetooth modules, but the Arduino nano 33 BLE does not do that.

I also tried the "Serial Bluetooth Terminal", but it requires a serial connection through bluetooth. After reading a few posts it seems that I could do that, but that's not the most optimal way of transmitting data over BLE.

So I'm a little loss here. Can someone give me a few pointers on what direction I should take?
I don't mind a steep learning curve, but I'd like to make sure I'm climbing the right hill! :wink:


OK the simple way install my free pfodDesigner app and use it to generate the Arduino code for you for a nano33BLE
Then you can either use my paid pfodApp OR just use Nordic's nRF UART app to send the commands expected.
The pfod commands all look like {... } See the spec for all the details
If you want something simpler you can remove the pfodParser code from the Arduino sketch and just read the text coming from the BLE serial connection and act on that

If I understand the Bluetooth SiG web page you need to pay a fee to sell any GATT-based Profile Client (app). That could explain why there are so few BLE apps out there. You can write your own and use it without Bluetooth SiG knowing about it but as soon as you publish it in a store you risk some lawyer sending you a letter. This is just my guess and not any legal advice.

Interesting. The Nordic UART is NOT a "Bluetooth SIG adopted GATT-based Profile" so all should be good. Branding may be an issue? Perhaps Ble instead or B?E or B*E
No one has contacted me about pfodApp yet.

Lawyers cost money, so nobody pays them to actively search for every little infringement. That is why I said you risk getting a letter. You might never get one but you cannot be sure. They are likely busy collecting fees for products that sell millions of units. Then there is a chance they get paid. :slight_smile:

Thanks, I will give that a try.
Is the generated code clean and readable enough to be modified and incorporated into a larger project?

Let know if it is not :slight_smile:

Hi drmfp,
I'm quite impressed with your app. It is very exhaustive and so far seems to run solid. Contrary to most apps out there that push simplicity to the point of removing all flexibility and options, your app includes everything that's needed and still keep it relatively simple. I can see it was written by an engineer for engineers and makers!
Also contrary to most apps, you provide A LOT f details on your website. Almost too much, as it is a little overwhelming at first... :wink: That's super useful.
I went through the example you describe on your webpage (How to Display/Plot Arduino Data on Android). I have an Arduino Nano 33 Sense. I chose BLE. Everything works well, except that there is a lot of delay on each update of the characteristics and the readings. For example if I press the LED button, it takes about 2 seconds for the led to turn on. Same for all data in both direction. If I change the voltage on A0, it takes about 2s for the value to change on the phone. Is that expected from BLE?
I searched and could not find anything on your website.

I know that BLE is for low power applications where real-time actions are not required. It is not for streaming audio or for file transfers. In my case I need to be able to control a robot, so some level of real-time control is needed. Unfortunately I could not find any information on how slow it can be. Is a latency of ~0.5 second max too much for BLE? If yes then I will switch to standard BT.

Is this set by the value on "Refresh Interval" on pfofdDesigner? The minimum value is 1s. Is there a way to reduce that to an even lower value?

Thanks! If there is already any documentation in that on your website or somewhere out there, please let me know!


BLE is slow and limited to 20 bytes per message (at least in my implementations) :slight_smile: I would need to see your sketch, but you can send much smaller messages for the response to a command (like led on) that just update only that part of the menu.

Edit -- In the sample code the sendMainMenuUpdate() is called after the led is command is processed, but you only need to send the led part of the menu date. Can help if you have long menus. Pour through the pfodSpecification.pdf for all the details and you can email me via support.

Re the 1sec refresh, you can manually lower it to 0.5 sec but the app ignores less than that as the screen updates on Android interfere with user button presses. Suggest you leave it a 1sec or more and make sure you send the latest led setting back in response to the command.

See Remote High Speed Data Logging for how to setup a high speed datalogging system

If you don't have constraints requiring the use of BLE, I would certainly use classic Bluetooth. It is far simpler.

If you want an integrated solution and not a separate HC05 or HC06 module I recommend the esp32 which has both BT and BLE.

The free pfodDesigner will generate code for Classic Bluetooth for ESP32 and simple serial connection code for HC05/06

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