Bluetooth module for Flora?

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Bluetooth module for Flora?

Post by adafruit_support_rick »

Not familiar with the HC-06.

User avatar
Franklin97355
 
Posts: 23911
Joined: Mon Apr 21, 2008 2:33 pm

Re: Bluetooth module for Flora?

Post by Franklin97355 »

What does the HC-06 need for power and inputs?

gustavolh
 
Posts: 5
Joined: Wed Jul 02, 2014 11:15 am

Re: Bluetooth module for Flora?

Post by gustavolh »

SLAVE mode only
3V OPERATION (5V will not work)
4PIN connector
4PINs are Vcc, GND, DO (TX), DI (RX)

It powers up, and I can connect with it, however, not communication is transmited.

I'm trying to run this example: https://www.youtube.com/watch?v=W5okUciwFkI

User avatar
Franklin97355
 
Posts: 23911
Joined: Mon Apr 21, 2008 2:33 pm

Re: Bluetooth module for Flora?

Post by Franklin97355 »

Could you show us how you have it connected and post the code you are running?
Please use the code button on the reply form.
2014-06-30_17h43_42.png
2014-06-30_17h43_42.png (6.65 KiB) Viewed 2158 times

gustavolh
 
Posts: 5
Joined: Wed Jul 02, 2014 11:15 am

Re: Bluetooth module for Flora?

Post by gustavolh »

This is the code, image is attached.
[img]
2014-07-02 11.45.51.jpg
2014-07-02 11.45.51.jpg (87.64 KiB) Viewed 2158 times
[/img]

Code: Select all

#include <SoftwareSerial.h>
char receivedChar;
int  LED = 13; // LED on pin 13
SoftwareSerial mySerial(10, 11); // RX, TX

int sensorPin = A0;
void setup()
{
  // Open serial communications and wait for port to open:
  pinMode(LED, OUTPUT);
  mySerial.begin(115200);
  mySerial.println("Welcome to the wonderful world of bluetooth communication");
  delay(1000);
  mySerial.println("Sending a '1' will turn on the LED, Sending a '0' will turn off the LED");
  delay(1000);
  mySerial.println("a '3' will flash the LED and a '4' will kick out a lot of data from the LDR");
}

void loop() // run over and over
{

  while (!mySerial.available());   // stay here so long as COM port is empty
  receivedChar = mySerial.read();
  if (receivedChar == '1') {
    digitalWrite(LED, HIGH);
  }// if it's a 1 turn LED on
  if (receivedChar == '2') {
    digitalWrite(LED, LOW);
  } // if it's a 2 turn LED off
  if (receivedChar == '3') {
    for (int i = 0; i < 30; i++) {
      digitalWrite(LED, HIGH);
      delay(20);
      digitalWrite(LED, LOW);
      delay(20);
    }
  } // if it is a 3 flash the LED
  if (receivedChar == '4') {
    for (int i = 0; i < 100; i++) {
      delay(20);
      int sensorValue = analogRead(sensorPin);
      float voltage = sensorValue * (5.0 / 1023.0);
      mySerial.println(voltage);
    }
  } // if it is a 4 print out lots of sensor data
}

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Bluetooth module for Flora?

Post by adafruit_support_rick »

Those connections to your Flora are not secure enough for data transmission. Either solder then, or use alligator clip leads between the wires and the pads

gustavolh
 
Posts: 5
Joined: Wed Jul 02, 2014 11:15 am

Re: Bluetooth module for Flora?

Post by gustavolh »

Soldered version
[img]
2014-07-03 08.09.45.jpg
2014-07-03 08.09.45.jpg (143.32 KiB) Viewed 2136 times
[/img]

Yesterday I connected the HC-06 bluetooth module with an arduino UNO and it worked, I also connected Flora with a LED and run the blink example, however together they seem to fail.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Bluetooth module for Flora?

Post by adafruit_support_rick »

Possible your HC-06 needs to be powered with 5V? What happens if you power it from the 3.3v pin on the Uno - does it still work?

Also, you should be using Serial1 with the Flora, not Serial

gustavolh
 
