element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Test & Tools
  • Technologies
  • More
Test & Tools
Blog Bluetooth LE Transmit Testing with the FPC1500 - nRF52 Measurements
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Test & Tools to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ralphjy
  • Date Created: 16 Jul 2022 7:40 PM Date Created
  • Views 2645 views
  • Likes 8 likes
  • Comments 2 comments
  • ble transmitter testing
  • BLEFPC1500
  • nrf52840
  • Rohde&Schwarz FPC1500
Related
Recommended

Bluetooth LE Transmit Testing with the FPC1500 - nRF52 Measurements

ralphjy
ralphjy
16 Jul 2022

Table of Contents
Blog 1: Bluetooth LE Transmit Testing with the FPC1500
Blog 2: Getting Started
Blog 3: BLE Development Boards
Blog 4: Test Development
Blog 5: ESP32 Measurements
Blog 6: nRF52 Measurements
Blog 7: CYW43-measurements
Blog 8: Summary

nRF52840 boards

Measurements on 3 nRF52840 boards shown below. 

Top to bottom

  • RAK4631 with external BLE antenna (module also does LoRa)
  • Arduino Nano 33 BLE Sense
  • Seeed Xiao BLE nRF52840

image

BLE libraries

The Arduino IDE supports all of these boards, but BLE is supported by two different libraries.  The Arduino Nano 33 BLE Sense and Seeed Xiao BLE nRF52840 use the ArduinoBLE library with the low level functions handled by the Mbed OS.  To implement iBeacon there is an additional small BeaconNano library used.  The RAK4631 uses the Adafruit Bluefruit52lib library with FreeRTOS.  The iBeacon is implemented within the Bluefruit library. Note: in the case of the RAK4631, the BLE library is automatically installed as part of the board library installation.

nRF52 TX power

Supported tx_power values depending on mcu:

nRF52832: -40dBm, -20dBm, -16dBm, -12dBm, -8dBm, -4dBm, 0dBm, +3dBm and +4dBm.
nRF52840: -40dBm, -20dBm, -16dBm, -12dBm, -8dBm, -4dBm, 0dBm, +2dBm, +3dBm, +4dBm, +5dBm, +6dBm, +7dBm and +8dBm.

Default is 0 dBm.

I had problems setting the TX power with the two boards using the Mbed OS.  The TX power is set within the Mbed Cordio BLE stack.  I found that the boards do have individual mbed_config.h files in their variants directory that include #defines for various Cordio parameters including TX power.  Unfortunately, changing that parameter definition (MBED_CONF_CORDIO_PREFERRED_TX_POWER) did not produce a change in measured TX power.

I've included the Cordio section of the mbed_config.h file below.

#define MBED_CONF_CORDIO_DESIRED_ATT_MTU                                        23                                                                                               // set by library:cordio
#define MBED_CONF_CORDIO_LL_DEFAULT_EXTENDED_ADVERTISING_FRAGMENTATION_SIZE     64                                                                                               // set by library:cordio-ll
#define MBED_CONF_CORDIO_LL_EXTENDED_ADVERTISING_SIZE                           512                                                                                              // set by library:cordio-ll[MCU_NRF52840]
#define MBED_CONF_CORDIO_LL_MAX_ACL_SIZE                                        256                                                                                              // set by library:cordio-ll
#define MBED_CONF_CORDIO_LL_MAX_ADVERTISING_REPORTS                             4                                                                                                // set by library:cordio-ll
#define MBED_CONF_CORDIO_LL_MAX_ADVERTISING_SETS                                3                                                                                                // set by library:cordio-ll
#define MBED_CONF_CORDIO_LL_MAX_SCAN_REQUEST_EVENTS                             4                                                                                                // set by library:cordio-ll
#define MBED_CONF_CORDIO_LL_NRF52840_CRYPTOCELL310_ACCELERATION                 1                                                                                                // set by library:cordio-ll-nrf52840
#define MBED_CONF_CORDIO_LL_PHY_2M_SUPPORT                                      1                                                                                                // set by library:cordio-ll
#define MBED_CONF_CORDIO_LL_PHY_CODED_SUPPORT                                   1                                                                                                // set by library:cordio-ll[MCU_NRF52840]
#define MBED_CONF_CORDIO_LL_RX_BUFFERS                                          4                                                                                                // set by library:cordio-ll
#define MBED_CONF_CORDIO_LL_TX_BUFFERS                                          4                                                                                                // set by library:cordio-ll
#define MBED_CONF_CORDIO_MAX_PREPARED_WRITES                                    4                                                                                                // set by library:cordio
#define MBED_CONF_CORDIO_NORDIC_LL_HCI_DRIVER_BUFFER_SIZE                       16056                                                                                            // set by library:cordio-nordic-ll[MCU_NRF52840]
#define MBED_CONF_CORDIO_NORDIC_LL_WSF_POOL_BUFFER_SIZE                         4900                                                                                             // set by library:cordio-nordic-ll
#define MBED_CONF_CORDIO_PREFERRED_TX_POWER                                     8                                                                                                // set by library:cordio
#define MBED_CONF_CORDIO_ROUTE_UNHANDLED_COMMAND_COMPLETE_EVENTS                1                                                                                                // set by library:cordio
#define MBED_CONF_CORDIO_RX_ACL_BUFFER_SIZE                                     70                                                                                               // set by library:cordio
#define MBED_CONF_CORDIO_TRACE_HCI_PACKETS                                      0                                                                                                // set by library:cordio
#define MBED_CONF_CORDIO_TRACE_PAL_ECHOES                                       0                                                                                                // set by library:cordio

