mbed Blog RSS Feed

Robotiky, a fun way to get kids Kickstarted with coding!

Last week we got the chance to speak with Robotiky about their Kickstarter project. Robotiky is a small programmable toy robot that makes learning how to code simple, digestible and best of all fun! The team prototyped the idea using an mbed-enabled NXP LPC1768 prototyping board, and then transitioned to a full custom design using the mbed HDK for NXP LPC11U24 board based on an ARM Cortex-M0+. The hardware features a voltage convertor, extension port and sensors for speed bumps, light and line following.


One of the unique features of this special toy is the online tutorials that utilize drag and drop exercises to teach the basics of coding, from simple blocks to full code. In the tutorials after each level is completed you can download and run your program on the robot for immediate gratification and realization of what programming can actually create. This toy is aimed at elementary and primary school ages, but as an adult myself, I have to say I could not stop testing out all of the demo coding challenges until I completed each level!


This robot and online programing tutorial is the brainchild of John Ginger and Matt Screeton, alumni’s of Cambridge University. They currently have eight days left on their Kickstarter funding where you can get your own Robotiky for £99 and help them reach their goal. However there are limited spots at this funding level, so sign up for your Robot before the deal is up.

Japanese mbed developer and his team won the highest prize at TBS TV Hack Day

Junichi Katsu (aka JKSoft in mbed community) and his team designed a unique gadget at TBS TV HACK DAY in Japan. And it got the highest prize with cash 1,000,000 JPY.

What is this?

TBS is one of the big TV stations in Japan, and "TBS TV Hack Day" is a hackathon hosted by TBS TV, focusing on TV related project. API is provided by sponsors i.e. NTT docomo, Philips, etc. The event was held early March. Mr. Junichi Katsu (aka JKSoft in mbed community), one of the Japanese mbed super developers, and his team designed a unique gadget named “Interactive TV - Tere-Boo” controlled by mbed. And it got the highest prize with cash 1,000,000 JPY!!


Demo movie

System overview

The Tere-Boo is a name of small soft toy and it is interactive TV control system. User can chosee TV channel by talk to Tere-Boo which has microphone, speaker, microcontroller (mbed LPC1768) and IR remote controller. Speaking audio data (digital voice) will be went out to cloud server using communication API and channel information API provided by Docomo (one of API sponsor). Then, Tere-Boo calls back appropriate TV channel and change to the channel at a time. It can be placed at the frame of TV screen and performs simple moving such as bowing by servo motors inside of it.

/media/uploads/MACRUM/tbs_teleboo3a.jpg /media/uploads/MACRUM/tbs_teleboo2a.jpg /media/uploads/MACRUM/tbs_teleboo1a.jpg


Webinar: How to Select the Right IoT Platform: Connectivity and Edge Considerations

Selecting the right platform for your Internet of Things (IoT) development is an integral step, but what are the key factors to pay attention to when evaluating platforms?


Chris Rommel, Executive Vice President, M2M Embedded Technology at VDC, Sam Grove, Senior Applications Engineer at ARM, and Axeda CMO Bill Zujewski will be joining together to on the webinar, “How to Select the Right IoT Platform: Connectivity and Edge Considerations” on Tuesday March 18th at 11am EST. Register for this webinar to find out why smart products need more intelligence at the end node and why your connectivity decisions are key to implementing your IoT infrastructure.


Follow the webinar with #IoTPlatform

mbed at Embedded World 2014

The mbed ecosystem has been growing rapidly and we are excited about all of our new Partners. The ARM onsite film team was able to catch up with a few of them at Embedded World (EW) last week. If you missed all the news last week, check out the videos below to get the latest updates.



STMicroelectronics announced their new STM32 Nucleo Development Board just before EW. This ARM Cortex®-M based board allows developers to build prototypes with ease and flexibility. As an mbed enabled platform developers can freely compile and take advantage of software libraries online. Watch the video to find out more and you can also see how easy to use the STMicroelectronics’s Nucleo board is in Mihail’s Hand-on blog.

Nordic Semiconductor

At EW Nordic Semiconductor announced their new mbed-enabled nRF51822-mKIT that combines a Bluetooth v4.1-compliant radio and an ARM Cortex-M0 processor along with SPI, I2C, ADC, PWM and GPIO on a single chip. Find out here how you can use mbed BLE APIs to easily implement a Bluetooth LE Health Thermometer. In the video below Thomas Ulleberg from Nordic discusses how he thinks this will bring “Bluetooth LE to the masses.”


Herbert Blaser from u-blox’s talks about their recent collaborations with ARM and how they are making development of communication modules easier with the mbed platform.


