Transfer data to a SD card from a BLE SENSE

Hello everyone,

I've been reading a lot of things about BLE and I'm still not sure about what I can do with it. Is it possible to write and read the data of my BLE sensors, on a SD card ? It would simplify my project a lot if I could do that.
I read about the SPI bus already in used to assure the bluetooth connection, and in this case it would be legit to be unable to communicate with a SD card.

What do you think, what do you know ?

Thanks in advance for your answers !

BLE is in the MCU. where did you read it is on SPI?

you can wire the SD card to SPI pins, 3.3 V, gnd and some pin as CS. use the SD library. begin() it with the CS pin of your choice.

don't use an 5 V SD card adapter. use a SD card holder breakout board.

Thank you for your answer !
I don't know where I read it, I wasn't even sure if it was the bluetooth who used the SPI port, that's why I wanted to be sure about it.

Okay I'll try that, thank you

Bluetooth is usually a Serial.read() or Serial.write() command, not bluetooth.

CrossRoads:
Bluetooth is usually a Serial.read() or Serial.write() command, not bluetooth.

Nano BLE has nRF52 MCU with BLE. the ArduinoBLE library uses SDK BLE API of the nRF52 SDK

The Arduino 33 BLE and BLE Sense have a radio peripheral on the nRF52840 MCU (inside the NINA-B3) which is connected internally via AHB and APB buses just like other peripherals on that chip. So, the radio is addressed via memory locations. This is all hidden by the library, so no need to worry about it. You can have a look at the block diagram of that chip in the datasheet.
You can find a link to the datasheet in the Arduino store under TECH SPECS.

On other Arduino's the radio module is separate from the MCU and then connected by external interfaces. The Arduino Nano 33 IoT has UART and SPI connected between the NINA-W10 module and the SAMD21.

I tried to write/read on my SD card with my BLE SENSE but without success. I took an example from the SD library and I removed a lot of the code because it didn't work fully and I wanted to see the problem. So here's the code.

#include <SPI.h>
#include <SD.h>

File myFile;

void setup()
{
  Serial.begin(9600);
  while (!Serial);
  delay(1000);  
  
  Serial.println("Initializing SD card...");

  if (!SD.begin(4)) {
    Serial.println("Initialization failed.");
    while(1);
  }
  Serial.println("Initialization done.");
}

void loop()
{
  delay(100);
}

It's just the initialization and even that doesn't work. My serial monitor does print "Initializing SD card..." but doesn't print anything else, as if it didn't go any further.

I put the CS pin on pin 4 and did the wiring as this tuto suggests : SD Card Module w/ Arduino: How to Read/Write Data - ElectroPeak

This code and the same wiring works with my ProMini card. I must be missing something because I really don't see my mistake on the BLE.

run the CardInfo example. and make sure you have the latest SD library with a fix for Nano BLE.

I already did, nothing has been printed in the serial monitor... But that also may be an issue with my BLE, I'm not sure.

What do you mean by "with a fix for Nano BLE" ? There is something special for BLE ?

paulgrad:
I already did, nothing has been printed in the serial monitor... But that also may be an issue with my BLE, I'm not sure.

What do you mean by "with a fix for Nano BLE" ? There is something special for BLE ?

how did you wire the SD card?

Just like in the tuto :

SD --- BLE
MOSI (DI for me) - pin 11
MISO (DO for me) - pin 12
CLK (SCK for me) - pin 13
CS - pin 4
GND - GND
VCC - VIN

VCC should be wired to 3.3 V pin.
Vin would not work on classic Nano either

1 Like

Ohhhh ok that's why, thanks a lot !