The Mbed library is a pre-compiled module that is linked during sketch compilation.  I've tried to find the correct method to call the Cordio function setTxPower() from my sketch code, but haven't succeeded yet.  For now, I'll run some close proximity tests with the default 0 dBm default power.

BeaconNano code (same for both Nano 33 and Xiao boards)

arduino_nano_ble33_ibeacon.ino

// GGBeaconNano - Version: Latest 

#include <ArduinoBLE.h>
#include <BeaconNano.h>

void setup() { 
  BeaconNano bn;
  bn.setUuid("c336aa38054bb0483b0ae75027061982");
  bn.setMajor(1);
  bn.setMinor(1);
  bn.setTx(197);  // TX power (0xC5 = 197, 2's complement = 256-197 = -59 dBm) is the strength of the signal measured at 1 meter from the device
  bn.startBeacon();


}

void loop(){
  
}

Arduino Nano 33 BLE Sense

image

Seeed Xiao BLE

image

The results are similar as might be expected, the Nano has a PCB antenna and the Xiao has a chip antenna.

RAK4531

I had more success being able to modify the TX power on the RAK4631.  The Bluefruit library has a setTxPower() function and that works properly with the sketch code.

I took a few data points between 0 and 8 dBm to check it out.  At 0 dBm the external antenna shows 7 to 9 dBm improvement over the chip/PCB antennas.

image

RAK4631_ble_beacon.ino

/*********************************************************************
 This is an example for our nRF52 based Bluefruit LE modules

 Pick one up today in the adafruit shop!

 Adafruit invests time and resources providing this open source code,
 please support Adafruit and open-source hardware by purchasing
 products from Adafruit!

 MIT license, check LICENSE for more information
 All text above, and the splash screen below must be included in
 any redistribution
*********************************************************************/
#include <bluefruit.h>

// Beacon uses the Manufacturer Specific Data field in the advertising
// packet, which means you must provide a valid Manufacturer ID. Update
// the field below to an appropriate value. For a list of valid IDs see:
// https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
// 0x004C is Apple
// 0x0822 is Adafruit
// 0x0059 is Nordic
#define MANUFACTURER_ID   0x0059

// "nRF Connect" app can be used to detect beacon
uint8_t beaconUuid[16] =
{
  0x01, 0x12, 0x23, 0x34, 0x45, 0x56, 0x67, 0x78,
  0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef, 0xf0
};

// A valid Beacon packet consists of the following information:
// UUID, Major, Minor, RSSI @ 1M
BLEBeacon beacon(beaconUuid, 0x0102, 0x0304, -54);

void setup() 
{
  Serial.begin(115200);

  // Uncomment to blocking wait for Serial connection
  // while ( !Serial ) delay(10);

  Serial.println("Bluefruit52 Beacon Example");
  Serial.println("--------------------------\n");

  Bluefruit.begin();

  // off Blue LED for lowest power consumption
  Bluefruit.autoConnLed(false);
  Bluefruit.setTxPower(4);    // Check bluefruit.h for supported values

  // Manufacturer ID is required for Manufacturer Specific Data
  beacon.setManufacturer(MANUFACTURER_ID);

  // Setup the advertising packet
  startAdv();

  Serial.println("Broadcasting beacon, open your beacon app to test");

  // Suspend Loop() to save power, since we didn't have any code there
  suspendLoop();
}

void startAdv(void)
{  
  // Advertising packet
  // Set the beacon payload using the BLEBeacon class populated
  // earlier in this example
  Bluefruit.Advertising.setBeacon(beacon);

  // Secondary Scan Response packet (optional)
  // Since there is no room for 'Name' in Advertising packet
  Bluefruit.ScanResponse.addName();
  
  /* Start Advertising
   * - Enable auto advertising if disconnected
   * - Timeout for fast mode is 30 seconds
   * - Start(timeout) with timeout = 0 will advertise forever (until connected)
   * 
   * Apple Beacon specs
   * - Type: Non connectable, undirected
   * - Fixed interval: 100 ms -> fast = slow = 100 ms
   */
  //Bluefruit.Advertising.setType(BLE_GAP_ADV_TYPE_ADV_NONCONN_IND);
  Bluefruit.Advertising.restartOnDisconnect(true);
  Bluefruit.Advertising.setInterval(160, 160);    // in unit of 0.625 ms
  Bluefruit.Advertising.setFastTimeout(30);      // number of seconds in fast mode
  Bluefruit.Advertising.start(0);                // 0 = Don't stop advertising after n seconds  
}

void loop() 
{
  // loop is already suspended, CPU will not run loop() at all
}

The Eye Diagrams at 0 and 8 dBm TX power

0 dBm

image

+8 dBm

image

  • Sign in to reply
  • BluetoothBeacon
    BluetoothBeacon over 1 year ago

    Good article!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 2 years ago

    Good data set.

    You always have to look at the details on these devices.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube