Can I do serial over Bluetooth?
How do I use the micro:bit UART over BLE
Is the Nordic UART available on micro:bit
In general, there is not one standard UART profile for BLE in the same way as there was for Bluetooth Classic. However, the micro:bit does include a Bluetooth UART service that is compatible with the Nordic UART service.
The service itself is documented here:
Some instructions for getting started are:
- Visit https://makecode.microbit.org/ and create a new project,
- Now you must add the Bluetooth package by expanding the 'Advanced' header in the list of block categories and then choosing 'Add Package"
- Select 'Bluetooth' and accept the fact that the 'Radio' package will be removed
This is demonstrated in the following animated image:
You can now use the 'Bluetooth' blocks in order to add the UART service.
There is an example program that uses the uart available at https://makecode.microbit.org/_g8VWUU1JsaMV
On your phone, you must observe the following points
- Every time you update the micro:bit software over USB, you must re-pair your device
- The UART apps will typically only work once you have paired your micro:bit and also connected to it.
This example program can be used with any UART app that follows the Nordic UART protocol, but the example above was tested on Android with the following app. If you have had success with a different app, please let us know using the 'Feedback on this article" feature so we can include it here:
Last Reviewed: 21 July - JA