Go Down

Topic: BLE very weak signal (Read 2483 times) previous topic - next topic

onepixel0

I just obtain my Arduino Nano BLE and try to test connection and services via nRF connect using example sketches.
Tested with different devices - Arduino is invisible in range more than 2 meters
It's incredibly short range. Is it ok? Can I connect external antenna to arduino or maybe change settings in sketch?

gregorss

... nRF ... It's incredibly short range. Is it ok?
AFAIK the 'n' in nRF stands for "near". I interpret this as a behaviour my cash card shows: It's not recognized until I place it directly on the thing with the display and keyboard (where I enter my PIN).

So, I wouldn't say that 2 m is "incredibly short range".

Gregor
Mir wird übel. (Uwe)

pert

The "n" in "nRF" stands for Nordic, the company that makes the chips.

pert

FYI, for the cash card you're thinking of NFC (near field communication). That's a different technology than BLE. BLE is generally considered a technology for PAN (personal area network), but it is possible to get some pretty good range (~100 m) with Bluetooth under ideal circumstances. I'm not sure how close to that theoretical maximum you can get with the Nano 33 BLE boards though.

gregorss

... NFC (near field communication) ..
Ooops ... yes ... I mixed that.

Thanks!

Gregor
Mir wird übel. (Uwe)

onepixel0

Application is not the problem, I also tried "BLE Scanner", and both apps show me the list of all bluetooth devices in pretty good range. But Arduino show poor signal in range more than 1m and completely missing in range more than 2m.

Can it be iOS problem? Unfortunately I have no other devices with BLE for testing

nuhash

Hey, I was actually going to make a post on this.

My Nano BLE has crazy short range too. It can be detected up to 2m away but I can only reliably communicate with it whilst it is 1m away.

This is with a laptop and 2 different android phones.

Sloox

The range is unfortunately exceptionaly short. I have approximately 2-3 meters of range and even if the devices are in clear range of each other with no obstruction they cannot communicate, (phone to ble sense).

Something clearly must be wrong 2 meters is way way way too low.

Any advice would be great!

Klaus_K

I have done a range test and could still receive data at a range of 40 meters / 130 ft. Here are the conditions of my experiment.

- Arduino Nano 33 BLE (1.5m above ground, outside, houses and vegetation around but free line of sight)
- iPhone 7 (BLE Scanner app)
- 3 characteristics (1 float and 1 long read notify and 1 bool write)
- The float is an accelerometer value and the long a counter
- the two values are updated every 20ms

I could clearly see the values updating dynamically in the app, but there are values dropped which is to be expected. I cannot measure the drop rate with the phone app, only see that the counter sometimes does not update with the same speed / amount of intermediate values (depending the orientation of the phone while walking). I could also write the bool value which resets the counter.

onepixel0

40m is fine I think, but really, I can't get even 5 in a room without any obstacles. According to nina b306 datasheet it's range could be up to 1400m.
Sad, but I just get external BLE module if we'll not figure it out

nuhash

I have done a range test and could still receive data at a range of 40 meters / 130 ft.
Could you provide the sketch you used and then I can compare mine? Having the same code should make a better comparison instead of us all doing different things.

Klaus_K

#11
Jan 21, 2020, 02:12 am Last Edit: Jan 21, 2020, 02:13 am by Klaus_K
Could you provide the sketch you used and then I can compare mine?
Sure. Here you go. You will need to reset the board once the connection was lost completely. I haven't found a way to recover the BLE stack from that.

Code: [Select]
/*
  This example creates a BLE peripheral with a service that contains a
  couple of characteristics to test BLE connection.
  The yellow LED shows the BLE module is initialized.
  The green LED shows RSSI of zero. The more it blinks the worse the connection.

  The circuit:
  - Arduino Nano 33 BLE Sense board.

  You can use a generic BLE central app, like LightBlue (iOS and Android) or
  nRF Connect (Android), to interact with the services and characteristics
  created in this sketch.

  This example code is in the public domain.
*/

#include <ArduinoBLE.h>
#include <Arduino_LSM9DS1.h>


//----------------------------------------------------------------------------------------------------------------------
// BLE UUIDs
//----------------------------------------------------------------------------------------------------------------------

#define BLE_UUID_TEST_SERVICE               "9A48ECBA-2E92-082F-C079-9E75AAE428B1"
#define BLE_UUID_ACCELERATION               "2713"
#define BLE_UUID_COUNTER                    "1A3AC130-31EE-758A-BC50-54A61958EF81"
#define BLE_UUID_RESET_COUNTER              "FE4E19FF-B132-0099-5E94-3FFB2CF07940"