Posts: 5
Joined: Wed Jul 02, 2014 11:15 am

Re: Bluetooth module for Flora?

Post by gustavolh »

Thanks a lot, it was the Serial, using Serial1 works fine.

tkrawiec
 
Posts: 3
Joined: Mon Jul 14, 2014 7:34 am

Re: Bluetooth module for Flora?

Post by tkrawiec »

adafruit wrote:in *theory* the flora can drive the nrf8001 but we don't have support or code for it so its not suggested except for super advanced users. we're working on a BTLE for the flora but no ETA at this time!
Can I ask for more information in this scope? Can I use ICSP ports on Flora for communication with Bluefruit nrf8001? I can find burning new bootloader using this one only. I would like to start from adapting code presented here for arduino:
https://learn.adafruit.com/getting-star ... -in-detail

Am I going in right direction?

tkrawiec
 
Posts: 3
Joined: Mon Jul 14, 2014 7:34 am

Re: Bluetooth module for Flora?

Post by tkrawiec »

Sorry if I'm missing something, but that link I've pasted says bluefruit BLE nrf8001 is working over SPI (check the pinout section). So still, my questions from previous post remain.

if it is possible to connect flora to it (as mentioned by adafruit) what would be connection schema? would SCK, MISO, MOSI, RST pins from nrf8001 go to Flora ICSP header, and
REQ to Flora D10, RDY to some interrupt enabled flora pin - not sure which :(

Thanks,

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Bluetooth module for Flora?

Post by adafruit_support_rick »

Yes, you can connect the nRF8001 by following the Leonardo instructions. D2 is interrupt-capable

tkrawiec
 
Posts: 3
Joined: Mon Jul 14, 2014 7:34 am

Re: Bluetooth module for Flora?

Post by tkrawiec »

Thanks for answer! D2 isn't exposed for Flora, I used SDA instead with success.

Regards,

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Bluetooth module for Flora?

Post by adafruit_support_rick »

Actually, SDA is D2!

Yashwanth28
 
Posts: 1
Joined: Sun Jul 20, 2014 1:17 pm

Re: Bluetooth module for Flora?

Post by Yashwanth28 »

Hi,
I'm also using the same HC-06 module and it properly pairs with a device(android phone) but messages are not getting displayed on arduino1.0.5 serial terminal and there are no LEDS which blinking when a particular message is sent.I use the same code as shown in the above example. Regarding the Serial1, where exactly should this be added?. Also what are the RX and TX pin numbers on Flora?. This is the code:

Code: Select all

#include <SoftwareSerial.h>
char receivedChar;
int  LED = 13; // LED on pin 13
SoftwareSerial mySerial(10, 11); // RX, TX

int sensorPin = A0;
void setup()
{
  // Open serial communications and wait for port to open:
  pinMode(LED, OUTPUT);
  mySerial.begin(9600);
  mySerial.println("Welcome to the wonderful world of bluetooth communication");
  delay(1000);
  mySerial.println("Sending a '1' will turn on the LED, Sending a '0' will turn off the LED");
  delay(1000);
  mySerial.println("a '3' will flash the LED and a '4' will kick out a lot of data from the LDR");
}

void loop() // run over and over
{

  while (!mySerial.available());   // stay here so long as COM port is empty
  receivedChar = mySerial.read();
  if (receivedChar == '1') {
    digitalWrite(LED, HIGH);
  }// if it's a 1 turn LED on
  if (receivedChar == '2') {
    digitalWrite(LED, LOW);
  } // if it's a 2 turn LED off
  if (receivedChar == '3') {
    for (int i = 0; i < 30; i++) {
      digitalWrite(LED, HIGH);
      delay(20);
      digitalWrite(LED, LOW);
      delay(20);
    }
  } // if it is a 3 flash the LED
  if (receivedChar == '4') {
    for (int i = 0; i < 100; i++) {
      delay(20);
      int sensorValue = analogRead(sensorPin);
      float voltage = sensorValue * (5.0 / 1023.0);
      mySerial.println(voltage);
    }
  } // if it is a 4 print out lots of sensor data
}
Thanks in advance!

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”