Introduction: 16mm Bluetooth + 6/9 DOF Gyroscope Wearable Board Talking to Phone and Programming With Open Source Tools

You are probably enough of large volume Arduino validation prototype and want you jump to next step -- building a mini/micro size real wearables.

However, tools like AD to design your own PCB could be tricky and iterations of which burns money and time, esp., when you have a high requirement of the size, cost and modules.

Tada!

What if, in the air, there is a board, which is super small, thin and with bluetooth 4.0, gyro/acc. That sounds like intel Curie!! Yep, however, they just don't sell us and Curie looks like not thin as well.

Oh, it will also be cool if you have wireless charging module!!! That will be great, right?

I browsed all the mouser/digikey/amazon/ebay... and there's no way you can find such a thing.

However, I just found this amazing board in Alibaba!!!

It contains an nrf51822 ble chip, mpu6050 6/9-dof gyro/acc and a wireless charging module.

What's more, the diameter is as small as 16mm and super thin.

For the first time, when I saw this, I was like, oh, it could be just some bluffing ....

HOWEVER!! After I purchased this, it actually WORKED!!!

Finally, I finished my college project and my supervisor was really happy about my work!!!

To thank the provider of the board, I am gonna share some steps of playing with that, esp., with free tools rather than J-link/St-link, which are expensive.

Open source! Ya!

Step 1: Step1: Preparing Materials

1, THSJ board (the 16mm BLE/Gyro/ACC/Wireless Charge)

2, 3V coin battery

3,MK20 (which will make it possible that you can program online and directly drag .hex files into your chip with MBED platform)

4, several jumper wires

5, soldering iron

Step 2: Step2: Wiring

There are 8 pad coming out on the board that we can solder with (see picture attached):

1) VCC

2) GND

3) SWDIO

4) SWCLK

5) RXD

6) TXD

7) CTS

8) RTS

Connect (see picture attached and refer to : http://redbearlab.com/blenano/):

Board --> MK 20 USB

1) VCC --> VCC

2) GND --> GNC

3) SWDIO --> RF_DIO

4) SWCLK --> RF_CLK

5) RXD--> TXD

6) TXD --> RXD

7) CTS --> RTS

8) RTS --> CTS

Connect the board and MK20 with jumper wires with above instructions and plug in the MK20 into your mac or win. There will be a virtual drive appearing in Desktop.

Bang!!!!! You've already finished half of them!

Step 3: Step3: MBED and Firmware

MBED is an IoT device platform, providing awesome free online programming environment. It's kinda like an arm based Arduino platform.

Traditional way to program arm based processor like stm32, is that, we use uKeil or other SW, to write, debug and compile C code and then using J-link or ST-link to load the program into the chip. However, both the SW and the *-link will cost like several grand, which may be not affordable for students or early prototyping.

With mbed, you can simply just program/compile online, and download the .hex files to your local drive. With mbed enabled dev board, once you plug in the usb interface, there will be a virtual drive appear in desktop. All you need to do left is to drag the .hex into the drive and reset. Tada!!!!

Simple huh?

So, MK20 USB is basically a mbed interface nrf programmer that you can directly drag the .hex file into the "Chip".

Attached is a demo .hex file and blink_test.hex file that you can directly drag into the drive.

Once you drag the .hex file into the drive, the drive will get ejected automatically. Don't worry, that's totally fine.

For those who are using Mac OS X Yosemite, if you fail to load the .hex file, you can simply open your "Terminal" and input the following:

sudo mount -u -w -o sync /Volumes/MBED; cp -X /* /Volumes/MBED

* will be the path of your .hex file (usually in download like Users/(mac name)/Download/*.hex)

You can use the blink_test .hex file to test whether you succeed loading the hex.

Then you can confidently load the demo.hex file.

blink_test code:

#include "mbed.h"

DigitalOut myled(P0_15);

int main() {

while(1) {

myled = 1;

wait_ms(80);

myled = 0;

wait_ms(80);

}

}

Step 4: Step4: Play and Read Value With App

For sure, if you can develop iOS/Android app or even Win/OS X app, that will be perfect. However, the thing is the learning curve of those looks like... not that realistic.

Even though, as a Geek, we are supposed to master that.

No worries and I am not gonna teach you how to dev app here. Instead, I will recommend any super powerful and free app for you to test.

LightBlue is my favourite since it can directly read service and values easily.

Officialy nRF Toolbox is cool however, kinda too complicated, esp., when you open the open source iOS app.

Therefore, next, you can just download LightBlue from app store and you can see the data.

If you have interests in developing app, you can hack nRF Toolbox with the official code. In Github, there are also many other good codes you can use.