//----------------------------------------------------------------------------------------------------------------------
// BLE
//----------------------------------------------------------------------------------------------------------------------

BLEService testService( BLE_UUID_TEST_SERVICE );
BLEFloatCharacteristic accelerationCharacteristic( BLE_UUID_ACCELERATION, BLERead | BLENotify );
BLEUnsignedLongCharacteristic counterCharacteristic( BLE_UUID_COUNTER, BLERead | BLENotify );
BLEBoolCharacteristic resetCounterCharacteristic( BLE_UUID_RESET_COUNTER, BLEWriteWithoutResponse );


const int BLE_LED_PIN = LED_BUILTIN;
const int RSSI_LED_PIN = LED_PWR;


void setup()
{
  Serial.begin( 9600 );
  //  while ( !Serial );

  pinMode( BLE_LED_PIN, OUTPUT );
  pinMode( RSSI_LED_PIN, OUTPUT );

  if ( !IMU.begin() )
  {
    Serial.println( "Failed to initialize IMU!" );
    while ( 1 );
  }
  Serial.print( "Accelerometer sample rate = " );
  Serial.print( IMU.accelerationSampleRate() );
  Serial.println( " Hz" );

  if( setupBleMode() )
  {
    digitalWrite( BLE_LED_PIN, HIGH );
  }
} // setup


void loop()
{
  static unsigned long counter = 0;
  static long previousMillis = 0;

  // listen for BLE peripherals to connect:
  BLEDevice central = BLE.central();

  if ( central )
  {
    Serial.print( "Connected to central: " );
    Serial.println( central.address() );

    while ( central.connected() )
    {
      if( resetCounterCharacteristic.written() )
      {
        counter = 0;
      }

      long interval = 20;
      unsigned long currentMillis = millis();
      if( currentMillis - previousMillis > interval )
      {
        previousMillis = currentMillis;

        Serial.print( "Central RSSI: " );
        Serial.println( central.rssi() );

        if( central.rssi() != 0 )
        {
          digitalWrite( RSSI_LED_PIN, LOW );
          float accelerationX, accelerationY, accelerationZ;
          if ( IMU.accelerationAvailable() )
          {
            IMU.readAcceleration( accelerationX, accelerationY, accelerationZ );
            accelerationCharacteristic.writeValue( accelerationX );
          }

          counter++;
          counterCharacteristic.writeValue( counter );
        }
        else
        {
          digitalWrite( RSSI_LED_PIN, HIGH );
        }
      } // intervall
    } // while connected

    Serial.print( F( "Disconnected from central: " ) );
    Serial.println( central.address() );
  } // if central
} // loop



bool setupBleMode()
{
  if ( !BLE.begin() )
  {
    return false;
  }

  // set advertised local name and service UUID:
  BLE.setDeviceName( "Arduino Nano 33 BLE" );
  BLE.setLocalName( "Arduino Nano 33 BLE" );
  BLE.setAdvertisedService( testService );

  // BLE add characteristics
  testService.addCharacteristic( accelerationCharacteristic );
  testService.addCharacteristic( counterCharacteristic );
  testService.addCharacteristic( resetCounterCharacteristic );

  // add service
  BLE.addService( testService );

  // set the initial value for the characeristic:
  accelerationCharacteristic.writeValue( 0.0 );
  counterCharacteristic.writeValue( 0 );

  // start advertising
  BLE.advertise();

  return true;
}

gagarcr

Also, the way you are powering the board can make the difference. Is that USB?

xsteven

Hi,
I have the same problem. I tried several examples with BLE and Raspberry Pi and maximum range is about 5 meters. Are there any signal strength settings? Power is from USB.

nuhash

Sure. Here you go. You will need to reset the board once the connection was lost completely. I haven't found a way to recover the BLE stack from that.

Thanks for that. I tried it and it can only communicate from at most 4m away. I replicated your test conditions as you had described (to a fair degree).

I opened a support ticket with ublox to ask them if they could advise on the issue (https://portal.u-blox.com/s/question/0D72p000008qj6k/is-it-normal-for-a-ninab306-module-to-have-an-extremely-short-range)

The support rep asked me to check the SMD components on the antenna and as it turns out, 2 of them are missing. They were never there, which explains why my experience has been so poor.

As I bought my device on amazon I have asked there for a refund or a replacement device.

Go Up