• Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
HomeProjectUse the Nordic nRF51-DK to program Openhapp Blueto ...
Previous Next

Use the Nordic nRF51-DK to program Openhapp Bluetooth 4.0 BLE Sensor Tag/iBeacon Station NRF51822 with mbed

Posted by: admin , September 5, 2015

Openhapp has a bluetooth 4.0 BLE sensors tag with iBeacon station function that is powered by NRF51822. On the board, the following sensors are integrated:

  • 3-axis accelerometer MPU6050
  • Bosch temperature and pressure sensor BMP180
  • Ambient light sensor AP3216
  • Power switch

It will be nice if we can use mbed to program the openhapp Bluetooth sensor tag. In this post, we show how to use Nordic nRF51-DK as a mbed programmer to program the openhapp Bluetooth sensor tag.

 

 

If we look at the schematic of nRF51-DK, we can find the headers for programming external board:

nrf51_1

 

The physical location of this header can be found on nRF51-DK as below:

nrf51_2

 

Wire out the 4-wire debug of openhapp bluetooth sensors tag. We can cut one side of the 0.1″ female to female jumper wires, and solder them to the debug points:

nrf51_3

 

nrf51_4

 

Wire instructions (we connect the debug port of the openhapp sensors tag to the programmer headers of nRF51-DK):

  • nRF51DK- SH_SWCLK –>   sensors tag – CLK
  • nRF51DK – SH_SWDIO   –>sensors tag – DIO
  • nRF51DK- SH_VTG       –>sensors tag – VCC
  • nRF51DK – SH_GND       –>sensors tag -GND

nrf51_5

 

When we program the sensors node, the sensors node needs to be powered externally by a button cell. We install the CR2032 battery on the back of the sensors node, and turn on the power switch of the sensor node:

nrf51_6

 

nrf51_7

 

We will blink the LED on the sensors node. First we look at the schematic of the sensor node and found that LED are connected to P0_17/18/19 of the NRF51:

nrf51_8

 

Open mbed web IDE environment, and enter the following code:

#include "mbed.h"

DigitalOut myled(P0_18);

int main() 
{
    while(1)
    {
        myled = 0;
        wait(0.5);
        myled = 1;
        wait(0.5); 
    }
}

Note: When we select the target board, it should NOT be Nordic nRF51-DK, and we should select Nordic nRF51822 (Click the upper right corner of the IDE to select):

nrf51_9

 

Click the button to build the code, and we will get a hex file:

nrf51_10

 

nrf51_11

Drag and place it into the USB drive that starts with mbed to flash this hex file to the sensor tag. The LED on the sensor tag will start blinking:

nrf51_12

 

Share!
Tweet

admin

About the author

Leave a Reply Cancel reply

You must be logged in to post a comment.

Category

  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors