Bluetooth configuration

Grove is a modulated, ready-to-use tool set.
Much like Lego, it takes a building block approach to assembling electronics.

Moderators: lily.li, violet, jeremy882, crail.lyu969

Post Reply
john136
Pre-kindergarten
Pre-kindergarten
Posts: 4
Joined: Tue Aug 20, 2019 8:43 pm

Bluetooth configuration

Post by john136 » Mon Sep 16, 2019 10:45 pm

I have a grove bluetooth module Serial V3.0 and struggling to configure it with my arduino:

Other bluetooth modules i have used have a push button to get it into command mode. The Grove does not have this, any ideas?

How should I use on my Arduino Uno Wifi Rev2? Is there a script I can download to connect to the Grove Bluetooth to configure it?

bill.yu
Junior-7
Junior-7
Posts: 735
Joined: Mon Apr 02, 2018 11:05 am

Re: Bluetooth configuration

Post by bill.yu » Thu Sep 19, 2019 11:37 am

Hi there~

The Arduino Uno WiFi Rev. 2 has 3 hardware serial ports. Serial is connected to the USB interface, Serial1 is connected to Pin 0 (RX) and 1 (TX), Serial 2 is connected to the u-blox NINA-W13 module. This allows the usage of pins 0 and 1 without issues: on the original Arduino UNO, the usage of Pins 0 and 1 disrupts the sketch upload.

You can connect the grove serial bluetooth v3.0 to D0/D1, then you can burn below code to board. You can use the arduino COM mointor to send command to serial bluetooth module and get response back on the monitor.

Code: Select all

 void setup()
 {
     Serial1.begin(9600);
     Serial.begin(9600);
 }

 void loop()
 {
     while(Serial1.available())
     {
         Serial.write(Serial1.read());
     }
     while(Serial.available())
     {
         Serial1.write(Serial.read());
     }
 }

You also can use the software serial, you can connect the tx/rx of the serial bluetooth to (10, 11)// RX, TX of the board. You can use the COM monitor as well. For more info, please refer to http://wiki.seeedstudio.com/Grove-Seria ... ooth_v3.0/. Hope it helps.

Code: Select all

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }



  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);
}

void loop() { // run over and over
  if (mySerial.available()) {
    Serial.write(mySerial.read());
  }
  if (Serial.available()) {
    mySerial.write(Serial.read());
  }
}

Post Reply