Git Product home page Git Product logo

ble-watch's Introduction

Bluetooth LE Watch

Language build

This is a sample project using the Zephyr RTOS and Nordic nRF Connect to create a BLE watch. This device is composed with:

  • nRF52840 DK Nordic board.
  • OLED monochrome displays SSD1306 128x64 pixels.
  • and the DS3231 real-time clock (RTC).

Both display and RTC communicates with the nRF52840 MCU via I2C bus.

Some topics covered:

  • Tested on nRF52840 DK board.
  • Embedded system with Zephyr RTOS and nRF Connect SDK.
  • Bluetooth Low Energy (LE) technology.
  • The device works as GAP Peripheral and GATT server.
  • Implemented BLE services officially adopted by Bluetooth SIG and custom services too.
  • Continuous integration (CI) with GitHub Actions.
  • Use of Docker container.

drawing

Bluetooth Services

Device information service (dis)

Exposes the device information.

  • Device Information Service: <UUID: 0x180A>
    • Characteristic: Model number string <UUID: 0x2A24>
      • Data format: < string >
      • Properties: Read.
    • Characteristic: Manufacturer name string <UUID: 0x2A29>
      • Data format: < string >
      • Properties: Read.
    • Characteristic: Serial number string <UUID: 0x2A25>
      • Data format: < string >
      • Properties: Read.
    • Characteristic: Firmware revision string <UUID: 0x2A26>
      • Data format: < string >
      • Properties: Read.
    • Characteristic: Hardware revision string <UUID: 0x2A27>
      • Data format: < string >
      • Properties: Read.
    • Characteristic: Software revision string <UUID: 0x2A28>
      • Data format: < string >
      • Properties: Read.

Battery service (bas)

Simulates the battery level voltage.

  • Battery Service: <UUID: 0x180F>
    • Characteristic: Battery level <UUID: 0x2A19>
      • Data format: < UINT8[1 byte]> percentage battery level
      • Properties: Notify, Read.

Custom service

Receives messages to be shown on the display screen.

  • Unknown Service: <UUID: 3C134D60-E275-406D-B6B4-BF0CC712CB7C>
    • Characteristic: Unknown <UUID: 3C134D61-E275-406D-B6B4-BF0CC712CB7C>
      • Data format: < TEXT (UTF-8) > limit up to 31 characters
      • Properties: Read, Write.

Project Structure

.
├── app
│   ├── inc
│   │   ├── device_information_service.h
│   │   ├── display_ssd1306.h
│   │   ├── gatt_central.h
│   │   └── rtc_ds3231.h
│   └── src
│       ├── device_information_service.c
│       ├── display_ssd1306.c
│       ├── gatt_central.c
│       └── rtc_ds3231.c
├── build_nrf52840dk
├── CMakeLists.txt
├── docs
│   ├── Assigned Numbers.pdf
│   ├── DS3231.pdf
│   └── DTS_v1.0.pdf
├── Kconfig
├── Makefile
├── nrf52840dk_nrf52840.overlay
├── prj.conf
├── README.md
├── sample.yaml
└── src
    └── main.c

Building and running

Building with Docker image on interactive mode

Access the project folder.

cd BLE-Watch

And run the docker image.

docker run --rm -it -v ${PWD}:/workdir/project -w /workdir/project charlesdias/nrfconnect-sdk /bin/bash

After that, run the command below to build the firmware.

make build

Running

Test the BLE Watch application with the nRF Connect app, which is available for iOS (App Store) and Android (Google Play).

BLE Watch

Next improvements

  • Create dedicate task to update the display.
  • Implement Bluetooth service to set the date and time.
  • Flash the application project running west on Docker container.
  • Add Doxygen configuration.

ble-watch's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.