Xadow - BLE Slave

Introduction

This is a Bluetooth 4.0 module(Bluetooth 4.0 slave module). Compared with Bluetooth version 2.0 and 3.0, it’s more advanced for its lower power consumption. You can easily connect your own project to the primary device of Bluetooth 4.0 by using this module. For instance, it can transfer the detected data which is about the information of your body to phone for displaying or analyzing, then, help you better manage your physical condition.

Specification


  • Bluetooth 4.0 Module
  • PIN:0000
  • Default Baudrate:38400
  • Dimensions: 25.43mm x 20.35mm

Demonstration


The demo is going to show you how to connect bluetooth device with Xadow BLE Slave and communicate. You can use it to communicate with phone(with Bluetooth 4.0). Now let us have a test: - Connect the Xadow BLE Slave to Xadow Main Board and connect Main Board to PC with a USB cable. In normal mode, the blue LED will blink once a time. If the blue led is off, please click the “reset” button on Xadow Main Board .

Note

When connect XadowBLE Slave to Xadow Main Board, you should concern about the connection direction. The connection method is that the unfilled corner of one Xadow module need to connect to the right angle of another module(see four corners of each Xadow module).

  • Upload the test code to your Xadow Main Board.
int error=0;
int n;
void setup()
{
    Serial.begin(38400);
    delay(100);
    PORTB|=0x04;
    TESTIO();
    if(error==0)
    {
        DDRB|=0x81;
        for(n=0;n<40;n++)
        {
            PORTB&=~0x81;
            delay(50);
            PORTB|=0x81;
        }
    }

    Serial1.begin(38400);
}
void loop()
{
    boot();
}
void TESTIO(void)
{
    DDRB|=0x0e;
    PORTB&=~0x0e;
    DDRF|=0x01;
    PORTF&=~0x01;
    DDRD&=~0x0f;

    PORTB|=0x04;
    PORTF|=0x01;
    delay(30);
    if(!(PIND&0x01))
    {
        error=1;
    }
    if(PIND&0x02)
    {
        error=1;
    }
    if(!(PIND&0x04))
    {
        error=1;
    }
    if(PIND&0x08)
    {
        error=1;
    }
    PORTB&=~0x04;
    PORTB|=0x0a;
    PORTF&=~0x01;
    delay(30);
    if(PIND&0x01)
    {
        error=1;
    }
    if(!(PIND&0x02))
    {
        error=1;
    }
    if(PIND&0x04)
    {
        error=1;
    }
    if(!(PIND&0x08))
    {
        error=1;
    }
    Serial.println(error);
}
void boot(void)
{
    for(;;)
    {
        if(Serial.available())
        {
            Serial1.write(Serial.read());
        }
        if(Serial1.available())
        {
            Serial.write(Serial1.read());
        }
    }
}
  • Select a serial tool to send and receive data. Here we use the Sscom32E. BaudRate should be 38400.

  • Get your Phone device ready and install “BlueSPP” APP and launch the BlueSPP. Remember that your device should be Bluetooth 4.0.

Tips

You should pair phone with BLE module first in the device manager of phone if the ‘BlueSPP’ can’t find the BLE module.

  • After connecting, the screen on Device is as following. You could type texts and data will send. It will show on serial tool of your PC. Of course, you can send data to phone by serial tool of your PC.

Resources


Help us make it better

Thank you for choosing Seeed. A couple of months ago we initiated a project to improve our documentation system. What you are looking at now is the first edition of the new documentation system. Comparing to the old one, here is the progresses that we made:

  • Replaced the old documentation system with a new one that was developed from Mkdocs, a more widely used and cooler tool to develop documentation system.
  • Integrated the documentation system with our official website, now you can go to Bazaar and other section like Forum and Community more conveniently.
  • Reviewed and rewrote documents for hundreds of products for the system’s first edition, and will continue migrate documents from old wiki to the new one.

An easy-to-use instruction is as important as the product itself. We are expecting this new system will improve your experience when using Seeed’s products. However since this is the first edition, there are still many things need to improve, if you have any suggestions or findings, you are most welcome to submit the amended version as our contributor or give us suggestions in the survey below, Please don’t forget to leave your email address so that we can reply.

Happy hacking