Last but not least they captured ARM's EVP and GM of the IoT Business Unit, John Cornish, thoughts about Sensinode & mbed's role in the development of the Internet of Things (IoT) market.


Another noteworthy mention is CSR announcing their partnership with ARM to bring connectivity & GPS solutions to the mbed community, "The partnership provides the mbed community access to CSR Bluetooth®, Bluetooth Smart, Wi-Fi® and GPS connectivity solutions and makes it easy for them to be integrated into existing microcontroller projects."


Additionally more mbed support is being added to Freescale’s Freedom microcontroller platform line with the FRDM-KL05Z. This is ultra-low-cost development platform is enabled by the Kinetis L Series KL0x MCU family built on the ARM Cortex-M0+ processor.

Looks like 2014 is off to a great start, and we are looking forward to growing the mbed ecosystem further!

Bluetooth LE Example on mbed - Health Thermometer!

Now the mbed Bluetooth APIs are almost complete and the mbed-enabled Nordic nRF51822 single-chip Bluetooth LE hardware is available for pre-order, here is a peek at how we can use the mbed BLE APIs to easily implement a Bluetooth LE Health Thermometer.

Before we get in to the details, this video shows the Bluetooth LE Health Thermometer program in action:

The Example

Here we are going to advertise and respond as a thermometer to devices that choose to connect to us. Bluetooth LE Health Thermometers implement the 'Health Thermometer' service, exposing temperature and other data from a BLE device intended for healthcare and fitness applications. Full details on the service can be found here:

Key Bluetooth LE Concepts

Lets get a basic understanding of BLE and it's core concepts:

BLE - Bluetooth Low Energy, also known as Bluetooth Smart, is a wireless protocol designed specifically for low power applications, such as those for healthcare, security, fitness and home entertainment / energy monitoring. BLE makes up one form of the Bluetooth 4 specification, the other form is Bluetooth Classic (or Bluetooth Basic Rate) which is that standard Bluetooth interface you will have used for connecting with Bluetooth headsets, transferring files to/from your mobile device, etc.

Generic Access Profile (GAP) - This is the first of two profiles that all BLE devices must implement. It defines the basic functionality required for a BLE device (physical/link layers, security, etc), and the basic characteristics of that device, such as device name, it's appearance/role (Heart Rate Monitor, keyboard, blood pressure monitor, etc), connection parameters, etc.

Generic Attribute Profile (GATT) - This is the second profile that all BLE devices must implement, and is the high-level protocol that BLE devices use to communicate. GATT defines two roles: Server and Client. The Server is typically the low power device that is exposing various services (e.g. temperature monitoring, speed monitoring, etc) which are consumed by a client (computer, mobile phone, etc).

Service - A service is a particular functionality set that a device supports. A single device can support multiple services - as stated above, GATT and GAP are two services that all BLE devices must support. In addition to these, a Heart Rate Monitor device would support 'Heart Rate' service and, perhaps, a 'Battery Service'. A full list of BLE services can be found on the Bluetooth Developer Portal here.

Characteristic - Each service has a set of characteristics assosicated with it, some mandatory and some optional. These characteristics define the data that is to be transmitted by that service. E.g. temperature measurement, temperature type, measurement interval, etc.

Bluetooth LE Health Thermometer Services

When a BLE client device requests the list of supported services and their characteristics from our Bluetooth LE Health Thermometer running on the Nordic nRF51822 evaluation board, it will receive the following:

  • Generic Access (GAP)
    • DeviceName Characteristic - The name of our device.
    • Appearance Characteristic - The role that this device takes. A full list of possible appearances can be found here.
    • SlavePreferredConnectionParameters Characteristic- Various parameters related to how this device connects to clients. See here.
  • Generic Attribute (GATT)
    • ServiceChanged Characteristic
  • Health Thermometer
    • Temperature Measurement Characteristic - This mandatory characteristic is used to present a temperature measurement to the client.
  • Battery Service
    • Battery Level Characteristic - this mandatory characteristic is used to read the battery level as a percentage.

For the sake of brievety we have not included in our example the optional Characteristics supported by the Health Thermometer service, the full list can be seen here.


We will be using the following to kit for our Bluetooth LE Health Thermometer:

In this example, I'm using a pre-production version of the board ahead of it being available.

Hardware Setup

We connect our TMP102 to the nRF51822 Eval Board using the Jumper wires:

TMP102 PinnRF51822 Eval Board Pin

Our board and sensor will look like this:



We will run through our example application from here:

Import programBLE_Health_Thermometer_Blog

An example BLE Health Thermometer using the mbed BLE API and Nordic NRF51822

We start off by creating instances of our nRF51822 and TMP102 objects. Along with some LEDs for indication:


