Using Bluetooth with Sparkfun Pro nRF52840 Mini

Hello Everyone,

I hope I am doing everything right here. It's my first post.

I am just getting into the world of electronics after years of software engineering and network security management. My first project is a vibrating alarm clock watch. The watch is fairly simple in design: a Sparkfun Pro nRF52840 Mini, a battery, and a vibration motor. I do not want to include a screen, as I fear it will prevent me from sleeping. Given the lack of a screen, inputting the alarm time will be done using an app that I designed in MIT App Inventor.

This is where the problem lies. I want to send the alarm time via a string from the app, but I can't figure out how to send data from the phone to the watch. I am very confused by BLEUart and BLE advertising and such. I have found a plethora of examples of sending information to a microcontroller via apps like Adafruit's Bluefruit Connect, but haven't yet seen source code for a reasonably simple way to send strings.

Additionally, I think that the Sparkfun supports regular Bluetooth, not just BLE. I was wondering if anyone knew anything about this board, or could provide examples of other projects that are similar?

Welcome to the forum

What you think you want to do, is not how BLE is designed to operate. The nRF52840 is a BLE device. There is no reference to Bluetooth Classic in the datasheet.

Bluetooth Classic and BLE are not compatible. In Bluetooth Classic there is a Serial Profile that can be used a UART serial wireless alternative. But this has many disadvantages you need to turn your data into strings and then parse them on the other side back into useful data.

In BLE you can create services and characteristics that describe the data. The services and characteristics have unique identifiers called UUIDs. There are 16-bit UUID defined by the Bluetooth SiG and anyone can create their own UUIDs, but they have to be 128-bit random. The data is stored and transferred in data types e.g., bytes, integers, ... No need for strings except for string type data e.g., a name. The UUID tells you indirectly what the data is. You can find a doc with the 16-bit UUID here:

I would suggest two options.

Create your own service and characteristic. The format is up to you. You could for instance have a alarm service with a fixed length byte array as a characteristic, or with multiple component characteristics e.g. hour, minute, seconds ...

Use the Current Time Service specified by the Bluetooth SiG. This way there is a possibility of interoperability with some other app. The specification you can find here

https://www.bluetooth.com/specifications/gatt/

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