nRF51822n   nrf;                               /* BLE radio driver */
TMP102      healthThemometer(p22, p20, 0x90);  /* The TMP102 connected to our board */

/* LEDs for indication: */
DigitalOut  oneSecondLed(LED1);        /* LED1 is toggled every second. */
DigitalOut  advertisingStateLed(LED2); /* LED2 is on when we are advertising, otherwise off. */

We then instantiate our Health Thermometer and Battery Level Service, including their mandatory characteristics. Note that we are not concerned with the GATT and GAP services, as they are automatically created by the BLE API interface.


/* Health Thermometer Service */ 
uint8_t             thermTempPayload[5] = { 0, 0, 0, 0, 0 };
GattService         thermService (GattService::UUID_HEALTH_THERMOMETER_SERVICE);
GattCharacteristic  thermTemp (GattCharacteristic::UUID_TEMPERATURE_MEASUREMENT_CHAR,
                               5, 5, GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_INDICATE);

/* Battery Level Service */
uint8_t            batt = 100;     /* Battery level */
uint8_t            read_batt = 0; /* Variable to hold battery level reads */
GattService        battService ( GattService::UUID_BATTERY_SERVICE );
GattCharacteristic battLevel   ( GattCharacteristic::UUID_BATTERY_LEVEL_CHAR, 1, 1,
                                 GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY |

Next up is the Advertising data and parameters, along with a list of services the device will support:


/* Advertising data and parameters */
GapAdvertisingData   advData;
GapAdvertisingData   scanResponse;
GapAdvertisingParams advParams ( GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED );

uint16_t             uuid16_list[] = {GattService::UUID_HEALTH_THERMOMETER_SERVICE,

The following is the application's main function. The code is straight forward enough: We initialise the BLE nrf object, adding the Appearance and various services that are supported. Then start advertising.


int main(void)
    /* Setup blinky led */
    /* Setup an event handler for GAP events i.e. Client/Server connection events. */
    nrf.getGap().setEventHandler(new GapEventHandler());
    /* Initialise the nRF51822 */

    /* Make sure we get a clean start */

    /* Add BLE-Only flag and complete service list to the advertising data */
                   (uint8_t*)uuid16_list, sizeof(uuid16_list));
    nrf.getGap().setAdvertisingData(advData, scanResponse);

    /* Health Thermometer Service */
    /* Add the Battery Level service */

    /* Start advertising (make sure you've added all your data first) */
    advertisingStateLed = 1;

    for (;;)
        /* Now that we're live, update the battery level & temperature characteristics */

Every second we update the values for the battery level and temperature characteristics:


void updateServiceValues(void)
      /* Toggle the one second LED */
      oneSecondLed = !oneSecondLed;
      /* Update battery level */
      nrf.getGattServer().updateValue(battLevel.handle, (uint8_t*)&batt, sizeof(batt));
      /* Decrement the battery level. */
      batt <=50 ? batt=100 : batt--;;
      /* Update the temperature. Note that we need to convert to an ieee11073 format float. */
      float temperature = healthThemometer.read();
      uint32_t temp_ieee11073 = quick_ieee11073_from_float(temperature);
      memcpy(thermTempPayload+1, &temp_ieee11073, 4);
      nrf.getGattServer().updateValue(thermTemp.handle, thermTempPayload, sizeof(thermTempPayload));

Finally we have our GAP events handler. When a client device connects to our device, our device will stop advertising. Once the client has disconnected, we need to instruct our device to start re-advertising.


class GapEventHandler : public GapEvents
    //virtual void onTimeout(void) {}   
    virtual void onConnected(void)
        advertisingStateLed = 0;

    /* When a client device disconnects we need to start advertising again. */
    virtual void onDisconnected(void)
        advertisingStateLed = 1;

To test our Bluetooth LE Health Thermometer, we compile, download and flash our program onto the Nordic nRF51822 board using the standard mbed workflow. When the board is powered, we will see the one second LED blinking regularly, and the advertising LED switched permanently on. We can then launch the Nordic Utility mobile application, open the temperature app, and click connect. The advertising LED on the board will switch off and the app will show data from our board:


Once we press the disconnect button on in the app, the app will stop displaying updates and the board's advertising LED will switch on again.

Final Notes

The whole mbed program is running on the single-chip Nordic Bluetooth device, and connecting up to the temperature sensor was as simple as pulling in a component from the component database, so hopefully this gives a good feel for how simple it should be to create a working Bluetooth LE device that can be made really cheaply.

If you want to get hold of one of the boards when they are released, take a look at:


Check out the Bluetooth Developers site for a webinar about adding Bluetooth Smart using the mbed BLE API https://developer.bluetooth.org/DevelopmentResources/Pages/Webinars.aspx